vskill 0.5.136 → 0.5.138

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.
Files changed (28) hide show
  1. package/agents.json +1 -1
  2. package/dist/eval/plugin-scanner.d.ts +1 -1
  3. package/dist/eval/plugin-scanner.js +19 -1
  4. package/dist/eval/plugin-scanner.js.map +1 -1
  5. package/dist/eval/skill-scanner.d.ts +13 -0
  6. package/dist/eval/skill-scanner.js +5 -1
  7. package/dist/eval/skill-scanner.js.map +1 -1
  8. package/dist/eval-server/api-routes.js +49 -8
  9. package/dist/eval-server/api-routes.js.map +1 -1
  10. package/dist/eval-server/git-routes.d.ts +1 -0
  11. package/dist/eval-server/git-routes.js +32 -0
  12. package/dist/eval-server/git-routes.js.map +1 -1
  13. package/dist/eval-server/skill-dir-registry.d.ts +17 -0
  14. package/dist/eval-server/skill-dir-registry.js +25 -0
  15. package/dist/eval-server/skill-dir-registry.js.map +1 -0
  16. package/dist/eval-server/skill-resolver.d.ts +14 -0
  17. package/dist/eval-server/skill-resolver.js +66 -1
  18. package/dist/eval-server/skill-resolver.js.map +1 -1
  19. package/dist/eval-ui/assets/{CommandPalette-C0OajJac.js → CommandPalette-DWl6kb7K.js} +1 -1
  20. package/dist/eval-ui/assets/{CreateSkillPage-BHTsGTx2.js → CreateSkillPage-IndkXdwH.js} +1 -1
  21. package/dist/eval-ui/assets/{FindSkillsPalette-Fd_xvWRc.js → FindSkillsPalette-Br5cToMQ.js} +2 -2
  22. package/dist/eval-ui/assets/{SearchPaletteCore-CYaU33vf.js → SearchPaletteCore-usZJoJGb.js} +1 -1
  23. package/dist/eval-ui/assets/{SkillDetailPanel-cxwua4jw.js → SkillDetailPanel-ZGSkm510.js} +1 -1
  24. package/dist/eval-ui/assets/{UpdateDropdown-C6b6HzFl.js → UpdateDropdown-Borwxx95.js} +1 -1
  25. package/dist/eval-ui/assets/index-BOR1gyX9.js +102 -0
  26. package/dist/eval-ui/index.html +1 -1
  27. package/package.json +1 -1
  28. package/dist/eval-ui/assets/index-CWWW1rkS.js +0 -102
@@ -1 +1 @@
1
- {"version":3,"file":"git-routes.js","sourceRoot":"","sources":["../../src/eval-server/git-routes.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kDAAkD;AAClD,EAAE;AACF,4DAA4D;AAC5D,qFAAqF;AACrF,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,6DAA6D;AAC7D,8EAA8E;AAG9E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AASpE,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,SAAS,YAAY;IACnB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,kBAAkB,CAAC;IACpC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;AAC9D,CAAC;AAED,0EAA0E;AAC1E,mEAAmE;AACnE,SAAS,aAAa,CACpB,IAAuB,EACvB,GAAW,EACX,SAAiB;IAEjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,IAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACrD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,KAAK,GAAG,UAAU,CAAC,GA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C,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAElE,MAAM,oBAAoB,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAErF,MAAM,cAAc,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,17 @@
1
+ export interface SkillDirEntry {
2
+ /** Absolute path to the skill directory the scanner emitted. */
3
+ dir: string;
4
+ /**
5
+ * Optional editable upstream source path (marketplace clone for plugin-cache
6
+ * installs). Stored for future use by routes that prefer the editable copy.
7
+ */
8
+ sourcePath?: string | null;
9
+ /** Origin classification, mostly informational. */
10
+ origin?: "source" | "installed";
11
+ }
12
+ /** Replace any existing entry for (plugin, skill). */
13
+ export declare function setSkillDirEntry(plugin: string, skill: string, entry: SkillDirEntry): void;
14
+ /** Look up an entry. Returns undefined when nothing is registered. */
15
+ export declare function getSkillDirEntry(plugin: string, skill: string): SkillDirEntry | undefined;
16
+ /** Clear the registry — used in tests. */
17
+ export declare function clearSkillDirRegistry(): void;
@@ -0,0 +1,25 @@
1
+ // ---------------------------------------------------------------------------
2
+ // 0769 T-006: SkillDirRegistry — server-side memo of (plugin, skill) → absolute
3
+ // skill directory, plus the editable upstream sourcePath when known.
4
+ //
5
+ // Populated each time the /api/skills handler enriches the scanner output;
6
+ // consumed by the /files and /file routes so they can serve plugin-cache
7
+ // installs whose skill directory lives OUTSIDE the studio's project root.
8
+ // ---------------------------------------------------------------------------
9
+ const ENTRIES = new Map();
10
+ function key(plugin, skill) {
11
+ return `${plugin}/${skill}`;
12
+ }
13
+ /** Replace any existing entry for (plugin, skill). */
14
+ export function setSkillDirEntry(plugin, skill, entry) {
15
+ ENTRIES.set(key(plugin, skill), entry);
16
+ }
17
+ /** Look up an entry. Returns undefined when nothing is registered. */
18
+ export function getSkillDirEntry(plugin, skill) {
19
+ return ENTRIES.get(key(plugin, skill));
20
+ }
21
+ /** Clear the registry — used in tests. */
22
+ export function clearSkillDirRegistry() {
23
+ ENTRIES.clear();
24
+ }
25
+ //# sourceMappingURL=skill-dir-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-dir-registry.js","sourceRoot":"","sources":["../../src/eval-server/skill-dir-registry.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,qEAAqE;AACrE,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,8EAA8E;AAc9E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAC;AAEjD,SAAS,GAAG,CAAC,MAAc,EAAE,KAAa;IACxC,OAAO,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,KAAa,EACb,KAAoB;IAEpB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,KAAa;IAC5D,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
@@ -1 +1,15 @@
1
1
  export declare function resolveSkillDir(root: string, plugin: string, skill: string): string;
2
+ /**
3
+ * 0769 T-006: registry-aware skill directory resolver with explicit allowlist.
4
+ *
5
+ * - If the registry has an entry for (plugin, skill), validate its `dir`
6
+ * against `allowedRoots` (after path.resolve normalization, plus a
7
+ * realpath check to defeat symlink escapes) and return it.
8
+ * - Otherwise fall back to the root-based `resolveSkillDir()`.
9
+ *
10
+ * Allowlist matching is prefix-based: a candidate is accepted iff its
11
+ * resolved path starts with the resolved form of at least one allowed root.
12
+ * Inputs containing '..' or symlinks whose realpath escapes the allowlist
13
+ * are rejected with an informative error.
14
+ */
15
+ export declare function resolveAllowedSkillDir(root: string, plugin: string, skill: string, allowedRoots: string[]): string;
@@ -1,8 +1,14 @@
1
1
  // ---------------------------------------------------------------------------
2
2
  // skill-resolver.ts -- shared skill directory resolution
3
+ //
4
+ // 0769 T-006: adds resolveAllowedSkillDir() — a registry-aware variant that
5
+ // supports skills whose directory lives OUTSIDE the studio root (e.g. plugin-
6
+ // cache snapshots at ~/.claude/plugins/cache/...) while still preventing path
7
+ // traversal via an explicit allowlist of root prefixes.
3
8
  // ---------------------------------------------------------------------------
4
- import { existsSync } from "node:fs";
9
+ import { existsSync, realpathSync } from "node:fs";
5
10
  import { join, basename, resolve } from "node:path";
11
+ import { getSkillDirEntry } from "./skill-dir-registry.js";
6
12
  function assertContained(candidate, root) {
7
13
  const resolved = resolve(candidate);
8
14
  if (!resolved.startsWith(resolve(root))) {
@@ -35,4 +41,63 @@ export function resolveSkillDir(root, plugin, skill) {
35
41
  return flatPath;
36
42
  return directPath;
37
43
  }
44
+ /**
45
+ * 0769 T-006: registry-aware skill directory resolver with explicit allowlist.
46
+ *
47
+ * - If the registry has an entry for (plugin, skill), validate its `dir`
48
+ * against `allowedRoots` (after path.resolve normalization, plus a
49
+ * realpath check to defeat symlink escapes) and return it.
50
+ * - Otherwise fall back to the root-based `resolveSkillDir()`.
51
+ *
52
+ * Allowlist matching is prefix-based: a candidate is accepted iff its
53
+ * resolved path starts with the resolved form of at least one allowed root.
54
+ * Inputs containing '..' or symlinks whose realpath escapes the allowlist
55
+ * are rejected with an informative error.
56
+ */
57
+ export function resolveAllowedSkillDir(root, plugin, skill, allowedRoots) {
58
+ const entry = getSkillDirEntry(plugin, skill);
59
+ if (entry) {
60
+ return validateAgainstAllowlist(entry.dir, allowedRoots);
61
+ }
62
+ return resolveSkillDir(root, plugin, skill);
63
+ }
64
+ function validateAgainstAllowlist(candidate, allowedRoots) {
65
+ if (candidate.includes("..")) {
66
+ throw new Error(`Invalid skill path: directory traversal detected in "${candidate}"`);
67
+ }
68
+ const resolved = resolve(candidate);
69
+ // Normalize roots both logically (path.resolve) AND via realpath so symlink-
70
+ // backed temp dirs (e.g. macOS /tmp -> /private/tmp) match in both directions.
71
+ const logicalRoots = allowedRoots.map((r) => resolve(r));
72
+ const realRoots = logicalRoots.map((r) => safeRealpath(r));
73
+ const fitsLogically = logicalRoots.some((r) => resolved.startsWith(r)) ||
74
+ realRoots.some((r) => resolved.startsWith(r));
75
+ if (!fitsLogically) {
76
+ throw new Error(`Invalid skill path: "${resolved}" is outside allowlist`);
77
+ }
78
+ // Defeat symlink escape: the realpath must also remain inside the allowlist.
79
+ let real;
80
+ try {
81
+ real = realpathSync(resolved);
82
+ }
83
+ catch {
84
+ // The path may not exist yet (route handler will then return 404). Fall
85
+ // back to the logical-path check above when realpath fails.
86
+ return resolved;
87
+ }
88
+ const fitsReal = logicalRoots.some((r) => real.startsWith(r)) ||
89
+ realRoots.some((r) => real.startsWith(r));
90
+ if (!fitsReal) {
91
+ throw new Error(`Invalid skill path: realpath "${real}" is outside allowlist`);
92
+ }
93
+ return resolved;
94
+ }
95
+ function safeRealpath(p) {
96
+ try {
97
+ return realpathSync(p);
98
+ }
99
+ catch {
100
+ return p;
101
+ }
102
+ }
38
103
  //# sourceMappingURL=skill-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-resolver.js","sourceRoot":"","sources":["../../src/eval-server/skill-resolver.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,yDAAyD;AACzD,8EAA8E;AAE9E,OAA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E,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,wBAAwB,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -1 +1 @@
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
+ import{r as a,j as o,s as g}from"./index-BOR1gyX9.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-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(`
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-BOR1gyX9.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-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
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-usZJoJGb.js","assets/index-BOR1gyX9.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-BOR1gyX9.js";/* empty css */const f=t.lazy(()=>l(()=>import("./SearchPaletteCore-usZJoJGb.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 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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}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:`
1
+ import{r as i,j as t,i as xe}from"./index-BOR1gyX9.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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}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; }
@@ -1 +1 @@
1
- import{j as e,r as l,T as M}from"./index-CWWW1rkS.js";import{s as C}from"./skill-url-C4ekwoGs.js";/* empty css */const z={T0:{label:"BLOCKED",cssVar:"var(--trust-t0)"},T1:{label:"UNSCANNED",cssVar:"var(--trust-t1)"},T2:{label:"BASIC",cssVar:"var(--trust-t2)"},T3:{label:"VERIFIED",cssVar:"var(--trust-t3)"},T4:{label:"CERTIFIED",cssVar:"var(--trust-t4)"}};function P({tier:t}){const s=z[t]??z.T1;return e.jsxs("span",{"data-testid":"trust-badge","data-tier":t,style:{display:"inline-flex",alignItems:"center",gap:"0.3rem",padding:"0.15rem 0.5rem",borderRadius:"4px",fontFamily:"var(--font-geist-mono)",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.03em",textTransform:"uppercase",whiteSpace:"nowrap",color:s.cssVar,backgroundColor:`color-mix(in srgb, ${s.cssVar} 10%, transparent)`,border:`1px solid color-mix(in srgb, ${s.cssVar} 25%, transparent)`,lineHeight:1,height:"22px"},children:[t," ",s.label]})}const W=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function H(t){var g,x;const o=t.trim().match(W);if(!o)return null;const d=(g=o[1])==null?void 0:g.toLowerCase();let r=(x=o[2])==null?void 0:x.toLowerCase();if(!d||!r)return null;r=r.replace(/\.git$/,"");const m=`https://github.com/${d}/${r}`;return{owner:d,name:r,url:m}}function K({repoUrl:t,mono:s="var(--font-geist-mono)",fontSize:o="0.75rem",showPlaceholder:d=!0}){if(!t)return d?e.jsx("span",{style:{color:"var(--text-faint)",fontSize:o},children:"--"}):null;const r=H(t);return r?e.jsxs("a",{"data-testid":"repo-link",href:r.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:o,fontFamily:s},children:[r.owner,"/",r.name]}):e.jsx("span",{style:{color:"var(--text-faint)",fontSize:o,fontFamily:s},children:t})}const q="var(--font-geist-mono)",G={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},Z={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function X({skillName:t,repoUrl:s}){const[o,d]=l.useState(null),[r,m]=l.useState(!1);if(l.useEffect(()=>{s&&(m(!0),fetch(C(t,"repo-health")).then(h=>{if(!h.ok)throw new Error("fetch failed");return h.json()}).then(h=>{d(h.status),m(!1)}).catch(()=>{d(null),m(!1)}))},[t,s]),!s)return null;if(r)return e.jsx("span",{"data-testid":"repo-health-loading",style:{display:"inline-block",width:56,height:20,borderRadius:"4px",backgroundColor:"color-mix(in srgb, var(--text-faint) 20%, transparent)",animation:"pulse 1.5s ease-in-out infinite"}});if(!o||o==="UNKNOWN")return null;const g=G[o]??"var(--status-neutral-text)",x=Z[o]??"var(--status-neutral-bg)";return e.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:q,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",padding:"0.2rem 0.6rem",borderRadius:"999px",backgroundColor:x,color:g,whiteSpace:"nowrap"},children:o})}function Y({children:t,compact:s}){return e.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code)",color:"#E6EDF3",fontFamily:"var(--font-geist-mono)",fontSize:s?"0.8rem":"0.875rem",lineHeight:1.6,padding:s?"1rem 1.25rem":"1.5rem 2rem",borderRadius:"6px",overflowX:"auto",margin:0},children:t})}const J="/api/v1/studio/telemetry/install-copy",Q=/^[a-zA-Z0-9._@/-]+$/,ee=/^[a-zA-Z0-9._-]+$/,te="https://verified-skill.com";function re(t){return`${t.owner}/${t.repo}/${t.slug}`}function ne(t,s){return t!=null&&t.ownerSlug&&(t!=null&&t.repoSlug)?`${t.ownerSlug}/${t.repoSlug}`:t!=null&&t.publisher?t.publisher:`${s.owner}/${s.repo}`}function se(t,s,o){const d=o?`${t}/${s}@${o}`:`${t}/${s}`;return Q.test(`${t}/${s}`)?o&&!ee.test(o)?{ok:!1,reason:"Invalid version identifier"}:{ok:!0,command:`vskill install ${d}`}:{ok:!1,reason:"Invalid skill identifier"}}function oe(t,s,o){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:t,kind:s,durationMs:o,severity:s==="error"?"error":"info"}}))}async function ie(t){var s;if(typeof navigator<"u"&&((s=navigator.clipboard)!=null&&s.writeText))try{return await navigator.clipboard.writeText(t),!0}catch{}if(typeof document>"u")return!1;try{const o=document.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.position="fixed",o.style.left="-9999px",document.body.appendChild(o),o.select();const d=document.execCommand("copy");return document.body.removeChild(o),d}catch{return!1}}function ae(t,s){try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}catch{}}function ue({selectedSkill:t,onClose:s,telemetryInstallCopyUrl:o=J,onToast:d}){const[r,m]=l.useState(null),[g,x]=l.useState([]),[h,E]=l.useState(!0),[T,$]=l.useState(null),[u,I]=l.useState(null),[D,B]=l.useState(0),F=l.useRef(null),A=l.useRef(null),L=l.useRef(null),y=re(t);l.useEffect(()=>(L.current=document.activeElement??null,()=>{const n=L.current;if(n&&typeof n.focus=="function")try{n.focus()}catch{}}),[]),l.useEffect(()=>{const n=setTimeout(()=>{var i;return(i=A.current)==null?void 0:i.focus()},50);return()=>clearTimeout(n)},[]),l.useEffect(()=>{let n=!1;E(!0),$(null);const i=C(y),p=C(y,"versions");return Promise.all([fetch(i).then(async a=>{if(!a.ok)throw new Error(`metadata ${a.status}`);return a.json()}),fetch(p).then(async a=>{if(!a.ok)throw new Error(`versions ${a.status}`);const c=await a.json();return Array.isArray(c)?c:(c==null?void 0:c.versions)??[]})]).then(([a,c])=>{if(n)return;m(a),x(c);const k=c.find(w=>w.isLatest)??c[0]??null;I(k?k.version:null),E(!1)}).catch(a=>{n||($(a instanceof Error?a.message:String(a)),E(!1))}),()=>{n=!0}},[y,D]),l.useEffect(()=>{function n(i){if(i.key==="Escape")i.stopPropagation(),R();else if(i.key==="Tab"){const p=F.current;if(!p)return;const a=p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(a.length===0)return;const c=a[0],k=a[a.length-1],w=document.activeElement;i.shiftKey&&w===c?(i.preventDefault(),k.focus()):!i.shiftKey&&w===k&&(i.preventDefault(),c.focus())}}return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[]);const R=l.useCallback(()=>{s();let n="";try{typeof window<"u"&&window.sessionStorage&&(n=window.sessionStorage.getItem("find-skills:last-query")??"")}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openFindSkills",{detail:{query:n}}))},[s]),S=ne(r,t),b=(r==null?void 0:r.skillSlug)??t.slug,N=(r==null?void 0:r.displayName)??t.displayName??b,_=(r==null?void 0:r.isBlocked)===!0,v=l.useMemo(()=>g.length===0?[]:[...g].sort((i,p)=>{const a=i.publishedAt?Date.parse(i.publishedAt):0;return(p.publishedAt?Date.parse(p.publishedAt):0)-a}).slice(0,5),[g]),j=l.useMemo(()=>!u||v.length===0?!0:v[0].version===u,[u,v]),f=l.useMemo(()=>u?se(S,b,j?null:u):null,[S,b,u,j]),V=l.useCallback(async()=>{if(!f||!f.ok)return;const n=await ie(f.command);ae(o,{skillName:y,version:u??"",q:"",ts:Date.now()});const i=n?`Run vskill install ${S}/${b}${j?"":`@${u}`} in your terminal`:"Copy failed — please copy the command manually.";if(d)try{d(i,n?"success":"error")}catch{}else oe(i,n?"success":"error",3500)},[f,o,y,u,S,b,j,d]),O=(r==null?void 0:r.trustTier)??"T1",U=(r==null?void 0:r.certTier)==="CERTIFIED"||(r==null?void 0:r.certTier)==="VERIFIED"?r.certTier:"VERIFIED";return e.jsxs("div",{ref:F,"data-testid":"skill-detail-panel",role:"dialog","aria-modal":"true","aria-label":`Skill detail — ${N}`,style:{position:"fixed",inset:0,zIndex:9998,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(10vh, 80px)"},onClick:n=>{n.target===n.currentTarget&&R()},children:[e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"}}),e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"relative",width:"100%",maxWidth:720,margin:"0 1rem",background:"var(--bg)",borderRadius:"8px",border:"1px solid var(--border)",boxShadow:"0 20px 60px rgba(0,0,0,0.15)",overflow:"hidden",maxHeight:"80vh",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[e.jsx("button",{ref:A,type:"button",onClick:R,"data-testid":"skill-detail-back",style:{background:"transparent",border:"none",padding:"4px 8px",borderRadius:4,cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary)"},children:"← Back to results"}),e.jsx("kbd",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11,color:"var(--text-faint)",border:"1px solid var(--border)",borderRadius:4,padding:"1px 5px"},children:"Esc"})]}),e.jsxs("div",{style:{overflowY:"auto",padding:"1rem",flex:1},children:[h&&e.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-faint)"},children:"Loading…"}),T&&!h&&e.jsxs("div",{"data-testid":"skill-detail-error",style:{padding:"1.5rem",textAlign:"center",fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",color:"var(--status-danger-text)"},children:[e.jsxs("div",{style:{marginBottom:"0.75rem"},children:["Failed to load skill: ",T]}),e.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>B(n=>n+1),style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",padding:"0.4rem 1rem",borderRadius:4,border:"1px solid var(--border)",background:"transparent",color:"var(--text)",cursor:"pointer"},children:"Retry"})]}),!h&&!T&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{"data-testid":"skill-detail-hero",style:{marginBottom:"1.25rem"},children:[e.jsx("h2",{style:{margin:"0 0 0.5rem",fontSize:"1.25rem",fontWeight:600},children:N}),(r==null?void 0:r.description)&&e.jsx("p",{style:{margin:"0 0 0.75rem",color:"var(--text-secondary)",fontSize:"0.875rem",lineHeight:1.5},children:r.description}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[e.jsx(P,{tier:O}),e.jsx(M,{tier:U,isTainted:r==null?void 0:r.isTainted}),e.jsx(K,{repoUrl:(r==null?void 0:r.repoUrl)??null}),e.jsx(X,{skillName:y,repoUrl:r==null?void 0:r.repoUrl})]})]}),e.jsxs("section",{"data-testid":"skill-detail-versions",style:{marginBottom:"1.25rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-faint)"},children:"Versions"}),v.length===0?e.jsx("div",{style:{color:"var(--text-faint)",fontSize:"0.8125rem"},children:"No versions found."}):e.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:v.map(n=>{const i=n.version===u,p=n.publishedAt?n.publishedAt.slice(0,10):"",a=n.authorEmail??n.author??"";return e.jsx("li",{children:e.jsxs("button",{type:"button","data-testid":"skill-detail-version-row","data-version":n.version,"data-selected":i?"true":"false","aria-pressed":i,onClick:()=>I(n.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:i?"1px solid var(--link-accent, #0d9488)":"1px solid var(--border)",background:i?"color-mix(in srgb, var(--link-accent, #0d9488) 8%, transparent)":"transparent",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",color:"var(--text)",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("span",{"aria-hidden":"true",style:{width:14,display:"inline-flex",justifyContent:"center"},children:i?"●":"○"}),e.jsxs("span",{style:{fontWeight:600},children:["v",n.version]}),p&&e.jsxs("span",{style:{color:"var(--text-faint)"},children:["· ",p]}),a&&e.jsxs("span",{style:{color:"var(--text-faint)"},children:["· ",a]}),i&&e.jsx("span",{"data-testid":"skill-detail-version-selected-tag",style:{marginLeft:"auto",fontSize:"0.6875rem",color:"var(--link-accent, #0d9488)"},children:"Selected"})]})},n.version)})}),e.jsx("div",{style:{marginTop:"0.5rem",textAlign:"right"},children:e.jsx("a",{"data-testid":"skill-detail-see-all-versions",href:`${te}/skills/${t.owner}/${t.repo}/${t.slug}/versions`,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--link-accent, #0d9488)",textDecoration:"none"},children:"see all versions →"})})]}),_?e.jsxs("section",{"data-testid":"skill-detail-blocked",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--status-danger-text)"},children:"This skill is blocked"}),e.jsx("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--status-danger-border)",background:"var(--status-danger-bg)",color:"var(--status-danger-text)",fontSize:"0.875rem"},children:(r==null?void 0:r.blockReason)??"This skill has been blocked by platform moderators and cannot be installed."})]}):f&&!f.ok?e.jsxs("section",{"data-testid":"skill-detail-install-error",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--status-danger-text)"},children:"Install command unavailable"}),e.jsxs("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--status-danger-border)",background:"var(--status-danger-bg)",color:"var(--status-danger-text)",fontSize:"0.875rem"},children:[f.reason," — refusing to render the install panel for safety."]})]}):f&&f.ok?e.jsxs("section",{"data-testid":"skill-detail-install",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-faint)"},children:"Install"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Y,{compact:!0,children:e.jsx("span",{"data-testid":"skill-detail-install-command",children:f.command})})}),e.jsx("button",{type:"button",onClick:V,"data-testid":"skill-detail-copy","aria-label":"Copy install command",style:{flexShrink:0,padding:"0 1rem",borderRadius:6,border:"1px solid var(--border)",background:"var(--bg)",color:"var(--text)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem"},children:"Copy"})]})]}):null]})]})]})]})}export{ue as SkillDetailPanel,ue as default};
1
+ import{j as e,r as l,T as M}from"./index-BOR1gyX9.js";import{s as C}from"./skill-url-C4ekwoGs.js";/* empty css */const z={T0:{label:"BLOCKED",cssVar:"var(--trust-t0)"},T1:{label:"UNSCANNED",cssVar:"var(--trust-t1)"},T2:{label:"BASIC",cssVar:"var(--trust-t2)"},T3:{label:"VERIFIED",cssVar:"var(--trust-t3)"},T4:{label:"CERTIFIED",cssVar:"var(--trust-t4)"}};function P({tier:t}){const s=z[t]??z.T1;return e.jsxs("span",{"data-testid":"trust-badge","data-tier":t,style:{display:"inline-flex",alignItems:"center",gap:"0.3rem",padding:"0.15rem 0.5rem",borderRadius:"4px",fontFamily:"var(--font-geist-mono)",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.03em",textTransform:"uppercase",whiteSpace:"nowrap",color:s.cssVar,backgroundColor:`color-mix(in srgb, ${s.cssVar} 10%, transparent)`,border:`1px solid color-mix(in srgb, ${s.cssVar} 25%, transparent)`,lineHeight:1,height:"22px"},children:[t," ",s.label]})}const W=/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(\/.*)?$/;function H(t){var g,x;const o=t.trim().match(W);if(!o)return null;const d=(g=o[1])==null?void 0:g.toLowerCase();let r=(x=o[2])==null?void 0:x.toLowerCase();if(!d||!r)return null;r=r.replace(/\.git$/,"");const m=`https://github.com/${d}/${r}`;return{owner:d,name:r,url:m}}function K({repoUrl:t,mono:s="var(--font-geist-mono)",fontSize:o="0.75rem",showPlaceholder:d=!0}){if(!t)return d?e.jsx("span",{style:{color:"var(--text-faint)",fontSize:o},children:"--"}):null;const r=H(t);return r?e.jsxs("a",{"data-testid":"repo-link",href:r.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{color:"#0D9488",textDecoration:"none",fontSize:o,fontFamily:s},children:[r.owner,"/",r.name]}):e.jsx("span",{style:{color:"var(--text-faint)",fontSize:o,fontFamily:s},children:t})}const q="var(--font-geist-mono)",G={ONLINE:"var(--status-success-text)",OFFLINE:"var(--status-danger-text)",STALE:"var(--status-neutral-text)"},Z={ONLINE:"var(--status-success-bg)",OFFLINE:"var(--status-danger-bg)",STALE:"var(--status-neutral-bg)"};function X({skillName:t,repoUrl:s}){const[o,d]=l.useState(null),[r,m]=l.useState(!1);if(l.useEffect(()=>{s&&(m(!0),fetch(C(t,"repo-health")).then(h=>{if(!h.ok)throw new Error("fetch failed");return h.json()}).then(h=>{d(h.status),m(!1)}).catch(()=>{d(null),m(!1)}))},[t,s]),!s)return null;if(r)return e.jsx("span",{"data-testid":"repo-health-loading",style:{display:"inline-block",width:56,height:20,borderRadius:"4px",backgroundColor:"color-mix(in srgb, var(--text-faint) 20%, transparent)",animation:"pulse 1.5s ease-in-out infinite"}});if(!o||o==="UNKNOWN")return null;const g=G[o]??"var(--status-neutral-text)",x=Z[o]??"var(--status-neutral-bg)";return e.jsx("span",{"data-testid":"repo-health-badge",style:{fontFamily:q,fontSize:"0.75rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",padding:"0.2rem 0.6rem",borderRadius:"999px",backgroundColor:x,color:g,whiteSpace:"nowrap"},children:o})}function Y({children:t,compact:s}){return e.jsx("pre",{"data-testid":"terminal-block",style:{background:"var(--bg-code)",color:"#E6EDF3",fontFamily:"var(--font-geist-mono)",fontSize:s?"0.8rem":"0.875rem",lineHeight:1.6,padding:s?"1rem 1.25rem":"1.5rem 2rem",borderRadius:"6px",overflowX:"auto",margin:0},children:t})}const J="/api/v1/studio/telemetry/install-copy",Q=/^[a-zA-Z0-9._@/-]+$/,ee=/^[a-zA-Z0-9._-]+$/,te="https://verified-skill.com";function re(t){return`${t.owner}/${t.repo}/${t.slug}`}function ne(t,s){return t!=null&&t.ownerSlug&&(t!=null&&t.repoSlug)?`${t.ownerSlug}/${t.repoSlug}`:t!=null&&t.publisher?t.publisher:`${s.owner}/${s.repo}`}function se(t,s,o){const d=o?`${t}/${s}@${o}`:`${t}/${s}`;return Q.test(`${t}/${s}`)?o&&!ee.test(o)?{ok:!1,reason:"Invalid version identifier"}:{ok:!0,command:`vskill install ${d}`}:{ok:!1,reason:"Invalid skill identifier"}}function oe(t,s,o){typeof window>"u"||window.dispatchEvent(new CustomEvent("studio:toast",{detail:{message:t,kind:s,durationMs:o,severity:s==="error"?"error":"info"}}))}async function ie(t){var s;if(typeof navigator<"u"&&((s=navigator.clipboard)!=null&&s.writeText))try{return await navigator.clipboard.writeText(t),!0}catch{}if(typeof document>"u")return!1;try{const o=document.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.position="fixed",o.style.left="-9999px",document.body.appendChild(o),o.select();const d=document.execCommand("copy");return document.body.removeChild(o),d}catch{return!1}}function ae(t,s){try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}catch{}}function ue({selectedSkill:t,onClose:s,telemetryInstallCopyUrl:o=J,onToast:d}){const[r,m]=l.useState(null),[g,x]=l.useState([]),[h,E]=l.useState(!0),[T,$]=l.useState(null),[u,I]=l.useState(null),[D,B]=l.useState(0),F=l.useRef(null),A=l.useRef(null),L=l.useRef(null),y=re(t);l.useEffect(()=>(L.current=document.activeElement??null,()=>{const n=L.current;if(n&&typeof n.focus=="function")try{n.focus()}catch{}}),[]),l.useEffect(()=>{const n=setTimeout(()=>{var i;return(i=A.current)==null?void 0:i.focus()},50);return()=>clearTimeout(n)},[]),l.useEffect(()=>{let n=!1;E(!0),$(null);const i=C(y),p=C(y,"versions");return Promise.all([fetch(i).then(async a=>{if(!a.ok)throw new Error(`metadata ${a.status}`);return a.json()}),fetch(p).then(async a=>{if(!a.ok)throw new Error(`versions ${a.status}`);const c=await a.json();return Array.isArray(c)?c:(c==null?void 0:c.versions)??[]})]).then(([a,c])=>{if(n)return;m(a),x(c);const k=c.find(w=>w.isLatest)??c[0]??null;I(k?k.version:null),E(!1)}).catch(a=>{n||($(a instanceof Error?a.message:String(a)),E(!1))}),()=>{n=!0}},[y,D]),l.useEffect(()=>{function n(i){if(i.key==="Escape")i.stopPropagation(),R();else if(i.key==="Tab"){const p=F.current;if(!p)return;const a=p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(a.length===0)return;const c=a[0],k=a[a.length-1],w=document.activeElement;i.shiftKey&&w===c?(i.preventDefault(),k.focus()):!i.shiftKey&&w===k&&(i.preventDefault(),c.focus())}}return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[]);const R=l.useCallback(()=>{s();let n="";try{typeof window<"u"&&window.sessionStorage&&(n=window.sessionStorage.getItem("find-skills:last-query")??"")}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent("openFindSkills",{detail:{query:n}}))},[s]),S=ne(r,t),b=(r==null?void 0:r.skillSlug)??t.slug,N=(r==null?void 0:r.displayName)??t.displayName??b,_=(r==null?void 0:r.isBlocked)===!0,v=l.useMemo(()=>g.length===0?[]:[...g].sort((i,p)=>{const a=i.publishedAt?Date.parse(i.publishedAt):0;return(p.publishedAt?Date.parse(p.publishedAt):0)-a}).slice(0,5),[g]),j=l.useMemo(()=>!u||v.length===0?!0:v[0].version===u,[u,v]),f=l.useMemo(()=>u?se(S,b,j?null:u):null,[S,b,u,j]),V=l.useCallback(async()=>{if(!f||!f.ok)return;const n=await ie(f.command);ae(o,{skillName:y,version:u??"",q:"",ts:Date.now()});const i=n?`Run vskill install ${S}/${b}${j?"":`@${u}`} in your terminal`:"Copy failed — please copy the command manually.";if(d)try{d(i,n?"success":"error")}catch{}else oe(i,n?"success":"error",3500)},[f,o,y,u,S,b,j,d]),O=(r==null?void 0:r.trustTier)??"T1",U=(r==null?void 0:r.certTier)==="CERTIFIED"||(r==null?void 0:r.certTier)==="VERIFIED"?r.certTier:"VERIFIED";return e.jsxs("div",{ref:F,"data-testid":"skill-detail-panel",role:"dialog","aria-modal":"true","aria-label":`Skill detail — ${N}`,style:{position:"fixed",inset:0,zIndex:9998,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(10vh, 80px)"},onClick:n=>{n.target===n.currentTarget&&R()},children:[e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"}}),e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"relative",width:"100%",maxWidth:720,margin:"0 1rem",background:"var(--bg)",borderRadius:"8px",border:"1px solid var(--border)",boxShadow:"0 20px 60px rgba(0,0,0,0.15)",overflow:"hidden",maxHeight:"80vh",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[e.jsx("button",{ref:A,type:"button",onClick:R,"data-testid":"skill-detail-back",style:{background:"transparent",border:"none",padding:"4px 8px",borderRadius:4,cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary)"},children:"← Back to results"}),e.jsx("kbd",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11,color:"var(--text-faint)",border:"1px solid var(--border)",borderRadius:4,padding:"1px 5px"},children:"Esc"})]}),e.jsxs("div",{style:{overflowY:"auto",padding:"1rem",flex:1},children:[h&&e.jsx("div",{"data-testid":"skill-detail-loading",style:{padding:"2rem",textAlign:"center",color:"var(--text-faint)"},children:"Loading…"}),T&&!h&&e.jsxs("div",{"data-testid":"skill-detail-error",style:{padding:"1.5rem",textAlign:"center",fontFamily:"var(--font-mono, monospace)",fontSize:"0.875rem",color:"var(--status-danger-text)"},children:[e.jsxs("div",{style:{marginBottom:"0.75rem"},children:["Failed to load skill: ",T]}),e.jsx("button",{"data-testid":"skill-detail-retry",onClick:()=>B(n=>n+1),style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",padding:"0.4rem 1rem",borderRadius:4,border:"1px solid var(--border)",background:"transparent",color:"var(--text)",cursor:"pointer"},children:"Retry"})]}),!h&&!T&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{"data-testid":"skill-detail-hero",style:{marginBottom:"1.25rem"},children:[e.jsx("h2",{style:{margin:"0 0 0.5rem",fontSize:"1.25rem",fontWeight:600},children:N}),(r==null?void 0:r.description)&&e.jsx("p",{style:{margin:"0 0 0.75rem",color:"var(--text-secondary)",fontSize:"0.875rem",lineHeight:1.5},children:r.description}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[e.jsx(P,{tier:O}),e.jsx(M,{tier:U,isTainted:r==null?void 0:r.isTainted}),e.jsx(K,{repoUrl:(r==null?void 0:r.repoUrl)??null}),e.jsx(X,{skillName:y,repoUrl:r==null?void 0:r.repoUrl})]})]}),e.jsxs("section",{"data-testid":"skill-detail-versions",style:{marginBottom:"1.25rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-faint)"},children:"Versions"}),v.length===0?e.jsx("div",{style:{color:"var(--text-faint)",fontSize:"0.8125rem"},children:"No versions found."}):e.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:v.map(n=>{const i=n.version===u,p=n.publishedAt?n.publishedAt.slice(0,10):"",a=n.authorEmail??n.author??"";return e.jsx("li",{children:e.jsxs("button",{type:"button","data-testid":"skill-detail-version-row","data-version":n.version,"data-selected":i?"true":"false","aria-pressed":i,onClick:()=>I(n.version),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",borderRadius:4,border:i?"1px solid var(--link-accent, #0d9488)":"1px solid var(--border)",background:i?"color-mix(in srgb, var(--link-accent, #0d9488) 8%, transparent)":"transparent",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem",color:"var(--text)",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("span",{"aria-hidden":"true",style:{width:14,display:"inline-flex",justifyContent:"center"},children:i?"●":"○"}),e.jsxs("span",{style:{fontWeight:600},children:["v",n.version]}),p&&e.jsxs("span",{style:{color:"var(--text-faint)"},children:["· ",p]}),a&&e.jsxs("span",{style:{color:"var(--text-faint)"},children:["· ",a]}),i&&e.jsx("span",{"data-testid":"skill-detail-version-selected-tag",style:{marginLeft:"auto",fontSize:"0.6875rem",color:"var(--link-accent, #0d9488)"},children:"Selected"})]})},n.version)})}),e.jsx("div",{style:{marginTop:"0.5rem",textAlign:"right"},children:e.jsx("a",{"data-testid":"skill-detail-see-all-versions",href:`${te}/skills/${t.owner}/${t.repo}/${t.slug}/versions`,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--font-mono, monospace)",fontSize:"0.75rem",color:"var(--link-accent, #0d9488)",textDecoration:"none"},children:"see all versions →"})})]}),_?e.jsxs("section",{"data-testid":"skill-detail-blocked",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--status-danger-text)"},children:"This skill is blocked"}),e.jsx("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--status-danger-border)",background:"var(--status-danger-bg)",color:"var(--status-danger-text)",fontSize:"0.875rem"},children:(r==null?void 0:r.blockReason)??"This skill has been blocked by platform moderators and cannot be installed."})]}):f&&!f.ok?e.jsxs("section",{"data-testid":"skill-detail-install-error",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--status-danger-text)"},children:"Install command unavailable"}),e.jsxs("div",{style:{padding:"1rem",borderRadius:6,border:"1px solid var(--status-danger-border)",background:"var(--status-danger-bg)",color:"var(--status-danger-text)",fontSize:"0.875rem"},children:[f.reason," — refusing to render the install panel for safety."]})]}):f&&f.ok?e.jsxs("section",{"data-testid":"skill-detail-install",style:{marginBottom:"0.5rem"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem",fontSize:"0.8125rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-faint)"},children:"Install"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Y,{compact:!0,children:e.jsx("span",{"data-testid":"skill-detail-install-command",children:f.command})})}),e.jsx("button",{type:"button",onClick:V,"data-testid":"skill-detail-copy","aria-label":"Copy install command",style:{flexShrink:0,padding:"0 1rem",borderRadius:6,border:"1px solid var(--border)",background:"var(--bg)",color:"var(--text)",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"0.8125rem"},children:"Copy"})]})]}):null]})]})]})]})}export{ue as SkillDetailPanel,ue as default};
@@ -1 +1 @@
1
- import{r as v,e as N,f as E,j as a,h as L}from"./index-CWWW1rkS.js";/* empty css */function M(l,d){const[c,u]=l.split("."),[w,f]=d.split("."),r=Number(c),m=Number(u),p=Number(w),y=Number(f);return!Number.isFinite(r)||!Number.isFinite(p)?(console.warn(`[semverBump] unparseable version: installed=${l} latest=${d}`),"patch"):p>r?"major":!Number.isFinite(m)||!Number.isFinite(y)?(console.warn(`[semverBump] unparseable minor: installed=${l} latest=${d}`),"patch"):y>m?"minor":"patch"}const F={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}},z=["project","personal","plugin"];function D(l,d={}){if(l.length===0)return"No tracked install — click to view details";const c=l.filter(n=>!n.readonly),u=l.filter(n=>n.readonly);if(c.length===0)return"Plugin-bundled — Update via plugin to refresh";const f=z.filter(n=>c.some(x=>x.scope===n)).join(" + "),m=Array.from(new Set(c.map(n=>n.agentLabel))).sort((n,x)=>n.localeCompare(x)).join(", "),p=c.length;let i=`Updates ${p} ${p===1?"location":"locations"}: ${f} (${m})`;if(d.pinned)return i+=" — pinned (skipped)",i;if(u.length>0){const n=Array.from(new Set(u.map(x=>x.pluginSlug??"?")));n.length===1&&n[0]!=="?"?i+=` — ${u.length} from plugin ${n[0]} (handled separately)`:i+=` — ${u.length} plugin-bundled (handled separately)`}return i}function O({updates:l,isRefreshing:d,onRefresh:c,onSelectSkill:u,onViewAll:w,onClose:f,anchorRef:r,diffSummariesById:m}){const p=v.useRef(null),y=v.useRef(null);v.useEffect(()=>{var e;(e=y.current)==null||e.focus()},[]),v.useEffect(()=>{function e(s){p.current&&(p.current.contains(s.target)||r!=null&&r.current&&r.current.contains(s.target)||f())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f,r]),v.useEffect(()=>{function e(s){var g;s.key==="Escape"&&(s.preventDefault(),f(),(g=r==null?void 0:r.current)==null||g.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f,r]);const i=l.filter(e=>e.updateAvailable),{toast:n}=N(),{onSkillUpdated:x}=E(),[j,k]=v.useState(()=>new Set);async function $(e){const s=e.installLocations??[],g=s.filter(t=>!t.readonly);if(s.length>0&&g.length===0){const t=s[0].pluginSlug??"the plugin";n({severity:"info",message:`This skill came from plugin ${t}. Update the plugin to refresh it.`});return}if(!j.has(e.name)){k(t=>{const o=new Set(t);return o.add(e.name),o});try{const t=e.name.split("/"),o=e.localPlugin??(t.length>=2?t[t.length-2]:t[0]),b=e.localSkill??t[t.length-1],h=await L.postSkillUpdate(o,b);if(h.ok){const S=g.length||1,U=S===1?"location":"locations";x(o,b),n({severity:"success",message:`Updated ${b} in ${S} ${U}.`,durationMs:4e3})}else n({severity:"error",message:`Couldn't update ${b} — HTTP ${h.status}`,durationMs:0})}catch(t){const o=t instanceof Error?t.message:"Network error";n({severity:"error",message:`Update failed: ${o}`,durationMs:0})}finally{k(t=>{const o=new Set(t);return o.delete(e.name),o})}}}return a.jsxs("div",{ref:p,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:320,maxHeight:400,overflow:"auto",background:"var(--bg-surface)",border:"1px solid var(--border-default)",borderRadius:8,padding:10,zIndex:1e3,fontFamily:"var(--font-sans)",display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[a.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:i.length===0?"No updates available":`${i.length} updates available`}),a.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:c,disabled:d,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:d?"not-allowed":"pointer",padding:"2px 6px"},children:d?"Refreshing…":"Refresh"})]}),i.length>0?a.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:i.map((e,s)=>{const g=e.latest?M(e.installed,e.latest):"patch",t=F[g],o=m==null?void 0:m.get(e.name),b=D(e.installLocations??[],{pinned:e.pinned??!1}),h=j.has(e.name);return a.jsxs("li",{style:{margin:0,display:"flex",alignItems:"stretch",gap:4},children:[a.jsxs("button",{ref:s===0?y:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>u(e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:"6px 8px",background:"transparent",border:"none",borderRadius:4,cursor:"pointer",color:"var(--text-primary)",fontFamily:"inherit",fontSize:12,textAlign:"left"},children:[a.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":g,style:{width:8,height:8,borderRadius:"50%",background:t.text,flexShrink:0,marginTop:4}}),a.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[a.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),a.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),o&&a.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]})]}),a.jsx("button",{type:"button","data-testid":"update-dropdown-row-update","data-skill-name":e.name,title:b,onClick:()=>{$(e)},disabled:h,style:{flexShrink:0,padding:"0 10px",background:"var(--color-ink)",color:"var(--color-paper)",border:"none",borderRadius:4,cursor:h?"not-allowed":"pointer",fontFamily:"var(--font-sans)",fontSize:11,fontWeight:500},children:h?"Updating…":"Update"})]},e.name)})}):a.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),a.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:a.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:w,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{O as default};
1
+ import{r as v,e as N,f as E,j as a,h as L}from"./index-BOR1gyX9.js";/* empty css */function M(l,d){const[c,u]=l.split("."),[w,f]=d.split("."),r=Number(c),m=Number(u),p=Number(w),y=Number(f);return!Number.isFinite(r)||!Number.isFinite(p)?(console.warn(`[semverBump] unparseable version: installed=${l} latest=${d}`),"patch"):p>r?"major":!Number.isFinite(m)||!Number.isFinite(y)?(console.warn(`[semverBump] unparseable minor: installed=${l} latest=${d}`),"patch"):y>m?"minor":"patch"}const F={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}},z=["project","personal","plugin"];function D(l,d={}){if(l.length===0)return"No tracked install — click to view details";const c=l.filter(n=>!n.readonly),u=l.filter(n=>n.readonly);if(c.length===0)return"Plugin-bundled — Update via plugin to refresh";const f=z.filter(n=>c.some(x=>x.scope===n)).join(" + "),m=Array.from(new Set(c.map(n=>n.agentLabel))).sort((n,x)=>n.localeCompare(x)).join(", "),p=c.length;let i=`Updates ${p} ${p===1?"location":"locations"}: ${f} (${m})`;if(d.pinned)return i+=" — pinned (skipped)",i;if(u.length>0){const n=Array.from(new Set(u.map(x=>x.pluginSlug??"?")));n.length===1&&n[0]!=="?"?i+=` — ${u.length} from plugin ${n[0]} (handled separately)`:i+=` — ${u.length} plugin-bundled (handled separately)`}return i}function O({updates:l,isRefreshing:d,onRefresh:c,onSelectSkill:u,onViewAll:w,onClose:f,anchorRef:r,diffSummariesById:m}){const p=v.useRef(null),y=v.useRef(null);v.useEffect(()=>{var e;(e=y.current)==null||e.focus()},[]),v.useEffect(()=>{function e(s){p.current&&(p.current.contains(s.target)||r!=null&&r.current&&r.current.contains(s.target)||f())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f,r]),v.useEffect(()=>{function e(s){var g;s.key==="Escape"&&(s.preventDefault(),f(),(g=r==null?void 0:r.current)==null||g.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f,r]);const i=l.filter(e=>e.updateAvailable),{toast:n}=N(),{onSkillUpdated:x}=E(),[j,k]=v.useState(()=>new Set);async function $(e){const s=e.installLocations??[],g=s.filter(t=>!t.readonly);if(s.length>0&&g.length===0){const t=s[0].pluginSlug??"the plugin";n({severity:"info",message:`This skill came from plugin ${t}. Update the plugin to refresh it.`});return}if(!j.has(e.name)){k(t=>{const o=new Set(t);return o.add(e.name),o});try{const t=e.name.split("/"),o=e.localPlugin??(t.length>=2?t[t.length-2]:t[0]),b=e.localSkill??t[t.length-1],h=await L.postSkillUpdate(o,b);if(h.ok){const S=g.length||1,U=S===1?"location":"locations";x(o,b),n({severity:"success",message:`Updated ${b} in ${S} ${U}.`,durationMs:4e3})}else n({severity:"error",message:`Couldn't update ${b} — HTTP ${h.status}`,durationMs:0})}catch(t){const o=t instanceof Error?t.message:"Network error";n({severity:"error",message:`Update failed: ${o}`,durationMs:0})}finally{k(t=>{const o=new Set(t);return o.delete(e.name),o})}}}return a.jsxs("div",{ref:p,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:320,maxHeight:400,overflow:"auto",background:"var(--bg-surface)",border:"1px solid var(--border-default)",borderRadius:8,padding:10,zIndex:1e3,fontFamily:"var(--font-sans)",display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[a.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:i.length===0?"No updates available":`${i.length} updates available`}),a.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:c,disabled:d,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:d?"not-allowed":"pointer",padding:"2px 6px"},children:d?"Refreshing…":"Refresh"})]}),i.length>0?a.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:i.map((e,s)=>{const g=e.latest?M(e.installed,e.latest):"patch",t=F[g],o=m==null?void 0:m.get(e.name),b=D(e.installLocations??[],{pinned:e.pinned??!1}),h=j.has(e.name);return a.jsxs("li",{style:{margin:0,display:"flex",alignItems:"stretch",gap:4},children:[a.jsxs("button",{ref:s===0?y:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>u(e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:"6px 8px",background:"transparent",border:"none",borderRadius:4,cursor:"pointer",color:"var(--text-primary)",fontFamily:"inherit",fontSize:12,textAlign:"left"},children:[a.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":g,style:{width:8,height:8,borderRadius:"50%",background:t.text,flexShrink:0,marginTop:4}}),a.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[a.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),a.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),o&&a.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]})]}),a.jsx("button",{type:"button","data-testid":"update-dropdown-row-update","data-skill-name":e.name,title:b,onClick:()=>{$(e)},disabled:h,style:{flexShrink:0,padding:"0 10px",background:"var(--color-ink)",color:"var(--color-paper)",border:"none",borderRadius:4,cursor:h?"not-allowed":"pointer",fontFamily:"var(--font-sans)",fontSize:11,fontWeight:500},children:h?"Updating…":"Update"})]},e.name)})}):a.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),a.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:a.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:w,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{O as default};