vskill 0.5.134 → 0.5.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents.json +1 -1
- package/dist/eval-server/api-routes.js +9 -0
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/plugin-cli-routes.d.ts +8 -1
- package/dist/eval-server/plugin-cli-routes.js +38 -2
- package/dist/eval-server/plugin-cli-routes.js.map +1 -1
- package/dist/eval-server/plugin-orphan-cleanup.d.ts +23 -0
- package/dist/eval-server/plugin-orphan-cleanup.js +105 -0
- package/dist/eval-server/plugin-orphan-cleanup.js.map +1 -0
- package/dist/eval-ui/assets/{CommandPalette-BRco5VQ_.js → CommandPalette-C0OajJac.js} +1 -1
- package/dist/eval-ui/assets/{CreateSkillPage-DJqOEoJ4.js → CreateSkillPage-BHTsGTx2.js} +1 -1
- package/dist/eval-ui/assets/{FindSkillsPalette-DMw8Y-MA.js → FindSkillsPalette-Fd_xvWRc.js} +2 -2
- package/dist/eval-ui/assets/{SearchPaletteCore-cxev8h5r.js → SearchPaletteCore-CYaU33vf.js} +2 -2
- package/dist/eval-ui/assets/{SkillDetailPanel-7onY0ArQ.js → SkillDetailPanel-cxwua4jw.js} +1 -1
- package/dist/eval-ui/assets/UpdateDropdown-C6b6HzFl.js +1 -0
- package/dist/eval-ui/assets/index-CWWW1rkS.js +102 -0
- package/dist/eval-ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/UpdateDropdown-CaT7AjS5.js +0 -1
- package/dist/eval-ui/assets/index-BLduRWyM.js +0 -102
|
@@ -29,6 +29,7 @@ import { sendJson, readBody } from "./router.js";
|
|
|
29
29
|
import { runClaudePlugin, parseInstalledPlugins, parseMarketplaces, } from "./plugin-cli.js";
|
|
30
30
|
import { buildClaudeCliFailureResponse } from "./plugin-cli-response.js";
|
|
31
31
|
import { resolvePluginRef } from "./plugin-ref-resolver.js";
|
|
32
|
+
import { listOrphanPluginCacheDirs, removeOrphanPluginCacheDirs, } from "./plugin-orphan-cleanup.js";
|
|
32
33
|
const VALID_SCOPES = ["user", "project", "local"];
|
|
33
34
|
function isValidScope(s) {
|
|
34
35
|
return typeof s === "string" && VALID_SCOPES.includes(s);
|
|
@@ -45,7 +46,8 @@ async function fetchPluginList(cwd) {
|
|
|
45
46
|
return [];
|
|
46
47
|
return parseInstalledPlugins(result.stdout);
|
|
47
48
|
}
|
|
48
|
-
export function registerPluginCliRoutes(router, root) {
|
|
49
|
+
export function registerPluginCliRoutes(router, root, options = {}) {
|
|
50
|
+
const cacheRoot = options.cacheRoot ?? join(homedir(), ".claude", "plugins", "cache");
|
|
49
51
|
// GET /api/plugins — list installed plugins
|
|
50
52
|
router.get("/api/plugins", async (_req, res) => {
|
|
51
53
|
try {
|
|
@@ -242,7 +244,41 @@ export function registerPluginCliRoutes(router, root) {
|
|
|
242
244
|
// short name while we shell out with the right ref.
|
|
243
245
|
const ref = resolvePluginRef(name, await fetchPluginList(root));
|
|
244
246
|
const args = ["uninstall", ref, ...(scope ? ["--scope", scope] : [])];
|
|
245
|
-
|
|
247
|
+
try {
|
|
248
|
+
const result = await runClaudePlugin(args, { cwd: root, timeout: 30_000 });
|
|
249
|
+
if (result.code === 0) {
|
|
250
|
+
const plugins = await fetchPluginList(root);
|
|
251
|
+
sendJson(res, { ok: true, stdout: result.stdout, plugins });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
// 0767: when the CLI says "not found in installed plugins" but the
|
|
255
|
+
// marketplace cache still holds an orphaned <mp>/<name>/ dir, remove
|
|
256
|
+
// it so the Studio sidebar stops surfacing the ghost plugin.
|
|
257
|
+
const combined = `${result.stdout}\n${result.stderr}`;
|
|
258
|
+
if (/not found in installed plugins/i.test(combined)) {
|
|
259
|
+
const bareName = name.split("@")[0];
|
|
260
|
+
const orphans = listOrphanPluginCacheDirs(bareName, cacheRoot);
|
|
261
|
+
if (orphans.length > 0) {
|
|
262
|
+
const cleanup = removeOrphanPluginCacheDirs(orphans, cacheRoot);
|
|
263
|
+
if (cleanup.removed.length > 0) {
|
|
264
|
+
const plugins = await fetchPluginList(root);
|
|
265
|
+
sendJson(res, {
|
|
266
|
+
ok: true,
|
|
267
|
+
fallback: "orphan-cache-removed",
|
|
268
|
+
removed: cleanup.removed,
|
|
269
|
+
failed: cleanup.failed,
|
|
270
|
+
plugins,
|
|
271
|
+
});
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const { status, body: failureBody } = buildClaudeCliFailureResponse(result);
|
|
277
|
+
sendJson(res, failureBody, status);
|
|
278
|
+
}
|
|
279
|
+
catch (err) {
|
|
280
|
+
sendError(res, 500, "unexpected", err instanceof Error ? err.message : String(err));
|
|
281
|
+
}
|
|
246
282
|
});
|
|
247
283
|
}
|
|
248
284
|
async function safeReadBody(req) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-cli-routes.js","sourceRoot":"","sources":["../../src/eval-server/plugin-cli-routes.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,oCAAoC;AACpC,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,sCAAsC;AACtC,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,+FAA+F;AAC/F,uFAAuF;AACvF,EAAE;AACF,2BAA2B;AAC3B,wDAAwD;AACxD,qFAAqF;AACrF,oFAAoF;AACpF,sEAAsE;AACtE,EAAE;AACF,4EAA4E;AAC5E,uCAAuC;AACvC,8EAA8E;AAG9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,QAAQ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E,IAAI,CAAC,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC;QACrF,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,6BAA6B,CAAC,MAAM,CAAC,CAAC;YAC/D,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QACD,wEAAwE;QACxE,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;QAC3C,QAAQ,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACtF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find every `<cacheRoot>/<marketplace>/<pluginName>/` directory.
|
|
3
|
+
*
|
|
4
|
+
* Returns absolute paths, in `readdir` order. Pure read — no mutations.
|
|
5
|
+
*
|
|
6
|
+
* Quietly returns `[]` for any unsafe input (path-traversal in name, missing
|
|
7
|
+
* cacheRoot, no marketplaces). Callers don't need to pre-validate.
|
|
8
|
+
*/
|
|
9
|
+
export declare function listOrphanPluginCacheDirs(pluginName: string, cacheRoot: string): string[];
|
|
10
|
+
export interface RemovalFailure {
|
|
11
|
+
path: string;
|
|
12
|
+
error: string;
|
|
13
|
+
}
|
|
14
|
+
export interface RemovalResult {
|
|
15
|
+
removed: string[];
|
|
16
|
+
failed: RemovalFailure[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Recursively remove each provided plugin cache directory. Each path is
|
|
20
|
+
* re-validated against cacheRoot before deletion — defense in depth, since
|
|
21
|
+
* the caller may have built the list from a different code path.
|
|
22
|
+
*/
|
|
23
|
+
export declare function removeOrphanPluginCacheDirs(paths: string[], cacheRoot: string): RemovalResult;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// 0767 — Orphan plugin-cache cleanup helper.
|
|
3
|
+
//
|
|
4
|
+
// `claude plugin uninstall <name>` only removes plugins it knows about
|
|
5
|
+
// (those listed in `installed_plugins.json`). When a plugin's marketplace
|
|
6
|
+
// cache dir survives without an installation entry — e.g. after a partial
|
|
7
|
+
// install, an upstream rename, or a manual `installed_plugins.json` edit —
|
|
8
|
+
// the Studio's plugin scanner keeps surfacing it as a "ghost" entry. The
|
|
9
|
+
// uninstall route falls back to this helper to GC those cache dirs.
|
|
10
|
+
//
|
|
11
|
+
// Layout assumed:
|
|
12
|
+
// <cacheRoot>/<marketplace>/<plugin-name>/<hash-or-version>/
|
|
13
|
+
//
|
|
14
|
+
// Path safety: every candidate is verified to resolve under cacheRoot via
|
|
15
|
+
// `path.resolve(...).startsWith(cacheRoot + sep)` before any rmSync.
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
import { existsSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
18
|
+
import { join, resolve, sep } from "node:path";
|
|
19
|
+
/**
|
|
20
|
+
* Find every `<cacheRoot>/<marketplace>/<pluginName>/` directory.
|
|
21
|
+
*
|
|
22
|
+
* Returns absolute paths, in `readdir` order. Pure read — no mutations.
|
|
23
|
+
*
|
|
24
|
+
* Quietly returns `[]` for any unsafe input (path-traversal in name, missing
|
|
25
|
+
* cacheRoot, no marketplaces). Callers don't need to pre-validate.
|
|
26
|
+
*/
|
|
27
|
+
export function listOrphanPluginCacheDirs(pluginName, cacheRoot) {
|
|
28
|
+
if (!isSafePluginName(pluginName))
|
|
29
|
+
return [];
|
|
30
|
+
if (!existsSync(cacheRoot))
|
|
31
|
+
return [];
|
|
32
|
+
const cacheRootResolved = resolve(cacheRoot);
|
|
33
|
+
let marketplaces;
|
|
34
|
+
try {
|
|
35
|
+
marketplaces = readdirSync(cacheRootResolved);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const matches = [];
|
|
41
|
+
for (const mp of marketplaces) {
|
|
42
|
+
const mpDir = join(cacheRootResolved, mp);
|
|
43
|
+
if (!safeStatIsDir(mpDir))
|
|
44
|
+
continue;
|
|
45
|
+
const candidate = join(mpDir, pluginName);
|
|
46
|
+
if (!isInside(candidate, cacheRootResolved))
|
|
47
|
+
continue;
|
|
48
|
+
if (!safeStatIsDir(candidate))
|
|
49
|
+
continue;
|
|
50
|
+
matches.push(candidate);
|
|
51
|
+
}
|
|
52
|
+
return matches;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Recursively remove each provided plugin cache directory. Each path is
|
|
56
|
+
* re-validated against cacheRoot before deletion — defense in depth, since
|
|
57
|
+
* the caller may have built the list from a different code path.
|
|
58
|
+
*/
|
|
59
|
+
export function removeOrphanPluginCacheDirs(paths, cacheRoot) {
|
|
60
|
+
const cacheRootResolved = resolve(cacheRoot);
|
|
61
|
+
const removed = [];
|
|
62
|
+
const failed = [];
|
|
63
|
+
for (const p of paths) {
|
|
64
|
+
if (!isInside(p, cacheRootResolved)) {
|
|
65
|
+
failed.push({ path: p, error: "path outside cache root" });
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
rmSync(p, { recursive: true, force: true });
|
|
70
|
+
removed.push(p);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
failed.push({
|
|
74
|
+
path: p,
|
|
75
|
+
error: err instanceof Error ? err.message : String(err),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return { removed, failed };
|
|
80
|
+
}
|
|
81
|
+
// Match `claude` plugin-name shape: alphanumerics, dot, dash, underscore.
|
|
82
|
+
// Crucially excludes `/`, `\`, `..`, and absolute paths.
|
|
83
|
+
const SAFE_PLUGIN_NAME = /^[a-z0-9][\w.-]*$/i;
|
|
84
|
+
function isSafePluginName(name) {
|
|
85
|
+
if (!name)
|
|
86
|
+
return false;
|
|
87
|
+
if (name.includes("/") || name.includes("\\"))
|
|
88
|
+
return false;
|
|
89
|
+
if (name === "." || name === "..")
|
|
90
|
+
return false;
|
|
91
|
+
return SAFE_PLUGIN_NAME.test(name);
|
|
92
|
+
}
|
|
93
|
+
function isInside(target, root) {
|
|
94
|
+
const t = resolve(target);
|
|
95
|
+
return t === root || t.startsWith(root + sep);
|
|
96
|
+
}
|
|
97
|
+
function safeStatIsDir(p) {
|
|
98
|
+
try {
|
|
99
|
+
return statSync(p).isDirectory();
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=plugin-orphan-cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-orphan-cleanup.js","sourceRoot":"","sources":["../../src/eval-server/plugin-orphan-cleanup.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6CAA6C;AAC7C,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,oEAAoE;AACpE,EAAE;AACF,kBAAkB;AAClB,+DAA+D;AAC/D,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,8EAA8E;AAE9E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAAkB,E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CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as o,s as g}from"./index-
|
|
1
|
+
import{r as a,j as o,s as g}from"./index-CWWW1rkS.js";/* empty css */function h(r,i){if(!i)return 1;const n=i.toLowerCase(),c=[r.label,r.description??"",...r.keywords??[]].join(" ").toLowerCase();if(c.startsWith(n))return 100;const s=r.label.toLowerCase();if(s.startsWith(n))return 90;if(s.includes(n))return 80;if(c.includes(n))return 60;let l=0;for(const u of c)if(u===n[l]&&l++,l===n.length)return 40;return 0}function j({open:r,onClose:i,commands:n,placeholder:c=g.palette.inputPlaceholder}){const[s,l]=a.useState(""),[u,f]=a.useState(0),m=a.useRef(null),v=a.useRef(null),b=a.useRef(null),p=a.useMemo(()=>n.map(e=>({c:e,s:h(e,s)})).filter(e=>e.s>0).sort((e,x)=>x.s-e.s).map(e=>e.c),[n,s]);if(a.useEffect(()=>{if(r)return m.current=document.activeElement??null,l(""),f(0),requestAnimationFrame(()=>{var t;return(t=v.current)==null?void 0:t.focus()}),()=>{var t,e;(e=(t=m.current)==null?void 0:t.focus)==null||e.call(t),m.current=null}},[r]),a.useEffect(()=>{f(0)},[s]),a.useEffect(()=>{if(!r)return;function t(e){var x;if(e.key==="Escape"){e.preventDefault(),i();return}if(e.key==="ArrowDown"){e.preventDefault(),f(d=>Math.min(d+1,Math.max(p.length-1,0)));return}if(e.key==="ArrowUp"){e.preventDefault(),f(d=>Math.max(d-1,0));return}if(e.key==="Enter"){const d=p[u];d&&(e.preventDefault(),d.onInvoke(),i());return}e.key==="Tab"&&(e.preventDefault(),(x=v.current)==null||x.focus())}return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[r,i,p,u]),!r)return null;const y="command-palette-listbox";return o.jsx("div",{"data-testid":"command-palette",role:"presentation",onClick:t=>{t.target===t.currentTarget&&i()},style:{position:"fixed",inset:0,background:"color-mix(in srgb, var(--bg-canvas) 70%, transparent)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh",zIndex:60},children:o.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":"Command palette",style:{width:"min(560px, 92vw)",background:"var(--bg-canvas)",border:"1px solid var(--border-default)",borderRadius:8,boxShadow:"0 24px 64px rgba(0,0,0,0.2)",overflow:"hidden",fontFamily:"var(--font-sans)",color:"var(--text-primary)"},children:[o.jsx("div",{role:"combobox","aria-expanded":"true","aria-controls":y,"aria-haspopup":"listbox",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-default)"},children:o.jsx("input",{ref:v,type:"text",value:s,onChange:t=>l(t.currentTarget.value),"aria-label":"Command","aria-autocomplete":"list","aria-controls":y,placeholder:c,style:{width:"100%",border:"none",outline:"none",background:"transparent",color:"var(--text-primary)",fontFamily:"var(--font-sans)",fontSize:14,padding:"6px 0"}})}),o.jsxs("ul",{id:y,role:"listbox",style:{listStyle:"none",margin:0,padding:"4px 0",maxHeight:320,overflow:"auto"},children:[p.length===0&&o.jsx("li",{role:"option","aria-selected":"false",style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:12},children:g.palette.emptyResults}),p.map((t,e)=>o.jsxs("li",{role:"option","aria-selected":e===u,onMouseEnter:()=>f(e),onClick:()=>{t.onInvoke(),i()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:e===u?"color-mix(in srgb, var(--accent-surface) 10%, transparent)":"transparent",cursor:"pointer",fontSize:13},children:[o.jsx("span",{children:t.label}),t.description&&o.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)",marginLeft:12},children:t.description})]},t.id))]})]})})}export{j as CommandPalette,j as default,h as scoreCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,R as y,u as Q,a as J,r as v,g as D,b as $,w as Z,c as X,t as P,L as R,P as ee,E as te,d as se,S as re}from"./index-BLduRWyM.js";/* empty css */const ae=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function le({supported:r,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:r?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:r?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${r?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function B({agent:r,checked:a,onToggle:m}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:r.installed?"1px solid var(--color-primary, #6366f1)":"1px solid var(--border-subtle, #333)",background:a?"var(--surface-2, #1e1e1e)":"transparent"},children:[e.jsx("input",{type:"checkbox",checked:a,onChange:m,style:{accentColor:"var(--color-primary, #6366f1)"}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontWeight:500,fontSize:13,color:"var(--text-primary, #fff)"},children:r.displayName}),r.installed&&e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:"var(--color-primary-bg, #312e81)",color:"var(--color-primary, #6366f1)"},children:"installed"})]}),e.jsx("div",{style:{marginTop:3},children:ae.map(u=>e.jsx(le,{supported:r.featureSupport[u.key],label:u.label},u.key))})]})]})}function ne({agents:r,selectedIds:a,onChange:m}){const u=new Set(a),n=r.filter(o=>o.isUniversal),l=r.filter(o=>!o.isUniversal),x=o=>{const i=u.has(o)?a.filter(k=>k!==o):[...a,o];m(i)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[n.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Universal Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:n.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]}),l.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Other Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:l.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]})]})}const oe="Cross-universal — emits the same skill to 8 universal agents (Claude, Codex, Cursor, Cline, Gemini CLI, OpenCode, Kimi, Amp). Constrains output to the common schema across all agents. Recommended for portable skills.",ie="Powerful Claude-native engine — Anthropic's built-in skill-creator with a slightly richer schema (more expressive on Claude) but Claude-only. Pick this when you only target Claude Code and want full expressiveness.",de="Generate raw — no engine assistance, you provide the full SKILL.md body.";function ce(r){return[{engine:"vskill",label:"VSkill skill-builder",caption:r.vskillSkillBuilder?`installed${r.vskillVersion?` v${r.vskillVersion}`:""}`:"not installed",tooltip:oe,detected:r.vskillSkillBuilder,installable:!0},{engine:"anthropic-skill-creator",label:"Anthropic skill-creator",caption:r.anthropicSkillCreator?"installed":"not installed",tooltip:ie,detected:r.anthropicSkillCreator,installable:!0},{engine:"none",label:"No engine — generate raw",caption:"always available",tooltip:de,detected:!0,installable:!1}]}function ue(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function xe(r){const{detection:a,selected:m,onSelect:u,onInstallClick:n}=r,l=y.useMemo(()=>ue(),[]),x=y.useMemo(()=>ce(a),[a]),o=l?"":"transition-colors";return e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"text-xs font-semibold text-gray-700",children:"Authoring engine"}),e.jsx("div",{role:"tablist","aria-label":"Authoring engine",className:"flex flex-col gap-1.5",children:x.map(i=>{const k=m===i.engine,p=!i.detected&&i.installable,b=["flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm cursor-pointer",o,k?"border-blue-600 bg-blue-50":"border-gray-300 bg-white hover:border-gray-400"].filter(Boolean).join(" "),h=i.detected?{}:{opacity:.6};return e.jsxs("div",{role:"tab",tabIndex:0,"data-testid":`engine-selector-${i.engine}`,"aria-selected":k?"true":"false",title:i.tooltip,style:h,className:b,onClick:()=>u(i.engine),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),u(i.engine))},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-gray-900",children:i.label}),e.jsx("span",{className:"text-xs text-gray-500",children:i.caption})]}),p&&e.jsx("button",{type:"button","data-testid":`install-${i.engine}`,className:"rounded border border-blue-600 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-100",onClick:d=>{d.stopPropagation(),n(i.engine)},children:"Install"})]},i.engine)})})]})}const A="(?:0|[1-9]\\d*)",H="[0-9A-Za-z-]",F=`(?:${A}|\\d*[A-Za-z-]${H}*)`,z=`${H}+`,pe=`(?:-${F}(?:\\.${F})*)`,me=`(?:\\+${z}(?:\\.${z})*)`,ge=new RegExp(`^${A}\\.${A}\\.${A}${pe}?${me}?$`);function V(r){return typeof r!="string"?!1:ge.test(r.trim())}const he="Skill version (semver). Auto-bumps on update unless versioningMode=author.",fe="Must be valid semver (e.g. 1.0.0, 2.1.3-beta.1)";function ve(r){const{value:a,onChange:m,mode:u,onValidityChange:n,versionsHref:l,disabled:x}=r,[o,i]=y.useState(!1),[k,p]=y.useState(()=>V(a)),b=V(a);y.useEffect(()=>{b!==k?(p(b),n==null||n(b)):n&&n(b)},[b]);const h=o&&!b,d=["w-full rounded-md border px-3 py-2 text-sm font-mono",h?"border-red-500 bg-red-50 focus:outline-red-600":"border-gray-300 bg-white focus:outline-blue-600",x?"opacity-60 cursor-not-allowed":""].join(" ");return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-700",htmlFor:"version-input",children:"Version"}),e.jsx("input",{id:"version-input","data-testid":"version-input",type:"text",title:he,value:a,onChange:g=>m(g.currentTarget.value),onBlur:()=>i(!0),"aria-invalid":h?"true":"false","aria-describedby":h?"version-input-helper":void 0,disabled:x,className:d,placeholder:"1.0.0"}),h&&e.jsx("span",{id:"version-input-helper","data-testid":"version-input-helper",className:"text-xs text-red-600",role:"alert",children:fe}),u==="update"&&l&&e.jsx("a",{"data-testid":"version-input-versions-link",href:l,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"Versions →"})]})}const E={status:"idle",liveTail:"",progress:[],exitCode:null,stderr:"",error:null};function ye(r={}){const a=r.fetchImpl??globalThis.fetch,m=r.eventSourceCtor??globalThis.EventSource,[u,n]=y.useState(E),l=y.useRef(null),x=y.useRef(null);y.useEffect(()=>()=>{var p;(p=x.current)==null||p.close()},[]);const o=y.useCallback(()=>{var p;(p=x.current)==null||p.close(),x.current=null,l.current=null,n(E)},[]),i=y.useCallback(async p=>{if(!m){n({...E,status:"failure",error:"EventSource not available"});return}l.current=p,n({...E,status:"spawning"});let b;try{const d=await a("/api/studio/install-engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engine:p})});if(!d.ok){const C=await d.json().catch(()=>({}));n({...E,status:"failure",error:C.remediation??C.error??`HTTP ${d.status}`});return}b=(await d.json()).jobId}catch(d){n({...E,status:"failure",error:d.message});return}const h=new m(`/api/studio/install-engine/${b}/stream`);x.current=h,n(d=>({...d,status:"streaming"})),h.addEventListener("progress",d=>{try{const g=JSON.parse(d.data);n(C=>({...C,liveTail:g.line.length>60?g.line.slice(0,60)+"…":g.line,progress:[...C.progress,g].slice(-200)}))}catch{}}),h.addEventListener("done",d=>{try{const g=JSON.parse(d.data);h.close(),x.current=null,n(C=>({...C,status:g.success?"success":"failure",exitCode:g.exitCode,stderr:g.stderr,error:g.success?null:g.stderr||`exit ${g.exitCode}`}))}catch{h.close(),x.current=null,n(g=>({...g,status:"failure",error:"malformed done event"}))}}),h.addEventListener("error",()=>{h.close(),x.current=null,n(d=>({...d,status:d.status==="streaming"?"failure":d.status,error:d.error??"stream error"}))})},[m,a]),k=y.useCallback(async()=>{const p=l.current;p&&await i(p)},[i]);return{state:u,install:i,retry:k,reset:o}}const be={vskill:"vskill install anton-abyzov/vskill/skill-builder","anthropic-skill-creator":"claude plugin install skill-creator"},je={vskill:"VSkill skill-builder","anthropic-skill-creator":"Anthropic skill-creator"},ke="This runs the command in your terminal as your user. Inspect before approving.";function we(r){const{engine:a,onClose:m,onSuccess:u,hookOpts:n}=r,{state:l,install:x,retry:o}=ye(n),i=be[a],k=je[a],p=y.useRef(!1);return y.useEffect(()=>{l.status==="success"&&!p.current&&(p.current=!0,u())},[l.status,u]),e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"install-engine-title","data-testid":"install-engine-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-xl",children:[e.jsxs("h2",{id:"install-engine-title",className:"text-lg font-semibold text-gray-900",children:["Install ",k]}),l.status==="idle"&&e.jsx(Ne,{command:i,onCancel:m,onRun:()=>x(a)}),(l.status==="spawning"||l.status==="streaming")&&e.jsx(Ce,{command:i,liveTail:l.liveTail}),l.status==="success"&&e.jsx(Se,{label:k,onClose:m}),l.status==="failure"&&e.jsx(Le,{error:l.error??"Install failed",stderr:l.stderr,progress:l.progress,onRetry:()=>o(),onClose:m})]})})}function G({command:r}){return e.jsxs("pre",{"data-testid":"install-command-preview",className:"my-3 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-green-300",children:["$ ",r]})}function Ne(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Studio will run this command on your behalf:"}),e.jsx(G,{command:r.command}),e.jsx("p",{className:"text-xs text-amber-700","data-testid":"install-security-note",children:ke}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-cancel",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onCancel,children:"Cancel"}),e.jsx("button",{type:"button","data-testid":"install-run",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRun,children:"Run install"})]})]})}function Ce(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Installing…"}),e.jsx(G,{command:r.command}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-gray-600",children:[e.jsx("span",{"data-testid":"install-spinner",className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"}),e.jsx("span",{"data-testid":"install-live-tail",className:"font-mono",children:r.liveTail||"starting…"})]})]})}function Se(r){return e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-testid":"install-success",className:"mt-3 text-sm font-medium text-green-700",children:["✓ ",r.label," installed"]}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onClose,children:"Done"})})]})}function Le(r){const[a,m]=y.useState(!1),u=r.progress.filter(l=>l.stream==="stderr").map(l=>l.line),n=u.length>0?u.join(`
|
|
1
|
+
import{j as e,R as y,u as Q,a as J,r as v,g as D,b as $,w as Z,c as X,t as P,L as R,P as ee,E as te,d as se,S as re}from"./index-CWWW1rkS.js";/* empty css */const ae=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function le({supported:r,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:r?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:r?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${r?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function B({agent:r,checked:a,onToggle:m}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:r.installed?"1px solid var(--color-primary, #6366f1)":"1px solid var(--border-subtle, #333)",background:a?"var(--surface-2, #1e1e1e)":"transparent"},children:[e.jsx("input",{type:"checkbox",checked:a,onChange:m,style:{accentColor:"var(--color-primary, #6366f1)"}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontWeight:500,fontSize:13,color:"var(--text-primary, #fff)"},children:r.displayName}),r.installed&&e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:"var(--color-primary-bg, #312e81)",color:"var(--color-primary, #6366f1)"},children:"installed"})]}),e.jsx("div",{style:{marginTop:3},children:ae.map(u=>e.jsx(le,{supported:r.featureSupport[u.key],label:u.label},u.key))})]})]})}function ne({agents:r,selectedIds:a,onChange:m}){const u=new Set(a),n=r.filter(o=>o.isUniversal),l=r.filter(o=>!o.isUniversal),x=o=>{const i=u.has(o)?a.filter(k=>k!==o):[...a,o];m(i)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[n.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Universal Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:n.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]}),l.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Other Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:l.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]})]})}const oe="Cross-universal — emits the same skill to 8 universal agents (Claude, Codex, Cursor, Cline, Gemini CLI, OpenCode, Kimi, Amp). Constrains output to the common schema across all agents. Recommended for portable skills.",ie="Powerful Claude-native engine — Anthropic's built-in skill-creator with a slightly richer schema (more expressive on Claude) but Claude-only. Pick this when you only target Claude Code and want full expressiveness.",de="Generate raw — no engine assistance, you provide the full SKILL.md body.";function ce(r){return[{engine:"vskill",label:"VSkill skill-builder",caption:r.vskillSkillBuilder?`installed${r.vskillVersion?` v${r.vskillVersion}`:""}`:"not installed",tooltip:oe,detected:r.vskillSkillBuilder,installable:!0},{engine:"anthropic-skill-creator",label:"Anthropic skill-creator",caption:r.anthropicSkillCreator?"installed":"not installed",tooltip:ie,detected:r.anthropicSkillCreator,installable:!0},{engine:"none",label:"No engine — generate raw",caption:"always available",tooltip:de,detected:!0,installable:!1}]}function ue(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function xe(r){const{detection:a,selected:m,onSelect:u,onInstallClick:n}=r,l=y.useMemo(()=>ue(),[]),x=y.useMemo(()=>ce(a),[a]),o=l?"":"transition-colors";return e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"text-xs font-semibold text-gray-700",children:"Authoring engine"}),e.jsx("div",{role:"tablist","aria-label":"Authoring engine",className:"flex flex-col gap-1.5",children:x.map(i=>{const k=m===i.engine,p=!i.detected&&i.installable,b=["flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm cursor-pointer",o,k?"border-blue-600 bg-blue-50":"border-gray-300 bg-white hover:border-gray-400"].filter(Boolean).join(" "),h=i.detected?{}:{opacity:.6};return e.jsxs("div",{role:"tab",tabIndex:0,"data-testid":`engine-selector-${i.engine}`,"aria-selected":k?"true":"false",title:i.tooltip,style:h,className:b,onClick:()=>u(i.engine),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),u(i.engine))},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-gray-900",children:i.label}),e.jsx("span",{className:"text-xs text-gray-500",children:i.caption})]}),p&&e.jsx("button",{type:"button","data-testid":`install-${i.engine}`,className:"rounded border border-blue-600 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-100",onClick:d=>{d.stopPropagation(),n(i.engine)},children:"Install"})]},i.engine)})})]})}const A="(?:0|[1-9]\\d*)",H="[0-9A-Za-z-]",F=`(?:${A}|\\d*[A-Za-z-]${H}*)`,z=`${H}+`,pe=`(?:-${F}(?:\\.${F})*)`,me=`(?:\\+${z}(?:\\.${z})*)`,ge=new RegExp(`^${A}\\.${A}\\.${A}${pe}?${me}?$`);function V(r){return typeof r!="string"?!1:ge.test(r.trim())}const he="Skill version (semver). Auto-bumps on update unless versioningMode=author.",fe="Must be valid semver (e.g. 1.0.0, 2.1.3-beta.1)";function ve(r){const{value:a,onChange:m,mode:u,onValidityChange:n,versionsHref:l,disabled:x}=r,[o,i]=y.useState(!1),[k,p]=y.useState(()=>V(a)),b=V(a);y.useEffect(()=>{b!==k?(p(b),n==null||n(b)):n&&n(b)},[b]);const h=o&&!b,d=["w-full rounded-md border px-3 py-2 text-sm font-mono",h?"border-red-500 bg-red-50 focus:outline-red-600":"border-gray-300 bg-white focus:outline-blue-600",x?"opacity-60 cursor-not-allowed":""].join(" ");return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-700",htmlFor:"version-input",children:"Version"}),e.jsx("input",{id:"version-input","data-testid":"version-input",type:"text",title:he,value:a,onChange:g=>m(g.currentTarget.value),onBlur:()=>i(!0),"aria-invalid":h?"true":"false","aria-describedby":h?"version-input-helper":void 0,disabled:x,className:d,placeholder:"1.0.0"}),h&&e.jsx("span",{id:"version-input-helper","data-testid":"version-input-helper",className:"text-xs text-red-600",role:"alert",children:fe}),u==="update"&&l&&e.jsx("a",{"data-testid":"version-input-versions-link",href:l,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"Versions →"})]})}const E={status:"idle",liveTail:"",progress:[],exitCode:null,stderr:"",error:null};function ye(r={}){const a=r.fetchImpl??globalThis.fetch,m=r.eventSourceCtor??globalThis.EventSource,[u,n]=y.useState(E),l=y.useRef(null),x=y.useRef(null);y.useEffect(()=>()=>{var p;(p=x.current)==null||p.close()},[]);const o=y.useCallback(()=>{var p;(p=x.current)==null||p.close(),x.current=null,l.current=null,n(E)},[]),i=y.useCallback(async p=>{if(!m){n({...E,status:"failure",error:"EventSource not available"});return}l.current=p,n({...E,status:"spawning"});let b;try{const d=await a("/api/studio/install-engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engine:p})});if(!d.ok){const C=await d.json().catch(()=>({}));n({...E,status:"failure",error:C.remediation??C.error??`HTTP ${d.status}`});return}b=(await d.json()).jobId}catch(d){n({...E,status:"failure",error:d.message});return}const h=new m(`/api/studio/install-engine/${b}/stream`);x.current=h,n(d=>({...d,status:"streaming"})),h.addEventListener("progress",d=>{try{const g=JSON.parse(d.data);n(C=>({...C,liveTail:g.line.length>60?g.line.slice(0,60)+"…":g.line,progress:[...C.progress,g].slice(-200)}))}catch{}}),h.addEventListener("done",d=>{try{const g=JSON.parse(d.data);h.close(),x.current=null,n(C=>({...C,status:g.success?"success":"failure",exitCode:g.exitCode,stderr:g.stderr,error:g.success?null:g.stderr||`exit ${g.exitCode}`}))}catch{h.close(),x.current=null,n(g=>({...g,status:"failure",error:"malformed done event"}))}}),h.addEventListener("error",()=>{h.close(),x.current=null,n(d=>({...d,status:d.status==="streaming"?"failure":d.status,error:d.error??"stream error"}))})},[m,a]),k=y.useCallback(async()=>{const p=l.current;p&&await i(p)},[i]);return{state:u,install:i,retry:k,reset:o}}const be={vskill:"vskill install anton-abyzov/vskill/skill-builder","anthropic-skill-creator":"claude plugin install skill-creator"},je={vskill:"VSkill skill-builder","anthropic-skill-creator":"Anthropic skill-creator"},ke="This runs the command in your terminal as your user. Inspect before approving.";function we(r){const{engine:a,onClose:m,onSuccess:u,hookOpts:n}=r,{state:l,install:x,retry:o}=ye(n),i=be[a],k=je[a],p=y.useRef(!1);return y.useEffect(()=>{l.status==="success"&&!p.current&&(p.current=!0,u())},[l.status,u]),e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"install-engine-title","data-testid":"install-engine-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-xl",children:[e.jsxs("h2",{id:"install-engine-title",className:"text-lg font-semibold text-gray-900",children:["Install ",k]}),l.status==="idle"&&e.jsx(Ne,{command:i,onCancel:m,onRun:()=>x(a)}),(l.status==="spawning"||l.status==="streaming")&&e.jsx(Ce,{command:i,liveTail:l.liveTail}),l.status==="success"&&e.jsx(Se,{label:k,onClose:m}),l.status==="failure"&&e.jsx(Le,{error:l.error??"Install failed",stderr:l.stderr,progress:l.progress,onRetry:()=>o(),onClose:m})]})})}function G({command:r}){return e.jsxs("pre",{"data-testid":"install-command-preview",className:"my-3 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-green-300",children:["$ ",r]})}function Ne(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Studio will run this command on your behalf:"}),e.jsx(G,{command:r.command}),e.jsx("p",{className:"text-xs text-amber-700","data-testid":"install-security-note",children:ke}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-cancel",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onCancel,children:"Cancel"}),e.jsx("button",{type:"button","data-testid":"install-run",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRun,children:"Run install"})]})]})}function Ce(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Installing…"}),e.jsx(G,{command:r.command}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-gray-600",children:[e.jsx("span",{"data-testid":"install-spinner",className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"}),e.jsx("span",{"data-testid":"install-live-tail",className:"font-mono",children:r.liveTail||"starting…"})]})]})}function Se(r){return e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-testid":"install-success",className:"mt-3 text-sm font-medium text-green-700",children:["✓ ",r.label," installed"]}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onClose,children:"Done"})})]})}function Le(r){const[a,m]=y.useState(!1),u=r.progress.filter(l=>l.stream==="stderr").map(l=>l.line),n=u.length>0?u.join(`
|
|
2
2
|
`):r.stderr;return e.jsxs(e.Fragment,{children:[e.jsx("p",{"data-testid":"install-failure",className:"mt-3 text-sm font-medium text-red-700",children:"✗ Install failed"}),e.jsx("p",{className:"mt-1 text-xs text-gray-700",children:r.error}),n&&e.jsxs("details",{className:"mt-3 text-xs",open:a,onToggle:l=>m(l.currentTarget.open),children:[e.jsx("summary",{className:"cursor-pointer text-gray-600",children:"stderr"}),e.jsx("pre",{"data-testid":"install-stderr",className:"mt-2 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-red-300",children:n})]}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onClose,children:"Close"}),e.jsx("button",{type:"button","data-testid":"install-retry",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRetry,children:"Retry"})]})]})}const N={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Ee(r){return r?/API usage limits|usage limit/i.test(r)&&/regain access|reset/i.test(r):!1}function Pe(r){const a=r.match(/regain access on ([^"\\]+?)(?:\s*UTC)?["\\]/i)??r.match(/regain access on ([^"\\]+)/i);return a?`Resets ${a[1].trim()} UTC`:"Quota resets at the start of your next billing period"}function I(r){switch(r){case"claude-cli":return"Uses your logged-in Claude Code session — your existing CLI session handles quota. No API key needed. Overflow runs at standard API rates if extra usage is enabled in your account settings.";case"anthropic":return"Direct Anthropic API — pay-per-token. Full Opus / Sonnet / Haiku catalog. Requires ANTHROPIC_API_KEY.";case"openrouter":return"One API key → 300+ models from Anthropic, OpenAI (GPT-5 / o4-mini), Google (Gemini), Meta (Llama) and more. Same prices as direct.";case"ollama":return"Local models on your machine (Llama, Qwen, Mistral, etc.). Zero cost, zero data leaves your laptop.";case"lm-studio":return"Local models via LM Studio's OpenAI-compatible server. Works offline. Pick any model you've loaded in LM Studio.";default:return""}}function M({size:r=14,color:a="currentColor"}){return e.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function Te(){const r=Q(),{config:a}=J(),[m,u]=v.useState(null),n=y.useMemo(()=>{if(typeof window>"u")return{};const s=window.location.hash,c=s.indexOf("?");if(c===-1)return{};const w=new URLSearchParams(s.slice(c+1)),j={};for(const f of["mode","skillName","description","pluginName"]){const L=w.get(f);L&&(j[f]=L)}return j},[]),[l,x]=v.useState("claude-cli"),[o,i]=v.useState("sonnet"),[k,p]=v.useState(!1),[b,h]=v.useState(null),d=v.useRef(!1),[g,C]=v.useState([]),[W,U]=v.useState(()=>D("activeAgent",null));v.useEffect(()=>{function s(){U(D("activeAgent",null))}return window.addEventListener("studio:agent-changed",s),window.addEventListener("storage",s),()=>{window.removeEventListener("studio:agent-changed",s),window.removeEventListener("storage",s)}},[]);const K=W!=="claude-code";v.useEffect(()=>{fetch("/api/agents/installed").then(s=>s.json()).then(s=>{s.agents&&C(s.agents)}).catch(()=>{})},[]),v.useEffect(()=>{var j;if(!a)return;const s=a.providers.filter(f=>f.available),c=$().skillGenModel;if(s.length===0){d.current=!0;return}if(c&&typeof c=="object"&&typeof c.provider=="string"&&typeof c.model=="string"){const f=s.find(T=>T.id===c.provider),L=f==null?void 0:f.models.some(T=>T.id===c.model);if(f&&L){x(c.provider),i(c.model),p(!0),d.current=!0;return}h({provider:c.provider,model:c.model})}if(s.find(f=>f.id==="claude-cli"))x("claude-cli"),i("sonnet");else{const f=s[0];x(f.id),i(((j=f.models[0])==null?void 0:j.id)??"")}p(!1),d.current=!0},[a]),v.useEffect(()=>{const s=c=>{if(c.key!==null&&!c.key.includes("vskill.studio.prefs"))return;const j=$().skillGenModel;j&&typeof j=="object"&&typeof j.provider=="string"&&typeof j.model=="string"&&(x(j.provider),i(j.model),p(!0))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]);const O=v.useCallback((s,c)=>{Z("skillGenModel",{provider:s,model:c}),p(!0)},[]),Y=v.useCallback(()=>({provider:l,model:o}),[l,o]),q=n.mode==="standalone"?3:void 0,t=X({onCreated:(s,c)=>r(`/skills/${s}/${c}`),resolveAiConfigOverride:Y,forceLayout:q});v.useEffect(()=>{n.skillName&&!t.name&&t.setName(P(n.skillName)),n.description&&!t.description&&t.setDescription(n.description),n.description&&!t.aiPrompt&&t.setAiPrompt(n.description),n.pluginName&&!t.plugin&&t.setPlugin(P(n.pluginName))},[]);const S=a==null?void 0:a.providers.find(s=>s.id===l&&s.available),_=v.useMemo(()=>{const s=["---"];return t.description?s.push(`description: "${t.description.replace(/"/g,'\\"')}"`):s.push('description: ""'),t.allowedTools.trim()&&s.push(`allowed-tools: ${t.allowedTools.trim()}`),t.model&&s.push(`model: ${t.model}`),t.targetAgents.length>0&&s.push(`target-agents: ${t.targetAgents.join(", ")}`),s.push("---"),s.push(""),t.body.trim()?s.push(t.body.trim()):(s.push(`# /${t.name||"skill-name"}`),s.push(""),s.push("You are a helpful assistant.")),s.join(`
|
|
3
3
|
`)},[t.name,t.description,t.model,t.allowedTools,t.body]);return e.jsxs("div",{className:"px-4 py-6 sm:px-6 sm:py-7 lg:px-10 lg:py-8 max-w-6xl mx-auto w-full overflow-x-hidden",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:[e.jsx(R,{to:"/",className:"hover:underline",style:{color:"var(--text-tertiary)"},children:"Skills"}),e.jsx("span",{children:"/"}),e.jsx("span",{style:{color:"var(--text-secondary)"},children:"New Skill"})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:"text-[22px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),t.standaloneLocked&&e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider px-2 py-0.5 rounded whitespace-nowrap",style:{background:"var(--accent-muted)",color:"var(--accent)",border:"1px solid var(--accent-muted)"},title:"You chose Standalone in the previous step. Plugin selection is disabled.",children:"Standalone"})]}),e.jsx("p",{className:"text-[13px] mt-1",style:{color:"var(--text-tertiary)"},children:"Define your skill's metadata, content, and placement"})]}),e.jsxs("div",{className:"inline-flex rounded-lg p-1 self-start sm:self-auto sm:flex-shrink-0 max-w-full",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},role:"tablist","aria-label":"Creation mode",children:[e.jsx("button",{onClick:()=>t.setMode("ai"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="ai"?"var(--purple-muted)":"transparent",color:t.mode==="ai"?"var(--purple)":"var(--text-tertiary)",boxShadow:t.mode==="ai"?"0 1px 3px rgba(0,0,0,0.08)":"none"},children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(M,{size:14}),"AI-Assisted"]})}),e.jsx("button",{onClick:()=>t.setMode("manual"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:t.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:t.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:"Manual"})]})]})]}),t.engineDetection&&e.jsx("div",{className:"mb-4",children:e.jsx(xe,{detection:t.engineDetection,selected:t.engine,onSelect:s=>t.setEngine(s),onInstallClick:s=>u(s)})}),t.layoutLoading&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!t.layoutLoading&&t.layout&&t.mode==="ai"&&e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 animate-fade-in",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[e.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"var(--purple-muted)"},children:e.jsx(M,{size:13,color:"var(--purple)"})}),"Describe Your Skill"]}),e.jsx("textarea",{ref:t.promptRef,value:t.aiPrompt,onChange:s=>t.setAiPrompt(s.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-
|
|
2
|
-
import{r as t,j as d,_ as l}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-CYaU33vf.js","assets/index-CWWW1rkS.js","assets/index-C8DXCPPg.css","assets/fonts-i7Lkz2zN.css","assets/skill-url-C4ekwoGs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as d,_ as l}from"./index-CWWW1rkS.js";/* empty css */const f=t.lazy(()=>l(()=>import("./SearchPaletteCore-CYaU33vf.js"),__vite__mapDeps([0,1,2,3,4])));function w(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function y({onSelect:i,onNavigate:u}={}){const[n,o]=t.useState(!1),s=t.useRef(null),a=w();t.useEffect(()=>{function e(){s.current=document.activeElement??null,o(!0)}return window.addEventListener("openFindSkills",e),()=>window.removeEventListener("openFindSkills",e)},[]),t.useEffect(()=>{if(!n)return;function e(r){r.key==="Escape"&&o(!1)}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),t.useEffect(()=>{if(n)return;const e=s.current;if(e&&typeof e.focus=="function")try{e.focus()}catch{}s.current=null},[n]);const c=t.useCallback((e,r)=>{try{typeof window<"u"&&window.sessionStorage&&window.sessionStorage.setItem("find-skills:last-query",r??"")}catch{}if(o(!1),i)try{i(e,r)}catch{}},[i]);return n?d.jsx("div",{"data-testid":"find-skills-palette-shell","data-reduced-motion":a?"true":"false",children:d.jsx(t.Suspense,{fallback:null,children:d.jsx(f,{initialOpen:!0,onSelect:c,onNavigate:u})})}):null}export{y as FindSkillsPalette,y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,j as t,h as xe}from"./index-BLduRWyM.js";import{a as ye}from"./skill-url-C4ekwoGs.js";/* empty css */function me(i){return i?i.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ie(i,p){if(!i)return"";const d=be(i);if(!p)return d;const u=p.trim().split(/\s+/).filter(Boolean);if(u.length===0)return d;const T=u.map(W=>W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),b=new RegExp(`(${T})`,"gi");return d.replace(b,"<b>$1</b>")}function ve(i){return i?i<1e3?String(i):`${(i/1e3).toFixed(1)}k`:""}const ke=[{label:"Security",href:"/skills?category=security"},{label:"Coding",href:"/skills?category=development"},{label:"DevOps",href:"/skills?category=devops"},{label:"Testing",href:"/skills?category=testing"},{label:"Data",href:"/skills?category=data"},{label:"Design",href:"/skills?category=design"}],Se=[{label:"Submit a skill",href:"/submit"},{label:"Browse all skills",href:"/skills"}],J="var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)",c="var(--font-mono, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace)";function Ee({tier:i,isTainted:p,isBlocked:d}){const u={display:"inline-flex",alignItems:"center",padding:"1px 6px",height:16,borderRadius:3,fontFamily:c,fontSize:9.5,fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",lineHeight:1,textTransform:"uppercase"};if(d)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"BLOCKED",style:{...u,color:"#7A1F1F",background:"#FBE8E5",border:"1px solid #E8B7B0"},children:"BLOCKED"});if(p)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"TAINTED",style:{...u,color:"#7A4A00",background:"#FBEFD3",border:"1px solid #E8C885"},children:"Tainted"});const b={CERTIFIED:{color:"var(--color-installed, #2F6A4A)",bg:"rgba(47,106,74,0.08)",border:"rgba(47,106,74,0.25)"},VERIFIED:{color:"var(--color-focus, #3B6EA8)",bg:"rgba(59,110,168,0.08)",border:"rgba(59,110,168,0.25)"},REJECTED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"},BLOCKED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"}}[i];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":i,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:xe(i)}):null}function O(){return t.jsxs("div",{"data-testid":"skeleton-row",style:{padding:"10px 18px",display:"flex",alignItems:"center",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t.jsx("div",{style:{height:12,width:"32%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:9,width:"55%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.18s"}})]}),t.jsx("div",{style:{height:14,width:52,borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.36s"}})]})}function Fe(i){var d,u;const p=(d=i.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=i.target)!=null&&u.isContentEditable)}const je="/api/v1/studio/search",we="/api/v1/stats",Ae="/api/v1/studio/telemetry/search-select",Re=10,Q=20,Ce=150;function Be({onSelect:i,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=a.useState(W),[o,F]=a.useState(""),[I,h]=a.useState([]),[U,v]=a.useState(0),[j,B]=a.useState(!1),[_,w]=a.useState(1),[H,x]=a.useState(!1),[M,V]=a.useState(!1),[$,k]=a.useState(null),[A,R]=a.useState(!1),Z=a.useRef(null),N=a.useRef(null),z=a.useRef(!1),ee=a.useRef(null),te=a.useRef(null),q=a.useRef(new Map),S=a.useRef(null),[,ue]=a.useState(!1),re=a.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=a.useRef(o);a.useEffect(()=>{K.current=o},[o]),a.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),a.useEffect(()=>{const e=r=>{if(r.key==="Escape"){E(!1);return}if(L&&(r.metaKey||r.ctrlKey)&&/^[1-9]$/.test(r.key)){r.preventDefault();const s=Number(r.key)-1;v(s),window.dispatchEvent(new CustomEvent("findSkillsActivateAt",{detail:{index:s}}));return}!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key.length===1&&!Fe(r)&&(z.current=!0,F(r.key),E(!0))},n=r=>{var y;const l=(y=r.detail)==null?void 0:y.query;l&&(z.current=!0,F(l)),E(!0)};return window.addEventListener("keydown",e),window.addEventListener("openFindSkills",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("openFindSkills",n)}},[L]),a.useLayoutEffect(()=>{var n;if(!L){(n=N.current)==null||n.abort();return}if(z.current)z.current=!1,h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1);else{const r=(()=>{var s;try{return((s=window.sessionStorage)==null?void 0:s.getItem("find-skills:last-query"))??""}catch{return""}})();F(r),h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1)}const e=Z.current;if(e){e.focus({preventScroll:!0});const r=e.value.length;e.setSelectionRange(r,r)}},[L]),a.useEffect(()=>{if(!o.trim()||o.trim().length<2){h([]),x(!1),w(1),k(null);return}const e=6e4,n=o.trim().toLowerCase(),r=q.current.get(n);if(r&&Date.now()-r.timestamp<e){h(r.results),x(r.hasMore),w(1),B(!1),k(null),fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`).then(m=>m.ok?m.json():null).then(m=>{var g;m&&q.current.set(n,{results:m.results||[],hasMore:((g=m.pagination)==null?void 0:g.hasMore)??!1,timestamp:Date.now()})}).catch(()=>{});return}B(!0),k(null);const l=new AbortController,y=setTimeout(async()=>{var m;try{const g=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`,{signal:l.signal});if(g.status>=500){R(!0),h([]),x(!1),k(null);return}if(!g.ok){h([]),x(!1),k(`search failed (${g.status})`);return}const ce=await g.json(),de=ce.results||[],pe=((m=ce.pagination)==null?void 0:m.hasMore)??!1;h(de),x(pe),w(1),R(!1),q.current.set(n,{results:de,hasMore:pe,timestamp:Date.now()})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;R(!0),h([]),x(!1),k(null)}finally{l.signal.aborted||B(!1)}},Ce);return()=>{clearTimeout(y),l.abort()}},[o,d]);const C=_>=b,ne=a.useCallback(async()=>{var n,r;if(M||C)return;const e=_+1;V(!0),N.current=new AbortController;try{const s=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=${e}`,{signal:N.current.signal});if(!s.ok)return;const l=await s.json();h(y=>[...y,...l.results||[]]),x(((n=l.pagination)==null?void 0:n.hasMore)??!1),w(e)}catch(s){if(s instanceof DOMException&&s.name==="AbortError")return}finally{(r=N.current)!=null&&r.signal.aborted||V(!1)}},[_,o,M,C,d]);a.useEffect(()=>{const e=ee.current,n=te.current;if(!e||!n||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(s=>{s[0].isIntersecting&&H&&!j&&!M&&!C&&ne()},{root:n,rootMargin:"100px"});return r.observe(e),()=>r.disconnect()},[H,j,M,C,ne]);const P=e=>({name:e.name,displayName:e.displayName,author:e.author,repoUrl:e.repoUrl,certTier:e.certTier,githubStars:0,highlight:"",category:"",ownerSlug:e.ownerSlug,repoSlug:e.repoSlug,skillSlug:e.skillSlug}),G=(()=>{const e=o.trim();if(A&&e.length>=1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().includes(n)||(r.displayName??"").toLowerCase().includes(n)).slice(0,30).map(P)}if(e.length>=2)return I;if(e.length===1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().startsWith(n)||r.displayName.toLowerCase().startsWith(n)).slice(0,10).map(P)}return e.length===0&&S.current?S.current.slice(0,10).map(P):[]})(),f=[...G.map(e=>{const n=e.skillSlug||e.name.split("/").pop()||e.name,r=e.ownerSlug&&e.repoSlug?`${e.ownerSlug}/${e.repoSlug}`:e.author;return{type:"skill",label:n,publisher:r,name:e.name,command:e.command?e.pluginName?`${e.pluginName}:${e.command}`:e.command:void 0,pluginName:e.pluginName||void 0,meta:e.category||"",certTier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked,repoUrl:e.repoUrl,highlight:e.highlight,githubStars:e.githubStars,category:e.category,href:ye(e.name),sourceResult:e}}),...!o&&G.length===0?ke.map(e=>({type:"category",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[],...!o&&G.length===0?Se.map(e=>({type:"action",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[]],ae=a.useCallback(e=>{try{fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillName:e,q:K.current.trim(),ts:Date.now()}),keepalive:!0}).catch(()=>{})}catch{}},[T]),D=a.useCallback((e,n)=>{if(n&&(ae(n.name),i))try{i(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[i,p,ae]);a.useEffect(()=>{function e(n){var l;const r=((l=n.detail)==null?void 0:l.index)??-1,s=f[r];s&&D(s.href,s.type==="skill"?s.sourceResult:void 0)}return window.addEventListener("findSkillsActivateAt",e),()=>window.removeEventListener("findSkillsActivateAt",e)},[f,D]);const fe=e=>{if(e.key==="ArrowDown")e.preventDefault(),v(n=>Math.min(n+1,f.length-1));else if(e.key==="ArrowUp")e.preventDefault(),v(n=>Math.max(n-1,0));else if(e.key==="Enter"&&f[U]){const n=f[U];D(n.href,n.type==="skill"?n.sourceResult:void 0)}};if(!L)return null;let ie="";const se=!j&&!$&&!A&&o.trim().length>=2&&I.length===0,Y=j&&I.length===0&&o.trim().length>=2&&!A,oe=o.trim(),le=()=>{R(!1);const e=o;F(""),setTimeout(()=>F(e),0)},ge={position:"fixed",inset:0,background:"color-mix(in srgb, var(--color-ink, #191919) 35%, transparent)",backdropFilter:"blur(6px) saturate(1.1)",WebkitBackdropFilter:"blur(6px) saturate(1.1)"},he={position:"relative",width:"100%",maxWidth:640,margin:"0 16px",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:12,border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset,0 24px 60px -12px rgba(25,20,15,0.28),0 12px 24px -8px rgba(25,20,15,0.18)",overflow:"hidden",fontFamily:J};return t.jsxs("div",{"data-testid":"find-skills-palette",role:"dialog","aria-modal":"true","aria-label":"Find verified skills",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(18vh, 144px)"},onClick:()=>E(!1),children:[t.jsx("div",{style:ge}),t.jsx("style",{children:`
|
|
1
|
+
import{r as i,j as t,i as xe}from"./index-CWWW1rkS.js";import{a as ye}from"./skill-url-C4ekwoGs.js";/* empty css */function me(a){return a?a.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ie(a,p){if(!a)return"";const d=be(a);if(!p)return d;const u=p.trim().split(/\s+/).filter(Boolean);if(u.length===0)return d;const T=u.map(W=>W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),b=new RegExp(`(${T})`,"gi");return d.replace(b,"<b>$1</b>")}function ve(a){return a?a<1e3?String(a):`${(a/1e3).toFixed(1)}k`:""}const ke=[{label:"Security",href:"/skills?category=security"},{label:"Coding",href:"/skills?category=development"},{label:"DevOps",href:"/skills?category=devops"},{label:"Testing",href:"/skills?category=testing"},{label:"Data",href:"/skills?category=data"},{label:"Design",href:"/skills?category=design"}],Se=[{label:"Submit a skill",href:"/submit"},{label:"Browse all skills",href:"/skills"}],J="var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)",c="var(--font-mono, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace)";function Ee({tier:a,isTainted:p,isBlocked:d}){const u={display:"inline-flex",alignItems:"center",padding:"1px 6px",height:16,borderRadius:3,fontFamily:c,fontSize:9.5,fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",lineHeight:1,textTransform:"uppercase"};if(d)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"BLOCKED",style:{...u,color:"#7A1F1F",background:"#FBE8E5",border:"1px solid #E8B7B0"},children:"BLOCKED"});if(p)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"TAINTED",style:{...u,color:"#7A4A00",background:"#FBEFD3",border:"1px solid #E8C885"},children:"Tainted"});const b={CERTIFIED:{color:"var(--color-installed, #2F6A4A)",bg:"rgba(47,106,74,0.08)",border:"rgba(47,106,74,0.25)"},VERIFIED:{color:"var(--color-focus, #3B6EA8)",bg:"rgba(59,110,168,0.08)",border:"rgba(59,110,168,0.25)"},REJECTED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"},BLOCKED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"}}[a];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":a,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:xe(a)}):null}function O(){return t.jsxs("div",{"data-testid":"skeleton-row",style:{padding:"10px 18px",display:"flex",alignItems:"center",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t.jsx("div",{style:{height:12,width:"32%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:9,width:"55%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.18s"}})]}),t.jsx("div",{style:{height:14,width:52,borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.36s"}})]})}function Fe(a){var d,u;const p=(d=a.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=a.target)!=null&&u.isContentEditable)}const je="/api/v1/studio/search",we="/api/v1/stats",Ae="/api/v1/studio/telemetry/search-select",Re=10,Q=20,Ce=150;function Be({onSelect:a,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=i.useState(W),[o,F]=i.useState(""),[I,h]=i.useState([]),[U,v]=i.useState(0),[j,B]=i.useState(!1),[_,w]=i.useState(1),[H,x]=i.useState(!1),[M,V]=i.useState(!1),[$,k]=i.useState(null),[A,R]=i.useState(!1),Z=i.useRef(null),N=i.useRef(null),z=i.useRef(!1),ee=i.useRef(null),te=i.useRef(null),q=i.useRef(new Map),S=i.useRef(null),[,ue]=i.useState(!1),re=i.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=i.useRef(o);i.useEffect(()=>{K.current=o},[o]),i.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),i.useEffect(()=>{const e=r=>{if(r.key==="Escape"){E(!1);return}if(L&&(r.metaKey||r.ctrlKey)&&/^[1-9]$/.test(r.key)){r.preventDefault();const s=Number(r.key)-1;v(s),window.dispatchEvent(new CustomEvent("findSkillsActivateAt",{detail:{index:s}}));return}!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key.length===1&&!Fe(r)&&(z.current=!0,F(r.key),E(!0))},n=r=>{var y;const l=(y=r.detail)==null?void 0:y.query;l&&(z.current=!0,F(l)),E(!0)};return window.addEventListener("keydown",e),window.addEventListener("openFindSkills",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("openFindSkills",n)}},[L]),i.useLayoutEffect(()=>{var n;if(!L){(n=N.current)==null||n.abort();return}if(z.current)z.current=!1,h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1);else{const r=(()=>{var s;try{return((s=window.sessionStorage)==null?void 0:s.getItem("find-skills:last-query"))??""}catch{return""}})();F(r),h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1)}const e=Z.current;if(e){e.focus({preventScroll:!0});const r=e.value.length;e.setSelectionRange(r,r)}},[L]),i.useEffect(()=>{if(!o.trim()||o.trim().length<2){h([]),x(!1),w(1),k(null);return}const e=6e4,n=o.trim().toLowerCase(),r=q.current.get(n);if(r&&Date.now()-r.timestamp<e){h(r.results),x(r.hasMore),w(1),B(!1),k(null),fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`).then(m=>m.ok?m.json():null).then(m=>{var g;m&&q.current.set(n,{results:m.results||[],hasMore:((g=m.pagination)==null?void 0:g.hasMore)??!1,timestamp:Date.now()})}).catch(()=>{});return}B(!0),k(null);const l=new AbortController,y=setTimeout(async()=>{var m;try{const g=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`,{signal:l.signal});if(g.status>=500){R(!0),h([]),x(!1),k(null);return}if(!g.ok){h([]),x(!1),k(`search failed (${g.status})`);return}const ce=await g.json(),de=ce.results||[],pe=((m=ce.pagination)==null?void 0:m.hasMore)??!1;h(de),x(pe),w(1),R(!1),q.current.set(n,{results:de,hasMore:pe,timestamp:Date.now()})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;R(!0),h([]),x(!1),k(null)}finally{l.signal.aborted||B(!1)}},Ce);return()=>{clearTimeout(y),l.abort()}},[o,d]);const C=_>=b,ne=i.useCallback(async()=>{var n,r;if(M||C)return;const e=_+1;V(!0),N.current=new AbortController;try{const s=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=${e}`,{signal:N.current.signal});if(!s.ok)return;const l=await s.json();h(y=>[...y,...l.results||[]]),x(((n=l.pagination)==null?void 0:n.hasMore)??!1),w(e)}catch(s){if(s instanceof DOMException&&s.name==="AbortError")return}finally{(r=N.current)!=null&&r.signal.aborted||V(!1)}},[_,o,M,C,d]);i.useEffect(()=>{const e=ee.current,n=te.current;if(!e||!n||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(s=>{s[0].isIntersecting&&H&&!j&&!M&&!C&&ne()},{root:n,rootMargin:"100px"});return r.observe(e),()=>r.disconnect()},[H,j,M,C,ne]);const P=e=>({name:e.name,displayName:e.displayName,author:e.author,repoUrl:e.repoUrl,certTier:e.certTier,githubStars:0,highlight:"",category:"",ownerSlug:e.ownerSlug,repoSlug:e.repoSlug,skillSlug:e.skillSlug}),G=(()=>{const e=o.trim();if(A&&e.length>=1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().includes(n)||(r.displayName??"").toLowerCase().includes(n)).slice(0,30).map(P)}if(e.length>=2)return I;if(e.length===1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().startsWith(n)||r.displayName.toLowerCase().startsWith(n)).slice(0,10).map(P)}return e.length===0&&S.current?S.current.slice(0,10).map(P):[]})(),f=[...G.map(e=>{const n=e.skillSlug||e.name.split("/").pop()||e.name,r=e.ownerSlug&&e.repoSlug?`${e.ownerSlug}/${e.repoSlug}`:e.author;return{type:"skill",label:n,publisher:r,name:e.name,command:e.command?e.pluginName?`${e.pluginName}:${e.command}`:e.command:void 0,pluginName:e.pluginName||void 0,meta:e.category||"",certTier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked,repoUrl:e.repoUrl,highlight:e.highlight,githubStars:e.githubStars,category:e.category,href:ye(e.name),sourceResult:e}}),...!o&&G.length===0?ke.map(e=>({type:"category",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[],...!o&&G.length===0?Se.map(e=>({type:"action",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[]],ie=i.useCallback(e=>{try{fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillName:e,q:K.current.trim(),ts:Date.now()}),keepalive:!0}).catch(()=>{})}catch{}},[T]),D=i.useCallback((e,n)=>{if(n&&(ie(n.name),a))try{a(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[a,p,ie]);i.useEffect(()=>{function e(n){var l;const r=((l=n.detail)==null?void 0:l.index)??-1,s=f[r];s&&D(s.href,s.type==="skill"?s.sourceResult:void 0)}return window.addEventListener("findSkillsActivateAt",e),()=>window.removeEventListener("findSkillsActivateAt",e)},[f,D]);const fe=e=>{if(e.key==="ArrowDown")e.preventDefault(),v(n=>Math.min(n+1,f.length-1));else if(e.key==="ArrowUp")e.preventDefault(),v(n=>Math.max(n-1,0));else if(e.key==="Enter"&&f[U]){const n=f[U];D(n.href,n.type==="skill"?n.sourceResult:void 0)}};if(!L)return null;let ae="";const se=!j&&!$&&!A&&o.trim().length>=2&&I.length===0,Y=j&&I.length===0&&o.trim().length>=2&&!A,oe=o.trim(),le=()=>{R(!1);const e=o;F(""),setTimeout(()=>F(e),0)},ge={position:"fixed",inset:0,background:"color-mix(in srgb, var(--color-ink, #191919) 35%, transparent)",backdropFilter:"blur(6px) saturate(1.1)",WebkitBackdropFilter:"blur(6px) saturate(1.1)"},he={position:"relative",width:"100%",maxWidth:640,margin:"0 16px",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:12,border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset,0 24px 60px -12px rgba(25,20,15,0.28),0 12px 24px -8px rgba(25,20,15,0.18)",overflow:"hidden",fontFamily:J};return t.jsxs("div",{"data-testid":"find-skills-palette",role:"dialog","aria-modal":"true","aria-label":"Find verified skills",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(18vh, 144px)"},onClick:()=>E(!1),children:[t.jsx("div",{style:ge}),t.jsx("style",{children:`
|
|
2
2
|
@keyframes fsp-pulse {
|
|
3
3
|
0%, 100% { opacity: 1; }
|
|
4
4
|
50% { opacity: 0.45; }
|
|
@@ -11,4 +11,4 @@ import{r as a,j as t,h as xe}from"./index-BLduRWyM.js";import{a as ye}from"./ski
|
|
|
11
11
|
.fsp-rise { animation: none !important; }
|
|
12
12
|
[data-testid="skeleton-row"] > div { animation: none !important; }
|
|
13
13
|
}
|
|
14
|
-
`}),t.jsxs("div",{className:"fsp-rise",style:{...he,animation:"fsp-rise 180ms cubic-bezier(0.2, 0, 0, 1)"},onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 18px",borderBottom:"1px solid var(--color-rule, #E8E1D6)",background:"linear-gradient(180deg, var(--bg-surface, #FFFFFF) 0%, color-mix(in srgb, var(--bg-surface, #FFFFFF) 96%, var(--color-accent, #D4A27F) 4%) 100%)"},children:[t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:18,height:18,marginRight:10,color:"var(--color-accent-ink, #7A4A24)"},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"4.5"}),t.jsx("path",{d:"m13.5 13.5-3.2-3.2"})]})}),t.jsx("input",{ref:Z,value:o,onChange:e=>{F(e.target.value),v(0)},onKeyDown:fe,placeholder:"Search verified skills…",role:"combobox","aria-expanded":"true","aria-controls":"find-skills-listbox","aria-autocomplete":"list",autoFocus:!0,spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{flex:1,border:"none",outline:"none",padding:"16px 0",fontFamily:J,fontSize:16,fontWeight:400,letterSpacing:"-0.005em",background:"transparent",color:"var(--text-primary, #191919)",minWidth:0}}),j&&t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",marginRight:10,color:"var(--text-secondary, #5A5651)"},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none",opacity:"0.25"}),t.jsx("path",{d:"M12.5 7a5.5 5.5 0 0 0-5.5-5.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none",strokeLinecap:"round",children:t.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"0.7s",repeatCount:"indefinite"})})]})}),t.jsx("kbd",{style:{fontFamily:c,fontSize:10.5,fontWeight:500,color:"var(--text-secondary, #5A5651)",border:"1px solid var(--color-rule, #E8E1D6)",borderRadius:4,padding:"2px 6px",background:"var(--bg-canvas, #FBF8F3)"},children:"Esc"})]}),A&&t.jsxs("div",{"data-testid":"search-degraded-banner",role:"status",style:{display:"flex",alignItems:"center",gap:10,padding:"8px 18px",fontFamily:c,fontSize:11.5,color:"var(--color-accent-ink, #7A4A24)",background:"color-mix(in srgb, var(--color-accent, #D4A27F) 12%, transparent)",borderBottom:"1px solid color-mix(in srgb, var(--color-accent, #D4A27F) 30%, transparent)"},children:[t.jsx("span",{"aria-hidden":"true",children:"◐"}),t.jsx("span",{style:{flex:1},children:"Live search is offline — showing trending matches"}),t.jsx("button",{"data-testid":"search-retry",onClick:le,style:{fontFamily:c,fontSize:10.5,padding:"3px 8px",borderRadius:3,border:"1px solid var(--color-accent, #D4A27F)",background:"transparent",color:"var(--color-accent-ink, #7A4A24)",cursor:"pointer"},children:"Retry"})]}),t.jsxs("div",{ref:te,role:"listbox",id:"find-skills-listbox",style:{maxHeight:"min(56vh, 432px)",overflowY:"auto",padding:"6px 0"},children:[Y&&t.jsxs(t.Fragment,{children:[t.jsx(O,{}),t.jsx(O,{}),t.jsx(O,{}),t.jsx(O,{})]}),$&&!A&&t.jsxs("div",{"data-testid":"search-error",style:{padding:"20px 18px",textAlign:"center",fontFamily:c,fontSize:12.5,color:"var(--color-ink-muted, #5A5651)"},children:[t.jsx("div",{style:{marginBottom:8},children:$}),t.jsx("button",{"data-testid":"search-retry",onClick:le,style:{fontFamily:c,fontSize:11,padding:"4px 10px",borderRadius:4,border:"1px solid var(--color-rule, #E8E1D6)",background:"transparent",color:"var(--text-primary, #191919)",cursor:"pointer"},children:"Retry"})]}),se&&t.jsxs("div",{style:{padding:"28px 18px",textAlign:"center"},children:[t.jsxs("div",{style:{fontFamily:J,fontSize:13,color:"var(--text-secondary, #5A5651)",marginBottom:6},children:["No matches for ",t.jsxs("span",{style:{color:"var(--text-primary, #191919)",fontFamily:c},children:['"',oe,'"']})]}),t.jsx("a",{href:"/skills",style:{fontFamily:c,fontSize:12,color:"var(--color-action, #2F5B8E)",textDecoration:"none",borderBottom:"1px solid currentColor",paddingBottom:1},onClick:e=>{e.preventDefault(),D("/skills")},children:"Browse by category →"})]}),!Y&&f.length===0&&!se&&!$&&t.jsx("div",{style:{padding:"20px 18px",textAlign:"center",fontFamily:c,fontSize:11.5,color:"var(--text-secondary, #5A5651)"},children:"Loading trending…"}),!Y&&f.map((e,n)=>{const r=e.type==="skill"?A?"TRENDING (FILTERED)":oe.length>=2?"RESULTS":"TRENDING":e.type==="category"?"CATEGORIES":"ACTIONS",s=r!==ie;s&&(ie=r);const l=n===U,y=n<9?`${re?"⌘":"Ctrl"} ${n+1}`:"";return t.jsxs("div",{children:[s&&t.jsx("div",{style:{padding:"10px 18px 4px",fontFamily:c,fontSize:9.5,fontWeight:600,color:"var(--text-secondary, #5A5651)",letterSpacing:"0.12em",textTransform:"uppercase"},children:r}),e.type==="skill"?t.jsxs("div",{role:"option","aria-selected":l,onClick:()=>D(e.href,e.sourceResult),onMouseEnter:()=>v(n),style:{position:"relative",padding:"8px 18px 8px 22px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,background:l?"color-mix(in srgb, var(--color-accent, #D4A27F) 8%, transparent)":"transparent",transition:"background 120ms ease"},children:[l&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:6,bottom:6,width:3,background:"var(--color-accent, #D4A27F)",borderRadius:"0 2px 2px 0"}}),t.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[t.jsx("span",{style:{fontFamily:c,fontSize:13,fontWeight:600,color:"var(--text-primary, #191919)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:e.label}),e.pluginName&&t.jsx("span",{style:{fontSize:9.5,padding:"1px 5px",borderRadius:3,color:"var(--color-action, #2F5B8E)",background:"rgba(47,91,142,0.08)",border:"1px solid rgba(47,91,142,0.22)",whiteSpace:"nowrap",flexShrink:0,fontFamily:c},children:e.pluginName})]}),t.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary, #5A5651)",fontFamily:c,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:.85},children:[e.publisher,e.highlight&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{margin:"0 6px",opacity:.5},children:"·"}),t.jsx("span",{"data-testid":"search-highlight",dangerouslySetInnerHTML:{__html:me(e.highlight)}})]})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.githubStars!=null&&e.githubStars>0&&t.jsxs("span",{"data-testid":"star-count",style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10.5,fontFamily:c,color:"var(--text-secondary, #5A5651)",whiteSpace:"nowrap"},children:[t.jsx("svg",{width:10,height:10,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),ve(e.githubStars)]}),t.jsx(Ee,{tier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked}),l&&y&&t.jsx("span",{"aria-hidden":"true",style:{fontFamily:c,fontSize:9.5,color:"var(--text-secondary, #5A5651)",padding:"1px 5px",borderRadius:3,border:"1px solid var(--color-rule, #E8E1D6)",whiteSpace:"nowrap"},children:y})]})]}):t.jsxs("div",{role:"option","aria-selected":l,onClick:()=>D(e.href),onMouseEnter:()=>v(n),style:{position:"relative",padding:"7px 18px 7px 22px",cursor:"pointer",background:l?"color-mix(in srgb, var(--color-accent, #D4A27F) 8%, transparent)":"transparent",fontFamily:c,fontSize:12.5,color:"var(--text-primary, #191919)"},children:[l&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:4,bottom:4,width:3,background:"var(--color-accent, #D4A27F)",borderRadius:"0 2px 2px 0"}}),e.label]})]},`${e.type}-${e.name||e.label}`)}),H&&!j&&I.length>0&&!C&&t.jsx("div",{ref:ee,"data-testid":"scroll-sentinel",style:{padding:"8px 18px",textAlign:"center"},children:M&&t.jsx("span",{style:{fontFamily:c,fontSize:11,color:"var(--text-secondary, #5A5651)"},children:"Loading…"})}),C&&I.length>0&&t.jsx("div",{"data-testid":"hard-cap-link",style:{padding:"12px 18px",textAlign:"center",fontFamily:c,fontSize:11.5},children:t.jsx("a",{href:`https://verified-skill.com/skills?q=${encodeURIComponent(o.trim())}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-action, #2F5B8E)",textDecoration:"none"},children:"See all results on verified-skill.com →"})})]}),t.jsxs("div",{"data-testid":"palette-footer",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 18px",borderTop:"1px solid var(--color-rule, #E8E1D6)",background:"var(--bg-canvas, #FBF8F3)",fontFamily:c,fontSize:10.5,color:"var(--text-secondary, #5A5651)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[t.jsx(X,{keys:["↑","↓"],label:"navigate"}),t.jsx(X,{keys:["↵"],label:"open"}),t.jsx(X,{keys:[re?"⌘":"Ctrl","1-9"],label:"jump"})]}),t.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:t.jsx("span",{style:{opacity:.7},children:f.length>0?`${f.length} ${f.length===1?"result":"results"}`:""})})]})]})]})}function X({keys:i,label:p}){return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[t.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:i.map((d,u)=>t.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,padding:"0 4px",fontFamily:c,fontSize:10,fontWeight:500,color:"var(--text-secondary, #5A5651)",background:"var(--bg-surface, #FFFFFF)",border:"1px solid var(--color-rule, #E8E1D6)",borderRadius:3,lineHeight:1},children:d},u))}),t.jsx("span",{children:p})]})}export{Be as default,ve as formatStarCount,Ie as highlightMatches};
|
|
14
|
+
`}),t.jsxs("div",{className:"fsp-rise",style:{...he,animation:"fsp-rise 180ms cubic-bezier(0.2, 0, 0, 1)"},onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 18px",borderBottom:"1px solid var(--color-rule, #E8E1D6)",background:"linear-gradient(180deg, var(--bg-surface, #FFFFFF) 0%, color-mix(in srgb, var(--bg-surface, #FFFFFF) 96%, var(--color-accent, #D4A27F) 4%) 100%)"},children:[t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:18,height:18,marginRight:10,color:"var(--color-accent-ink, #7A4A24)"},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"4.5"}),t.jsx("path",{d:"m13.5 13.5-3.2-3.2"})]})}),t.jsx("input",{ref:Z,value:o,onChange:e=>{F(e.target.value),v(0)},onKeyDown:fe,placeholder:"Search verified skills…",role:"combobox","aria-expanded":"true","aria-controls":"find-skills-listbox","aria-autocomplete":"list",autoFocus:!0,spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{flex:1,border:"none",outline:"none",padding:"16px 0",fontFamily:J,fontSize:16,fontWeight:400,letterSpacing:"-0.005em",background:"transparent",color:"var(--text-primary, #191919)",minWidth:0}}),j&&t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",marginRight:10,color:"var(--text-secondary, #5A5651)"},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none",opacity:"0.25"}),t.jsx("path",{d:"M12.5 7a5.5 5.5 0 0 0-5.5-5.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none",strokeLinecap:"round",children:t.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"0.7s",repeatCount:"indefinite"})})]})}),t.jsx("kbd",{style:{fontFamily:c,fontSize:10.5,fontWeight:500,color:"var(--text-secondary, #5A5651)",border:"1px solid var(--color-rule, #E8E1D6)",borderRadius:4,padding:"2px 6px",background:"var(--bg-canvas, #FBF8F3)"},children:"Esc"})]}),A&&t.jsxs("div",{"data-testid":"search-degraded-banner",role:"status",style:{display:"flex",alignItems:"center",gap:10,padding:"8px 18px",fontFamily:c,fontSize:11.5,color:"var(--color-accent-ink, #7A4A24)",background:"color-mix(in srgb, var(--color-accent, #D4A27F) 12%, transparent)",borderBottom:"1px solid color-mix(in srgb, var(--color-accent, #D4A27F) 30%, transparent)"},children:[t.jsx("span",{"aria-hidden":"true",children:"◐"}),t.jsx("span",{style:{flex:1},children:"Live search is offline — showing trending matches"}),t.jsx("button",{"data-testid":"search-retry",onClick:le,style:{fontFamily:c,fontSize:10.5,padding:"3px 8px",borderRadius:3,border:"1px solid var(--color-accent, #D4A27F)",background:"transparent",color:"var(--color-accent-ink, #7A4A24)",cursor:"pointer"},children:"Retry"})]}),t.jsxs("div",{ref:te,role:"listbox",id:"find-skills-listbox",style:{maxHeight:"min(56vh, 432px)",overflowY:"auto",padding:"6px 0"},children:[Y&&t.jsxs(t.Fragment,{children:[t.jsx(O,{}),t.jsx(O,{}),t.jsx(O,{}),t.jsx(O,{})]}),$&&!A&&t.jsxs("div",{"data-testid":"search-error",style:{padding:"20px 18px",textAlign:"center",fontFamily:c,fontSize:12.5,color:"var(--color-ink-muted, #5A5651)"},children:[t.jsx("div",{style:{marginBottom:8},children:$}),t.jsx("button",{"data-testid":"search-retry",onClick:le,style:{fontFamily:c,fontSize:11,padding:"4px 10px",borderRadius:4,border:"1px solid var(--color-rule, #E8E1D6)",background:"transparent",color:"var(--text-primary, #191919)",cursor:"pointer"},children:"Retry"})]}),se&&t.jsxs("div",{style:{padding:"28px 18px",textAlign:"center"},children:[t.jsxs("div",{style:{fontFamily:J,fontSize:13,color:"var(--text-secondary, #5A5651)",marginBottom:6},children:["No matches for ",t.jsxs("span",{style:{color:"var(--text-primary, #191919)",fontFamily:c},children:['"',oe,'"']})]}),t.jsx("a",{href:"/skills",style:{fontFamily:c,fontSize:12,color:"var(--color-action, #2F5B8E)",textDecoration:"none",borderBottom:"1px solid currentColor",paddingBottom:1},onClick:e=>{e.preventDefault(),D("/skills")},children:"Browse by category →"})]}),!Y&&f.length===0&&!se&&!$&&t.jsx("div",{style:{padding:"20px 18px",textAlign:"center",fontFamily:c,fontSize:11.5,color:"var(--text-secondary, #5A5651)"},children:"Loading trending…"}),!Y&&f.map((e,n)=>{const r=e.type==="skill"?A?"TRENDING (FILTERED)":oe.length>=2?"RESULTS":"TRENDING":e.type==="category"?"CATEGORIES":"ACTIONS",s=r!==ae;s&&(ae=r);const l=n===U,y=n<9?`${re?"⌘":"Ctrl"} ${n+1}`:"";return t.jsxs("div",{children:[s&&t.jsx("div",{style:{padding:"10px 18px 4px",fontFamily:c,fontSize:9.5,fontWeight:600,color:"var(--text-secondary, #5A5651)",letterSpacing:"0.12em",textTransform:"uppercase"},children:r}),e.type==="skill"?t.jsxs("div",{role:"option","aria-selected":l,onClick:()=>D(e.href,e.sourceResult),onMouseEnter:()=>v(n),style:{position:"relative",padding:"8px 18px 8px 22px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,background:l?"color-mix(in srgb, var(--color-accent, #D4A27F) 8%, transparent)":"transparent",transition:"background 120ms ease"},children:[l&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:6,bottom:6,width:3,background:"var(--color-accent, #D4A27F)",borderRadius:"0 2px 2px 0"}}),t.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[t.jsx("span",{style:{fontFamily:c,fontSize:13,fontWeight:600,color:"var(--text-primary, #191919)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:e.label}),e.pluginName&&t.jsx("span",{style:{fontSize:9.5,padding:"1px 5px",borderRadius:3,color:"var(--color-action, #2F5B8E)",background:"rgba(47,91,142,0.08)",border:"1px solid rgba(47,91,142,0.22)",whiteSpace:"nowrap",flexShrink:0,fontFamily:c},children:e.pluginName})]}),t.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary, #5A5651)",fontFamily:c,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:.85},children:[e.publisher,e.highlight&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{margin:"0 6px",opacity:.5},children:"·"}),t.jsx("span",{"data-testid":"search-highlight",dangerouslySetInnerHTML:{__html:me(e.highlight)}})]})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.githubStars!=null&&e.githubStars>0&&t.jsxs("span",{"data-testid":"star-count",style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10.5,fontFamily:c,color:"var(--text-secondary, #5A5651)",whiteSpace:"nowrap"},children:[t.jsx("svg",{width:10,height:10,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),ve(e.githubStars)]}),t.jsx(Ee,{tier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked}),l&&y&&t.jsx("span",{"aria-hidden":"true",style:{fontFamily:c,fontSize:9.5,color:"var(--text-secondary, #5A5651)",padding:"1px 5px",borderRadius:3,border:"1px solid var(--color-rule, #E8E1D6)",whiteSpace:"nowrap"},children:y})]})]}):t.jsxs("div",{role:"option","aria-selected":l,onClick:()=>D(e.href),onMouseEnter:()=>v(n),style:{position:"relative",padding:"7px 18px 7px 22px",cursor:"pointer",background:l?"color-mix(in srgb, var(--color-accent, #D4A27F) 8%, transparent)":"transparent",fontFamily:c,fontSize:12.5,color:"var(--text-primary, #191919)"},children:[l&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:4,bottom:4,width:3,background:"var(--color-accent, #D4A27F)",borderRadius:"0 2px 2px 0"}}),e.label]})]},`${e.type}-${e.name||e.label}`)}),H&&!j&&I.length>0&&!C&&t.jsx("div",{ref:ee,"data-testid":"scroll-sentinel",style:{padding:"8px 18px",textAlign:"center"},children:M&&t.jsx("span",{style:{fontFamily:c,fontSize:11,color:"var(--text-secondary, #5A5651)"},children:"Loading…"})}),C&&I.length>0&&t.jsx("div",{"data-testid":"hard-cap-link",style:{padding:"12px 18px",textAlign:"center",fontFamily:c,fontSize:11.5},children:t.jsx("a",{href:`https://verified-skill.com/skills?q=${encodeURIComponent(o.trim())}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-action, #2F5B8E)",textDecoration:"none"},children:"See all results on verified-skill.com →"})})]}),t.jsxs("div",{"data-testid":"palette-footer",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 18px",borderTop:"1px solid var(--color-rule, #E8E1D6)",background:"var(--bg-canvas, #FBF8F3)",fontFamily:c,fontSize:10.5,color:"var(--text-secondary, #5A5651)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[t.jsx(X,{keys:["↑","↓"],label:"navigate"}),t.jsx(X,{keys:["↵"],label:"open"}),t.jsx(X,{keys:[re?"⌘":"Ctrl","1-9"],label:"jump"})]}),t.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:t.jsx("span",{style:{opacity:.7},children:f.length>0?`${f.length} ${f.length===1?"result":"results"}`:""})})]})]})]})}function X({keys:a,label:p}){return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[t.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:a.map((d,u)=>t.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,padding:"0 4px",fontFamily:c,fontSize:10,fontWeight:500,color:"var(--text-secondary, #5A5651)",background:"var(--bg-surface, #FFFFFF)",border:"1px solid var(--color-rule, #E8E1D6)",borderRadius:3,lineHeight:1},children:d},u))}),t.jsx("span",{children:p})]})}export{Be as default,ve as formatStarCount,Ie as highlightMatches};
|