skillex 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.1] - 2026-05-02
11
+
12
+ A developer-experience patch on top of 0.4.0. Same runtime behaviour for end
13
+ users; one-command Web UI dev workflow for contributors.
14
+
15
+ ### Added
16
+ - **`npm run dev`** — one-command dev orchestrator (`scripts/dev.mjs`). Spawns the Skillex backend with `--no-open --port 4174`, parses the token from the first `Skillex Web UI running at <url>` line, spawns the Vite dev server on port 4175 with `VITE_SKILLEX_BACKEND` pre-wired, and opens the browser at `http://127.0.0.1:4175?token=<token>` automatically. Ctrl+C cleanly tears both processes down.
17
+ - New convenience npm scripts:
18
+ - `npm run dev` — full dev loop (above)
19
+ - `npm run web` — alias for `npm run build && node ./bin/skillex.js ui`
20
+ - `npm run tui` — open the interactive terminal browser
21
+ - `npm run skillex -- <args>` — run any CLI command without typing `node ./bin/skillex.js`
22
+ - `skillex ui` gains `--host`, `--port`, and `--no-open` flags so the dev orchestrator (and any other automation) can run the backend on a known port without auto-opening the browser.
23
+ - Env vars to override the dev orchestrator: `SKILLEX_DEV_BACKEND_PORT`, `SKILLEX_DEV_VITE_PORT`, `SKILLEX_DEV_NO_OPEN=1`.
24
+
25
+ ### Fixed
26
+ - **Web UI dev mode (`npm run dev:ui`)** no longer throws `Missing Skillex Web UI bootstrap payload` and a blank page. When no bootstrap is injected (Vite serves `index.html` directly without the backend's substitution), an in-page overlay now explains exactly how to wire the dev server to a running `skillex ui` backend.
27
+ - The dev page can also recover the bootstrap from a query string (e.g. `http://127.0.0.1:4174?token=<token>&scope=local`); the token is cached in `localStorage` so subsequent reloads work.
28
+
29
+ ### Changed
30
+ - `vite.config.ts` reads a new `VITE_SKILLEX_BACKEND` env var. When set, the Vite dev server proxies `/api/*` to that backend so the UI talks to a real `skillex ui` instance with HMR enabled. The new `npm run dev` script sets this automatically.
31
+ - README "Local Web UI development" rewritten: `npm run dev` is now the primary workflow; production-style (`npm run web`) is documented as a single one-liner.
32
+
10
33
  ## [0.4.0] - 2026-05-02
11
34
 
12
35
  A substantial release focused on **reliability, security, and UX**. The CLI is
@@ -380,7 +403,8 @@ Test count went from 63 → 88 (no regressions).
380
403
  - Adapter detection and managed-block sync for Copilot, Cline, Cursor, Claude, Gemini, Windsurf, Codex
381
404
  - Lockfile-based workspace state at `.agent-skills/skills.json`
382
405
 
383
- [Unreleased]: https://github.com/lgili/skillex/compare/v0.4.0...HEAD
406
+ [Unreleased]: https://github.com/lgili/skillex/compare/v0.4.1...HEAD
407
+ [0.4.1]: https://github.com/lgili/skillex/compare/v0.4.0...v0.4.1
384
408
  [0.4.0]: https://github.com/lgili/skillex/compare/v0.3.1...v0.4.0
385
409
  [0.3.1]: https://github.com/lgili/skillex/compare/v0.3.0...v0.3.1
386
410
  [0.3.0]: https://github.com/lgili/skillex/compare/v0.2.5...v0.3.0
package/README.md CHANGED
@@ -92,21 +92,40 @@ npx skillex <command>
92
92
 
93
93
  ### Local Web UI development
94
94
 
95
- When working on the repository itself, the browser UI is a standalone Vue 3 + Vite frontend under [`ui/`](/Users/lgili/Documents/01%20-%20Codes/01%20-%20Github/Skill/ui). The CLI serves the built assets from [`dist-ui/`](/Users/lgili/Documents/01%20-%20Codes/01%20-%20Github/Skill/dist-ui) and keeps all install/remove/update/sync logic in the local TypeScript backend.
95
+ When working on the repository itself, the browser UI is a standalone Vue 3 + Vite frontend under `ui/`. The CLI serves the built assets from `dist-ui/` and keeps all install/remove/update/sync logic in the local TypeScript backend.
96
+
97
+ **One-command dev mode** — `npm run dev` spawns the backend, the Vite dev server with `/api/*` proxied, and opens the browser with the right token. Edit a `.vue` file and HMR reloads instantly.
96
98
 
97
99
  ```bash
98
100
  npm install
99
- npm run build:ui
100
- npm run build
101
- node ./bin/skillex.js ui
101
+ npm run dev
102
+ # Backend: http://127.0.0.1:4174 (token captured automatically)
103
+ # ➜ UI: http://127.0.0.1:4175 (opens in your browser)
102
104
  ```
103
105
 
104
- For frontend-only iteration:
106
+ Override the ports if you need to:
105
107
 
106
108
  ```bash
107
- npm run dev:ui
109
+ SKILLEX_DEV_BACKEND_PORT=5000 SKILLEX_DEV_VITE_PORT=5001 npm run dev
110
+ SKILLEX_DEV_NO_OPEN=1 npm run dev # keep the URL on stdout, don't open
108
111
  ```
109
112
 
113
+ **Production-style local run** — builds everything and serves it exactly like an end user gets via `npx skillex ui`:
114
+
115
+ ```bash
116
+ npm run web # alias for `npm run build && node ./bin/skillex.js ui`
117
+ ```
118
+
119
+ **Other handy aliases:**
120
+
121
+ | Command | What it does |
122
+ |---|---|
123
+ | `npm run dev` | Backend + Vite + auto-open (full HMR loop) |
124
+ | `npm run web` | Production-style: build + run the local Web UI server |
125
+ | `npm run tui` | Open the interactive terminal browser |
126
+ | `npm run skillex -- <args>` | Run any CLI command without `node ./bin/skillex.js` (e.g. `npm run skillex -- list`) |
127
+ | `npm run dev:ui` | Vite dev server only (advanced; needs `VITE_SKILLEX_BACKEND=…` env var pointing at a running backend) |
128
+
110
129
  ---
111
130
 
112
131
  ## Commands
package/dist/cli.js CHANGED
@@ -33,6 +33,8 @@ const STRING_FLAGS = new Set([
33
33
  "skills-dir",
34
34
  "label",
35
35
  "timeout",
36
+ "host",
37
+ "port",
36
38
  ]);
37
39
  /** Flags that are pure booleans (presence = true; supports `--name=value` parsing too). */
38
40
  const BOOLEAN_FLAGS = new Set([
@@ -50,6 +52,7 @@ const BOOLEAN_FLAGS = new Set([
50
52
  "exit-code",
51
53
  "raw",
52
54
  "install-recommended",
55
+ "no-open",
53
56
  ]);
54
57
  /** Union of all flags the parser accepts anywhere in the CLI. */
55
58
  const KNOWN_FLAGS = new Set([...STRING_FLAGS, ...BOOLEAN_FLAGS]);
@@ -231,10 +234,14 @@ Options:
231
234
  --scope <scope> local or global (default: local)
232
235
  --global Shortcut for --scope global
233
236
  --no-cache Bypass local catalog cache
237
+ --host <host> Bind address (default: 127.0.0.1; loopback only)
238
+ --port <number> Listen port (default: pick a free port)
239
+ --no-open Do not open the system browser; just print the URL
234
240
 
235
241
  Example:
236
242
  skillex ui
237
- skillex ui --global`,
243
+ skillex ui --global
244
+ skillex ui --port 4173 --no-open # for the dev orchestrator`,
238
245
  status: `Usage: skillex status [options]
239
246
 
240
247
  Show the installation status of the selected scope.
@@ -665,9 +672,18 @@ async function handleBrowse(flags, userConfig) {
665
672
  }
666
673
  async function handleWebUi(flags, userConfig) {
667
674
  const options = commonOptions(flags, userConfig);
668
- const session = await startWebUiServer(options);
675
+ const host = asOptionalString(flags.host);
676
+ const portRaw = asOptionalString(flags.port);
677
+ const port = portRaw !== undefined ? parsePositiveInt(portRaw) : undefined;
678
+ const noOpen = parseBooleanFlag(flags["no-open"], "no-open") ?? false;
679
+ const session = await startWebUiServer({
680
+ ...options,
681
+ ...(host ? { host } : {}),
682
+ ...(port !== undefined ? { port } : {}),
683
+ autoOpen: !noOpen,
684
+ });
669
685
  output.success(`Skillex Web UI running at ${session.url}`);
670
- if (!session.opened) {
686
+ if (!noOpen && !session.opened) {
671
687
  output.warn("Could not open the browser automatically. Open the URL above manually.");
672
688
  }
673
689
  output.info("Press Ctrl+C to stop the local server.");
@@ -1 +1 @@
1
- import{d as G,w as ce,o as J,a as Z,c as ee,b as te,e as n,f as o,g as P,h as t,t as d,n as A,i as f,T as le,r as T,u as se,j as p,F as x,k as E,l as ke,m as b,p as $,q as ve,s as N}from"./index-I0b-syhc.js";import{_ as K,S as ge}from"./Skeleton-B_xm5L3P.js";import{RECOMMENDED_SKILL_IDS as he}from"./recommended-D_i10hwH.js";const fe=["aria-labelledby"],me=["id"],pe={class:"confirm-message"},ye={class:"confirm-actions"},be=G({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},tone:{}},emits:["confirm","cancel"],setup(i,{emit:w}){const C=i,s=w,S=T(null),h=T(null);function m(k){var g;C.open&&(k.key==="Escape"&&(k.preventDefault(),s("cancel")),k.key==="Enter"&&((g=document.activeElement)==null?void 0:g.tagName)!=="BUTTON"&&(k.preventDefault(),s("confirm")))}return ce(()=>C.open,async k=>{var g;k&&(await new Promise(R=>setTimeout(R,0)),(g=h.value)==null||g.focus())}),J(()=>window.addEventListener("keydown",m)),Z(()=>window.removeEventListener("keydown",m)),(k,g)=>(n(),ee(le,{name:"confirm"},{default:te(()=>[i.open?(n(),o("div",{key:0,ref_key:"dialogEl",ref:S,class:"confirm-backdrop",role:"presentation",onClick:g[2]||(g[2]=P(R=>s("cancel"),["self"]))},[t("div",{class:"confirm-card",role:"dialog","aria-modal":"true","aria-labelledby":`confirm-title-${i.title.replace(/\s+/g,"-")}`},[t("h3",{id:`confirm-title-${i.title.replace(/\s+/g,"-")}`,class:"confirm-title"},d(i.title),9,me),t("p",pe,d(i.message),1),t("div",ye,[t("button",{ref_key:"cancelBtn",ref:h,class:"button button-ghost",type:"button",onClick:g[0]||(g[0]=R=>s("cancel"))},d(i.cancelLabel||"Cancel"),513),t("button",{class:A(["button",i.tone==="danger"?"button-danger":"button-primary"]),type:"button",onClick:g[1]||(g[1]=R=>s("confirm"))},d(i.confirmLabel||"Confirm"),3)])],8,fe)],512)):f("",!0)]),_:1}))}}),Y=K(be,[["__scopeId","data-v-2119c01b"]]);function X(i,w){if(!i)return[{text:"",match:!1}];const C=w.trim();if(!C)return[{text:i,match:!1}];const s=i.toLowerCase(),S=C.toLowerCase(),h=[];let m=0,k=s.indexOf(S,m);for(;k!==-1;)k>m&&h.push({text:i.slice(m,k),match:!1}),h.push({text:i.slice(k,k+S.length),match:!0}),m=k+S.length,k=s.indexOf(S,m);return m<i.length&&h.push({text:i.slice(m),match:!1}),h.length===0?[{text:i,match:!1}]:h}const we=["aria-checked","aria-label"],Ce={key:0,width:"12",height:"12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},Se={class:"skill-card-body"},$e={class:"skill-card-icon-row"},xe={key:0,class:"skill-installed-dot"},Ie={class:"skill-card-meta"},Le={class:"downloads-count"},Me={class:"skill-card-head"},Be={key:0,class:"search-mark"},Re={class:"version-badge"},Ae={class:"skill-description"},Ee={key:0,class:"search-mark"},Te={key:0,class:"tag-block"},je={key:1,class:"tag-block tag-block-compat"},De={class:"skill-card-footer"},_e={class:"skill-author"},ze={key:0,class:"inferred-chip",title:"Category inferred from id/tags. Add `category:` to the skill manifest to override."},Oe=["disabled"],Ne={key:0,class:"card-spinner","aria-label":"Working"},Pe={key:1,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ve=["disabled"],Fe={key:0,class:"card-spinner","aria-label":"Working"},He=G({__name:"SkillCard",props:{skill:{},onOpen:{type:Function},onInstall:{type:Function},onRemove:{type:Function},onSelectRange:{type:Function},inferredCategory:{type:Boolean},resolvedCategoryId:{}},setup(i){const w=i,C=se(),s=b(()=>C.state.busyCards.has(w.skill.id)),S=b(()=>C.state.searchQuery),h=b(()=>X(w.skill.name,S.value)),m=b(()=>X(w.skill.description,S.value)),k=b(()=>C.state.selectedSkillIds.has(w.skill.id)),g=b(()=>C.state.selectedSkillIds.size>0);function R(v){var l;if(v.shiftKey){v.preventDefault(),(l=window.getSelection())==null||l.removeAllRanges(),w.onSelectRange?w.onSelectRange(w.skill.id):C.toggleSelectedSkill(w.skill.id);return}if(g.value){v.preventDefault(),C.toggleSelectedSkill(w.skill.id);return}w.onOpen(w.skill.id)}function V(v){v.stopPropagation(),C.toggleSelectedSkill(w.skill.id)}const j={workflow:"icon-bg-workflow",testing:"icon-bg-testing",devops:"icon-bg-devops",tools:"icon-bg-tools",security:"icon-bg-security"},F={git:"tag-git",github:"tag-git",commit:"tag-git",testing:"tag-test",jest:"tag-test",tdd:"tag-test",test:"tag-test",docker:"tag-docker",devops:"tag-docker",yaml:"tag-docker",security:"tag-security",owasp:"tag-security",audit:"tag-security",react:"tag-react",hooks:"tag-react",python:"tag-python",docs:"tag-python"};function M(v){const l=v.tags.map(r=>r.toLowerCase());return l.some(r=>["git","github","commit","workflow"].includes(r))?"icon-bg-workflow":l.some(r=>["testing","jest","tdd","test","vitest"].includes(r))?"icon-bg-testing":l.some(r=>["docker","devops","ci","cd"].includes(r))?"icon-bg-devops":l.some(r=>["security","owasp","audit"].includes(r))?"icon-bg-security":l.some(r=>["tools","python","scraper","web"].includes(r))?"icon-bg-tools":j[v.id]??"icon-bg-default"}function I(v){return F[v.toLowerCase()]??"tag-default"}function L(v){const l=v.id.toLowerCase();return l.includes("git")||l.includes("commit")?"🌿":l.includes("test")||l.includes("jest")?"🧪":l.includes("docker")?"🐳":l.includes("security")||l.includes("guard")?"🛡️":l.includes("react")?"⚛️":l.includes("python")?"🐍":l.includes("typescript")||l.includes("ts")?"🔷":l.includes("cpp")||l.includes("c++")?"⚙️":l.includes("latex")?"📄":l.includes("create")?"✨":l.includes("code")||l.includes("review")?"🔍":l.includes("error")?"🐛":"📦"}function _(v){const l=(v.author||v.source.repo).trim();if(!l)return"?";const r=l.replace(/[/_-]+/g," ").split(/\s+/).filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():r[0].slice(0,2).toUpperCase()}function B(v){const l=(v.author||v.source.repo).trim();let r=0;for(let z=0;z<l.length;z++)r=r*31+l.charCodeAt(z)|0;return`hsl(${Math.abs(r)%360}deg 70% 35%)`}return(v,l)=>(n(),o("article",{class:A(["skill-card",{"is-installed":i.skill.installed,"is-busy":s.value,"is-selected":k.value,"in-selection-mode":g.value}]),onClick:R},[g.value?(n(),o("button",{key:0,type:"button",class:A(["skill-card-checkbox",{checked:k.value}]),"aria-checked":k.value,"aria-label":`${k.value?"Deselect":"Select"} ${i.skill.name}`,role:"checkbox",onClick:P(V,["stop"])},[k.value?(n(),o("svg",Ce,[...l[3]||(l[3]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):f("",!0)],10,we)):f("",!0),t("div",Se,[t("div",$e,[t("div",{class:A(["skill-icon-wrap",M(i.skill)])},[p(d(L(i.skill))+" ",1),i.skill.installed?(n(),o("div",xe,[...l[4]||(l[4]=[t("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[t("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])])):f("",!0)],2),t("div",Ie,[t("span",Le,[l[5]||(l[5]=t("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)),p(" "+d(i.skill.source.repo),1)])])]),t("div",Me,[t("h3",null,[(n(!0),o(x,null,E(h.value,(r,D)=>(n(),o(x,{key:`name-${D}`},[r.match?(n(),o("mark",Be,d(r.text),1)):(n(),o(x,{key:1},[p(d(r.text),1)],64))],64))),128))]),t("span",Re,"v"+d(i.skill.version),1)]),t("p",Ae,[(n(!0),o(x,null,E(m.value,(r,D)=>(n(),o(x,{key:`desc-${D}`},[r.match?(n(),o("mark",Ee,d(r.text),1)):(n(),o(x,{key:1},[p(d(r.text),1)],64))],64))),128))]),i.skill.tags.length>0?(n(),o("div",Te,[(n(!0),o(x,null,E(i.skill.tags,r=>(n(),o("span",{key:`${i.skill.id}-${r}`,class:A(["skill-tag",I(r)])},d(r),3))),128))])):f("",!0),i.skill.compatibility.length>0?(n(),o("div",je,[(n(!0),o(x,null,E(i.skill.compatibility,r=>(n(),o("span",{key:`${i.skill.id}-${r}`,class:"chip chip-accent",style:{height:"20px","font-size":"10px",padding:"0 8px"}},d(r),1))),128))])):f("",!0)]),t("div",De,[t("div",_e,[t("span",{class:"skill-author-avatar",style:ke({background:B(i.skill)}),"aria-hidden":!0},d(_(i.skill)),5),p(" "+d(i.skill.author||i.skill.source.repo),1)]),t("div",{class:"skill-card-actions",onClick:l[2]||(l[2]=P(()=>{},["stop"]))},[i.inferredCategory?(n(),o("span",ze," (inferred) ")):f("",!0),i.skill.installed?(n(),o(x,{key:1},[l[7]||(l[7]=t("span",{class:"installed-label"},"Installed",-1)),t("button",{class:"remove-btn",type:"button",title:"Remove",disabled:s.value,onClick:l[0]||(l[0]=r=>i.onRemove(i.skill.id))},[s.value?(n(),o("span",Ne)):(n(),o("svg",Pe,[...l[6]||(l[6]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"},null,-1)])]))],8,Oe)],64)):(n(),o("button",{key:2,class:"button button-primary",style:{"min-height":"28px",padding:"0 12px","font-size":"0.75rem"},type:"button",disabled:s.value,onClick:l[1]||(l[1]=r=>i.onInstall(i.skill))},[s.value?(n(),o("span",Fe)):(n(),o(x,{key:1},[l[8]||(l[8]=t("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),l[9]||(l[9]=p(" Install ",-1))],64))],8,Ve))])])],2))}}),Ge=K(He,[["__scopeId","data-v-9ad9747c"]]),Ke={class:"page-column"},Qe={class:"panel"},Ue={class:"panel-head",style:{"align-items":"flex-start","flex-wrap":"wrap",gap:"16px"}},qe={key:0,class:"bulk-actions"},We=["disabled","title"],Ye={key:0,class:"bulk-count"},Xe={key:1,class:"bulk-shortcut","aria-hidden":"true"},Je=["disabled","title"],Ze={class:"bulk-count",style:{background:"rgba(16,185,129,0.18)",color:"var(--accent)"}},et=["disabled","title"],tt={key:0,class:"bulk-select-hint"},lt={class:"catalog-overview"},st={class:"overview-card"},nt={class:"overview-card"},ot=["aria-pressed","title"],it={key:0,style:{"font-size":"0.6em",color:"var(--text-dim)","font-weight":"500"}},at={class:"category-pills"},rt=["onClick"],dt={"aria-hidden":"true"},ut={key:0,class:"category-pill-count"},ct=["aria-pressed","title"],kt={key:0,class:"selection-bar",role:"region","aria-label":"Bulk selection"},vt={class:"selection-bar-info"},gt={class:"selection-bar-hint"},ht={class:"selection-bar-actions"},ft=["disabled"],mt=["disabled"],pt={key:0,class:"catalog-grid"},yt={key:1,class:"onboarding-card"},bt={class:"onboarding-text"},wt=["disabled"],Ct={key:2,class:"empty-state"},St={width:"40",height:"40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",style:{color:"var(--text-dim)","margin-bottom":"4px"},"aria-hidden":"true"},$t={key:0,class:"source-group-head"},xt={key:0,class:"source-group-repo"},It={class:"source-group-count"},Lt={class:"catalog-grid"},Mt=G({__name:"CatalogPage",setup(i){const C=typeof navigator<"u"&&/Mac|iPad|iPhone|iPod/.test(navigator.platform)?"⇧⌘A":"Ctrl+Shift+A",s=se(),S=T("all"),h=T(!1),m=T(!1),k=T(!1),g=T(!1),R=[{id:"all",name:"All",icon:"✦"},{id:"code",name:"Code",icon:"💻"},{id:"engineering",name:"Engineering",icon:"⚡"},{id:"workflow",name:"Workflow",icon:"🌿"},{id:"testing",name:"Testing",icon:"🧪"},{id:"security",name:"Security",icon:"🛡️"},{id:"devops",name:"DevOps",icon:"🐳"},{id:"research",name:"Research",icon:"🔍"},{id:"data",name:"Data",icon:"📊"},{id:"tools",name:"Tools",icon:"🔧"},{id:"other",name:"Other",icon:"📦"}];function V(a,e){const c=[a,...e].map(y=>y.toLowerCase()).join(" ");return/wikipedia|arxiv|pubmed|ncbi|duckduckgo|web-search|web-scraper|research-wikipedia|research-arxiv|research-pubmed/.test(c)?"research":/data-engineer|data-scientist|data-science|machine-learning|\bml\b|etl|elt|\bdbt\b|airflow|pipeline|feature-engineering|data-warehouse|data-modeling/.test(c)?"data":/simulation|mna|z-domain|magnetics|mosfet|igbt|waveform|fft|thd|newton-raphson|psim|schematic|netlist|altium|datasheet|curve-digitization|semiconductor/.test(c)?"engineering":/typescript|python|cpp-pro|c-pro|code-review|error-handling/.test(c)?"code":/git|commit|workflow|branch/.test(c)?"workflow":/test|jest|tdd|vitest|spec/.test(c)?"testing":/security|owasp|audit|guard/.test(c)?"security":/docker|devops|ci|cd|helm/.test(c)?"devops":/pdf|extraction|document|scraper|tool|docs|web/.test(c)?"tools":"other"}function j(a){var c;const e=(c=a.category)==null?void 0:c.trim();return e?{id:e.toLowerCase(),inferred:!1}:{id:V(a.id,a.tags),inferred:!0}}function F(a){var e,c;return a==="all"?((e=s.state.catalog)==null?void 0:e.skills.length)??0:(((c=s.state.catalog)==null?void 0:c.skills)??[]).filter(y=>j(y).id===a).length}const M=b(()=>{var a;return((a=s.state.catalog)==null?void 0:a.skills.length)??0}),I=b(()=>{var a;return((a=s.state.dashboard)==null?void 0:a.installed.length)??0}),L=b(()=>Math.max(0,M.value-I.value)),_=b(()=>{var c,y;const a=new Set((((c=s.state.catalog)==null?void 0:c.skills)??[]).map(u=>u.id)),e=new Set((((y=s.state.dashboard)==null?void 0:y.installed)??[]).map(u=>u.id));return he.filter(u=>a.has(u)&&!e.has(u))}),B=b(()=>{let a=s.filteredSkills.value;return S.value!=="all"&&(a=a.filter(e=>j(e).id===S.value)),h.value&&(a=a.filter(e=>e.installed)),a}),v=b(()=>s.state.catalog===null),l=b(()=>{if(!m.value)return[{key:"_all",label:"",repo:"",skills:B.value}];const a=new Map;for(const e of B.value){const c=`${e.source.repo}@${e.source.ref}`,y=e.source.label||e.source.repo;a.has(c)||a.set(c,{key:c,label:y,repo:e.source.repo,skills:[]}),a.get(c).skills.push(e)}return[...a.values()].sort((e,c)=>e.label.localeCompare(c.label))}),r=b(()=>{var a,e;return(((e=(a=s.state.catalog)==null?void 0:a.sources)==null?void 0:e.length)??0)>1}),D=b(()=>!v.value&&M.value>0&&I.value===0);async function z(){k.value=!1;try{await s.installAll()}catch{}}async function ne(){try{await s.installRecommended()}catch{}}async function oe(){g.value=!1;try{await s.removeAllInstalled()}catch{}}function ie(){s.setSearchQuery(""),S.value="all",h.value=!1}function Q(){L.value===0||s.state.busyLabel||(k.value=!0)}function U(a){if(a.key!=="Escape"||a.defaultPrevented||s.state.selectedSkillIds.size===0||k.value||g.value)return;const e=a.target;e&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")||(a.preventDefault(),s.clearSelection())}const H=b(()=>s.state.selectedSkillIds.size),q=b(()=>{var c;const a=new Set((((c=s.state.dashboard)==null?void 0:c.installed)??[]).map(y=>y.id));let e=0;for(const y of s.state.selectedSkillIds)a.has(y)||(e+=1);return e}),W=b(()=>{var c;const a=new Set((((c=s.state.dashboard)==null?void 0:c.installed)??[]).map(y=>y.id));let e=0;for(const y of s.state.selectedSkillIds)a.has(y)&&(e+=1);return e});function ae(){s.setSelectedSkills(B.value.map(a=>a.id))}function re(a){s.selectRangeFromAnchor(a,B.value.map(e=>e.id))}async function de(){try{await s.installSelectedSkills()}catch{}}async function ue(){try{await s.removeSelectedSkills()}catch{}}return J(()=>{window.addEventListener("skillex:request-install-all",Q),window.addEventListener("keydown",U)}),Z(()=>{window.removeEventListener("skillex:request-install-all",Q),window.removeEventListener("keydown",U)}),(a,e)=>{var c,y;return n(),o("section",Ke,[t("div",Qe,[t("div",Ue,[e[14]||(e[14]=t("div",{class:"panel-head-title"},[t("p",{class:"eyebrow"},"Discovery"),t("h2",null,"Marketplace"),t("p",null,"Browse skills from your configured catalog sources and install them in your workspace.")],-1)),!v.value&&M.value>0?(n(),o("div",qe,[t("button",{class:"button button-primary",type:"button",disabled:L.value===0||$(s).state.busyLabel!==null,title:L.value===0?"All skills are already installed.":`Install all ${L.value} remaining skill(s) into your workspace. (${$(C)})`,onClick:e[0]||(e[0]=u=>k.value=!0)},[e[9]||(e[9]=t("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),e[10]||(e[10]=p(" Install all ",-1)),L.value>0?(n(),o("span",Ye,d(L.value),1)):f("",!0),L.value>0?(n(),o("span",Xe,d($(C)),1)):f("",!0)],8,We),_.value.length>0?(n(),o("button",{key:0,class:"button button-secondary",type:"button",disabled:$(s).state.busyLabel!==null,title:`Install the curated starter pack: ${_.value.join(", ")}`,onClick:ne},[e[11]||(e[11]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.539 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.196-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})],-1)),e[12]||(e[12]=p(" Install recommended ",-1)),t("span",Ze,d(_.value.length),1)],8,Je)):f("",!0),I.value>0?(n(),o("button",{key:1,class:"button button-ghost danger-ghost",type:"button",disabled:$(s).state.busyLabel!==null,title:`Remove all ${I.value} installed skill(s) from your workspace.`,onClick:e[1]||(e[1]=u=>g.value=!0)},[e[13]||(e[13]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)),p(" Remove all ("+d(I.value)+") ",1)],8,et)):f("",!0)])):f("",!0)]),!v.value&&M.value>0&&H.value===0?(n(),o("p",tt,[...e[15]||(e[15]=[t("kbd",null,"Shift",-1),p(" + click any card to start a multi-select. Hold ",-1),t("kbd",null,"Shift",-1),p(" on a second card to select the range between them. ",-1)])])):f("",!0),t("div",lt,[t("article",st,[e[16]||(e[16]=t("span",null,"Visible",-1)),t("strong",null,d(B.value.length),1)]),t("article",nt,[e[17]||(e[17]=t("span",null,"Sources",-1)),t("strong",null,d(((c=$(s).state.catalog)==null?void 0:c.sources.length)??0),1)]),t("article",{class:A(["overview-card overview-card-clickable",{active:h.value}]),role:"button",tabindex:"0","aria-pressed":h.value,title:h.value?"Showing installed only — click to clear":"Click to filter installed only",onClick:e[2]||(e[2]=u=>h.value=!h.value),onKeydown:e[3]||(e[3]=ve(P(u=>h.value=!h.value,["prevent"]),["enter","space"]))},[e[18]||(e[18]=t("span",null,"Installed",-1)),t("strong",null,[p(d(I.value),1),I.value>0?(n(),o("span",it," / "+d(M.value),1)):f("",!0)])],42,ot)]),t("div",at,[(n(),o(x,null,E(R,u=>t("button",{key:u.id,class:A(["category-pill",{active:S.value===u.id}]),type:"button",onClick:O=>S.value=u.id},[t("span",dt,d(u.icon),1),p(" "+d(u.name)+" ",1),u.id!=="all"?(n(),o("span",ut,d(F(u.id)),1)):f("",!0)],10,rt)),64)),r.value?(n(),o("button",{key:0,class:A(["category-pill group-toggle",{active:m.value}]),type:"button","aria-pressed":m.value,title:m.value?"Click to flatten the grid":"Group skills by their catalog source",onClick:e[4]||(e[4]=u=>m.value=!m.value)},[...e[19]||(e[19]=[t("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h7"})],-1),p(" Group by source ",-1)])],10,ct)):f("",!0)])]),N(le,{name:"selection-bar"},{default:te(()=>[H.value>0?(n(),o("div",kt,[t("div",vt,[t("strong",null,d(H.value)+" selected",1),t("span",gt,[e[20]||(e[20]=p(" Shift+click cards to add/remove · ",-1)),t("button",{type:"button",class:"link-button",onClick:ae},"Select all visible ("+d(B.value.length)+")",1)])]),t("div",ht,[q.value>0?(n(),o("button",{key:0,class:"button button-primary",type:"button",disabled:$(s).state.busyLabel!==null,onClick:de},[e[21]||(e[21]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),p(" Install "+d(q.value),1)],8,ft)):f("",!0),W.value>0?(n(),o("button",{key:1,class:"button button-danger",type:"button",disabled:$(s).state.busyLabel!==null,onClick:ue},[e[22]||(e[22]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)),p(" Remove "+d(W.value),1)],8,mt)):f("",!0),t("button",{class:"button button-ghost",type:"button",title:"Clear selection (Esc)",onClick:e[5]||(e[5]=u=>$(s).clearSelection())}," Clear ")])])):f("",!0)]),_:1}),v.value?(n(),o("div",pt,[(n(),o(x,null,E(6,u=>N(ge,{key:`skeleton-${u}`,variant:"card"})),64))])):D.value&&!h.value&&S.value==="all"&&!$(s).state.searchQuery?(n(),o("div",yt,[e[25]||(e[25]=t("div",{class:"onboarding-icon","aria-hidden":"true"},[t("svg",{width:"32",height:"32",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.8",d:"M9 12l2 2 4-4m5 2a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),t("div",bt,[e[23]||(e[23]=t("strong",null,"Your workspace is set up. Install your first skill.",-1)),t("p",null,d(M.value)+" skill(s) are available across "+d(((y=$(s).state.catalog)==null?void 0:y.sources.length)??0)+" source(s). Pick one below, or install everything at once.",1)]),t("button",{class:"button button-primary",type:"button",disabled:$(s).state.busyLabel!==null,onClick:e[6]||(e[6]=u=>k.value=!0)},[e[24]||(e[24]=t("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),p(" Install all "+d(M.value)+" skills ",1)],8,wt)])):B.value.length===0?(n(),o("div",Ct,[(n(),o("svg",St,[...e[26]||(e[26]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},null,-1)])])),e[29]||(e[29]=t("strong",null,"No skills match your filters",-1)),t("p",null,[e[27]||(e[27]=p(" Try a different category or search term, or ",-1)),t("button",{type:"button",class:"link-button",onClick:ie},"clear all filters"),e[28]||(e[28]=p(". ",-1))])])):(n(!0),o(x,{key:3},E(l.value,u=>(n(),o(x,{key:u.key},[m.value&&u.label?(n(),o("div",$t,[e[30]||(e[30]=t("span",{class:"source-group-icon","aria-hidden":"true"},"📦",-1)),t("strong",null,d(u.label),1),u.label!==u.repo?(n(),o("code",xt,d(u.repo),1)):f("",!0),t("span",It,d(u.skills.length)+" skill(s)",1)])):f("",!0),t("div",Lt,[(n(!0),o(x,null,E(u.skills,O=>(n(),ee(Ge,{key:`${u.key}-${O.id}`,skill:O,"inferred-category":j(O).inferred,"resolved-category-id":j(O).id,"on-open":$(s).navigateToSkill,"on-install":$(s).installSkill,"on-remove":$(s).removeSkill,"on-select-range":re},null,8,["skill","inferred-category","resolved-category-id","on-open","on-install","on-remove"]))),128))])],64))),128)),N(Y,{open:k.value,title:"Install every skill in the catalog?",message:`This will download and install ${L.value} skill(s) into your workspace. The active agent will be auto-synced when finished.`,"confirm-label":"Install all",onConfirm:z,onCancel:e[7]||(e[7]=u=>k.value=!1)},null,8,["open","message"]),N(Y,{open:g.value,tone:"danger",title:"Remove every installed skill?",message:`This will remove ${I.value} skill(s) from your workspace. Synced adapter targets will be cleaned up automatically. This cannot be undone (you can reinstall via 'Install all').`,"confirm-label":"Remove all",onConfirm:oe,onCancel:e[8]||(e[8]=u=>g.value=!1)},null,8,["open","message"])])}}}),Et=K(Mt,[["__scopeId","data-v-552dec63"]]);export{Et as default};
1
+ import{d as G,w as ce,o as J,a as Z,c as ee,b as te,e as n,f as o,g as P,h as t,t as d,n as A,i as f,T as le,r as T,u as se,j as p,F as x,k as E,l as ke,m as b,p as $,q as ve,s as N}from"./index-DAVP4Xp_.js";import{_ as K,S as ge}from"./Skeleton-BISmLuhY.js";import{RECOMMENDED_SKILL_IDS as he}from"./recommended-D_i10hwH.js";const fe=["aria-labelledby"],me=["id"],pe={class:"confirm-message"},ye={class:"confirm-actions"},be=G({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},tone:{}},emits:["confirm","cancel"],setup(i,{emit:w}){const C=i,s=w,S=T(null),h=T(null);function m(k){var g;C.open&&(k.key==="Escape"&&(k.preventDefault(),s("cancel")),k.key==="Enter"&&((g=document.activeElement)==null?void 0:g.tagName)!=="BUTTON"&&(k.preventDefault(),s("confirm")))}return ce(()=>C.open,async k=>{var g;k&&(await new Promise(R=>setTimeout(R,0)),(g=h.value)==null||g.focus())}),J(()=>window.addEventListener("keydown",m)),Z(()=>window.removeEventListener("keydown",m)),(k,g)=>(n(),ee(le,{name:"confirm"},{default:te(()=>[i.open?(n(),o("div",{key:0,ref_key:"dialogEl",ref:S,class:"confirm-backdrop",role:"presentation",onClick:g[2]||(g[2]=P(R=>s("cancel"),["self"]))},[t("div",{class:"confirm-card",role:"dialog","aria-modal":"true","aria-labelledby":`confirm-title-${i.title.replace(/\s+/g,"-")}`},[t("h3",{id:`confirm-title-${i.title.replace(/\s+/g,"-")}`,class:"confirm-title"},d(i.title),9,me),t("p",pe,d(i.message),1),t("div",ye,[t("button",{ref_key:"cancelBtn",ref:h,class:"button button-ghost",type:"button",onClick:g[0]||(g[0]=R=>s("cancel"))},d(i.cancelLabel||"Cancel"),513),t("button",{class:A(["button",i.tone==="danger"?"button-danger":"button-primary"]),type:"button",onClick:g[1]||(g[1]=R=>s("confirm"))},d(i.confirmLabel||"Confirm"),3)])],8,fe)],512)):f("",!0)]),_:1}))}}),Y=K(be,[["__scopeId","data-v-2119c01b"]]);function X(i,w){if(!i)return[{text:"",match:!1}];const C=w.trim();if(!C)return[{text:i,match:!1}];const s=i.toLowerCase(),S=C.toLowerCase(),h=[];let m=0,k=s.indexOf(S,m);for(;k!==-1;)k>m&&h.push({text:i.slice(m,k),match:!1}),h.push({text:i.slice(k,k+S.length),match:!0}),m=k+S.length,k=s.indexOf(S,m);return m<i.length&&h.push({text:i.slice(m),match:!1}),h.length===0?[{text:i,match:!1}]:h}const we=["aria-checked","aria-label"],Ce={key:0,width:"12",height:"12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},Se={class:"skill-card-body"},$e={class:"skill-card-icon-row"},xe={key:0,class:"skill-installed-dot"},Ie={class:"skill-card-meta"},Le={class:"downloads-count"},Me={class:"skill-card-head"},Be={key:0,class:"search-mark"},Re={class:"version-badge"},Ae={class:"skill-description"},Ee={key:0,class:"search-mark"},Te={key:0,class:"tag-block"},je={key:1,class:"tag-block tag-block-compat"},De={class:"skill-card-footer"},_e={class:"skill-author"},ze={key:0,class:"inferred-chip",title:"Category inferred from id/tags. Add `category:` to the skill manifest to override."},Oe=["disabled"],Ne={key:0,class:"card-spinner","aria-label":"Working"},Pe={key:1,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ve=["disabled"],Fe={key:0,class:"card-spinner","aria-label":"Working"},He=G({__name:"SkillCard",props:{skill:{},onOpen:{type:Function},onInstall:{type:Function},onRemove:{type:Function},onSelectRange:{type:Function},inferredCategory:{type:Boolean},resolvedCategoryId:{}},setup(i){const w=i,C=se(),s=b(()=>C.state.busyCards.has(w.skill.id)),S=b(()=>C.state.searchQuery),h=b(()=>X(w.skill.name,S.value)),m=b(()=>X(w.skill.description,S.value)),k=b(()=>C.state.selectedSkillIds.has(w.skill.id)),g=b(()=>C.state.selectedSkillIds.size>0);function R(v){var l;if(v.shiftKey){v.preventDefault(),(l=window.getSelection())==null||l.removeAllRanges(),w.onSelectRange?w.onSelectRange(w.skill.id):C.toggleSelectedSkill(w.skill.id);return}if(g.value){v.preventDefault(),C.toggleSelectedSkill(w.skill.id);return}w.onOpen(w.skill.id)}function V(v){v.stopPropagation(),C.toggleSelectedSkill(w.skill.id)}const j={workflow:"icon-bg-workflow",testing:"icon-bg-testing",devops:"icon-bg-devops",tools:"icon-bg-tools",security:"icon-bg-security"},F={git:"tag-git",github:"tag-git",commit:"tag-git",testing:"tag-test",jest:"tag-test",tdd:"tag-test",test:"tag-test",docker:"tag-docker",devops:"tag-docker",yaml:"tag-docker",security:"tag-security",owasp:"tag-security",audit:"tag-security",react:"tag-react",hooks:"tag-react",python:"tag-python",docs:"tag-python"};function M(v){const l=v.tags.map(r=>r.toLowerCase());return l.some(r=>["git","github","commit","workflow"].includes(r))?"icon-bg-workflow":l.some(r=>["testing","jest","tdd","test","vitest"].includes(r))?"icon-bg-testing":l.some(r=>["docker","devops","ci","cd"].includes(r))?"icon-bg-devops":l.some(r=>["security","owasp","audit"].includes(r))?"icon-bg-security":l.some(r=>["tools","python","scraper","web"].includes(r))?"icon-bg-tools":j[v.id]??"icon-bg-default"}function I(v){return F[v.toLowerCase()]??"tag-default"}function L(v){const l=v.id.toLowerCase();return l.includes("git")||l.includes("commit")?"🌿":l.includes("test")||l.includes("jest")?"🧪":l.includes("docker")?"🐳":l.includes("security")||l.includes("guard")?"🛡️":l.includes("react")?"⚛️":l.includes("python")?"🐍":l.includes("typescript")||l.includes("ts")?"🔷":l.includes("cpp")||l.includes("c++")?"⚙️":l.includes("latex")?"📄":l.includes("create")?"✨":l.includes("code")||l.includes("review")?"🔍":l.includes("error")?"🐛":"📦"}function _(v){const l=(v.author||v.source.repo).trim();if(!l)return"?";const r=l.replace(/[/_-]+/g," ").split(/\s+/).filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():r[0].slice(0,2).toUpperCase()}function B(v){const l=(v.author||v.source.repo).trim();let r=0;for(let z=0;z<l.length;z++)r=r*31+l.charCodeAt(z)|0;return`hsl(${Math.abs(r)%360}deg 70% 35%)`}return(v,l)=>(n(),o("article",{class:A(["skill-card",{"is-installed":i.skill.installed,"is-busy":s.value,"is-selected":k.value,"in-selection-mode":g.value}]),onClick:R},[g.value?(n(),o("button",{key:0,type:"button",class:A(["skill-card-checkbox",{checked:k.value}]),"aria-checked":k.value,"aria-label":`${k.value?"Deselect":"Select"} ${i.skill.name}`,role:"checkbox",onClick:P(V,["stop"])},[k.value?(n(),o("svg",Ce,[...l[3]||(l[3]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):f("",!0)],10,we)):f("",!0),t("div",Se,[t("div",$e,[t("div",{class:A(["skill-icon-wrap",M(i.skill)])},[p(d(L(i.skill))+" ",1),i.skill.installed?(n(),o("div",xe,[...l[4]||(l[4]=[t("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[t("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])])):f("",!0)],2),t("div",Ie,[t("span",Le,[l[5]||(l[5]=t("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)),p(" "+d(i.skill.source.repo),1)])])]),t("div",Me,[t("h3",null,[(n(!0),o(x,null,E(h.value,(r,D)=>(n(),o(x,{key:`name-${D}`},[r.match?(n(),o("mark",Be,d(r.text),1)):(n(),o(x,{key:1},[p(d(r.text),1)],64))],64))),128))]),t("span",Re,"v"+d(i.skill.version),1)]),t("p",Ae,[(n(!0),o(x,null,E(m.value,(r,D)=>(n(),o(x,{key:`desc-${D}`},[r.match?(n(),o("mark",Ee,d(r.text),1)):(n(),o(x,{key:1},[p(d(r.text),1)],64))],64))),128))]),i.skill.tags.length>0?(n(),o("div",Te,[(n(!0),o(x,null,E(i.skill.tags,r=>(n(),o("span",{key:`${i.skill.id}-${r}`,class:A(["skill-tag",I(r)])},d(r),3))),128))])):f("",!0),i.skill.compatibility.length>0?(n(),o("div",je,[(n(!0),o(x,null,E(i.skill.compatibility,r=>(n(),o("span",{key:`${i.skill.id}-${r}`,class:"chip chip-accent",style:{height:"20px","font-size":"10px",padding:"0 8px"}},d(r),1))),128))])):f("",!0)]),t("div",De,[t("div",_e,[t("span",{class:"skill-author-avatar",style:ke({background:B(i.skill)}),"aria-hidden":!0},d(_(i.skill)),5),p(" "+d(i.skill.author||i.skill.source.repo),1)]),t("div",{class:"skill-card-actions",onClick:l[2]||(l[2]=P(()=>{},["stop"]))},[i.inferredCategory?(n(),o("span",ze," (inferred) ")):f("",!0),i.skill.installed?(n(),o(x,{key:1},[l[7]||(l[7]=t("span",{class:"installed-label"},"Installed",-1)),t("button",{class:"remove-btn",type:"button",title:"Remove",disabled:s.value,onClick:l[0]||(l[0]=r=>i.onRemove(i.skill.id))},[s.value?(n(),o("span",Ne)):(n(),o("svg",Pe,[...l[6]||(l[6]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"},null,-1)])]))],8,Oe)],64)):(n(),o("button",{key:2,class:"button button-primary",style:{"min-height":"28px",padding:"0 12px","font-size":"0.75rem"},type:"button",disabled:s.value,onClick:l[1]||(l[1]=r=>i.onInstall(i.skill))},[s.value?(n(),o("span",Fe)):(n(),o(x,{key:1},[l[8]||(l[8]=t("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),l[9]||(l[9]=p(" Install ",-1))],64))],8,Ve))])])],2))}}),Ge=K(He,[["__scopeId","data-v-9ad9747c"]]),Ke={class:"page-column"},Qe={class:"panel"},Ue={class:"panel-head",style:{"align-items":"flex-start","flex-wrap":"wrap",gap:"16px"}},qe={key:0,class:"bulk-actions"},We=["disabled","title"],Ye={key:0,class:"bulk-count"},Xe={key:1,class:"bulk-shortcut","aria-hidden":"true"},Je=["disabled","title"],Ze={class:"bulk-count",style:{background:"rgba(16,185,129,0.18)",color:"var(--accent)"}},et=["disabled","title"],tt={key:0,class:"bulk-select-hint"},lt={class:"catalog-overview"},st={class:"overview-card"},nt={class:"overview-card"},ot=["aria-pressed","title"],it={key:0,style:{"font-size":"0.6em",color:"var(--text-dim)","font-weight":"500"}},at={class:"category-pills"},rt=["onClick"],dt={"aria-hidden":"true"},ut={key:0,class:"category-pill-count"},ct=["aria-pressed","title"],kt={key:0,class:"selection-bar",role:"region","aria-label":"Bulk selection"},vt={class:"selection-bar-info"},gt={class:"selection-bar-hint"},ht={class:"selection-bar-actions"},ft=["disabled"],mt=["disabled"],pt={key:0,class:"catalog-grid"},yt={key:1,class:"onboarding-card"},bt={class:"onboarding-text"},wt=["disabled"],Ct={key:2,class:"empty-state"},St={width:"40",height:"40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",style:{color:"var(--text-dim)","margin-bottom":"4px"},"aria-hidden":"true"},$t={key:0,class:"source-group-head"},xt={key:0,class:"source-group-repo"},It={class:"source-group-count"},Lt={class:"catalog-grid"},Mt=G({__name:"CatalogPage",setup(i){const C=typeof navigator<"u"&&/Mac|iPad|iPhone|iPod/.test(navigator.platform)?"⇧⌘A":"Ctrl+Shift+A",s=se(),S=T("all"),h=T(!1),m=T(!1),k=T(!1),g=T(!1),R=[{id:"all",name:"All",icon:"✦"},{id:"code",name:"Code",icon:"💻"},{id:"engineering",name:"Engineering",icon:"⚡"},{id:"workflow",name:"Workflow",icon:"🌿"},{id:"testing",name:"Testing",icon:"🧪"},{id:"security",name:"Security",icon:"🛡️"},{id:"devops",name:"DevOps",icon:"🐳"},{id:"research",name:"Research",icon:"🔍"},{id:"data",name:"Data",icon:"📊"},{id:"tools",name:"Tools",icon:"🔧"},{id:"other",name:"Other",icon:"📦"}];function V(a,e){const c=[a,...e].map(y=>y.toLowerCase()).join(" ");return/wikipedia|arxiv|pubmed|ncbi|duckduckgo|web-search|web-scraper|research-wikipedia|research-arxiv|research-pubmed/.test(c)?"research":/data-engineer|data-scientist|data-science|machine-learning|\bml\b|etl|elt|\bdbt\b|airflow|pipeline|feature-engineering|data-warehouse|data-modeling/.test(c)?"data":/simulation|mna|z-domain|magnetics|mosfet|igbt|waveform|fft|thd|newton-raphson|psim|schematic|netlist|altium|datasheet|curve-digitization|semiconductor/.test(c)?"engineering":/typescript|python|cpp-pro|c-pro|code-review|error-handling/.test(c)?"code":/git|commit|workflow|branch/.test(c)?"workflow":/test|jest|tdd|vitest|spec/.test(c)?"testing":/security|owasp|audit|guard/.test(c)?"security":/docker|devops|ci|cd|helm/.test(c)?"devops":/pdf|extraction|document|scraper|tool|docs|web/.test(c)?"tools":"other"}function j(a){var c;const e=(c=a.category)==null?void 0:c.trim();return e?{id:e.toLowerCase(),inferred:!1}:{id:V(a.id,a.tags),inferred:!0}}function F(a){var e,c;return a==="all"?((e=s.state.catalog)==null?void 0:e.skills.length)??0:(((c=s.state.catalog)==null?void 0:c.skills)??[]).filter(y=>j(y).id===a).length}const M=b(()=>{var a;return((a=s.state.catalog)==null?void 0:a.skills.length)??0}),I=b(()=>{var a;return((a=s.state.dashboard)==null?void 0:a.installed.length)??0}),L=b(()=>Math.max(0,M.value-I.value)),_=b(()=>{var c,y;const a=new Set((((c=s.state.catalog)==null?void 0:c.skills)??[]).map(u=>u.id)),e=new Set((((y=s.state.dashboard)==null?void 0:y.installed)??[]).map(u=>u.id));return he.filter(u=>a.has(u)&&!e.has(u))}),B=b(()=>{let a=s.filteredSkills.value;return S.value!=="all"&&(a=a.filter(e=>j(e).id===S.value)),h.value&&(a=a.filter(e=>e.installed)),a}),v=b(()=>s.state.catalog===null),l=b(()=>{if(!m.value)return[{key:"_all",label:"",repo:"",skills:B.value}];const a=new Map;for(const e of B.value){const c=`${e.source.repo}@${e.source.ref}`,y=e.source.label||e.source.repo;a.has(c)||a.set(c,{key:c,label:y,repo:e.source.repo,skills:[]}),a.get(c).skills.push(e)}return[...a.values()].sort((e,c)=>e.label.localeCompare(c.label))}),r=b(()=>{var a,e;return(((e=(a=s.state.catalog)==null?void 0:a.sources)==null?void 0:e.length)??0)>1}),D=b(()=>!v.value&&M.value>0&&I.value===0);async function z(){k.value=!1;try{await s.installAll()}catch{}}async function ne(){try{await s.installRecommended()}catch{}}async function oe(){g.value=!1;try{await s.removeAllInstalled()}catch{}}function ie(){s.setSearchQuery(""),S.value="all",h.value=!1}function Q(){L.value===0||s.state.busyLabel||(k.value=!0)}function U(a){if(a.key!=="Escape"||a.defaultPrevented||s.state.selectedSkillIds.size===0||k.value||g.value)return;const e=a.target;e&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")||(a.preventDefault(),s.clearSelection())}const H=b(()=>s.state.selectedSkillIds.size),q=b(()=>{var c;const a=new Set((((c=s.state.dashboard)==null?void 0:c.installed)??[]).map(y=>y.id));let e=0;for(const y of s.state.selectedSkillIds)a.has(y)||(e+=1);return e}),W=b(()=>{var c;const a=new Set((((c=s.state.dashboard)==null?void 0:c.installed)??[]).map(y=>y.id));let e=0;for(const y of s.state.selectedSkillIds)a.has(y)&&(e+=1);return e});function ae(){s.setSelectedSkills(B.value.map(a=>a.id))}function re(a){s.selectRangeFromAnchor(a,B.value.map(e=>e.id))}async function de(){try{await s.installSelectedSkills()}catch{}}async function ue(){try{await s.removeSelectedSkills()}catch{}}return J(()=>{window.addEventListener("skillex:request-install-all",Q),window.addEventListener("keydown",U)}),Z(()=>{window.removeEventListener("skillex:request-install-all",Q),window.removeEventListener("keydown",U)}),(a,e)=>{var c,y;return n(),o("section",Ke,[t("div",Qe,[t("div",Ue,[e[14]||(e[14]=t("div",{class:"panel-head-title"},[t("p",{class:"eyebrow"},"Discovery"),t("h2",null,"Marketplace"),t("p",null,"Browse skills from your configured catalog sources and install them in your workspace.")],-1)),!v.value&&M.value>0?(n(),o("div",qe,[t("button",{class:"button button-primary",type:"button",disabled:L.value===0||$(s).state.busyLabel!==null,title:L.value===0?"All skills are already installed.":`Install all ${L.value} remaining skill(s) into your workspace. (${$(C)})`,onClick:e[0]||(e[0]=u=>k.value=!0)},[e[9]||(e[9]=t("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),e[10]||(e[10]=p(" Install all ",-1)),L.value>0?(n(),o("span",Ye,d(L.value),1)):f("",!0),L.value>0?(n(),o("span",Xe,d($(C)),1)):f("",!0)],8,We),_.value.length>0?(n(),o("button",{key:0,class:"button button-secondary",type:"button",disabled:$(s).state.busyLabel!==null,title:`Install the curated starter pack: ${_.value.join(", ")}`,onClick:ne},[e[11]||(e[11]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.539 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.196-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})],-1)),e[12]||(e[12]=p(" Install recommended ",-1)),t("span",Ze,d(_.value.length),1)],8,Je)):f("",!0),I.value>0?(n(),o("button",{key:1,class:"button button-ghost danger-ghost",type:"button",disabled:$(s).state.busyLabel!==null,title:`Remove all ${I.value} installed skill(s) from your workspace.`,onClick:e[1]||(e[1]=u=>g.value=!0)},[e[13]||(e[13]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)),p(" Remove all ("+d(I.value)+") ",1)],8,et)):f("",!0)])):f("",!0)]),!v.value&&M.value>0&&H.value===0?(n(),o("p",tt,[...e[15]||(e[15]=[t("kbd",null,"Shift",-1),p(" + click any card to start a multi-select. Hold ",-1),t("kbd",null,"Shift",-1),p(" on a second card to select the range between them. ",-1)])])):f("",!0),t("div",lt,[t("article",st,[e[16]||(e[16]=t("span",null,"Visible",-1)),t("strong",null,d(B.value.length),1)]),t("article",nt,[e[17]||(e[17]=t("span",null,"Sources",-1)),t("strong",null,d(((c=$(s).state.catalog)==null?void 0:c.sources.length)??0),1)]),t("article",{class:A(["overview-card overview-card-clickable",{active:h.value}]),role:"button",tabindex:"0","aria-pressed":h.value,title:h.value?"Showing installed only — click to clear":"Click to filter installed only",onClick:e[2]||(e[2]=u=>h.value=!h.value),onKeydown:e[3]||(e[3]=ve(P(u=>h.value=!h.value,["prevent"]),["enter","space"]))},[e[18]||(e[18]=t("span",null,"Installed",-1)),t("strong",null,[p(d(I.value),1),I.value>0?(n(),o("span",it," / "+d(M.value),1)):f("",!0)])],42,ot)]),t("div",at,[(n(),o(x,null,E(R,u=>t("button",{key:u.id,class:A(["category-pill",{active:S.value===u.id}]),type:"button",onClick:O=>S.value=u.id},[t("span",dt,d(u.icon),1),p(" "+d(u.name)+" ",1),u.id!=="all"?(n(),o("span",ut,d(F(u.id)),1)):f("",!0)],10,rt)),64)),r.value?(n(),o("button",{key:0,class:A(["category-pill group-toggle",{active:m.value}]),type:"button","aria-pressed":m.value,title:m.value?"Click to flatten the grid":"Group skills by their catalog source",onClick:e[4]||(e[4]=u=>m.value=!m.value)},[...e[19]||(e[19]=[t("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h7"})],-1),p(" Group by source ",-1)])],10,ct)):f("",!0)])]),N(le,{name:"selection-bar"},{default:te(()=>[H.value>0?(n(),o("div",kt,[t("div",vt,[t("strong",null,d(H.value)+" selected",1),t("span",gt,[e[20]||(e[20]=p(" Shift+click cards to add/remove · ",-1)),t("button",{type:"button",class:"link-button",onClick:ae},"Select all visible ("+d(B.value.length)+")",1)])]),t("div",ht,[q.value>0?(n(),o("button",{key:0,class:"button button-primary",type:"button",disabled:$(s).state.busyLabel!==null,onClick:de},[e[21]||(e[21]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),p(" Install "+d(q.value),1)],8,ft)):f("",!0),W.value>0?(n(),o("button",{key:1,class:"button button-danger",type:"button",disabled:$(s).state.busyLabel!==null,onClick:ue},[e[22]||(e[22]=t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)),p(" Remove "+d(W.value),1)],8,mt)):f("",!0),t("button",{class:"button button-ghost",type:"button",title:"Clear selection (Esc)",onClick:e[5]||(e[5]=u=>$(s).clearSelection())}," Clear ")])])):f("",!0)]),_:1}),v.value?(n(),o("div",pt,[(n(),o(x,null,E(6,u=>N(ge,{key:`skeleton-${u}`,variant:"card"})),64))])):D.value&&!h.value&&S.value==="all"&&!$(s).state.searchQuery?(n(),o("div",yt,[e[25]||(e[25]=t("div",{class:"onboarding-icon","aria-hidden":"true"},[t("svg",{width:"32",height:"32",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.8",d:"M9 12l2 2 4-4m5 2a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),t("div",bt,[e[23]||(e[23]=t("strong",null,"Your workspace is set up. Install your first skill.",-1)),t("p",null,d(M.value)+" skill(s) are available across "+d(((y=$(s).state.catalog)==null?void 0:y.sources.length)??0)+" source(s). Pick one below, or install everything at once.",1)]),t("button",{class:"button button-primary",type:"button",disabled:$(s).state.busyLabel!==null,onClick:e[6]||(e[6]=u=>k.value=!0)},[e[24]||(e[24]=t("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)),p(" Install all "+d(M.value)+" skills ",1)],8,wt)])):B.value.length===0?(n(),o("div",Ct,[(n(),o("svg",St,[...e[26]||(e[26]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},null,-1)])])),e[29]||(e[29]=t("strong",null,"No skills match your filters",-1)),t("p",null,[e[27]||(e[27]=p(" Try a different category or search term, or ",-1)),t("button",{type:"button",class:"link-button",onClick:ie},"clear all filters"),e[28]||(e[28]=p(". ",-1))])])):(n(!0),o(x,{key:3},E(l.value,u=>(n(),o(x,{key:u.key},[m.value&&u.label?(n(),o("div",$t,[e[30]||(e[30]=t("span",{class:"source-group-icon","aria-hidden":"true"},"📦",-1)),t("strong",null,d(u.label),1),u.label!==u.repo?(n(),o("code",xt,d(u.repo),1)):f("",!0),t("span",It,d(u.skills.length)+" skill(s)",1)])):f("",!0),t("div",Lt,[(n(!0),o(x,null,E(u.skills,O=>(n(),ee(Ge,{key:`${u.key}-${O.id}`,skill:O,"inferred-category":j(O).inferred,"resolved-category-id":j(O).id,"on-open":$(s).navigateToSkill,"on-install":$(s).installSkill,"on-remove":$(s).removeSkill,"on-select-range":re},null,8,["skill","inferred-category","resolved-category-id","on-open","on-install","on-remove"]))),128))])],64))),128)),N(Y,{open:k.value,title:"Install every skill in the catalog?",message:`This will download and install ${L.value} skill(s) into your workspace. The active agent will be auto-synced when finished.`,"confirm-label":"Install all",onConfirm:z,onCancel:e[7]||(e[7]=u=>k.value=!1)},null,8,["open","message"]),N(Y,{open:g.value,tone:"danger",title:"Remove every installed skill?",message:`This will remove ${I.value} skill(s) from your workspace. Synced adapter targets will be cleaned up automatically. This cannot be undone (you can reinstall via 'Install all').`,"confirm-label":"Remove all",onConfirm:oe,onCancel:e[8]||(e[8]=u=>g.value=!1)},null,8,["open","message"])])}}}),Et=K(Mt,[["__scopeId","data-v-552dec63"]]);export{Et as default};
@@ -1 +1 @@
1
- import{S as _}from"./Skeleton-B_xm5L3P.js";import{d as f,u as h,o as k,f as t,h as e,j as y,t as l,i as d,F as m,k as v,r as u,s as b,l as S,e as s}from"./index-I0b-syhc.js";const w={class:"doctor-page",style:{padding:"24px",display:"grid",gap:"16px"}},z={class:"panel",style:{padding:"20px"}},D={style:{"margin-top":"12px",display:"flex",gap:"8px","align-items":"center"}},F=["disabled"],N={key:0},V={key:1},B={key:0,style:{"font-size":"12px",color:"var(--text-dim)"}},C={style:{"font-family":"monospace"}},E={key:0,class:"status-banner","data-tone":"error"},R={key:1,class:"panel",style:{padding:"8px",display:"grid",gap:"8px"}},j={key:2,class:"panel",style:{padding:"0",overflow:"hidden"}},A=["data-status"],H={style:{"font-family":"monospace","font-size":"12px",color:"var(--text)"}},L={style:{margin:"0",color:"var(--text)","font-size":"13px"}},M={key:0,style:{margin:"6px 0 0",color:"var(--text-dim)","font-size":"12px"}},P={key:3,class:"status-banner","data-tone":"success"},q=f({__name:"DoctorPage",setup(T){const g=h(),o=u(null),p=u(null),i=u(!1);async function c(){i.value=!0,p.value=null;try{o.value=await g.loadDoctor()}catch(r){p.value=r instanceof Error?r.message:String(r)}finally{i.value=!1}}k(c);function x(r){return r==="fail"?"✗":r==="warn"?"⚠":"✓"}return(r,n)=>(s(),t("section",w,[e("header",z,[n[0]||(n[0]=e("p",{class:"eyebrow"},"Diagnostics",-1)),n[1]||(n[1]=e("h2",{style:{margin:"6px 0 4px"}},"Doctor",-1)),n[2]||(n[2]=e("p",{style:{margin:"0",color:"var(--text-dim)","font-size":"13px"}}," Six health checks for the workspace and your environment. ",-1)),e("div",D,[e("button",{class:"button button-primary",type:"button",disabled:i.value,onClick:c},[i.value?(s(),t("span",N,"Running...")):(s(),t("span",V,"Re-run checks"))],8,F),o.value?(s(),t("span",B,[y(" Scope: "+l(o.value.scope)+" · State: ",1),e("code",C,l(o.value.stateDir),1)])):d("",!0)])]),p.value?(s(),t("div",E,l(p.value),1)):d("",!0),i.value&&!o.value?(s(),t("div",R,[(s(),t(m,null,v(4,a=>b(_,{key:`doctor-skel-${a}`,variant:"row"})),64))])):o.value?(s(),t("div",j,[(s(!0),t(m,null,v(o.value.checks,a=>(s(),t("div",{key:a.name,"data-status":a.status,style:{display:"grid","grid-template-columns":"32px 110px 1fr",gap:"14px",padding:"14px 18px","border-bottom":"1px solid rgba(63,63,70,0.3)","align-items":"start"}},[e("span",{style:S({fontWeight:700,color:a.status==="fail"?"var(--danger)":a.status==="warn"?"#facc15":"var(--success, #34d399)"})},l(x(a.status)),5),e("strong",H,l(a.name),1),e("div",null,[e("p",L,l(a.message),1),a.hint?(s(),t("p",M,[n[3]||(n[3]=e("strong",{style:{color:"var(--text-muted)"}},"Hint:",-1)),y(" "+l(a.hint),1)])):d("",!0)])],8,A))),128))])):d("",!0),o.value&&!o.value.hasFailures?(s(),t("div",P," All checks passed. ")):d("",!0)]))}});export{q as default};
1
+ import{S as _}from"./Skeleton-BISmLuhY.js";import{d as f,u as h,o as k,f as t,h as e,j as y,t as l,i as d,F as m,k as v,r as u,s as b,l as S,e as s}from"./index-DAVP4Xp_.js";const w={class:"doctor-page",style:{padding:"24px",display:"grid",gap:"16px"}},z={class:"panel",style:{padding:"20px"}},D={style:{"margin-top":"12px",display:"flex",gap:"8px","align-items":"center"}},F=["disabled"],N={key:0},V={key:1},B={key:0,style:{"font-size":"12px",color:"var(--text-dim)"}},C={style:{"font-family":"monospace"}},E={key:0,class:"status-banner","data-tone":"error"},R={key:1,class:"panel",style:{padding:"8px",display:"grid",gap:"8px"}},j={key:2,class:"panel",style:{padding:"0",overflow:"hidden"}},A=["data-status"],H={style:{"font-family":"monospace","font-size":"12px",color:"var(--text)"}},L={style:{margin:"0",color:"var(--text)","font-size":"13px"}},M={key:0,style:{margin:"6px 0 0",color:"var(--text-dim)","font-size":"12px"}},P={key:3,class:"status-banner","data-tone":"success"},q=f({__name:"DoctorPage",setup(T){const g=h(),o=u(null),p=u(null),i=u(!1);async function c(){i.value=!0,p.value=null;try{o.value=await g.loadDoctor()}catch(r){p.value=r instanceof Error?r.message:String(r)}finally{i.value=!1}}k(c);function x(r){return r==="fail"?"✗":r==="warn"?"⚠":"✓"}return(r,n)=>(s(),t("section",w,[e("header",z,[n[0]||(n[0]=e("p",{class:"eyebrow"},"Diagnostics",-1)),n[1]||(n[1]=e("h2",{style:{margin:"6px 0 4px"}},"Doctor",-1)),n[2]||(n[2]=e("p",{style:{margin:"0",color:"var(--text-dim)","font-size":"13px"}}," Six health checks for the workspace and your environment. ",-1)),e("div",D,[e("button",{class:"button button-primary",type:"button",disabled:i.value,onClick:c},[i.value?(s(),t("span",N,"Running...")):(s(),t("span",V,"Re-run checks"))],8,F),o.value?(s(),t("span",B,[y(" Scope: "+l(o.value.scope)+" · State: ",1),e("code",C,l(o.value.stateDir),1)])):d("",!0)])]),p.value?(s(),t("div",E,l(p.value),1)):d("",!0),i.value&&!o.value?(s(),t("div",R,[(s(),t(m,null,v(4,a=>b(_,{key:`doctor-skel-${a}`,variant:"row"})),64))])):o.value?(s(),t("div",j,[(s(!0),t(m,null,v(o.value.checks,a=>(s(),t("div",{key:a.name,"data-status":a.status,style:{display:"grid","grid-template-columns":"32px 110px 1fr",gap:"14px",padding:"14px 18px","border-bottom":"1px solid rgba(63,63,70,0.3)","align-items":"start"}},[e("span",{style:S({fontWeight:700,color:a.status==="fail"?"var(--danger)":a.status==="warn"?"#facc15":"var(--success, #34d399)"})},l(x(a.status)),5),e("strong",H,l(a.name),1),e("div",null,[e("p",L,l(a.message),1),a.hint?(s(),t("p",M,[n[3]||(n[3]=e("strong",{style:{color:"var(--text-muted)"}},"Hint:",-1)),y(" "+l(a.hint),1)])):d("",!0)])],8,A))),128))])):d("",!0),o.value&&!o.value.hasFailures?(s(),t("div",P," All checks passed. ")):d("",!0)]))}});export{q as default};
@@ -1 +1 @@
1
- import{d as p,f as i,h as s,x as n,e as a}from"./index-I0b-syhc.js";const r=(t,l)=>{const e=t.__vccOpts||t;for(const[d,o]of l)e[d]=o;return e},c={key:0,class:"skeleton skeleton-row"},v={key:1,class:"skeleton skeleton-card"},h=p({__name:"Skeleton",props:{variant:{}},setup(t){return(l,e)=>t.variant==="row"?(a(),i("div",c,[...e[0]||(e[0]=[s("div",{class:"skeleton-pill",style:{width:"18px",height:"18px"}},null,-1),s("div",{class:"skeleton-pill",style:{width:"80px",height:"14px"}},null,-1),s("div",{class:"skeleton-pill",style:{flex:"1",height:"14px"}},null,-1)])])):(a(),i("article",v,[...e[1]||(e[1]=[n('<div class="skeleton-pill" style="width:48px;height:48px;border-radius:12px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:65%;height:18px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:90%;height:12px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:75%;height:12px;" data-v-cb55574f></div><div style="display:flex;gap:6px;margin-top:8px;" data-v-cb55574f><div class="skeleton-pill" style="width:60px;height:20px;border-radius:999px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:48px;height:20px;border-radius:999px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:80px;height:20px;border-radius:999px;" data-v-cb55574f></div></div><div class="skeleton-pill" style="width:100%;height:36px;border-radius:10px;margin-top:12px;" data-v-cb55574f></div>',6)])]))}}),k=r(h,[["__scopeId","data-v-cb55574f"]]);export{k as S,r as _};
1
+ import{d as p,f as i,h as s,x as n,e as a}from"./index-DAVP4Xp_.js";const r=(t,l)=>{const e=t.__vccOpts||t;for(const[d,o]of l)e[d]=o;return e},c={key:0,class:"skeleton skeleton-row"},v={key:1,class:"skeleton skeleton-card"},h=p({__name:"Skeleton",props:{variant:{}},setup(t){return(l,e)=>t.variant==="row"?(a(),i("div",c,[...e[0]||(e[0]=[s("div",{class:"skeleton-pill",style:{width:"18px",height:"18px"}},null,-1),s("div",{class:"skeleton-pill",style:{width:"80px",height:"14px"}},null,-1),s("div",{class:"skeleton-pill",style:{flex:"1",height:"14px"}},null,-1)])])):(a(),i("article",v,[...e[1]||(e[1]=[n('<div class="skeleton-pill" style="width:48px;height:48px;border-radius:12px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:65%;height:18px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:90%;height:12px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:75%;height:12px;" data-v-cb55574f></div><div style="display:flex;gap:6px;margin-top:8px;" data-v-cb55574f><div class="skeleton-pill" style="width:60px;height:20px;border-radius:999px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:48px;height:20px;border-radius:999px;" data-v-cb55574f></div><div class="skeleton-pill" style="width:80px;height:20px;border-radius:999px;" data-v-cb55574f></div></div><div class="skeleton-pill" style="width:100%;height:36px;border-radius:10px;margin-top:12px;" data-v-cb55574f></div>',6)])]))}}),k=r(h,[["__scopeId","data-v-cb55574f"]]);export{k as S,r as _};
@@ -1 +1 @@
1
- import{d as $,v as N,u as z,w as R,o as T,f as i,h as t,p,j as h,i as c,t as o,F as k,s as m,x as D,l as E,k as b,m as w,e as a}from"./index-I0b-syhc.js";import{S as g,_ as Y}from"./Skeleton-B_xm5L3P.js";const A={class:"page-column"},F={class:"panel"},P={class:"detail-topbar"},K={class:"breadcrumbs","aria-label":"Breadcrumb"},O={key:0,class:"breadcrumb-sep","aria-hidden":"true"},U={key:1,class:"breadcrumb-segment"},q={class:"breadcrumb-current","aria-current":"page"},G={key:0,class:"detail-hero"},J={class:"detail-description"},Q={class:"detail-actions"},W=["title"],X={class:"panel detail-skeleton-grid"},Z={class:"panel"},tt={class:"detail-metadata-grid"},et={class:"metadata-card"},st={style:{"font-family":"monospace","font-size":"0.82rem"}},lt={class:"metadata-card"},it={class:"metadata-card"},at={style:{"font-family":"monospace"}},ot={class:"metadata-card"},nt={class:"detail-chip-sections"},rt={class:"chip-row"},dt={key:0,style:{"font-size":"0.8rem",color:"var(--text-dim)"}},ut={class:"chip-row"},ct={key:0,style:{"font-size":"0.8rem",color:"var(--text-dim)"}},pt={class:"panel"},vt={key:0,class:"error-card",style:{margin:"0 20px 20px"}},kt=["innerHTML"],ht={key:0,class:"panel"},mt={class:"related-grid"},bt={key:1,class:"panel"},gt={class:"panel-head"},yt={class:"panel-head-title"},wt={class:"related-grid"},_t=["title","onClick"],ft={class:"related-card-head"},xt={key:0,class:"related-installed-mark","aria-label":"Installed"},Ct={class:"related-card-tags"},St=$({__name:"SkillDetailPage",setup(Lt){const C=N(),r=z(),y=w(()=>typeof C.params.skillId=="string"?C.params.skillId:""),s=w(()=>r.state.detail);async function S(){y.value&&await r.loadSkillDetail(y.value)}R(y,()=>void S()),T(()=>void S());const _=w(()=>{var l,v;const u=(l=s.value)==null?void 0:l.skill;if(!u)return null;const e=(v=u.category)==null?void 0:v.trim();if(e)return e;const d=[u.id,...u.tags].join(" ").toLowerCase();return/git|commit|workflow|branch/.test(d)?"workflow":/test|jest|tdd|vitest|spec/.test(d)?"testing":/security|owasp|audit|guard/.test(d)?"security":/typescript|python|cpp-pro|c-pro|code-review|error-handling/.test(d)?"code":/docker|devops|ci|cd|helm/.test(d)?"devops":/wikipedia|arxiv|pubmed|web-search|web-scraper|research/.test(d)?"research":null}),f=w(()=>{var L,M,I;const u=(L=s.value)==null?void 0:L.skill;if(!u)return[];const e=((M=r.state.catalog)==null?void 0:M.skills)??[];if(e.length===0)return[];const d=new Set(u.tags.map(n=>n.toLowerCase())),l=(I=u.category)==null?void 0:I.trim().toLowerCase();return e.filter(n=>n.id!==u.id).map(n=>{var B;const x=n.tags.reduce((j,H)=>j+(d.has(H.toLowerCase())?1:0),0),V=l&&((B=n.category)==null?void 0:B.trim().toLowerCase())===l?.5:0;return{skill:n,score:x+V}}).filter(n=>n.score>0).sort((n,x)=>x.score-n.score).slice(0,4).map(n=>n.skill)});return(u,e)=>{var d;return a(),i("section",A,[t("div",F,[t("div",P,[t("nav",K,[t("button",{class:"breadcrumb-link",type:"button",onClick:e[0]||(e[0]=l=>p(r).navigateHome())},[...e[5]||(e[5]=[t("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12l9-9 9 9M5 10v10a1 1 0 001 1h3v-6h6v6h3a1 1 0 001-1V10"})],-1),h(" Catalog ",-1)])]),_.value?(a(),i("span",O,"/")):c("",!0),_.value?(a(),i("span",U,o(_.value),1)):c("",!0),e[6]||(e[6]=t("span",{class:"breadcrumb-sep","aria-hidden":"true"},"/",-1)),t("span",q,o(((d=s.value)==null?void 0:d.skill.name)??y.value),1)])]),s.value?(a(),i("div",G,[t("div",null,[e[7]||(e[7]=t("p",{class:"eyebrow"},"Skill",-1)),t("h2",null,o(s.value.skill.name),1),t("p",J,o(s.value.skill.description),1)]),t("div",Q,[t("button",{class:"button button-ghost",type:"button",onClick:e[1]||(e[1]=l=>p(r).syncNow()),title:"Re-sync this workspace's adapters"},[...e[8]||(e[8]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),h(" Sync ",-1)])]),s.value.skill.installed?(a(),i("button",{key:0,class:"button button-secondary",type:"button",title:`Re-fetch ${s.value.skill.id} from its source`,onClick:e[2]||(e[2]=l=>p(r).updateSkill(s.value.skill.id))},[...e[9]||(e[9]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 12a4 4 0 11-8 0 4 4 0 018 0zM12 8V4m0 16v-4m4-4h4M4 12h4"})],-1),h(" Update ",-1)])],8,W)):c("",!0),s.value.skill.installed?(a(),i("button",{key:2,class:"button button-danger",type:"button",onClick:e[4]||(e[4]=l=>p(r).removeSkill(s.value.skill.id))},[...e[11]||(e[11]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),h(" Remove ",-1)])])):(a(),i("button",{key:1,class:"button button-primary",type:"button",onClick:e[3]||(e[3]=l=>p(r).installSkill(s.value.skill))},[...e[10]||(e[10]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1),h(" Install ",-1)])]))])])):c("",!0)]),p(r).state.detailLoading&&!s.value?(a(),i(k,{key:0},[t("div",X,[m(g,{variant:"row"}),m(g,{variant:"row"}),m(g,{variant:"row"}),m(g,{variant:"row"})]),e[12]||(e[12]=D('<div class="panel" style="padding:18px;display:grid;gap:10px;" data-v-e10b653b><div class="skeleton-pill" style="width:30%;height:12px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:90%;height:14px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:80%;height:14px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:60%;height:14px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:75%;height:14px;border-radius:6px;" data-v-e10b653b></div></div>',1))],64)):s.value?(a(),i(k,{key:1},[t("div",Z,[t("div",tt,[t("article",et,[e[13]||(e[13]=t("span",null,"Skill ID",-1)),t("strong",st,o(s.value.skill.id),1)]),t("article",lt,[e[14]||(e[14]=t("span",null,"Source",-1)),t("strong",null,o(s.value.skill.source.label||s.value.skill.source.repo),1)]),t("article",it,[e[15]||(e[15]=t("span",null,"Version",-1)),t("strong",at,"v"+o(s.value.skill.version),1)]),t("article",ot,[e[16]||(e[16]=t("span",null,"Installed",-1)),t("strong",{style:E(s.value.skill.installed?"color:var(--accent)":"color:var(--text-muted)")},o(s.value.skill.installed?"✓ Yes":"No"),5)])]),t("div",nt,[t("div",null,[e[17]||(e[17]=t("p",{class:"section-label",style:{margin:"0 0 8px",display:"block"}},"Tags",-1)),t("div",rt,[(a(!0),i(k,null,b(s.value.skill.tags,l=>(a(),i("span",{key:l,class:"chip"},o(l),1))),128)),s.value.skill.tags.length===0?(a(),i("span",dt,"—")):c("",!0)])]),t("div",null,[e[18]||(e[18]=t("p",{class:"section-label",style:{margin:"0 0 8px",display:"block"}},"Compatibility",-1)),t("div",ut,[(a(!0),i(k,null,b(s.value.skill.compatibility,l=>(a(),i("span",{key:l,class:"chip chip-accent"},o(l),1))),128)),s.value.skill.compatibility.length===0?(a(),i("span",ct,"—")):c("",!0)])])])]),t("div",pt,[e[20]||(e[20]=t("div",{class:"panel-head"},[t("div",{class:"panel-head-title"},[t("p",{class:"eyebrow"},"Instructions"),t("h2",null,"SKILL.md"),t("p",null,"Content rendered by the backend.")])],-1)),s.value.instructionsError?(a(),i("div",vt,[e[19]||(e[19]=t("strong",null,"Instructions unavailable",-1)),t("p",null,o(s.value.instructionsError),1)])):(a(),i("article",{key:1,class:"markdown-body",innerHTML:s.value.instructionsHtml},null,8,kt))]),f.value.length===0&&p(r).state.catalog===null?(a(),i("div",ht,[e[21]||(e[21]=t("div",{class:"panel-head"},[t("div",{class:"panel-head-title"},[t("p",{class:"eyebrow"},"You might also like"),t("h2",null,"Related skills")])],-1)),t("div",mt,[(a(),i(k,null,b(4,l=>m(g,{key:`related-skel-${l}`,variant:"card"})),64))])])):f.value.length>0?(a(),i("div",bt,[t("div",gt,[t("div",yt,[e[22]||(e[22]=t("p",{class:"eyebrow"},"You might also like",-1)),e[23]||(e[23]=t("h2",null,"Related skills",-1)),t("p",null,"Suggested by shared tags"+o(s.value.skill.category?" and category":"")+".",1)])]),t("div",wt,[(a(!0),i(k,null,b(f.value,l=>(a(),i("button",{key:l.id,class:"related-card",type:"button",title:l.description,onClick:v=>p(r).navigateToSkill(l.id)},[t("div",ft,[t("strong",null,o(l.name),1),l.installed?(a(),i("span",xt,"✓")):c("",!0)]),t("p",null,o(l.description),1),t("div",Ct,[(a(!0),i(k,null,b(l.tags.slice(0,3),v=>(a(),i("span",{key:v,class:"chip",style:{height:"18px","font-size":"9px",padding:"0 6px"}},o(v),1))),128))])],8,_t))),128))])])):c("",!0)],64)):c("",!0)])}}}),Bt=Y(St,[["__scopeId","data-v-e10b653b"]]);export{Bt as default};
1
+ import{d as $,v as N,u as z,w as R,o as T,f as i,h as t,p,j as h,i as c,t as o,F as k,s as m,x as D,l as E,k as b,m as w,e as a}from"./index-DAVP4Xp_.js";import{S as g,_ as Y}from"./Skeleton-BISmLuhY.js";const A={class:"page-column"},F={class:"panel"},P={class:"detail-topbar"},K={class:"breadcrumbs","aria-label":"Breadcrumb"},O={key:0,class:"breadcrumb-sep","aria-hidden":"true"},U={key:1,class:"breadcrumb-segment"},q={class:"breadcrumb-current","aria-current":"page"},G={key:0,class:"detail-hero"},J={class:"detail-description"},Q={class:"detail-actions"},W=["title"],X={class:"panel detail-skeleton-grid"},Z={class:"panel"},tt={class:"detail-metadata-grid"},et={class:"metadata-card"},st={style:{"font-family":"monospace","font-size":"0.82rem"}},lt={class:"metadata-card"},it={class:"metadata-card"},at={style:{"font-family":"monospace"}},ot={class:"metadata-card"},nt={class:"detail-chip-sections"},rt={class:"chip-row"},dt={key:0,style:{"font-size":"0.8rem",color:"var(--text-dim)"}},ut={class:"chip-row"},ct={key:0,style:{"font-size":"0.8rem",color:"var(--text-dim)"}},pt={class:"panel"},vt={key:0,class:"error-card",style:{margin:"0 20px 20px"}},kt=["innerHTML"],ht={key:0,class:"panel"},mt={class:"related-grid"},bt={key:1,class:"panel"},gt={class:"panel-head"},yt={class:"panel-head-title"},wt={class:"related-grid"},_t=["title","onClick"],ft={class:"related-card-head"},xt={key:0,class:"related-installed-mark","aria-label":"Installed"},Ct={class:"related-card-tags"},St=$({__name:"SkillDetailPage",setup(Lt){const C=N(),r=z(),y=w(()=>typeof C.params.skillId=="string"?C.params.skillId:""),s=w(()=>r.state.detail);async function S(){y.value&&await r.loadSkillDetail(y.value)}R(y,()=>void S()),T(()=>void S());const _=w(()=>{var l,v;const u=(l=s.value)==null?void 0:l.skill;if(!u)return null;const e=(v=u.category)==null?void 0:v.trim();if(e)return e;const d=[u.id,...u.tags].join(" ").toLowerCase();return/git|commit|workflow|branch/.test(d)?"workflow":/test|jest|tdd|vitest|spec/.test(d)?"testing":/security|owasp|audit|guard/.test(d)?"security":/typescript|python|cpp-pro|c-pro|code-review|error-handling/.test(d)?"code":/docker|devops|ci|cd|helm/.test(d)?"devops":/wikipedia|arxiv|pubmed|web-search|web-scraper|research/.test(d)?"research":null}),f=w(()=>{var L,M,I;const u=(L=s.value)==null?void 0:L.skill;if(!u)return[];const e=((M=r.state.catalog)==null?void 0:M.skills)??[];if(e.length===0)return[];const d=new Set(u.tags.map(n=>n.toLowerCase())),l=(I=u.category)==null?void 0:I.trim().toLowerCase();return e.filter(n=>n.id!==u.id).map(n=>{var B;const x=n.tags.reduce((j,H)=>j+(d.has(H.toLowerCase())?1:0),0),V=l&&((B=n.category)==null?void 0:B.trim().toLowerCase())===l?.5:0;return{skill:n,score:x+V}}).filter(n=>n.score>0).sort((n,x)=>x.score-n.score).slice(0,4).map(n=>n.skill)});return(u,e)=>{var d;return a(),i("section",A,[t("div",F,[t("div",P,[t("nav",K,[t("button",{class:"breadcrumb-link",type:"button",onClick:e[0]||(e[0]=l=>p(r).navigateHome())},[...e[5]||(e[5]=[t("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12l9-9 9 9M5 10v10a1 1 0 001 1h3v-6h6v6h3a1 1 0 001-1V10"})],-1),h(" Catalog ",-1)])]),_.value?(a(),i("span",O,"/")):c("",!0),_.value?(a(),i("span",U,o(_.value),1)):c("",!0),e[6]||(e[6]=t("span",{class:"breadcrumb-sep","aria-hidden":"true"},"/",-1)),t("span",q,o(((d=s.value)==null?void 0:d.skill.name)??y.value),1)])]),s.value?(a(),i("div",G,[t("div",null,[e[7]||(e[7]=t("p",{class:"eyebrow"},"Skill",-1)),t("h2",null,o(s.value.skill.name),1),t("p",J,o(s.value.skill.description),1)]),t("div",Q,[t("button",{class:"button button-ghost",type:"button",onClick:e[1]||(e[1]=l=>p(r).syncNow()),title:"Re-sync this workspace's adapters"},[...e[8]||(e[8]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),h(" Sync ",-1)])]),s.value.skill.installed?(a(),i("button",{key:0,class:"button button-secondary",type:"button",title:`Re-fetch ${s.value.skill.id} from its source`,onClick:e[2]||(e[2]=l=>p(r).updateSkill(s.value.skill.id))},[...e[9]||(e[9]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 12a4 4 0 11-8 0 4 4 0 018 0zM12 8V4m0 16v-4m4-4h4M4 12h4"})],-1),h(" Update ",-1)])],8,W)):c("",!0),s.value.skill.installed?(a(),i("button",{key:2,class:"button button-danger",type:"button",onClick:e[4]||(e[4]=l=>p(r).removeSkill(s.value.skill.id))},[...e[11]||(e[11]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),h(" Remove ",-1)])])):(a(),i("button",{key:1,class:"button button-primary",type:"button",onClick:e[3]||(e[3]=l=>p(r).installSkill(s.value.skill))},[...e[10]||(e[10]=[t("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1),h(" Install ",-1)])]))])])):c("",!0)]),p(r).state.detailLoading&&!s.value?(a(),i(k,{key:0},[t("div",X,[m(g,{variant:"row"}),m(g,{variant:"row"}),m(g,{variant:"row"}),m(g,{variant:"row"})]),e[12]||(e[12]=D('<div class="panel" style="padding:18px;display:grid;gap:10px;" data-v-e10b653b><div class="skeleton-pill" style="width:30%;height:12px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:90%;height:14px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:80%;height:14px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:60%;height:14px;border-radius:6px;" data-v-e10b653b></div><div class="skeleton-pill" style="width:75%;height:14px;border-radius:6px;" data-v-e10b653b></div></div>',1))],64)):s.value?(a(),i(k,{key:1},[t("div",Z,[t("div",tt,[t("article",et,[e[13]||(e[13]=t("span",null,"Skill ID",-1)),t("strong",st,o(s.value.skill.id),1)]),t("article",lt,[e[14]||(e[14]=t("span",null,"Source",-1)),t("strong",null,o(s.value.skill.source.label||s.value.skill.source.repo),1)]),t("article",it,[e[15]||(e[15]=t("span",null,"Version",-1)),t("strong",at,"v"+o(s.value.skill.version),1)]),t("article",ot,[e[16]||(e[16]=t("span",null,"Installed",-1)),t("strong",{style:E(s.value.skill.installed?"color:var(--accent)":"color:var(--text-muted)")},o(s.value.skill.installed?"✓ Yes":"No"),5)])]),t("div",nt,[t("div",null,[e[17]||(e[17]=t("p",{class:"section-label",style:{margin:"0 0 8px",display:"block"}},"Tags",-1)),t("div",rt,[(a(!0),i(k,null,b(s.value.skill.tags,l=>(a(),i("span",{key:l,class:"chip"},o(l),1))),128)),s.value.skill.tags.length===0?(a(),i("span",dt,"—")):c("",!0)])]),t("div",null,[e[18]||(e[18]=t("p",{class:"section-label",style:{margin:"0 0 8px",display:"block"}},"Compatibility",-1)),t("div",ut,[(a(!0),i(k,null,b(s.value.skill.compatibility,l=>(a(),i("span",{key:l,class:"chip chip-accent"},o(l),1))),128)),s.value.skill.compatibility.length===0?(a(),i("span",ct,"—")):c("",!0)])])])]),t("div",pt,[e[20]||(e[20]=t("div",{class:"panel-head"},[t("div",{class:"panel-head-title"},[t("p",{class:"eyebrow"},"Instructions"),t("h2",null,"SKILL.md"),t("p",null,"Content rendered by the backend.")])],-1)),s.value.instructionsError?(a(),i("div",vt,[e[19]||(e[19]=t("strong",null,"Instructions unavailable",-1)),t("p",null,o(s.value.instructionsError),1)])):(a(),i("article",{key:1,class:"markdown-body",innerHTML:s.value.instructionsHtml},null,8,kt))]),f.value.length===0&&p(r).state.catalog===null?(a(),i("div",ht,[e[21]||(e[21]=t("div",{class:"panel-head"},[t("div",{class:"panel-head-title"},[t("p",{class:"eyebrow"},"You might also like"),t("h2",null,"Related skills")])],-1)),t("div",mt,[(a(),i(k,null,b(4,l=>m(g,{key:`related-skel-${l}`,variant:"card"})),64))])])):f.value.length>0?(a(),i("div",bt,[t("div",gt,[t("div",yt,[e[22]||(e[22]=t("p",{class:"eyebrow"},"You might also like",-1)),e[23]||(e[23]=t("h2",null,"Related skills",-1)),t("p",null,"Suggested by shared tags"+o(s.value.skill.category?" and category":"")+".",1)])]),t("div",wt,[(a(!0),i(k,null,b(f.value,l=>(a(),i("button",{key:l.id,class:"related-card",type:"button",title:l.description,onClick:v=>p(r).navigateToSkill(l.id)},[t("div",ft,[t("strong",null,o(l.name),1),l.installed?(a(),i("span",xt,"✓")):c("",!0)]),t("p",null,o(l.description),1),t("div",Ct,[(a(!0),i(k,null,b(l.tags.slice(0,3),v=>(a(),i("span",{key:v,class:"chip",style:{height:"18px","font-size":"9px",padding:"0 6px"}},o(v),1))),128))])],8,_t))),128))])])):c("",!0)],64)):c("",!0)])}}}),Bt=Y(St,[["__scopeId","data-v-e10b653b"]]);export{Bt as default};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CatalogPage-CbtMTkxd.js","assets/Skeleton-B_xm5L3P.js","assets/Skeleton-_Ooiw1nN.css","assets/recommended-D_i10hwH.js","assets/CatalogPage-W5MqylAz.css","assets/SkillDetailPage-5JHQLq3q.js","assets/SkillDetailPage-CBAaWpcc.css","assets/DoctorPage-oUZyX91t.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CatalogPage-CKEfRSvG.js","assets/Skeleton-BISmLuhY.js","assets/Skeleton-_Ooiw1nN.css","assets/recommended-D_i10hwH.js","assets/CatalogPage-W5MqylAz.css","assets/SkillDetailPage-CWGjTH2M.js","assets/SkillDetailPage-CBAaWpcc.css","assets/DoctorPage-C92pEVl_.js"])))=>i.map(i=>d[i]);
2
2
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/**
3
3
  * @vue/shared v3.5.32
4
4
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -23,4 +23,4 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CatalogPage-Cbt
23
23
  * vue-router v4.6.4
24
24
  * (c) 2025 Eduardo San Martin Morote
25
25
  * @license MIT
26
- */let ou=()=>location.protocol+"//"+location.host;function Bi(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let i=r.includes(e.slice(o))?e.slice(o).length:1,l=r.slice(i);return l[0]!=="/"&&(l="/"+l),Zr(l,"")}return Zr(n,e)+s+r}function iu(e,t,n,s){let r=[],o=[],i=null;const l=({state:h})=>{const v=Bi(e,location),O=n.value,R=t.value;let $=0;if(h){if(n.value=v,t.value=h,i&&i===O){i=null;return}$=R?h.position-R.position:0}else s(v);r.forEach(V=>{V(n.value,O,{delta:$,type:Ns.pop,direction:$?$>0?vs.forward:vs.back:vs.unknown})})};function a(){i=n.value}function u(h){r.push(h);const v=()=>{const O=r.indexOf(h);O>-1&&r.splice(O,1)};return o.push(v),v}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(oe({},h.state,{scroll:ts()}),"")}}function d(){for(const h of o)h();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:a,listen:u,destroy:d}}function ro(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?ts():null}}function lu(e){const{history:t,location:n}=window,s={value:Bi(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(a,u,c){const d=e.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+a:ou()+e+a;try{t[c?"replaceState":"pushState"](u,"",h),r.value=u}catch(v){console.error(v),n[c?"replace":"assign"](h)}}function i(a,u){o(a,oe({},t.state,ro(r.value.back,a,r.value.forward,!0),u,{position:r.value.position}),!0),s.value=a}function l(a,u){const c=oe({},r.value,t.state,{forward:a,scroll:ts()});o(c.current,c,!0),o(a,oe({},ro(s.value,a,null),{position:c.position+1},u),!1),s.value=a}return{location:s,state:r,push:l,replace:i}}function au(e){e=Gc(e);const t=lu(e),n=iu(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=oe({location:"",base:e,go:s,createHref:qc.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Mt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var _e=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(_e||{});const cu={type:Mt.Static,value:""},uu=/[a-zA-Z0-9_]/;function fu(e){if(!e)return[[]];if(e==="/")return[[cu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${u}": ${v}`)}let n=_e.Static,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let l=0,a,u="",c="";function d(){u&&(n===_e.Static?o.push({type:Mt.Static,value:u}):n===_e.Param||n===_e.ParamRegExp||n===_e.ParamRegExpEnd?(o.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Mt.Param,value:u,regexp:c,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==_e.ParamRegExp){s=n,n=_e.EscapeNext;continue}switch(n){case _e.Static:a==="/"?(u&&d(),i()):a===":"?(d(),n=_e.Param):h();break;case _e.EscapeNext:h(),n=s;break;case _e.Param:a==="("?n=_e.ParamRegExp:uu.test(a)?h():(d(),n=_e.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case _e.ParamRegExp:a===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+a:n=_e.ParamRegExpEnd:c+=a;break;case _e.ParamRegExpEnd:d(),n=_e.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,c="";break;default:t("Unknown state");break}}return n===_e.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),d(),i(),r}const oo="[^/]+?",du={sensitive:!1,strict:!1,start:!0,end:!0};var Ie=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Ie||{});const pu=/[.+*?^${}()[\]/\\]/g;function hu(e,t){const n=oe({},du,t),s=[];let r=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Ie.Root];n.strict&&!u.length&&(r+="/");for(let d=0;d<u.length;d++){const h=u[d];let v=Ie.Segment+(n.sensitive?Ie.BonusCaseSensitive:0);if(h.type===Mt.Static)d||(r+="/"),r+=h.value.replace(pu,"\\$&"),v+=Ie.Static;else if(h.type===Mt.Param){const{value:O,repeatable:R,optional:$,regexp:V}=h;o.push({name:O,repeatable:R,optional:$});const P=V||oo;if(P!==oo){v+=Ie.BonusCustomRegExp;try{`${P}`}catch(g){throw new Error(`Invalid custom RegExp for param "${O}" (${P}): `+g.message)}}let H=R?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;d||(H=$&&u.length<2?`(?:/${H})`:"/"+H),$&&(H+="?"),r+=H,v+=Ie.Dynamic,$&&(v+=Ie.BonusOptional),R&&(v+=Ie.BonusRepeatable),P===".*"&&(v+=Ie.BonusWildcard)}c.push(v)}s.push(c)}if(n.strict&&n.end){const u=s.length-1;s[u][s[u].length-1]+=Ie.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const i=new RegExp(r,n.sensitive?"":"i");function l(u){const c=u.match(i),d={};if(!c)return null;for(let h=1;h<c.length;h++){const v=c[h]||"",O=o[h-1];d[O.name]=v&&O.repeatable?v.split("/"):v}return d}function a(u){let c="",d=!1;for(const h of e){(!d||!c.endsWith("/"))&&(c+="/"),d=!1;for(const v of h)if(v.type===Mt.Static)c+=v.value;else if(v.type===Mt.Param){const{value:O,repeatable:R,optional:$}=v,V=O in u?u[O]:"";if(Xe(V)&&!R)throw new Error(`Provided param "${O}" is an array but it is not repeatable (* or + modifiers)`);const P=Xe(V)?V.join("/"):V;if(!P)if($)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):d=!0);else throw new Error(`Missing required param "${O}"`);c+=P}}return c||"/"}return{re:i,score:s,keys:o,parse:l,stringify:a}}function gu(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Ie.Static+Ie.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ie.Static+Ie.Segment?1:-1:0}function ji(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const o=gu(s[n],r[n]);if(o)return o;n++}if(Math.abs(r.length-s.length)===1){if(io(s))return 1;if(io(r))return-1}return r.length-s.length}function io(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const mu={strict:!1,end:!0,sensitive:!1};function vu(e,t,n){const s=hu(fu(e.path),n),r=oe(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function yu(e,t){const n=[],s=new Map;t=Xr(mu,t);function r(d){return s.get(d)}function o(d,h,v){const O=!v,R=ao(d);R.aliasOf=v&&v.record;const $=Xr(t,d),V=[R];if("alias"in d){const g=typeof d.alias=="string"?[d.alias]:d.alias;for(const _ of g)V.push(ao(oe({},R,{components:v?v.record.components:R.components,path:_,aliasOf:v?v.record:R})))}let P,H;for(const g of V){const{path:_}=g;if(h&&_[0]!=="/"){const M=h.record.path,D=M[M.length-1]==="/"?"":"/";g.path=h.record.path+(_&&D+_)}if(P=vu(g,h,$),v?v.alias.push(P):(H=H||P,H!==P&&H.alias.push(P),O&&d.name&&!co(P)&&i(d.name)),Hi(P)&&a(P),R.children){const M=R.children;for(let D=0;D<M.length;D++)o(M[D],P,v&&v.children[D])}v=v||P}return H?()=>{i(H)}:pn}function i(d){if(Mi(d)){const h=s.get(d);h&&(s.delete(d),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(d);h>-1&&(n.splice(h,1),d.record.name&&s.delete(d.record.name),d.children.forEach(i),d.alias.forEach(i))}}function l(){return n}function a(d){const h=Su(d,n);n.splice(h,0,d),d.record.name&&!co(d)&&s.set(d.record.name,d)}function u(d,h){let v,O={},R,$;if("name"in d&&d.name){if(v=s.get(d.name),!v)throw Yt(me.MATCHER_NOT_FOUND,{location:d});$=v.record.name,O=oe(lo(h.params,v.keys.filter(H=>!H.optional).concat(v.parent?v.parent.keys.filter(H=>H.optional):[]).map(H=>H.name)),d.params&&lo(d.params,v.keys.map(H=>H.name))),R=v.stringify(O)}else if(d.path!=null)R=d.path,v=n.find(H=>H.re.test(R)),v&&(O=v.parse(R),$=v.record.name);else{if(v=h.name?s.get(h.name):n.find(H=>H.re.test(h.path)),!v)throw Yt(me.MATCHER_NOT_FOUND,{location:d,currentLocation:h});$=v.record.name,O=oe({},h.params,d.params),R=v.stringify(O)}const V=[];let P=v;for(;P;)V.unshift(P.record),P=P.parent;return{name:$,path:R,params:O,matched:V,meta:_u(V)}}e.forEach(d=>o(d));function c(){n.length=0,s.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:l,getRecordMatcher:r}}function lo(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function ao(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function bu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function co(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _u(e){return e.reduce((t,n)=>oe(t,n.meta),{})}function Su(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;ji(e,t[o])<0?s=o:n=o+1}const r=wu(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function wu(e){let t=e;for(;t=t.parent;)if(Hi(t)&&ji(e,t)===0)return t}function Hi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function uo(e){const t=Ge(ns),n=Ge(or),s=xe(()=>{const a=X(e.to);return t.resolve(a)}),r=xe(()=>{const{matched:a}=s.value,{length:u}=a,c=a[u-1],d=n.matched;if(!c||!d.length)return-1;const h=d.findIndex(Jt.bind(null,c));if(h>-1)return h;const v=fo(a[u-2]);return u>1&&fo(c)===v&&d[d.length-1].path!==v?d.findIndex(Jt.bind(null,a[u-2])):h}),o=xe(()=>r.value>-1&&Ru(n.params,s.value.params)),i=xe(()=>r.value>-1&&r.value===n.matched.length-1&&Li(n.params,s.value.params));function l(a={}){if(Cu(a)){const u=t[X(e.replace)?"replace":"push"](X(e.to)).catch(pn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:s,href:xe(()=>s.value.href),isActive:o,isExactActive:i,navigate:l}}function Eu(e){return e.length===1?e[0]:e}const xu=Ys({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:uo,setup(e,{slots:t}){const n=En(uo(e)),{options:s}=Ge(ns),r=xe(()=>({[po(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[po(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Eu(t.default(n));return e.custom?o:sr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),Au=xu;function Cu(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ru(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Xe(r)||r.length!==s.length||s.some((o,i)=>o.valueOf()!==r[i].valueOf()))return!1}return!0}function fo(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const po=(e,t,n)=>e??t??n,Tu=Ys({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ge(Ls),r=xe(()=>e.route||s.value),o=Ge(so,0),i=xe(()=>{let u=X(o);const{matched:c}=r.value;let d;for(;(d=c[u])&&!d.components;)u++;return u}),l=xe(()=>r.value.matched[i.value]);In(so,xe(()=>i.value+1)),In(su,l),In(Ls,r);const a=Nt();return jt(()=>[a.value,l.value,e.name],([u,c,d],[h,v,O])=>{c&&(c.instances[d]=u,v&&v!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=v.leaveGuards),c.updateGuards.size||(c.updateGuards=v.updateGuards))),u&&c&&(!v||!Jt(c,v)||!h)&&(c.enterCallbacks[d]||[]).forEach(R=>R(u))},{flush:"post"}),()=>{const u=r.value,c=e.name,d=l.value,h=d&&d.components[c];if(!h)return ho(n.default,{Component:h,route:u});const v=d.props[c],O=v?v===!0?u.params:typeof v=="function"?v(u):v:null,$=sr(h,oe({},O,t,{onVnodeUnmounted:V=>{V.component.isUnmounted&&(d.instances[c]=null)},ref:a}));return ho(n.default,{Component:$,route:u})||$}}});function ho(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ou=Tu;function Iu(e){const t=yu(e.routes,e),n=e.parseQuery||tu,s=e.stringifyQuery||no,r=e.history,o=sn(),i=sn(),l=sn(),a=wl(Et);let u=Et;$t&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=gs.bind(null,S=>""+S),d=gs.bind(null,Bc),h=gs.bind(null,Sn);function v(S,j){let L,U;return Mi(S)?(L=t.getRecordMatcher(S),U=j):U=S,t.addRoute(U,L)}function O(S){const j=t.getRecordMatcher(S);j&&t.removeRoute(j)}function R(){return t.getRoutes().map(S=>S.record)}function $(S){return!!t.getRecordMatcher(S)}function V(S,j){if(j=oe({},j||a.value),typeof S=="string"){const m=ms(n,S,j.path),y=t.resolve({path:m.path},j),w=r.createHref(m.fullPath);return oe(m,y,{params:h(y.params),hash:Sn(m.hash),redirectedFrom:void 0,href:w})}let L;if(S.path!=null)L=oe({},S,{path:ms(n,S.path,j.path).path});else{const m=oe({},S.params);for(const y in m)m[y]==null&&delete m[y];L=oe({},S,{params:d(m)}),j.params=d(j.params)}const U=t.resolve(L,j),Z=S.hash||"";U.params=c(h(U.params));const f=Vc(s,oe({},S,{hash:Lc(Z),path:U.path})),p=r.createHref(f);return oe({fullPath:f,hash:Z,query:s===no?nu(S.query):S.query||{}},U,{redirectedFrom:void 0,href:p})}function P(S){return typeof S=="string"?ms(n,S,a.value.path):oe({},S)}function H(S,j){if(u!==S)return Yt(me.NAVIGATION_CANCELLED,{from:j,to:S})}function g(S){return D(S)}function _(S){return g(oe(P(S),{replace:!0}))}function M(S,j){const L=S.matched[S.matched.length-1];if(L&&L.redirect){const{redirect:U}=L;let Z=typeof U=="function"?U(S,j):U;return typeof Z=="string"&&(Z=Z.includes("?")||Z.includes("#")?Z=P(Z):{path:Z},Z.params={}),oe({query:S.query,hash:S.hash,params:Z.path!=null?{}:S.params},Z)}}function D(S,j){const L=u=V(S),U=a.value,Z=S.state,f=S.force,p=S.replace===!0,m=M(L,U);if(m)return D(oe(P(m),{state:typeof m=="object"?oe({},Z,m.state):Z,force:f,replace:p}),j||L);const y=L;y.redirectedFrom=j;let w;return!f&&Uc(s,U,L)&&(w=Yt(me.NAVIGATION_DUPLICATED,{to:y,from:U}),Fe(U,U,!0,!1)),(w?Promise.resolve(w):Y(y,U)).catch(b=>pt(b)?pt(b,me.NAVIGATION_GUARD_REDIRECT)?b:We(b):te(b,y,U)).then(b=>{if(b){if(pt(b,me.NAVIGATION_GUARD_REDIRECT))return D(oe({replace:p},P(b.to),{state:typeof b.to=="object"?oe({},Z,b.to.state):Z,force:f}),j||y)}else b=N(y,U,!0,p,Z);return ee(y,U,b),b})}function W(S,j){const L=H(S,j);return L?Promise.reject(L):Promise.resolve()}function B(S){const j=ut.values().next().value;return j&&typeof j.runWithContext=="function"?j.runWithContext(S):S()}function Y(S,j){let L;const[U,Z,f]=ru(S,j);L=ys(U.reverse(),"beforeRouteLeave",S,j);for(const m of U)m.leaveGuards.forEach(y=>{L.push(At(y,S,j))});const p=W.bind(null,S,j);return L.push(p),Ue(L).then(()=>{L=[];for(const m of o.list())L.push(At(m,S,j));return L.push(p),Ue(L)}).then(()=>{L=ys(Z,"beforeRouteUpdate",S,j);for(const m of Z)m.updateGuards.forEach(y=>{L.push(At(y,S,j))});return L.push(p),Ue(L)}).then(()=>{L=[];for(const m of f)if(m.beforeEnter)if(Xe(m.beforeEnter))for(const y of m.beforeEnter)L.push(At(y,S,j));else L.push(At(m.beforeEnter,S,j));return L.push(p),Ue(L)}).then(()=>(S.matched.forEach(m=>m.enterCallbacks={}),L=ys(f,"beforeRouteEnter",S,j,B),L.push(p),Ue(L))).then(()=>{L=[];for(const m of i.list())L.push(At(m,S,j));return L.push(p),Ue(L)}).catch(m=>pt(m,me.NAVIGATION_CANCELLED)?m:Promise.reject(m))}function ee(S,j,L){l.list().forEach(U=>B(()=>U(S,j,L)))}function N(S,j,L,U,Z){const f=H(S,j);if(f)return f;const p=j===Et,m=$t?history.state:{};L&&(U||p?r.replace(S.fullPath,oe({scroll:p&&m&&m.scroll},Z)):r.push(S.fullPath,Z)),a.value=S,Fe(S,j,L,p),We()}let x;function E(){x||(x=r.listen((S,j,L)=>{if(!Tt.listening)return;const U=V(S),Z=M(U,Tt.currentRoute.value);if(Z){D(oe(Z,{replace:!0,force:!0}),U).catch(pn);return}u=U;const f=a.value;$t&&Jc(to(f.fullPath,L.delta),ts()),Y(U,f).catch(p=>pt(p,me.NAVIGATION_ABORTED|me.NAVIGATION_CANCELLED)?p:pt(p,me.NAVIGATION_GUARD_REDIRECT)?(D(oe(P(p.to),{force:!0}),U).then(m=>{pt(m,me.NAVIGATION_ABORTED|me.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===Ns.pop&&r.go(-1,!1)}).catch(pn),Promise.reject()):(L.delta&&r.go(-L.delta,!1),te(p,U,f))).then(p=>{p=p||N(U,f,!1),p&&(L.delta&&!pt(p,me.NAVIGATION_CANCELLED)?r.go(-L.delta,!1):L.type===Ns.pop&&pt(p,me.NAVIGATION_ABORTED|me.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),ee(U,f,p)}).catch(pn)}))}let be=sn(),de=sn(),se;function te(S,j,L){We(S);const U=de.list();return U.length?U.forEach(Z=>Z(S,j,L)):console.error(S),Promise.reject(S)}function Ve(){return se&&a.value!==Et?Promise.resolve():new Promise((S,j)=>{be.add([S,j])})}function We(S){return se||(se=!S,E(),be.list().forEach(([j,L])=>S?L(S):j()),be.reset()),S}function Fe(S,j,L,U){const{scrollBehavior:Z}=e;if(!$t||!Z)return Promise.resolve();const f=!L&&Yc(to(S.fullPath,0))||(U||!L)&&history.state&&history.state.scroll||null;return Uo().then(()=>Z(S,j,f)).then(p=>p&&Qc(p)).catch(p=>te(p,S,j))}const we=S=>r.go(S);let z;const ut=new Set,Tt={currentRoute:a,listening:!0,addRoute:v,removeRoute:O,clearRoutes:t.clearRoutes,hasRoute:$,getRoutes:R,resolve:V,options:e,push:g,replace:_,go:we,back:()=>we(-1),forward:()=>we(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:de.add,isReady:Ve,install(S){S.component("RouterLink",Au),S.component("RouterView",Ou),S.config.globalProperties.$router=Tt,Object.defineProperty(S.config.globalProperties,"$route",{enumerable:!0,get:()=>X(a)}),$t&&!z&&a.value===Et&&(z=!0,g(r.location).catch(U=>{}));const j={};for(const U in Et)Object.defineProperty(j,U,{get:()=>a.value[U],enumerable:!0});S.provide(ns,Tt),S.provide(or,Bo(j)),S.provide(Ls,a);const L=S.unmount;ut.add(S),S.unmount=function(){ut.delete(S),ut.size<1&&(u=Et,x&&x(),x=null,a.value=Et,z=!1,se=!1),L()}}};function Ue(S){return S.reduce((j,L)=>j.then(()=>B(L)),Promise.resolve())}return Tt}function Pu(){return Ge(ns)}function ku(e){return Ge(or)}const Nu=()=>es(()=>import("./CatalogPage-CbtMTkxd.js"),__vite__mapDeps([0,1,2,3,4])),Du=()=>es(()=>import("./SkillDetailPage-5JHQLq3q.js"),__vite__mapDeps([5,1,2,6])),Lu=()=>es(()=>import("./DoctorPage-oUZyX91t.js"),__vite__mapDeps([7,1,2]));function Mu(e){return Iu({history:au(),routes:[{path:"/",name:"catalog",component:Nu},{path:"/skills/:skillId",name:"skill-detail",component:Du,props:!0},{path:"/doctor",name:"doctor",component:Lu}],scrollBehavior(){return{top:0}}})}function Fu(e){async function t(n,s={}){var l;const r=new URL(n,window.location.origin);s.query?r.search=s.query.toString():(s.method===void 0||s.method==="GET"||s.method==="DELETE")&&r.searchParams.set("scope",e.getScope());const o=await fetch(r,{method:s.method||"GET",headers:{"x-skillex-token":e.token,...s.body?{"content-type":"application/json"}:{}},body:s.body?JSON.stringify({...s.body,scope:e.getScope()}):void 0}),i=await o.json().catch(()=>({}));if(!o.ok)throw new Error(((l=i.error)==null?void 0:l.message)||`Request failed with ${o.status}`);return i}return{getState(){return t("/api/state")},getDoctor(){return t("/api/doctor")},getCatalog(){return t("/api/catalog")},getSkillDetail(n){return t(`/api/catalog/${encodeURIComponent(n)}`)},getSources(){return t("/api/sources")},installSkill(n,s){return t("/api/install",{method:"POST",body:{skillIds:[n],...s!=null&&s.repo?{repo:s.repo}:{},...s!=null&&s.ref?{ref:s.ref}:{}}})},installAll(n){return t("/api/install",{method:"POST",body:{all:!0,...n!=null&&n.repo?{repo:n.repo}:{},...n!=null&&n.ref?{ref:n.ref}:{}}})},installSkillIds(n,s){return t("/api/install",{method:"POST",body:{skillIds:n,...s!=null&&s.repo?{repo:s.repo}:{},...s!=null&&s.ref?{ref:s.ref}:{}}})},removeSkills(n){return t("/api/remove",{method:"POST",body:{skillIds:n}})},removeSkill(n){return t("/api/remove",{method:"POST",body:{skillIds:[n]}})},updateSkill(n){return t("/api/update",{method:"POST",body:n?{skillIds:[n]}:{}})},syncSkills(n){return t("/api/sync",{method:"POST",body:n==="all"?{}:{adapter:n}})},addSource(n){return t("/api/sources",{method:"POST",body:n})},removeSource(n){const s=new URLSearchParams;return s.set("scope",e.getScope()),t(`/api/sources/${encodeURIComponent(n)}`,{method:"DELETE",query:s})}}}function Bu(e){return Object.values(e||{}).sort((t,n)=>n.syncedAt.localeCompare(t.syncedAt))}function bs(e){return e instanceof Error?e.message:String(e)}const Ms="skillex.selection";function ju(){try{const e=window.localStorage.getItem(Ms);if(!e)return null;const t=JSON.parse(e);return!t||!Array.isArray(t.ids)?null:t}catch{return null}}function Hu(e){try{if(!e||e.ids.length===0){window.localStorage.removeItem(Ms);return}window.localStorage.setItem(Ms,JSON.stringify(e))}catch{}}const Vi=Symbol("skillex-store");function Vu(e,t){const n=En({bootstrap:t,scope:t.initialScope,syncAdapter:"all",searchQuery:"",dashboard:null,catalog:null,detail:null,detailLoading:!1,initialized:!1,busyLabel:null,busyCards:new Set,selectedSkillIds:new Set,selectionAnchorId:null,doctorStatus:null,notice:null,toast:{visible:!1,tone:"info",message:""}}),s=Fu({token:t.token,getScope:()=>n.scope});let r=null;function o(){return{token:t.token,scope:n.scope}}function i(g,_){n.notice={message:g,tone:_},n.toast.visible=!0,n.toast.message=g,n.toast.tone=_,r&&clearTimeout(r),r=setTimeout(()=>{n.toast.visible=!1},2600)}async function l(){const[g,_]=await Promise.all([s.getState(),s.getCatalog()]);n.dashboard=g,n.catalog=_}async function a(g){await l(),g&&await O(g)}async function u(g,_,M){n.busyLabel=g;try{await _(),await a(M),i(`${g} complete.`,"success"),d()}catch(D){const W=bs(D);throw n.notice={message:W,tone:"error"},i(W,"error"),D}finally{n.busyLabel=null}}async function c(g,_,M,D){const W=new Set(n.busyCards);W.add(g),n.busyCards=W;try{await M(),await a(D),i(`${_} complete.`,"success"),d()}catch(B){const Y=bs(B);throw n.notice={message:Y,tone:"error"},i(Y,"error"),B}finally{const B=new Set(n.busyCards);B.delete(g),n.busyCards=B}}async function d(){try{const g=await s.getDoctor();g.hasFailures?n.doctorStatus="fail":g.checks.some(_=>_.status==="warn")?n.doctorStatus="warn":n.doctorStatus="pass"}catch{}}async function h(){n.detail=null,await e.push({name:"catalog",query:o()})}async function v(g){await e.push({name:"skill-detail",params:{skillId:g},query:o()})}async function O(g){n.detailLoading=!0;try{n.detail=await s.getSkillDetail(g)}catch(_){throw n.detail=null,i(bs(_),"error"),_}finally{n.detailLoading=!1}}async function R(g){var M;if(n.initialized){g&&await O(g);return}n.initialized=!0,await l(),d();const _=ju();if(_&&_.scope===n.scope){const D=new Set((((M=n.catalog)==null?void 0:M.skills)??[]).map(B=>B.id)),W=_.ids.filter(B=>D.has(B));W.length>0&&(n.selectedSkillIds=new Set(W),_.anchor&&W.includes(_.anchor)?n.selectionAnchorId=_.anchor:n.selectionAnchorId=W[W.length-1]??null)}g&&await O(g)}jt(()=>({ids:[...n.selectedSkillIds],anchor:n.selectionAnchorId,scope:n.scope,initialized:n.initialized}),g=>{g.initialized&&Hu({scope:g.scope,ids:g.ids,anchor:g.anchor})},{deep:!1});async function $(g){if(n.scope===g)return;n.scope=g;const _=typeof e.currentRoute.value.params.skillId=="string"?e.currentRoute.value.params.skillId:null;_?await e.replace({name:"skill-detail",params:{skillId:_},query:o()}):await e.replace({name:"catalog",query:o()}),await a(_)}const V=xe(()=>{var M;const g=((M=n.catalog)==null?void 0:M.skills)||[],_=n.searchQuery.trim().toLowerCase();return _?g.filter(D=>[D.id,D.name,D.description,D.author||"",D.source.label||"",D.source.repo,...D.tags,...D.compatibility].join(" ").toLowerCase().includes(_)):g}),P=xe(()=>{var _;const g=((_=n.dashboard)==null?void 0:_.adapters.supported)||[];return[{value:"all",label:"All detected"},...g.map(M=>({value:M.id,label:M.label}))]}),H=xe(()=>{var g;return Bu(((g=n.dashboard)==null?void 0:g.syncHistory)||{})});return{state:n,filteredSkills:V,availableSyncAdapters:P,recentSyncTargets:H,initialize:R,refreshAll:l,async loadSkillDetail(g){await O(g)},clearDetail(){n.detail=null},async navigateHome(){await h()},async navigateToSkill(g){await v(g)},async setScope(g){await $(g)},setSyncAdapter(g){n.syncAdapter=g||"all"},async installSkill(g){var _;await c(g.id,`Installed ${g.name}`,()=>s.installSkill(g.id,{repo:g.source.repo,ref:g.source.ref}),((_=n.detail)==null?void 0:_.skill.id)||null)},async installAll(g){var M;let _={installedCount:0};return await u("Installing every skill in the catalog",async()=>{_=await s.installAll(g)},((M=n.detail)==null?void 0:M.skill.id)||null),_},async installRecommended(){var Y,ee,N;const{RECOMMENDED_SKILL_IDS:g}=await es(async()=>{const{RECOMMENDED_SKILL_IDS:x}=await import("./recommended-D_i10hwH.js");return{RECOMMENDED_SKILL_IDS:x}},[]),_=new Set((((Y=n.catalog)==null?void 0:Y.skills)??[]).map(x=>x.id)),M=new Set((((ee=n.dashboard)==null?void 0:ee.installed)??[]).map(x=>x.id)),D=g.filter(x=>_.has(x)&&!M.has(x)),W=g.filter(x=>!_.has(x));if(D.length===0)return i(W.length>0?`Recommended pack already installed (skipped ${W.length} not in catalog).`:"Recommended pack is already installed.","info"),{installedCount:0,missing:[...W]};let B={installedCount:0,missing:[...W]};return await u(`Installing ${D.length} recommended skill(s)`,async()=>{B={installedCount:(await s.installSkillIds([...D])).installedCount,missing:[...W]}},((N=n.detail)==null?void 0:N.skill.id)||null),B},async removeSkill(g){var M;const _=((M=n.detail)==null?void 0:M.skill.id)||null;await c(g,`Removed ${g}`,()=>s.removeSkill(g),_===g?null:_),_===g&&(n.detail=null,await h())},async removeAllInstalled(){var M;const g=(((M=n.dashboard)==null?void 0:M.installed)??[]).map(D=>D.id);if(g.length===0)return{removedCount:0};let _={removedCount:0};return await u(`Removing ${g.length} installed skill(s)`,async()=>{_={removedCount:(await s.removeSkills(g)).removedSkills.length}}),_},async updateSkill(g){var _,M;g?await c(g,`Updated ${g}`,()=>s.updateSkill(g),((_=n.detail)==null?void 0:_.skill.id)||null):await u("Updated installed skills",()=>s.updateSkill(g),((M=n.detail)==null?void 0:M.skill.id)||null)},async syncNow(){var g;await u("Sync finished",()=>s.syncSkills(n.syncAdapter),((g=n.detail)==null?void 0:g.skill.id)||null)},async addSource(g){var _;await u(`Added ${g.repo}`,()=>s.addSource(g),((_=n.detail)==null?void 0:_.skill.id)||null)},async removeSource(g){var _;await u(`Removed ${g}`,()=>s.removeSource(g),((_=n.detail)==null?void 0:_.skill.id)||null)},setSearchQuery(g){n.searchQuery=g},clearNotice(){n.notice=null},async loadDoctorStatus(){await d()},loadDoctor(){return s.getDoctor()},toggleSelectedSkill(g){const _=new Set(n.selectedSkillIds);_.has(g)?_.delete(g):_.add(g),n.selectedSkillIds=_,n.selectionAnchorId=g},selectRangeFromAnchor(g,_){const M=n.selectionAnchorId;if(!M||!_.includes(M)||!_.includes(g)){const x=new Set(n.selectedSkillIds);x.has(g)?x.delete(g):x.add(g),n.selectedSkillIds=x,n.selectionAnchorId=g;return}const D=_.indexOf(M),W=_.indexOf(g),[B,Y]=D<=W?[D,W]:[W,D],ee=_.slice(B,Y+1),N=new Set(n.selectedSkillIds);for(const x of ee)N.add(x);n.selectedSkillIds=N,n.selectionAnchorId=g},setSelectedSkills(g){n.selectedSkillIds=new Set(g),n.selectionAnchorId=g[g.length-1]??null},clearSelection(){n.selectedSkillIds.size===0&&n.selectionAnchorId===null||(n.selectedSkillIds=new Set,n.selectionAnchorId=null)},async installSelectedSkills(){var D,W;const g=new Set((((D=n.dashboard)==null?void 0:D.installed)??[]).map(B=>B.id)),_=[...n.selectedSkillIds].filter(B=>!g.has(B));if(_.length===0)return i("Selected skills are already installed.","info"),n.selectedSkillIds=new Set,{installedCount:0};let M={installedCount:0};return await u(`Installing ${_.length} selected skill(s)`,async()=>{M={installedCount:(await s.installSkillIds(_)).installedCount}},((W=n.detail)==null?void 0:W.skill.id)||null),n.selectedSkillIds=new Set,M},async removeSelectedSkills(){var D;const g=new Set((((D=n.dashboard)==null?void 0:D.installed)??[]).map(W=>W.id)),_=[...n.selectedSkillIds].filter(W=>g.has(W));if(_.length===0)return i("No selected skills are installed.","info"),n.selectedSkillIds=new Set,{removedCount:0};let M={removedCount:0};return await u(`Removing ${_.length} selected skill(s)`,async()=>{M={removedCount:(await s.removeSkills(_)).removedSkills.length}}),n.selectedSkillIds=new Set,M}}}function Uu(){const e=Ge(Vi);if(!e)throw new Error("Skillex store was not provided.");return e}function Ku(){const e=window.__SKILLEX_BOOTSTRAP__,t=typeof e=="string"?e==="__SKILLEX_BOOTSTRAP__"?null:JSON.parse(e):e;if(!t||typeof t!="object"||!("token"in t)||!("initialScope"in t))throw new Error("Missing Skillex Web UI bootstrap payload.");return{token:String(t.token),initialScope:t.initialScope==="global"?"global":"local",initialSkillId:t.initialSkillId?String(t.initialSkillId):null}}const $u={class:"sidebar"},Gu={class:"sidebar-nav"},Wu={key:0,class:"nav-badge"},qu=["data-status","title"],zu={style:{padding:"0 10px 8px",display:"flex","flex-wrap":"wrap",gap:"5px"}},Qu={key:0,style:{"font-size":"11px",color:"var(--text-dim)",padding:"2px 0"}},Ju={class:"nav-section-label",style:{"font-size":"9px","margin-bottom":"4px",color:"var(--text-dim)"}},Yu={style:{padding:"0 10px 8px",display:"grid",gap:"4px"}},Xu={style:{margin:"0","font-size":"11px","font-weight":"600",color:"var(--text)"}},Zu={style:{margin:"2px 0 0","font-size":"10px",color:"var(--text-dim)","font-family":"monospace"}},ef=["onClick"],tf={key:0,style:{"font-size":"11px",color:"var(--text-dim)",padding:"2px 0"}},nf={style:{padding:"0 10px 8px",display:"grid",gap:"4px"}},sf={style:{display:"flex","justify-content":"space-between",gap:"6px"}},rf={style:{"font-size":"11px","font-weight":"600",color:"var(--text)"}},of={style:{"font-size":"10px",color:"var(--text-dim)"}},lf={style:{margin:"2px 0 0","font-size":"10px",color:"var(--text-dim)","font-family":"monospace","word-break":"break-all"}},af={key:0,style:{"font-size":"11px",color:"var(--text-dim)",padding:"2px 0"}},cf={class:"sidebar-footer"},uf={class:"adapter-badge"},ff={class:"adapter-badge-icon"},df={class:"adapter-badge-info"},pf={class:"adapter-badge-name"},hf={class:"sidebar-meta"},gf={style:{"font-family":"monospace"}},mf={class:"main-col"},vf={class:"topbar"},yf={class:"search-shell"},bf=["value"],_f=["title"],Sf={class:"toggle-group"},wf={class:"toggle-group adapter-toggle-row"},Ef=["title","onClick"],xf={class:"adapter-dropdown"},Af=["aria-expanded"],Cf={"aria-hidden":"true"},Rf={key:0,class:"adapter-dropdown-menu",role:"listbox"},Tf=["aria-selected","onClick"],Of={"aria-hidden":"true"},If={key:0,width:"12",height:"12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},Pf={class:"topbar-actions"},kf=["data-tone"],Nf={class:"workspace-layout"},Df=["data-tone"],Lf={class:"toast-content"},Mf={class:"toast-icon"},Ff={key:0,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Bf={key:1,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},jf={class:"toast-text"},Hf={key:1,class:"busy-overlay"},Vf={class:"busy-card"},Uf=Ys({__name:"App",setup(e){const t=Uu(),n=ku(),s=Pu(),r=Nt(""),o=Nt(""),i=Nt(""),l=Nt(!1),a=xe(()=>t.state.dashboard),u=xe(()=>t.recentSyncTargets.value),c="0.4.0";function d(){l.value=!1}const h=Nt(null),v=typeof navigator<"u"&&/Mac|iPad|iPhone|iPod/.test(navigator.platform),O=v?"⌘K":"Ctrl K",R=v?"Press ⌘K to focus":"Press Ctrl+K to focus";async function $(){n.name!=="catalog"&&await s.push({name:"catalog"}),await new Promise(E=>setTimeout(E,0));const x=h.value??document.getElementById("topbar-search");x==null||x.focus(),x==null||x.select()}function V(x){const E=x.target;if(!E)return!1;const be=E.tagName;return be==="INPUT"||be==="TEXTAREA"||be==="SELECT"||E.isContentEditable===!0}async function P(){n.name!=="catalog"&&(await s.push({name:"catalog"}),await new Promise(x=>setTimeout(x,0))),window.dispatchEvent(new CustomEvent("skillex:request-install-all"))}function H(x){if(x.key==="Escape"&&!x.defaultPrevented){if(D.value){x.preventDefault(),D.value=!1;return}if(l.value){x.preventDefault(),l.value=!1;return}}if((x.metaKey||x.ctrlKey)&&!x.shiftKey&&x.key.toLowerCase()==="k"){x.preventDefault(),$();return}if((x.metaKey||x.ctrlKey)&&x.shiftKey&&x.key.toLowerCase()==="a"){if(V(x))return;x.preventDefault(),P()}}const g=[{value:"all",label:"All detected",icon:"✨"},{value:"claude",label:"Claude",icon:"🤖"},{value:"cursor",label:"Cursor",icon:"⚡"},{value:"copilot",label:"Copilot",icon:"🐙"},{value:"cline",label:"Cline",icon:"🔵"},{value:"codex",label:"Codex",icon:"🧠"},{value:"gemini",label:"Gemini",icon:"✨"},{value:"windsurf",label:"Windsurf",icon:"🏄"}],_=g.filter(x=>x.value!=="all"),M=xe(()=>{const x=t.state.syncAdapter;return g.find(E=>E.value===x)??{value:x,label:x||"Auto",icon:"🔧"}}),D=Nt(!1);function W(){D.value=!D.value}function B(x){t.setSyncAdapter(x),D.value=!1}function Y(x){if(!D.value)return;const E=x.target;E&&E.closest(".adapter-dropdown")||(D.value=!1)}function ee(x){return new Date(x).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}async function N(){const x=r.value.trim();x&&(await t.addSource({repo:x,ref:o.value.trim()||void 0,label:i.value.trim()||void 0}),r.value="",o.value="",i.value="")}return jt(()=>n.query.scope,x=>{(x==="global"||x==="local")&&t.setScope(x)}),Xs(async()=>{const x=typeof n.params.skillId=="string"?n.params.skillId:null;await t.initialize(x),window.addEventListener("keydown",H),document.addEventListener("click",Y)}),Zs(()=>{window.removeEventListener("keydown",H),document.removeEventListener("click",Y)}),jt(()=>n.fullPath,()=>{l.value=!1}),(x,E)=>{var de,se,te,Ve,We,Fe,we;const be=Yl("RouterView");return pe(),he("div",{class:ze(["app-shell",{"drawer-open":l.value}])},[E[36]||(E[36]=C("div",{class:"shell-background"},[C("div",{class:"shell-glow shell-glow-left"}),C("div",{class:"shell-glow shell-glow-right"}),C("div",{class:"shell-grid"})],-1)),l.value?(pe(),he("button",{key:0,class:"mobile-drawer-backdrop",type:"button","aria-label":"Close navigation",onClick:d})):qe("",!0),C("aside",$u,[E[23]||(E[23]=C("div",{class:"sidebar-logo"},[C("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})]),Ut(" skillex"),C("span",{class:"accent-dot"},".")],-1)),C("nav",Gu,[E[17]||(E[17]=C("p",{class:"nav-section-label"},"Browse",-1)),C("button",{class:ze(["nav-btn",{active:x.$route.name==="catalog"}]),type:"button",onClick:E[0]||(E[0]=z=>X(t).navigateHome())},[...E[11]||(E[11]=[C("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),Ut(" Marketplace ",-1)])],2),C("button",{class:ze(["nav-btn",{active:!1}]),type:"button",onClick:E[1]||(E[1]=z=>X(t).navigateHome())},[E[12]||(E[12]=C("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),E[13]||(E[13]=Ut(" Installed ",-1)),(((de=a.value)==null?void 0:de.installed.length)??0)>0?(pe(),he("span",Wu,ge((se=a.value)==null?void 0:se.installed.length),1)):qe("",!0)]),C("button",{class:ze(["nav-btn",{active:x.$route.name==="doctor"}]),type:"button",onClick:E[2]||(E[2]=z=>X(s).push({name:"doctor"}))},[E[14]||(E[14]=C("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),E[15]||(E[15]=Ut(" Doctor ",-1)),X(t).state.doctorStatus?(pe(),he("span",{key:0,class:"doctor-status-dot","data-status":X(t).state.doctorStatus,title:`Doctor: ${X(t).state.doctorStatus}`},null,8,qu)):qe("",!0)],2),E[18]||(E[18]=C("p",{class:"nav-section-label"},"Workspace",-1)),E[19]||(E[19]=C("p",{class:"nav-section-label",style:{"font-size":"9px","margin-top":"8px","margin-bottom":"4px",color:"var(--text-dim)"}}," Detected adapters ",-1)),C("div",zu,[(pe(!0),he(ke,null,tn(((te=a.value)==null?void 0:te.adapters.detected)??[],z=>(pe(),he("span",{key:z,class:"chip chip-accent",style:{height:"22px","font-size":"10px"}},ge(z),1))),128)),(((Ve=a.value)==null?void 0:Ve.adapters.detected.length)??0)===0?(pe(),he("span",Qu," None ")):qe("",!0)]),C("p",Ju," Sources ("+ge(((We=a.value)==null?void 0:We.sources.length)??0)+") ",1),C("form",{style:{padding:"0 10px 8px",display:"grid",gap:"5px"},onSubmit:Qr(N,["prevent"])},[kl(C("input",{"onUpdate:modelValue":E[3]||(E[3]=z=>r.value=z),type:"text",placeholder:"owner/repo",style:{width:"100%",padding:"6px 8px",border:"1px solid rgba(63,63,70,0.5)","border-radius":"8px",background:"rgba(9,9,11,0.6)",color:"#f4f4f5","font-size":"11px",outline:"none"}},null,512),[[hc,r.value]]),E[16]||(E[16]=C("button",{class:"button button-primary",type:"submit",style:{"min-height":"28px",padding:"0 10px","font-size":"11px",width:"100%"}}," + Add source ",-1))],32),C("div",Yu,[(pe(!0),he(ke,null,tn(((Fe=a.value)==null?void 0:Fe.sources)??[],z=>(pe(),he("div",{key:z.repo,style:{display:"flex","align-items":"center","justify-content":"space-between",padding:"6px 8px","border-radius":"8px",background:"rgba(39,39,42,0.4)",border:"1px solid rgba(63,63,70,0.3)"}},[C("div",null,[C("p",Xu,ge(z.label||z.repo),1),C("p",Zu,"@"+ge(z.ref),1)]),C("button",{type:"button",onClick:ut=>X(t).removeSource(z.repo),style:{padding:"3px 6px","font-size":"10px",border:"1px solid rgba(248,113,113,0.2)","border-radius":"6px",background:"transparent",color:"var(--danger)",cursor:"pointer"}}," × ",8,ef)]))),128)),(((we=a.value)==null?void 0:we.sources.length)??0)===0?(pe(),he("p",tf," No sources. ")):qe("",!0)]),E[20]||(E[20]=C("p",{class:"nav-section-label",style:{"font-size":"9px","margin-bottom":"4px",color:"var(--text-dim)"}},"Sync history",-1)),C("div",nf,[(pe(!0),he(ke,null,tn(u.value.slice(0,3),z=>(pe(),he("div",{key:`${z.adapter}-${z.syncedAt}`,style:{padding:"6px 8px","border-radius":"8px",background:"rgba(39,39,42,0.4)",border:"1px solid rgba(63,63,70,0.3)"}},[C("div",sf,[C("span",rf,ge(z.adapter),1),C("span",of,ge(ee(z.syncedAt)),1)]),C("p",lf,ge(z.targetPath),1)]))),128)),u.value.length===0?(pe(),he("p",af," No syncs yet. ")):qe("",!0)])]),C("div",cf,[C("div",uf,[C("span",ff,ge(M.value.icon),1),C("div",df,[E[21]||(E[21]=C("p",{class:"adapter-badge-label"},"Active agent",-1)),C("p",pf,ge(M.value.label),1)]),E[22]||(E[22]=C("span",{class:"adapter-badge-dot"},null,-1))]),C("div",hf,[C("span",gf,"v"+ge(X(c)),1),C("span",null,ge(X(t).state.scope),1)])])]),C("div",mf,[C("header",vf,[C("button",{class:"mobile-hamburger",type:"button","aria-label":"Open navigation",onClick:E[4]||(E[4]=z=>l.value=!l.value)},[...E[24]||(E[24]=[C("svg",{width:"20",height:"20",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),C("div",yf,[E[25]||(E[25]=C("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),C("input",{id:"topbar-search",ref_key:"searchInputEl",ref:h,value:X(t).state.searchQuery,type:"search",placeholder:"Search skills...",onInput:E[5]||(E[5]=z=>X(t).setSearchQuery(z.target.value))},null,40,bf),C("span",{class:"search-kbd",title:X(R)},ge(X(O)),9,_f)]),C("div",Sf,[C("button",{class:ze(["toggle-btn",{active:X(t).state.scope==="local"}]),type:"button",onClick:E[6]||(E[6]=z=>X(t).setScope("local"))}," 📁 Local ",2),C("button",{class:ze(["toggle-btn",{active:X(t).state.scope==="global"}]),type:"button",onClick:E[7]||(E[7]=z=>X(t).setScope("global"))}," 🌍 Global ",2)]),E[29]||(E[29]=C("div",{class:"topbar-divider"},null,-1)),C("div",wf,[(pe(!0),he(ke,null,tn(X(_),z=>(pe(),he("button",{key:z.value,class:ze(["adapter-toggle-btn",{active:X(t).state.syncAdapter===z.value}]),title:z.label,type:"button",onClick:ut=>X(t).setSyncAdapter(z.value)},ge(z.icon),11,Ef))),128))]),C("div",xf,[C("button",{class:"button button-ghost adapter-dropdown-trigger",type:"button","aria-expanded":D.value,"aria-haspopup":"listbox",onClick:Qr(W,["stop"])},[C("span",Cf,ge(M.value.icon),1),C("span",null,ge(M.value.label),1),E[26]||(E[26]=C("svg",{width:"10",height:"10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))],8,Af),D.value?(pe(),he("div",Rf,[(pe(),he(ke,null,tn(g,z=>C("button",{key:`dd-${z.value}`,type:"button",role:"option","aria-selected":X(t).state.syncAdapter===z.value,class:ze(["adapter-dropdown-item",{active:X(t).state.syncAdapter===z.value}]),onClick:ut=>B(z.value)},[C("span",Of,ge(z.icon),1),C("span",null,ge(z.label),1),X(t).state.syncAdapter===z.value?(pe(),he("svg",If,[...E[27]||(E[27]=[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 13l4 4L19 7"},null,-1)])])):qe("",!0)],10,Tf)),64))])):qe("",!0)]),E[30]||(E[30]=C("div",{class:"topbar-divider"},null,-1)),C("div",Pf,[C("button",{class:"button button-ghost",type:"button",onClick:E[8]||(E[8]=z=>X(t).refreshAll())},[...E[28]||(E[28]=[C("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Ut(" Refresh ",-1)])]),C("button",{class:"button button-secondary",type:"button",onClick:E[9]||(E[9]=z=>X(t).updateSkill())}," Update "),C("button",{class:"button button-primary",type:"button",onClick:E[10]||(E[10]=z=>X(t).syncNow())}," Sync now ")])]),X(t).state.notice?(pe(),he("div",{key:0,class:"status-banner","data-tone":X(t).state.notice.tone},ge(X(t).state.notice.message),9,kf)):qe("",!0),C("div",Nf,[Re(be)])]),Re(Wa,{name:"toast"},{default:qo(()=>[X(t).state.toast.visible?(pe(),he("div",{key:0,class:"toast","data-tone":X(t).state.toast.tone},[C("div",Lf,[C("div",Mf,[X(t).state.toast.tone==="success"?(pe(),he("svg",Ff,[...E[31]||(E[31]=[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):(pe(),he("svg",Bf,[...E[32]||(E[32]=[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])]))]),C("div",jf,[C("strong",null,ge(X(t).state.toast.tone==="error"?"Error":"Done"),1),C("span",null,ge(X(t).state.toast.message),1)])]),E[33]||(E[33]=C("div",{class:"toast-bar"},null,-1))],8,Df)):qe("",!0)]),_:1}),X(t).state.busyLabel?(pe(),he("div",Hf,[C("div",Vf,[E[34]||(E[34]=C("div",{class:"busy-spinner"},null,-1)),C("strong",null,ge(X(t).state.busyLabel),1),E[35]||(E[35]=C("span",null,"Working...",-1))])])):qe("",!0)],2)}}}),Kf=Ku(),Ui=Mu(),$f=Vu(Ui,Kf),ir=_c(Uf);ir.provide(Vi,$f);ir.use(Ui);ir.mount("#app");export{ke as F,Wa as T,Zs as a,qo as b,Ra as c,Ys as d,pe as e,he as f,Qr as g,C as h,qe as i,Ut as j,tn as k,Vs as l,xe as m,ze as n,Xs as o,X as p,Wf as q,Nt as r,Re as s,ge as t,Uu as u,ku as v,jt as w,Gf as x};
26
+ */let ou=()=>location.protocol+"//"+location.host;function Bi(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let i=r.includes(e.slice(o))?e.slice(o).length:1,l=r.slice(i);return l[0]!=="/"&&(l="/"+l),Zr(l,"")}return Zr(n,e)+s+r}function iu(e,t,n,s){let r=[],o=[],i=null;const l=({state:h})=>{const v=Bi(e,location),O=n.value,R=t.value;let $=0;if(h){if(n.value=v,t.value=h,i&&i===O){i=null;return}$=R?h.position-R.position:0}else s(v);r.forEach(V=>{V(n.value,O,{delta:$,type:Ns.pop,direction:$?$>0?vs.forward:vs.back:vs.unknown})})};function a(){i=n.value}function u(h){r.push(h);const v=()=>{const O=r.indexOf(h);O>-1&&r.splice(O,1)};return o.push(v),v}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(oe({},h.state,{scroll:ts()}),"")}}function d(){for(const h of o)h();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:a,listen:u,destroy:d}}function ro(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?ts():null}}function lu(e){const{history:t,location:n}=window,s={value:Bi(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(a,u,c){const d=e.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+a:ou()+e+a;try{t[c?"replaceState":"pushState"](u,"",h),r.value=u}catch(v){console.error(v),n[c?"replace":"assign"](h)}}function i(a,u){o(a,oe({},t.state,ro(r.value.back,a,r.value.forward,!0),u,{position:r.value.position}),!0),s.value=a}function l(a,u){const c=oe({},r.value,t.state,{forward:a,scroll:ts()});o(c.current,c,!0),o(a,oe({},ro(s.value,a,null),{position:c.position+1},u),!1),s.value=a}return{location:s,state:r,push:l,replace:i}}function au(e){e=Gc(e);const t=lu(e),n=iu(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=oe({location:"",base:e,go:s,createHref:qc.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Mt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var _e=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(_e||{});const cu={type:Mt.Static,value:""},uu=/[a-zA-Z0-9_]/;function fu(e){if(!e)return[[]];if(e==="/")return[[cu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${u}": ${v}`)}let n=_e.Static,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let l=0,a,u="",c="";function d(){u&&(n===_e.Static?o.push({type:Mt.Static,value:u}):n===_e.Param||n===_e.ParamRegExp||n===_e.ParamRegExpEnd?(o.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Mt.Param,value:u,regexp:c,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==_e.ParamRegExp){s=n,n=_e.EscapeNext;continue}switch(n){case _e.Static:a==="/"?(u&&d(),i()):a===":"?(d(),n=_e.Param):h();break;case _e.EscapeNext:h(),n=s;break;case _e.Param:a==="("?n=_e.ParamRegExp:uu.test(a)?h():(d(),n=_e.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case _e.ParamRegExp:a===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+a:n=_e.ParamRegExpEnd:c+=a;break;case _e.ParamRegExpEnd:d(),n=_e.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,c="";break;default:t("Unknown state");break}}return n===_e.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),d(),i(),r}const oo="[^/]+?",du={sensitive:!1,strict:!1,start:!0,end:!0};var Ie=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Ie||{});const pu=/[.+*?^${}()[\]/\\]/g;function hu(e,t){const n=oe({},du,t),s=[];let r=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Ie.Root];n.strict&&!u.length&&(r+="/");for(let d=0;d<u.length;d++){const h=u[d];let v=Ie.Segment+(n.sensitive?Ie.BonusCaseSensitive:0);if(h.type===Mt.Static)d||(r+="/"),r+=h.value.replace(pu,"\\$&"),v+=Ie.Static;else if(h.type===Mt.Param){const{value:O,repeatable:R,optional:$,regexp:V}=h;o.push({name:O,repeatable:R,optional:$});const P=V||oo;if(P!==oo){v+=Ie.BonusCustomRegExp;try{`${P}`}catch(g){throw new Error(`Invalid custom RegExp for param "${O}" (${P}): `+g.message)}}let H=R?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;d||(H=$&&u.length<2?`(?:/${H})`:"/"+H),$&&(H+="?"),r+=H,v+=Ie.Dynamic,$&&(v+=Ie.BonusOptional),R&&(v+=Ie.BonusRepeatable),P===".*"&&(v+=Ie.BonusWildcard)}c.push(v)}s.push(c)}if(n.strict&&n.end){const u=s.length-1;s[u][s[u].length-1]+=Ie.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const i=new RegExp(r,n.sensitive?"":"i");function l(u){const c=u.match(i),d={};if(!c)return null;for(let h=1;h<c.length;h++){const v=c[h]||"",O=o[h-1];d[O.name]=v&&O.repeatable?v.split("/"):v}return d}function a(u){let c="",d=!1;for(const h of e){(!d||!c.endsWith("/"))&&(c+="/"),d=!1;for(const v of h)if(v.type===Mt.Static)c+=v.value;else if(v.type===Mt.Param){const{value:O,repeatable:R,optional:$}=v,V=O in u?u[O]:"";if(Xe(V)&&!R)throw new Error(`Provided param "${O}" is an array but it is not repeatable (* or + modifiers)`);const P=Xe(V)?V.join("/"):V;if(!P)if($)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):d=!0);else throw new Error(`Missing required param "${O}"`);c+=P}}return c||"/"}return{re:i,score:s,keys:o,parse:l,stringify:a}}function gu(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Ie.Static+Ie.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ie.Static+Ie.Segment?1:-1:0}function ji(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const o=gu(s[n],r[n]);if(o)return o;n++}if(Math.abs(r.length-s.length)===1){if(io(s))return 1;if(io(r))return-1}return r.length-s.length}function io(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const mu={strict:!1,end:!0,sensitive:!1};function vu(e,t,n){const s=hu(fu(e.path),n),r=oe(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function yu(e,t){const n=[],s=new Map;t=Xr(mu,t);function r(d){return s.get(d)}function o(d,h,v){const O=!v,R=ao(d);R.aliasOf=v&&v.record;const $=Xr(t,d),V=[R];if("alias"in d){const g=typeof d.alias=="string"?[d.alias]:d.alias;for(const _ of g)V.push(ao(oe({},R,{components:v?v.record.components:R.components,path:_,aliasOf:v?v.record:R})))}let P,H;for(const g of V){const{path:_}=g;if(h&&_[0]!=="/"){const M=h.record.path,D=M[M.length-1]==="/"?"":"/";g.path=h.record.path+(_&&D+_)}if(P=vu(g,h,$),v?v.alias.push(P):(H=H||P,H!==P&&H.alias.push(P),O&&d.name&&!co(P)&&i(d.name)),Hi(P)&&a(P),R.children){const M=R.children;for(let D=0;D<M.length;D++)o(M[D],P,v&&v.children[D])}v=v||P}return H?()=>{i(H)}:pn}function i(d){if(Mi(d)){const h=s.get(d);h&&(s.delete(d),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(d);h>-1&&(n.splice(h,1),d.record.name&&s.delete(d.record.name),d.children.forEach(i),d.alias.forEach(i))}}function l(){return n}function a(d){const h=Su(d,n);n.splice(h,0,d),d.record.name&&!co(d)&&s.set(d.record.name,d)}function u(d,h){let v,O={},R,$;if("name"in d&&d.name){if(v=s.get(d.name),!v)throw Yt(me.MATCHER_NOT_FOUND,{location:d});$=v.record.name,O=oe(lo(h.params,v.keys.filter(H=>!H.optional).concat(v.parent?v.parent.keys.filter(H=>H.optional):[]).map(H=>H.name)),d.params&&lo(d.params,v.keys.map(H=>H.name))),R=v.stringify(O)}else if(d.path!=null)R=d.path,v=n.find(H=>H.re.test(R)),v&&(O=v.parse(R),$=v.record.name);else{if(v=h.name?s.get(h.name):n.find(H=>H.re.test(h.path)),!v)throw Yt(me.MATCHER_NOT_FOUND,{location:d,currentLocation:h});$=v.record.name,O=oe({},h.params,d.params),R=v.stringify(O)}const V=[];let P=v;for(;P;)V.unshift(P.record),P=P.parent;return{name:$,path:R,params:O,matched:V,meta:_u(V)}}e.forEach(d=>o(d));function c(){n.length=0,s.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:l,getRecordMatcher:r}}function lo(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function ao(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function bu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function co(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _u(e){return e.reduce((t,n)=>oe(t,n.meta),{})}function Su(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;ji(e,t[o])<0?s=o:n=o+1}const r=wu(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function wu(e){let t=e;for(;t=t.parent;)if(Hi(t)&&ji(e,t)===0)return t}function Hi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function uo(e){const t=Ge(ns),n=Ge(or),s=xe(()=>{const a=X(e.to);return t.resolve(a)}),r=xe(()=>{const{matched:a}=s.value,{length:u}=a,c=a[u-1],d=n.matched;if(!c||!d.length)return-1;const h=d.findIndex(Jt.bind(null,c));if(h>-1)return h;const v=fo(a[u-2]);return u>1&&fo(c)===v&&d[d.length-1].path!==v?d.findIndex(Jt.bind(null,a[u-2])):h}),o=xe(()=>r.value>-1&&Ru(n.params,s.value.params)),i=xe(()=>r.value>-1&&r.value===n.matched.length-1&&Li(n.params,s.value.params));function l(a={}){if(Cu(a)){const u=t[X(e.replace)?"replace":"push"](X(e.to)).catch(pn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:s,href:xe(()=>s.value.href),isActive:o,isExactActive:i,navigate:l}}function Eu(e){return e.length===1?e[0]:e}const xu=Ys({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:uo,setup(e,{slots:t}){const n=En(uo(e)),{options:s}=Ge(ns),r=xe(()=>({[po(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[po(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Eu(t.default(n));return e.custom?o:sr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),Au=xu;function Cu(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ru(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Xe(r)||r.length!==s.length||s.some((o,i)=>o.valueOf()!==r[i].valueOf()))return!1}return!0}function fo(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const po=(e,t,n)=>e??t??n,Tu=Ys({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ge(Ls),r=xe(()=>e.route||s.value),o=Ge(so,0),i=xe(()=>{let u=X(o);const{matched:c}=r.value;let d;for(;(d=c[u])&&!d.components;)u++;return u}),l=xe(()=>r.value.matched[i.value]);In(so,xe(()=>i.value+1)),In(su,l),In(Ls,r);const a=Nt();return jt(()=>[a.value,l.value,e.name],([u,c,d],[h,v,O])=>{c&&(c.instances[d]=u,v&&v!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=v.leaveGuards),c.updateGuards.size||(c.updateGuards=v.updateGuards))),u&&c&&(!v||!Jt(c,v)||!h)&&(c.enterCallbacks[d]||[]).forEach(R=>R(u))},{flush:"post"}),()=>{const u=r.value,c=e.name,d=l.value,h=d&&d.components[c];if(!h)return ho(n.default,{Component:h,route:u});const v=d.props[c],O=v?v===!0?u.params:typeof v=="function"?v(u):v:null,$=sr(h,oe({},O,t,{onVnodeUnmounted:V=>{V.component.isUnmounted&&(d.instances[c]=null)},ref:a}));return ho(n.default,{Component:$,route:u})||$}}});function ho(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ou=Tu;function Iu(e){const t=yu(e.routes,e),n=e.parseQuery||tu,s=e.stringifyQuery||no,r=e.history,o=sn(),i=sn(),l=sn(),a=wl(Et);let u=Et;$t&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=gs.bind(null,S=>""+S),d=gs.bind(null,Bc),h=gs.bind(null,Sn);function v(S,j){let L,U;return Mi(S)?(L=t.getRecordMatcher(S),U=j):U=S,t.addRoute(U,L)}function O(S){const j=t.getRecordMatcher(S);j&&t.removeRoute(j)}function R(){return t.getRoutes().map(S=>S.record)}function $(S){return!!t.getRecordMatcher(S)}function V(S,j){if(j=oe({},j||a.value),typeof S=="string"){const m=ms(n,S,j.path),y=t.resolve({path:m.path},j),w=r.createHref(m.fullPath);return oe(m,y,{params:h(y.params),hash:Sn(m.hash),redirectedFrom:void 0,href:w})}let L;if(S.path!=null)L=oe({},S,{path:ms(n,S.path,j.path).path});else{const m=oe({},S.params);for(const y in m)m[y]==null&&delete m[y];L=oe({},S,{params:d(m)}),j.params=d(j.params)}const U=t.resolve(L,j),Z=S.hash||"";U.params=c(h(U.params));const f=Vc(s,oe({},S,{hash:Lc(Z),path:U.path})),p=r.createHref(f);return oe({fullPath:f,hash:Z,query:s===no?nu(S.query):S.query||{}},U,{redirectedFrom:void 0,href:p})}function P(S){return typeof S=="string"?ms(n,S,a.value.path):oe({},S)}function H(S,j){if(u!==S)return Yt(me.NAVIGATION_CANCELLED,{from:j,to:S})}function g(S){return D(S)}function _(S){return g(oe(P(S),{replace:!0}))}function M(S,j){const L=S.matched[S.matched.length-1];if(L&&L.redirect){const{redirect:U}=L;let Z=typeof U=="function"?U(S,j):U;return typeof Z=="string"&&(Z=Z.includes("?")||Z.includes("#")?Z=P(Z):{path:Z},Z.params={}),oe({query:S.query,hash:S.hash,params:Z.path!=null?{}:S.params},Z)}}function D(S,j){const L=u=V(S),U=a.value,Z=S.state,f=S.force,p=S.replace===!0,m=M(L,U);if(m)return D(oe(P(m),{state:typeof m=="object"?oe({},Z,m.state):Z,force:f,replace:p}),j||L);const y=L;y.redirectedFrom=j;let w;return!f&&Uc(s,U,L)&&(w=Yt(me.NAVIGATION_DUPLICATED,{to:y,from:U}),Fe(U,U,!0,!1)),(w?Promise.resolve(w):Y(y,U)).catch(b=>pt(b)?pt(b,me.NAVIGATION_GUARD_REDIRECT)?b:We(b):te(b,y,U)).then(b=>{if(b){if(pt(b,me.NAVIGATION_GUARD_REDIRECT))return D(oe({replace:p},P(b.to),{state:typeof b.to=="object"?oe({},Z,b.to.state):Z,force:f}),j||y)}else b=N(y,U,!0,p,Z);return ee(y,U,b),b})}function W(S,j){const L=H(S,j);return L?Promise.reject(L):Promise.resolve()}function B(S){const j=ut.values().next().value;return j&&typeof j.runWithContext=="function"?j.runWithContext(S):S()}function Y(S,j){let L;const[U,Z,f]=ru(S,j);L=ys(U.reverse(),"beforeRouteLeave",S,j);for(const m of U)m.leaveGuards.forEach(y=>{L.push(At(y,S,j))});const p=W.bind(null,S,j);return L.push(p),Ue(L).then(()=>{L=[];for(const m of o.list())L.push(At(m,S,j));return L.push(p),Ue(L)}).then(()=>{L=ys(Z,"beforeRouteUpdate",S,j);for(const m of Z)m.updateGuards.forEach(y=>{L.push(At(y,S,j))});return L.push(p),Ue(L)}).then(()=>{L=[];for(const m of f)if(m.beforeEnter)if(Xe(m.beforeEnter))for(const y of m.beforeEnter)L.push(At(y,S,j));else L.push(At(m.beforeEnter,S,j));return L.push(p),Ue(L)}).then(()=>(S.matched.forEach(m=>m.enterCallbacks={}),L=ys(f,"beforeRouteEnter",S,j,B),L.push(p),Ue(L))).then(()=>{L=[];for(const m of i.list())L.push(At(m,S,j));return L.push(p),Ue(L)}).catch(m=>pt(m,me.NAVIGATION_CANCELLED)?m:Promise.reject(m))}function ee(S,j,L){l.list().forEach(U=>B(()=>U(S,j,L)))}function N(S,j,L,U,Z){const f=H(S,j);if(f)return f;const p=j===Et,m=$t?history.state:{};L&&(U||p?r.replace(S.fullPath,oe({scroll:p&&m&&m.scroll},Z)):r.push(S.fullPath,Z)),a.value=S,Fe(S,j,L,p),We()}let x;function E(){x||(x=r.listen((S,j,L)=>{if(!Tt.listening)return;const U=V(S),Z=M(U,Tt.currentRoute.value);if(Z){D(oe(Z,{replace:!0,force:!0}),U).catch(pn);return}u=U;const f=a.value;$t&&Jc(to(f.fullPath,L.delta),ts()),Y(U,f).catch(p=>pt(p,me.NAVIGATION_ABORTED|me.NAVIGATION_CANCELLED)?p:pt(p,me.NAVIGATION_GUARD_REDIRECT)?(D(oe(P(p.to),{force:!0}),U).then(m=>{pt(m,me.NAVIGATION_ABORTED|me.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===Ns.pop&&r.go(-1,!1)}).catch(pn),Promise.reject()):(L.delta&&r.go(-L.delta,!1),te(p,U,f))).then(p=>{p=p||N(U,f,!1),p&&(L.delta&&!pt(p,me.NAVIGATION_CANCELLED)?r.go(-L.delta,!1):L.type===Ns.pop&&pt(p,me.NAVIGATION_ABORTED|me.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),ee(U,f,p)}).catch(pn)}))}let be=sn(),de=sn(),se;function te(S,j,L){We(S);const U=de.list();return U.length?U.forEach(Z=>Z(S,j,L)):console.error(S),Promise.reject(S)}function Ve(){return se&&a.value!==Et?Promise.resolve():new Promise((S,j)=>{be.add([S,j])})}function We(S){return se||(se=!S,E(),be.list().forEach(([j,L])=>S?L(S):j()),be.reset()),S}function Fe(S,j,L,U){const{scrollBehavior:Z}=e;if(!$t||!Z)return Promise.resolve();const f=!L&&Yc(to(S.fullPath,0))||(U||!L)&&history.state&&history.state.scroll||null;return Uo().then(()=>Z(S,j,f)).then(p=>p&&Qc(p)).catch(p=>te(p,S,j))}const we=S=>r.go(S);let z;const ut=new Set,Tt={currentRoute:a,listening:!0,addRoute:v,removeRoute:O,clearRoutes:t.clearRoutes,hasRoute:$,getRoutes:R,resolve:V,options:e,push:g,replace:_,go:we,back:()=>we(-1),forward:()=>we(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:de.add,isReady:Ve,install(S){S.component("RouterLink",Au),S.component("RouterView",Ou),S.config.globalProperties.$router=Tt,Object.defineProperty(S.config.globalProperties,"$route",{enumerable:!0,get:()=>X(a)}),$t&&!z&&a.value===Et&&(z=!0,g(r.location).catch(U=>{}));const j={};for(const U in Et)Object.defineProperty(j,U,{get:()=>a.value[U],enumerable:!0});S.provide(ns,Tt),S.provide(or,Bo(j)),S.provide(Ls,a);const L=S.unmount;ut.add(S),S.unmount=function(){ut.delete(S),ut.size<1&&(u=Et,x&&x(),x=null,a.value=Et,z=!1,se=!1),L()}}};function Ue(S){return S.reduce((j,L)=>j.then(()=>B(L)),Promise.resolve())}return Tt}function Pu(){return Ge(ns)}function ku(e){return Ge(or)}const Nu=()=>es(()=>import("./CatalogPage-CKEfRSvG.js"),__vite__mapDeps([0,1,2,3,4])),Du=()=>es(()=>import("./SkillDetailPage-CWGjTH2M.js"),__vite__mapDeps([5,1,2,6])),Lu=()=>es(()=>import("./DoctorPage-C92pEVl_.js"),__vite__mapDeps([7,1,2]));function Mu(e){return Iu({history:au(),routes:[{path:"/",name:"catalog",component:Nu},{path:"/skills/:skillId",name:"skill-detail",component:Du,props:!0},{path:"/doctor",name:"doctor",component:Lu}],scrollBehavior(){return{top:0}}})}function Fu(e){async function t(n,s={}){var l;const r=new URL(n,window.location.origin);s.query?r.search=s.query.toString():(s.method===void 0||s.method==="GET"||s.method==="DELETE")&&r.searchParams.set("scope",e.getScope());const o=await fetch(r,{method:s.method||"GET",headers:{"x-skillex-token":e.token,...s.body?{"content-type":"application/json"}:{}},body:s.body?JSON.stringify({...s.body,scope:e.getScope()}):void 0}),i=await o.json().catch(()=>({}));if(!o.ok)throw new Error(((l=i.error)==null?void 0:l.message)||`Request failed with ${o.status}`);return i}return{getState(){return t("/api/state")},getDoctor(){return t("/api/doctor")},getCatalog(){return t("/api/catalog")},getSkillDetail(n){return t(`/api/catalog/${encodeURIComponent(n)}`)},getSources(){return t("/api/sources")},installSkill(n,s){return t("/api/install",{method:"POST",body:{skillIds:[n],...s!=null&&s.repo?{repo:s.repo}:{},...s!=null&&s.ref?{ref:s.ref}:{}}})},installAll(n){return t("/api/install",{method:"POST",body:{all:!0,...n!=null&&n.repo?{repo:n.repo}:{},...n!=null&&n.ref?{ref:n.ref}:{}}})},installSkillIds(n,s){return t("/api/install",{method:"POST",body:{skillIds:n,...s!=null&&s.repo?{repo:s.repo}:{},...s!=null&&s.ref?{ref:s.ref}:{}}})},removeSkills(n){return t("/api/remove",{method:"POST",body:{skillIds:n}})},removeSkill(n){return t("/api/remove",{method:"POST",body:{skillIds:[n]}})},updateSkill(n){return t("/api/update",{method:"POST",body:n?{skillIds:[n]}:{}})},syncSkills(n){return t("/api/sync",{method:"POST",body:n==="all"?{}:{adapter:n}})},addSource(n){return t("/api/sources",{method:"POST",body:n})},removeSource(n){const s=new URLSearchParams;return s.set("scope",e.getScope()),t(`/api/sources/${encodeURIComponent(n)}`,{method:"DELETE",query:s})}}}function Bu(e){return Object.values(e||{}).sort((t,n)=>n.syncedAt.localeCompare(t.syncedAt))}function bs(e){return e instanceof Error?e.message:String(e)}const Ms="skillex.selection";function ju(){try{const e=window.localStorage.getItem(Ms);if(!e)return null;const t=JSON.parse(e);return!t||!Array.isArray(t.ids)?null:t}catch{return null}}function Hu(e){try{if(!e||e.ids.length===0){window.localStorage.removeItem(Ms);return}window.localStorage.setItem(Ms,JSON.stringify(e))}catch{}}const Vi=Symbol("skillex-store");function Vu(e,t){const n=En({bootstrap:t,scope:t.initialScope,syncAdapter:"all",searchQuery:"",dashboard:null,catalog:null,detail:null,detailLoading:!1,initialized:!1,busyLabel:null,busyCards:new Set,selectedSkillIds:new Set,selectionAnchorId:null,doctorStatus:null,notice:null,toast:{visible:!1,tone:"info",message:""}}),s=Fu({token:t.token,getScope:()=>n.scope});let r=null;function o(){return{token:t.token,scope:n.scope}}function i(g,_){n.notice={message:g,tone:_},n.toast.visible=!0,n.toast.message=g,n.toast.tone=_,r&&clearTimeout(r),r=setTimeout(()=>{n.toast.visible=!1},2600)}async function l(){const[g,_]=await Promise.all([s.getState(),s.getCatalog()]);n.dashboard=g,n.catalog=_}async function a(g){await l(),g&&await O(g)}async function u(g,_,M){n.busyLabel=g;try{await _(),await a(M),i(`${g} complete.`,"success"),d()}catch(D){const W=bs(D);throw n.notice={message:W,tone:"error"},i(W,"error"),D}finally{n.busyLabel=null}}async function c(g,_,M,D){const W=new Set(n.busyCards);W.add(g),n.busyCards=W;try{await M(),await a(D),i(`${_} complete.`,"success"),d()}catch(B){const Y=bs(B);throw n.notice={message:Y,tone:"error"},i(Y,"error"),B}finally{const B=new Set(n.busyCards);B.delete(g),n.busyCards=B}}async function d(){try{const g=await s.getDoctor();g.hasFailures?n.doctorStatus="fail":g.checks.some(_=>_.status==="warn")?n.doctorStatus="warn":n.doctorStatus="pass"}catch{}}async function h(){n.detail=null,await e.push({name:"catalog",query:o()})}async function v(g){await e.push({name:"skill-detail",params:{skillId:g},query:o()})}async function O(g){n.detailLoading=!0;try{n.detail=await s.getSkillDetail(g)}catch(_){throw n.detail=null,i(bs(_),"error"),_}finally{n.detailLoading=!1}}async function R(g){var M;if(n.initialized){g&&await O(g);return}n.initialized=!0,await l(),d();const _=ju();if(_&&_.scope===n.scope){const D=new Set((((M=n.catalog)==null?void 0:M.skills)??[]).map(B=>B.id)),W=_.ids.filter(B=>D.has(B));W.length>0&&(n.selectedSkillIds=new Set(W),_.anchor&&W.includes(_.anchor)?n.selectionAnchorId=_.anchor:n.selectionAnchorId=W[W.length-1]??null)}g&&await O(g)}jt(()=>({ids:[...n.selectedSkillIds],anchor:n.selectionAnchorId,scope:n.scope,initialized:n.initialized}),g=>{g.initialized&&Hu({scope:g.scope,ids:g.ids,anchor:g.anchor})},{deep:!1});async function $(g){if(n.scope===g)return;n.scope=g;const _=typeof e.currentRoute.value.params.skillId=="string"?e.currentRoute.value.params.skillId:null;_?await e.replace({name:"skill-detail",params:{skillId:_},query:o()}):await e.replace({name:"catalog",query:o()}),await a(_)}const V=xe(()=>{var M;const g=((M=n.catalog)==null?void 0:M.skills)||[],_=n.searchQuery.trim().toLowerCase();return _?g.filter(D=>[D.id,D.name,D.description,D.author||"",D.source.label||"",D.source.repo,...D.tags,...D.compatibility].join(" ").toLowerCase().includes(_)):g}),P=xe(()=>{var _;const g=((_=n.dashboard)==null?void 0:_.adapters.supported)||[];return[{value:"all",label:"All detected"},...g.map(M=>({value:M.id,label:M.label}))]}),H=xe(()=>{var g;return Bu(((g=n.dashboard)==null?void 0:g.syncHistory)||{})});return{state:n,filteredSkills:V,availableSyncAdapters:P,recentSyncTargets:H,initialize:R,refreshAll:l,async loadSkillDetail(g){await O(g)},clearDetail(){n.detail=null},async navigateHome(){await h()},async navigateToSkill(g){await v(g)},async setScope(g){await $(g)},setSyncAdapter(g){n.syncAdapter=g||"all"},async installSkill(g){var _;await c(g.id,`Installed ${g.name}`,()=>s.installSkill(g.id,{repo:g.source.repo,ref:g.source.ref}),((_=n.detail)==null?void 0:_.skill.id)||null)},async installAll(g){var M;let _={installedCount:0};return await u("Installing every skill in the catalog",async()=>{_=await s.installAll(g)},((M=n.detail)==null?void 0:M.skill.id)||null),_},async installRecommended(){var Y,ee,N;const{RECOMMENDED_SKILL_IDS:g}=await es(async()=>{const{RECOMMENDED_SKILL_IDS:x}=await import("./recommended-D_i10hwH.js");return{RECOMMENDED_SKILL_IDS:x}},[]),_=new Set((((Y=n.catalog)==null?void 0:Y.skills)??[]).map(x=>x.id)),M=new Set((((ee=n.dashboard)==null?void 0:ee.installed)??[]).map(x=>x.id)),D=g.filter(x=>_.has(x)&&!M.has(x)),W=g.filter(x=>!_.has(x));if(D.length===0)return i(W.length>0?`Recommended pack already installed (skipped ${W.length} not in catalog).`:"Recommended pack is already installed.","info"),{installedCount:0,missing:[...W]};let B={installedCount:0,missing:[...W]};return await u(`Installing ${D.length} recommended skill(s)`,async()=>{B={installedCount:(await s.installSkillIds([...D])).installedCount,missing:[...W]}},((N=n.detail)==null?void 0:N.skill.id)||null),B},async removeSkill(g){var M;const _=((M=n.detail)==null?void 0:M.skill.id)||null;await c(g,`Removed ${g}`,()=>s.removeSkill(g),_===g?null:_),_===g&&(n.detail=null,await h())},async removeAllInstalled(){var M;const g=(((M=n.dashboard)==null?void 0:M.installed)??[]).map(D=>D.id);if(g.length===0)return{removedCount:0};let _={removedCount:0};return await u(`Removing ${g.length} installed skill(s)`,async()=>{_={removedCount:(await s.removeSkills(g)).removedSkills.length}}),_},async updateSkill(g){var _,M;g?await c(g,`Updated ${g}`,()=>s.updateSkill(g),((_=n.detail)==null?void 0:_.skill.id)||null):await u("Updated installed skills",()=>s.updateSkill(g),((M=n.detail)==null?void 0:M.skill.id)||null)},async syncNow(){var g;await u("Sync finished",()=>s.syncSkills(n.syncAdapter),((g=n.detail)==null?void 0:g.skill.id)||null)},async addSource(g){var _;await u(`Added ${g.repo}`,()=>s.addSource(g),((_=n.detail)==null?void 0:_.skill.id)||null)},async removeSource(g){var _;await u(`Removed ${g}`,()=>s.removeSource(g),((_=n.detail)==null?void 0:_.skill.id)||null)},setSearchQuery(g){n.searchQuery=g},clearNotice(){n.notice=null},async loadDoctorStatus(){await d()},loadDoctor(){return s.getDoctor()},toggleSelectedSkill(g){const _=new Set(n.selectedSkillIds);_.has(g)?_.delete(g):_.add(g),n.selectedSkillIds=_,n.selectionAnchorId=g},selectRangeFromAnchor(g,_){const M=n.selectionAnchorId;if(!M||!_.includes(M)||!_.includes(g)){const x=new Set(n.selectedSkillIds);x.has(g)?x.delete(g):x.add(g),n.selectedSkillIds=x,n.selectionAnchorId=g;return}const D=_.indexOf(M),W=_.indexOf(g),[B,Y]=D<=W?[D,W]:[W,D],ee=_.slice(B,Y+1),N=new Set(n.selectedSkillIds);for(const x of ee)N.add(x);n.selectedSkillIds=N,n.selectionAnchorId=g},setSelectedSkills(g){n.selectedSkillIds=new Set(g),n.selectionAnchorId=g[g.length-1]??null},clearSelection(){n.selectedSkillIds.size===0&&n.selectionAnchorId===null||(n.selectedSkillIds=new Set,n.selectionAnchorId=null)},async installSelectedSkills(){var D,W;const g=new Set((((D=n.dashboard)==null?void 0:D.installed)??[]).map(B=>B.id)),_=[...n.selectedSkillIds].filter(B=>!g.has(B));if(_.length===0)return i("Selected skills are already installed.","info"),n.selectedSkillIds=new Set,{installedCount:0};let M={installedCount:0};return await u(`Installing ${_.length} selected skill(s)`,async()=>{M={installedCount:(await s.installSkillIds(_)).installedCount}},((W=n.detail)==null?void 0:W.skill.id)||null),n.selectedSkillIds=new Set,M},async removeSelectedSkills(){var D;const g=new Set((((D=n.dashboard)==null?void 0:D.installed)??[]).map(W=>W.id)),_=[...n.selectedSkillIds].filter(W=>g.has(W));if(_.length===0)return i("No selected skills are installed.","info"),n.selectedSkillIds=new Set,{removedCount:0};let M={removedCount:0};return await u(`Removing ${_.length} selected skill(s)`,async()=>{M={removedCount:(await s.removeSkills(_)).removedSkills.length}}),n.selectedSkillIds=new Set,M}}}function Uu(){const e=Ge(Vi);if(!e)throw new Error("Skillex store was not provided.");return e}function Ku(){const e=window.__SKILLEX_BOOTSTRAP__,t=typeof e=="string"?e==="__SKILLEX_BOOTSTRAP__"?null:JSON.parse(e):e;if(!t||typeof t!="object"||!("token"in t)||!("initialScope"in t))throw new Error("Missing Skillex Web UI bootstrap payload.");return{token:String(t.token),initialScope:t.initialScope==="global"?"global":"local",initialSkillId:t.initialSkillId?String(t.initialSkillId):null}}const $u={class:"sidebar"},Gu={class:"sidebar-nav"},Wu={key:0,class:"nav-badge"},qu=["data-status","title"],zu={style:{padding:"0 10px 8px",display:"flex","flex-wrap":"wrap",gap:"5px"}},Qu={key:0,style:{"font-size":"11px",color:"var(--text-dim)",padding:"2px 0"}},Ju={class:"nav-section-label",style:{"font-size":"9px","margin-bottom":"4px",color:"var(--text-dim)"}},Yu={style:{padding:"0 10px 8px",display:"grid",gap:"4px"}},Xu={style:{margin:"0","font-size":"11px","font-weight":"600",color:"var(--text)"}},Zu={style:{margin:"2px 0 0","font-size":"10px",color:"var(--text-dim)","font-family":"monospace"}},ef=["onClick"],tf={key:0,style:{"font-size":"11px",color:"var(--text-dim)",padding:"2px 0"}},nf={style:{padding:"0 10px 8px",display:"grid",gap:"4px"}},sf={style:{display:"flex","justify-content":"space-between",gap:"6px"}},rf={style:{"font-size":"11px","font-weight":"600",color:"var(--text)"}},of={style:{"font-size":"10px",color:"var(--text-dim)"}},lf={style:{margin:"2px 0 0","font-size":"10px",color:"var(--text-dim)","font-family":"monospace","word-break":"break-all"}},af={key:0,style:{"font-size":"11px",color:"var(--text-dim)",padding:"2px 0"}},cf={class:"sidebar-footer"},uf={class:"adapter-badge"},ff={class:"adapter-badge-icon"},df={class:"adapter-badge-info"},pf={class:"adapter-badge-name"},hf={class:"sidebar-meta"},gf={style:{"font-family":"monospace"}},mf={class:"main-col"},vf={class:"topbar"},yf={class:"search-shell"},bf=["value"],_f=["title"],Sf={class:"toggle-group"},wf={class:"toggle-group adapter-toggle-row"},Ef=["title","onClick"],xf={class:"adapter-dropdown"},Af=["aria-expanded"],Cf={"aria-hidden":"true"},Rf={key:0,class:"adapter-dropdown-menu",role:"listbox"},Tf=["aria-selected","onClick"],Of={"aria-hidden":"true"},If={key:0,width:"12",height:"12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},Pf={class:"topbar-actions"},kf=["data-tone"],Nf={class:"workspace-layout"},Df=["data-tone"],Lf={class:"toast-content"},Mf={class:"toast-icon"},Ff={key:0,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Bf={key:1,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},jf={class:"toast-text"},Hf={key:1,class:"busy-overlay"},Vf={class:"busy-card"},Uf=Ys({__name:"App",setup(e){const t=Uu(),n=ku(),s=Pu(),r=Nt(""),o=Nt(""),i=Nt(""),l=Nt(!1),a=xe(()=>t.state.dashboard),u=xe(()=>t.recentSyncTargets.value),c="0.4.1";function d(){l.value=!1}const h=Nt(null),v=typeof navigator<"u"&&/Mac|iPad|iPhone|iPod/.test(navigator.platform),O=v?"⌘K":"Ctrl K",R=v?"Press ⌘K to focus":"Press Ctrl+K to focus";async function $(){n.name!=="catalog"&&await s.push({name:"catalog"}),await new Promise(E=>setTimeout(E,0));const x=h.value??document.getElementById("topbar-search");x==null||x.focus(),x==null||x.select()}function V(x){const E=x.target;if(!E)return!1;const be=E.tagName;return be==="INPUT"||be==="TEXTAREA"||be==="SELECT"||E.isContentEditable===!0}async function P(){n.name!=="catalog"&&(await s.push({name:"catalog"}),await new Promise(x=>setTimeout(x,0))),window.dispatchEvent(new CustomEvent("skillex:request-install-all"))}function H(x){if(x.key==="Escape"&&!x.defaultPrevented){if(D.value){x.preventDefault(),D.value=!1;return}if(l.value){x.preventDefault(),l.value=!1;return}}if((x.metaKey||x.ctrlKey)&&!x.shiftKey&&x.key.toLowerCase()==="k"){x.preventDefault(),$();return}if((x.metaKey||x.ctrlKey)&&x.shiftKey&&x.key.toLowerCase()==="a"){if(V(x))return;x.preventDefault(),P()}}const g=[{value:"all",label:"All detected",icon:"✨"},{value:"claude",label:"Claude",icon:"🤖"},{value:"cursor",label:"Cursor",icon:"⚡"},{value:"copilot",label:"Copilot",icon:"🐙"},{value:"cline",label:"Cline",icon:"🔵"},{value:"codex",label:"Codex",icon:"🧠"},{value:"gemini",label:"Gemini",icon:"✨"},{value:"windsurf",label:"Windsurf",icon:"🏄"}],_=g.filter(x=>x.value!=="all"),M=xe(()=>{const x=t.state.syncAdapter;return g.find(E=>E.value===x)??{value:x,label:x||"Auto",icon:"🔧"}}),D=Nt(!1);function W(){D.value=!D.value}function B(x){t.setSyncAdapter(x),D.value=!1}function Y(x){if(!D.value)return;const E=x.target;E&&E.closest(".adapter-dropdown")||(D.value=!1)}function ee(x){return new Date(x).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}async function N(){const x=r.value.trim();x&&(await t.addSource({repo:x,ref:o.value.trim()||void 0,label:i.value.trim()||void 0}),r.value="",o.value="",i.value="")}return jt(()=>n.query.scope,x=>{(x==="global"||x==="local")&&t.setScope(x)}),Xs(async()=>{const x=typeof n.params.skillId=="string"?n.params.skillId:null;await t.initialize(x),window.addEventListener("keydown",H),document.addEventListener("click",Y)}),Zs(()=>{window.removeEventListener("keydown",H),document.removeEventListener("click",Y)}),jt(()=>n.fullPath,()=>{l.value=!1}),(x,E)=>{var de,se,te,Ve,We,Fe,we;const be=Yl("RouterView");return pe(),he("div",{class:ze(["app-shell",{"drawer-open":l.value}])},[E[36]||(E[36]=C("div",{class:"shell-background"},[C("div",{class:"shell-glow shell-glow-left"}),C("div",{class:"shell-glow shell-glow-right"}),C("div",{class:"shell-grid"})],-1)),l.value?(pe(),he("button",{key:0,class:"mobile-drawer-backdrop",type:"button","aria-label":"Close navigation",onClick:d})):qe("",!0),C("aside",$u,[E[23]||(E[23]=C("div",{class:"sidebar-logo"},[C("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})]),Ut(" skillex"),C("span",{class:"accent-dot"},".")],-1)),C("nav",Gu,[E[17]||(E[17]=C("p",{class:"nav-section-label"},"Browse",-1)),C("button",{class:ze(["nav-btn",{active:x.$route.name==="catalog"}]),type:"button",onClick:E[0]||(E[0]=z=>X(t).navigateHome())},[...E[11]||(E[11]=[C("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),Ut(" Marketplace ",-1)])],2),C("button",{class:ze(["nav-btn",{active:!1}]),type:"button",onClick:E[1]||(E[1]=z=>X(t).navigateHome())},[E[12]||(E[12]=C("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),E[13]||(E[13]=Ut(" Installed ",-1)),(((de=a.value)==null?void 0:de.installed.length)??0)>0?(pe(),he("span",Wu,ge((se=a.value)==null?void 0:se.installed.length),1)):qe("",!0)]),C("button",{class:ze(["nav-btn",{active:x.$route.name==="doctor"}]),type:"button",onClick:E[2]||(E[2]=z=>X(s).push({name:"doctor"}))},[E[14]||(E[14]=C("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),E[15]||(E[15]=Ut(" Doctor ",-1)),X(t).state.doctorStatus?(pe(),he("span",{key:0,class:"doctor-status-dot","data-status":X(t).state.doctorStatus,title:`Doctor: ${X(t).state.doctorStatus}`},null,8,qu)):qe("",!0)],2),E[18]||(E[18]=C("p",{class:"nav-section-label"},"Workspace",-1)),E[19]||(E[19]=C("p",{class:"nav-section-label",style:{"font-size":"9px","margin-top":"8px","margin-bottom":"4px",color:"var(--text-dim)"}}," Detected adapters ",-1)),C("div",zu,[(pe(!0),he(ke,null,tn(((te=a.value)==null?void 0:te.adapters.detected)??[],z=>(pe(),he("span",{key:z,class:"chip chip-accent",style:{height:"22px","font-size":"10px"}},ge(z),1))),128)),(((Ve=a.value)==null?void 0:Ve.adapters.detected.length)??0)===0?(pe(),he("span",Qu," None ")):qe("",!0)]),C("p",Ju," Sources ("+ge(((We=a.value)==null?void 0:We.sources.length)??0)+") ",1),C("form",{style:{padding:"0 10px 8px",display:"grid",gap:"5px"},onSubmit:Qr(N,["prevent"])},[kl(C("input",{"onUpdate:modelValue":E[3]||(E[3]=z=>r.value=z),type:"text",placeholder:"owner/repo",style:{width:"100%",padding:"6px 8px",border:"1px solid rgba(63,63,70,0.5)","border-radius":"8px",background:"rgba(9,9,11,0.6)",color:"#f4f4f5","font-size":"11px",outline:"none"}},null,512),[[hc,r.value]]),E[16]||(E[16]=C("button",{class:"button button-primary",type:"submit",style:{"min-height":"28px",padding:"0 10px","font-size":"11px",width:"100%"}}," + Add source ",-1))],32),C("div",Yu,[(pe(!0),he(ke,null,tn(((Fe=a.value)==null?void 0:Fe.sources)??[],z=>(pe(),he("div",{key:z.repo,style:{display:"flex","align-items":"center","justify-content":"space-between",padding:"6px 8px","border-radius":"8px",background:"rgba(39,39,42,0.4)",border:"1px solid rgba(63,63,70,0.3)"}},[C("div",null,[C("p",Xu,ge(z.label||z.repo),1),C("p",Zu,"@"+ge(z.ref),1)]),C("button",{type:"button",onClick:ut=>X(t).removeSource(z.repo),style:{padding:"3px 6px","font-size":"10px",border:"1px solid rgba(248,113,113,0.2)","border-radius":"6px",background:"transparent",color:"var(--danger)",cursor:"pointer"}}," × ",8,ef)]))),128)),(((we=a.value)==null?void 0:we.sources.length)??0)===0?(pe(),he("p",tf," No sources. ")):qe("",!0)]),E[20]||(E[20]=C("p",{class:"nav-section-label",style:{"font-size":"9px","margin-bottom":"4px",color:"var(--text-dim)"}},"Sync history",-1)),C("div",nf,[(pe(!0),he(ke,null,tn(u.value.slice(0,3),z=>(pe(),he("div",{key:`${z.adapter}-${z.syncedAt}`,style:{padding:"6px 8px","border-radius":"8px",background:"rgba(39,39,42,0.4)",border:"1px solid rgba(63,63,70,0.3)"}},[C("div",sf,[C("span",rf,ge(z.adapter),1),C("span",of,ge(ee(z.syncedAt)),1)]),C("p",lf,ge(z.targetPath),1)]))),128)),u.value.length===0?(pe(),he("p",af," No syncs yet. ")):qe("",!0)])]),C("div",cf,[C("div",uf,[C("span",ff,ge(M.value.icon),1),C("div",df,[E[21]||(E[21]=C("p",{class:"adapter-badge-label"},"Active agent",-1)),C("p",pf,ge(M.value.label),1)]),E[22]||(E[22]=C("span",{class:"adapter-badge-dot"},null,-1))]),C("div",hf,[C("span",gf,"v"+ge(X(c)),1),C("span",null,ge(X(t).state.scope),1)])])]),C("div",mf,[C("header",vf,[C("button",{class:"mobile-hamburger",type:"button","aria-label":"Open navigation",onClick:E[4]||(E[4]=z=>l.value=!l.value)},[...E[24]||(E[24]=[C("svg",{width:"20",height:"20",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),C("div",yf,[E[25]||(E[25]=C("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),C("input",{id:"topbar-search",ref_key:"searchInputEl",ref:h,value:X(t).state.searchQuery,type:"search",placeholder:"Search skills...",onInput:E[5]||(E[5]=z=>X(t).setSearchQuery(z.target.value))},null,40,bf),C("span",{class:"search-kbd",title:X(R)},ge(X(O)),9,_f)]),C("div",Sf,[C("button",{class:ze(["toggle-btn",{active:X(t).state.scope==="local"}]),type:"button",onClick:E[6]||(E[6]=z=>X(t).setScope("local"))}," 📁 Local ",2),C("button",{class:ze(["toggle-btn",{active:X(t).state.scope==="global"}]),type:"button",onClick:E[7]||(E[7]=z=>X(t).setScope("global"))}," 🌍 Global ",2)]),E[29]||(E[29]=C("div",{class:"topbar-divider"},null,-1)),C("div",wf,[(pe(!0),he(ke,null,tn(X(_),z=>(pe(),he("button",{key:z.value,class:ze(["adapter-toggle-btn",{active:X(t).state.syncAdapter===z.value}]),title:z.label,type:"button",onClick:ut=>X(t).setSyncAdapter(z.value)},ge(z.icon),11,Ef))),128))]),C("div",xf,[C("button",{class:"button button-ghost adapter-dropdown-trigger",type:"button","aria-expanded":D.value,"aria-haspopup":"listbox",onClick:Qr(W,["stop"])},[C("span",Cf,ge(M.value.icon),1),C("span",null,ge(M.value.label),1),E[26]||(E[26]=C("svg",{width:"10",height:"10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))],8,Af),D.value?(pe(),he("div",Rf,[(pe(),he(ke,null,tn(g,z=>C("button",{key:`dd-${z.value}`,type:"button",role:"option","aria-selected":X(t).state.syncAdapter===z.value,class:ze(["adapter-dropdown-item",{active:X(t).state.syncAdapter===z.value}]),onClick:ut=>B(z.value)},[C("span",Of,ge(z.icon),1),C("span",null,ge(z.label),1),X(t).state.syncAdapter===z.value?(pe(),he("svg",If,[...E[27]||(E[27]=[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 13l4 4L19 7"},null,-1)])])):qe("",!0)],10,Tf)),64))])):qe("",!0)]),E[30]||(E[30]=C("div",{class:"topbar-divider"},null,-1)),C("div",Pf,[C("button",{class:"button button-ghost",type:"button",onClick:E[8]||(E[8]=z=>X(t).refreshAll())},[...E[28]||(E[28]=[C("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Ut(" Refresh ",-1)])]),C("button",{class:"button button-secondary",type:"button",onClick:E[9]||(E[9]=z=>X(t).updateSkill())}," Update "),C("button",{class:"button button-primary",type:"button",onClick:E[10]||(E[10]=z=>X(t).syncNow())}," Sync now ")])]),X(t).state.notice?(pe(),he("div",{key:0,class:"status-banner","data-tone":X(t).state.notice.tone},ge(X(t).state.notice.message),9,kf)):qe("",!0),C("div",Nf,[Re(be)])]),Re(Wa,{name:"toast"},{default:qo(()=>[X(t).state.toast.visible?(pe(),he("div",{key:0,class:"toast","data-tone":X(t).state.toast.tone},[C("div",Lf,[C("div",Mf,[X(t).state.toast.tone==="success"?(pe(),he("svg",Ff,[...E[31]||(E[31]=[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):(pe(),he("svg",Bf,[...E[32]||(E[32]=[C("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])]))]),C("div",jf,[C("strong",null,ge(X(t).state.toast.tone==="error"?"Error":"Done"),1),C("span",null,ge(X(t).state.toast.message),1)])]),E[33]||(E[33]=C("div",{class:"toast-bar"},null,-1))],8,Df)):qe("",!0)]),_:1}),X(t).state.busyLabel?(pe(),he("div",Hf,[C("div",Vf,[E[34]||(E[34]=C("div",{class:"busy-spinner"},null,-1)),C("strong",null,ge(X(t).state.busyLabel),1),E[35]||(E[35]=C("span",null,"Working...",-1))])])):qe("",!0)],2)}}}),Kf=Ku(),Ui=Mu(),$f=Vu(Ui,Kf),ir=_c(Uf);ir.provide(Vi,$f);ir.use(Ui);ir.mount("#app");export{ke as F,Wa as T,Zs as a,qo as b,Ra as c,Ys as d,pe as e,he as f,Qr as g,C as h,qe as i,Ut as j,tn as k,Vs as l,xe as m,ze as n,Xs as o,X as p,Wf as q,Nt as r,Re as s,ge as t,Uu as u,ku as v,jt as w,Gf as x};
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Skillex UI</title>
7
- <script type="module" crossorigin src="/assets/index-I0b-syhc.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-DAVP4Xp_.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-CWm7zQTg.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillex",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "CLI to list, install, and synchronize AI agent skills from GitHub-hosted catalogs.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -69,7 +69,11 @@
69
69
  "build:test": "tsc -p tsconfig.test.json",
70
70
  "typecheck": "npm run typecheck:ui && tsc --noEmit -p tsconfig.json",
71
71
  "typecheck:ui": "vue-tsc --noEmit -p ui/tsconfig.app.json",
72
+ "dev": "node scripts/dev.mjs",
72
73
  "dev:ui": "vite --config ui/vite.config.ts",
74
+ "web": "npm run build && node ./bin/skillex.js ui",
75
+ "tui": "node ./bin/skillex.js",
76
+ "skillex": "node ./bin/skillex.js",
73
77
  "start": "npm run build && node ./bin/skillex.js",
74
78
  "test": "node scripts/check-language.mjs && npm run build:ui && npm run build:test && node --test .test-dist/test/*.test.js",
75
79
  "prepublishOnly": "npm run build && npm test"