diff --git a/main.js b/main.js index 5ccf9e2..47151ff 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,3 @@ -var vt=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Ce=Object.prototype.hasOwnProperty;var Le=(n,t)=>{for(var e in t)vt(n,e,{get:t[e],enumerable:!0})},Te=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ee(t))!Ce.call(n,i)&&i!==e&&vt(n,i,{get:()=>t[i],enumerable:!(s=De(t,i))||s.enumerable});return n};var Me=n=>Te(vt({},"__esModule",{value:!0}),n);var as={};Le(as,{default:()=>gt});module.exports=Me(as);var we=require("obsidian");var ke=require("obsidian");var R=require("obsidian"),jt=require("electron");var Ft=require("os"),b=require("fs"),p=require("path"),u=(0,Ft.homedir)(),V=process.env.XDG_CONFIG_HOME||(0,p.join)(u,".config");function K(n){return(0,b.existsSync)(`/Applications/${n}.app`)||(0,b.existsSync)((0,p.join)(u,"Applications",`${n}.app`))}function F(n){let t=[`/usr/local/bin/${n}`,`/opt/homebrew/bin/${n}`,(0,p.join)(u,".local","bin",n)];for(let s of t)if((0,b.existsSync)(s))return!0;let e=(0,p.join)(u,".nvm","versions","node");try{for(let s of(0,b.readdirSync)(e))if((0,b.existsSync)((0,p.join)(e,s,"bin",n)))return!0}catch{}return!1}var D=[{id:"claude-code",name:"Claude Code",color:"#f97316",icon:"brain",paths:[{baseDir:(0,p.join)(u,".claude","skills"),type:"skill",pattern:"directory-with-skillmd"},{baseDir:(0,p.join)(u,".claude","commands"),type:"command",pattern:"flat-md"}],agentPaths:[{baseDir:(0,p.join)(u,".claude","agents"),type:"agent",pattern:"flat-md"}],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".claude","settings.json"))||(0,b.existsSync)((0,p.join)(u,".claude","CLAUDE.md"))||F("claude")},{id:"cursor",name:"Cursor",color:"#3b82f6",icon:"mouse-pointer",paths:[{baseDir:(0,p.join)(u,".cursor","skills"),type:"skill",pattern:"directory-with-skillmd"},{baseDir:(0,p.join)(u,".cursor","rules"),type:"rule",pattern:"flat-md"}],agentPaths:[{baseDir:(0,p.join)(u,".cursor","agents"),type:"agent",pattern:"flat-md"}],isInstalled:()=>K("Cursor")||(0,b.existsSync)((0,p.join)(u,".cursor","argv.json"))},{id:"windsurf",name:"Windsurf",color:"#14b8a6",icon:"wind",paths:[{baseDir:(0,p.join)(u,".codeium","windsurf","memories"),type:"memory",pattern:"flat-md"},{baseDir:(0,p.join)(u,".windsurf","rules"),type:"rule",pattern:"flat-md"}],agentPaths:[],isInstalled:()=>K("Windsurf")||(0,b.existsSync)((0,p.join)(u,".codeium","windsurf","argv.json"))},{id:"codex",name:"Codex",color:"#22c55e",icon:"book",paths:[{baseDir:(0,p.join)(u,".codex","skills"),type:"skill",pattern:"directory-with-skillmd"},{baseDir:(0,p.join)(u,".codex","prompts"),type:"command",pattern:"flat-md"},{baseDir:(0,p.join)(u,".codex","memories"),type:"memory",pattern:"flat-md"}],agentPaths:[{baseDir:(0,p.join)(u,".codex","agents"),type:"agent",pattern:"flat-md"}],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".codex","config.toml"))||(0,b.existsSync)((0,p.join)(u,".codex","auth.json"))||F("codex")},{id:"copilot",name:"Copilot",color:"#a855f7",icon:"plane",paths:[{baseDir:(0,p.join)(u,".copilot","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".copilot"))||F("copilot")},{id:"amp",name:"Amp",color:"#ec4899",icon:"zap",paths:[{baseDir:(0,p.join)(V,"amp","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>(0,b.existsSync)((0,p.join)(V,"amp","config.json"))||(0,b.existsSync)((0,p.join)(V,"amp","settings.json"))||F("amp")},{id:"opencode",name:"OpenCode",color:"#ef4444",icon:"terminal",paths:[{baseDir:(0,p.join)(V,"opencode","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>K("OpenCode")||(0,b.existsSync)((0,p.join)(V,"opencode","opencode.json"))||(0,b.existsSync)((0,p.join)(V,"opencode","opencode.jsonc"))||F("opencode")},{id:"pi",name:"Pi",color:"#06b6d4",icon:"sparkles",paths:[{baseDir:(0,p.join)(u,".pi","agent","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>F("pi")},{id:"antigravity",name:"Antigravity",color:"#ef4444",icon:"arrow-up-circle",paths:[{baseDir:(0,p.join)(u,".gemini","antigravity","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>K("Antigravity")||(0,b.existsSync)((0,p.join)(u,".gemini","antigravity","skills"))||F("antigravity")},{id:"claude-desktop",name:"Claude Desktop",color:"#f97316",icon:"monitor",paths:[],agentPaths:[],isInstalled:()=>K("Claude")},{id:"global-agents",name:"Global",color:"#a3e635",icon:"globe",paths:[{baseDir:(0,p.join)(u,".agents","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".agents","skills"))},{id:"aider",name:"Aider",color:"#eab308",icon:"wrench",paths:[],agentPaths:[],isInstalled:()=>F("aider")}];var C={"claude-code":{viewBox:"0 0 24 24",paths:''},cursor:{viewBox:"0 0 466.73 532.09",paths:''},windsurf:{viewBox:"0 0 24 24",paths:''},codex:{viewBox:"0 0 24 24",paths:''},copilot:{viewBox:"0 0 24 24",paths:''},opencode:{viewBox:"0 0 24 36",paths:''},"claude-desktop":{viewBox:"0 0 24 24",paths:''},"global-agents":{viewBox:"0 0 24 24",paths:''},goose:{viewBox:"0 0 24 24",paths:''},cline:{viewBox:"0 0 24 24",paths:''},continue:{viewBox:"0 0 26 24",paths:''},"roo-code":{viewBox:"0 0 96 96",paths:''},replit:{viewBox:"0 0 24 24",paths:''},"gemini-cli":{viewBox:"0 0 24 24",paths:''}};function j(n,t,e=16){let s=C[t];if(!s)return;let i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox",s.viewBox),i.setAttribute("width",String(e)),i.setAttribute("height",String(e)),i.setAttribute("fill","none"),i.classList.add("as-tool-svg"),i.innerHTML=s.paths,n.appendChild(i)}var tt=class{containerEl;store;onToggleDashboard;onToggleMarketplace;dashboardActive=!1;marketplaceActive=!1;constructor(t,e,s,i){this.containerEl=t,this.store=e,this.onToggleDashboard=s,this.onToggleMarketplace=i}setDashboardActive(t){this.dashboardActive=t,t&&(this.marketplaceActive=!1)}setMarketplaceActive(t){this.marketplaceActive=t,t&&(this.dashboardActive=!1)}render(){this.containerEl.empty(),this.containerEl.addClass("as-sidebar"),this.renderLibrarySection(),this.renderTypeSection(),this.renderToolSection(),this.renderProjectSection(),this.renderCollectionSection(),this.store.hasSkillkit||this.renderSkillkitCta()}renderSection(t,e){let s=this.containerEl.createDiv("as-sidebar-section");s.createDiv({cls:"as-sidebar-title",text:t});for(let i of e){let a=s.createDiv("as-sidebar-item");!this.dashboardActive&&this.isActive(i.filter)&&a.addClass("is-active");let r=a.createSpan("as-sidebar-icon");(0,R.setIcon)(r,i.icon),a.createSpan({cls:"as-sidebar-label",text:i.label}),i.count!==void 0&&a.createSpan({cls:"as-sidebar-count",text:String(i.count)}),a.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.marketplaceActive&&this.onToggleMarketplace(),this.store.setFilter(i.filter)})}}renderTypeSection(){let t=this.store.getTypeCounts(),s=[{label:"Skills",icon:"sparkles",type:"skill"},{label:"Commands",icon:"terminal",type:"command"},{label:"Agents",icon:"bot",type:"agent"},{label:"Rules",icon:"scroll",type:"rule"}].filter(i=>t.has(i.type)).map(i=>({label:i.label,icon:i.icon,filter:{kind:"type",type:i.type},count:t.get(i.type)||0}));s.length>0&&this.renderSection("Types",s)}renderToolSection(){let t=this.store.getToolCounts(),e=D.filter(i=>i.isInstalled()&&t.has(i.id));if(e.length===0)return;let s=this.containerEl.createDiv("as-sidebar-section");s.createDiv({cls:"as-sidebar-title",text:"Tools"});for(let i of e){let a={kind:"tool",toolId:i.id},r=s.createDiv("as-sidebar-item");!this.dashboardActive&&this.isActive(a)&&r.addClass("is-active");let l=r.createSpan("as-sidebar-icon");C[i.id]?j(l,i.id,14):(0,R.setIcon)(l,i.icon),r.createSpan({cls:"as-sidebar-label",text:i.name}),r.createSpan({cls:"as-sidebar-count",text:String(t.get(i.id)||0)}),r.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.store.setFilter(a)})}}renderProjectSection(){let t=this.store.getProjectCounts();if(t.size===0)return;let e=[];for(let[s,i]of t)e.push({label:s,icon:"folder-git-2",filter:{kind:"project",project:s},count:i});e.sort((s,i)=>s.label.localeCompare(i.label)),this.renderSection("Projects",e)}renderCollectionSection(){let t=this.containerEl.createDiv("as-sidebar-section");t.createDiv({cls:"as-sidebar-title",text:"Collections"});let e=new Set;for(let s of this.store.allItems)for(let i of s.collections)e.add(i);if(e.size===0){t.createDiv({cls:"as-sidebar-empty",text:"No collections yet"});return}for(let s of e){let i={kind:"collection",name:s},a=t.createDiv("as-sidebar-item");!this.dashboardActive&&this.isActive(i)&&a.addClass("is-active");let r=a.createSpan("as-sidebar-icon");(0,R.setIcon)(r,"folder"),a.createSpan({cls:"as-sidebar-label",text:s}),a.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.store.setFilter(i)})}}renderLibrarySection(){let t=this.containerEl.createDiv("as-sidebar-section");t.createDiv({cls:"as-sidebar-title",text:"Library"});let e=[{label:"All Skills",icon:"layers",filter:{kind:"all"}},{label:"Favorites",icon:"star",filter:{kind:"favorites"}}],s=this.dashboardActive||this.marketplaceActive;for(let o of e){let c=t.createDiv("as-sidebar-item");!s&&this.isActive(o.filter)&&c.addClass("is-active");let d=c.createSpan("as-sidebar-icon");(0,R.setIcon)(d,o.icon),c.createSpan({cls:"as-sidebar-label",text:o.label}),c.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.marketplaceActive&&this.onToggleMarketplace(),this.store.setFilter(o.filter)})}let i=t.createDiv("as-sidebar-item");this.dashboardActive&&i.addClass("is-active");let a=i.createSpan("as-sidebar-icon");(0,R.setIcon)(a,"bar-chart-2"),i.createSpan({cls:"as-sidebar-label",text:"Dashboard"}),i.addEventListener("click",()=>{this.marketplaceActive&&this.onToggleMarketplace(),this.dashboardActive||this.onToggleDashboard()});let r=t.createDiv("as-sidebar-item");this.marketplaceActive&&r.addClass("is-active");let l=r.createSpan("as-sidebar-icon");(0,R.setIcon)(l,"shopping-bag"),r.createSpan({cls:"as-sidebar-label",text:"Marketplace"}),r.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.marketplaceActive||this.onToggleMarketplace()})}renderSkillkitCta(){let t=this.containerEl.createDiv("as-skillkit-cta"),e=t.createDiv("as-skillkit-icon");(0,R.setIcon)(e,"bar-chart-2"),t.createDiv({cls:"as-skillkit-title",text:"Unlock analytics"}),t.createDiv({cls:"as-skillkit-desc",text:"Install skillkit to see usage stats, stale badges, and heavy skill warnings."}),t.createDiv("as-skillkit-cmd").createEl("code",{text:"npm i -g skillkit"}),t.createEl("a",{cls:"as-skillkit-link",text:"Learn more",href:"https://www.npmjs.com/package/skillkit"}).addEventListener("click",a=>{a.preventDefault(),jt.shell.openExternal("https://www.npmjs.com/package/skillkit")})}isActive(t){let e=this.store.filter;return e.kind!==t.kind?!1:e.kind==="tool"&&t.kind==="tool"?e.toolId===t.toolId:e.kind==="type"&&t.kind==="type"?e.type===t.type:e.kind==="collection"&&t.kind==="collection"?e.name===t.name:e.kind==="project"&&t.kind==="project"?e.project===t.project:!0}};var Q=require("obsidian");var et=class{containerEl;store;onSelect;selectedId=null;inputEl=null;listEl=null;typeFilter=null;sortBy="name";dropdownEl=null;constructor(t,e,s){this.containerEl=t,this.store=e,this.onSelect=s}setSelected(t){this.selectedId=t}render(){if(!this.inputEl){this.containerEl.empty(),this.containerEl.addClass("as-list");let t=this.containerEl.createDiv("as-search");this.inputEl=t.createEl("input",{type:"text",placeholder:"Search skills...",cls:"as-search-input"}),this.inputEl.addEventListener("input",()=>{this.store.setSearch(this.inputEl.value)});let e=t.createDiv("as-filter-btn");(0,Q.setIcon)(e,"filter"),e.setAttribute("aria-label","Filter by status"),e.addEventListener("click",i=>{i.stopPropagation(),this.toggleDropdown(e)});let s=t.createDiv("as-filter-btn");(0,Q.setIcon)(s,this.sortBy==="usage"?"arrow-down-wide-narrow":"arrow-down-a-z"),s.setAttribute("aria-label",this.sortBy==="usage"?"Sorted by usage":"Sorted by name"),s.addEventListener("click",()=>{this.sortBy=this.sortBy==="name"?"usage":"name",(0,Q.setIcon)(s,this.sortBy==="usage"?"arrow-down-wide-narrow":"arrow-down-a-z"),s.setAttribute("aria-label",this.sortBy==="usage"?"Sorted by usage":"Sorted by name"),this.renderList()}),this.listEl=this.containerEl.createDiv("as-list-items")}this.inputEl.value=this.store.searchQuery,this.renderList()}toggleDropdown(t){if(this.dropdownEl){this.dropdownEl.remove(),this.dropdownEl=null;return}this.dropdownEl=t.createDiv("as-filter-dropdown");let e=[{id:"all",label:"All",cls:""},{id:"stale",label:"Stale",cls:"as-badge-stale"},{id:"heavy",label:"Heavy",cls:"as-badge-heavy"},{id:"oversized",label:"Oversized",cls:"as-badge-warn"},{id:"conflict",label:"Conflict",cls:"as-badge-conflict"}];for(let i of e){let a=this.dropdownEl.createDiv("as-filter-option");(i.id==="all"&&!this.typeFilter||i.id===this.typeFilter)&&a.addClass("is-active"),i.cls?a.createSpan({cls:i.cls,text:i.label}):a.setText(i.label),a.addEventListener("click",r=>{r.stopPropagation(),this.typeFilter=i.id==="all"?null:i.id,this.dropdownEl&&(this.dropdownEl.remove(),this.dropdownEl=null),this.renderList()})}let s=()=>{this.dropdownEl&&(this.dropdownEl.remove(),this.dropdownEl=null),document.removeEventListener("click",s)};setTimeout(()=>document.addEventListener("click",s),0)}renderList(){if(!this.listEl)return;this.listEl.empty();let t=this.store.filteredItems;if(this.typeFilter)switch(this.typeFilter){case"stale":t=t.filter(e=>e.usage?.isStale);break;case"heavy":t=t.filter(e=>e.usage?.isHeavy);break;case"oversized":t=t.filter(e=>e.warnings?.oversized);break;case"conflict":t=t.filter(e=>e.conflicts&&e.conflicts.length>0);break}if(this.sortBy==="usage"&&(t=[...t].sort((e,s)=>(s.usage?.uses??0)-(e.usage?.uses??0))),this.typeFilter){let e={stale:"Stale",heavy:"Heavy",oversized:"Oversized",conflict:"Conflict"},s=this.listEl.createDiv("as-active-filter");s.createSpan({text:`Showing: ${e[this.typeFilter]??this.typeFilter}`}),s.createSpan({cls:"as-filter-clear",text:"Clear"}).addEventListener("click",()=>{this.typeFilter=null,this.renderList()})}if(t.length===0){this.listEl.createDiv({cls:"as-list-empty",text:"No skills found"});return}for(let e of t)this.renderCard(this.listEl,e)}renderCard(t,e){let s=t.createDiv("as-skill-card");e.id===this.selectedId&&s.addClass("is-selected");let i=s.createDiv("as-skill-header");if(i.createSpan({cls:"as-skill-name",text:e.name}),e.isFavorite){let r=i.createSpan("as-skill-star");(0,Q.setIcon)(r,"star")}e.description&&s.createDiv({cls:"as-skill-desc",text:e.description.length>80?e.description.slice(0,80)+"...":e.description});let a=s.createDiv("as-skill-meta");a.createSpan({cls:`as-type-tag as-type-${e.type}`,text:e.type});for(let r of e.tools){let l=D.find(c=>c.id===r);if(!l)continue;let o=a.createSpan("as-tool-badge");o.title=l.name,o.setAttribute("aria-label",l.name),o.setCssProps({"--tool-color":l.color}),C[r]?j(o,r,12):o.addClass("as-tool-badge-dot")}e.usage&&(e.usage.uses>0&&a.createSpan({cls:"as-usage-badge",text:`${e.usage.uses}`,attr:{"aria-label":`Used ${e.usage.uses} times`}}),e.usage.isStale&&a.createSpan({cls:"as-badge-stale",text:"stale"}),e.usage.isHeavy&&a.createSpan({cls:"as-badge-heavy",text:"heavy"})),e.warnings?.oversized&&a.createSpan({cls:"as-badge-warn",text:"oversized"}),e.conflicts&&e.conflicts.length>0&&a.createSpan({cls:"as-badge-conflict",text:"conflict"}),s.addEventListener("click",()=>{this.selectedId=e.id,this.onSelect(e)})}};var y=require("obsidian"),Jt=require("fs"),Zt=require("electron");var kt=require("child_process"),A=require("fs"),k=require("path"),Rt=require("os"),I=(0,Rt.homedir)(),Pe=(0,k.join)(I,".skillkit","analytics.db");function Ot(){let n=["/usr/local/bin","/opt/homebrew/bin",(0,k.join)(I,".local","bin"),(0,k.join)(I,".bun","bin")],t=(0,k.join)(I,".nvm","versions","node");try{for(let s of(0,A.readdirSync)(t))n.push((0,k.join)(t,s,"bin"))}catch{}let e=(0,k.join)(I,".local","share","mise","installs");for(let s of["node","bun"])try{for(let i of(0,A.readdirSync)((0,k.join)(e,s)))n.push((0,k.join)(e,s,i,"bin"))}catch{}return[...n,process.env.PATH||""].join(":")}function Ie(){let n=["/usr/local/bin/skillkit","/opt/homebrew/bin/skillkit",(0,k.join)(I,".local","bin","skillkit"),(0,k.join)(I,".bun","bin","skillkit"),(0,k.join)(I,".local","share","mise","shims","skillkit")];for(let s of n)if((0,A.existsSync)(s))return s;let t=(0,k.join)(I,".nvm","versions","node");try{for(let s of(0,A.readdirSync)(t)){let i=(0,k.join)(t,s,"bin","skillkit");if((0,A.existsSync)(i))return i}}catch{}let e=(0,k.join)(I,".local","share","mise","installs");for(let s of["node","bun"])try{for(let i of(0,A.readdirSync)((0,k.join)(e,s))){let a=(0,k.join)(e,s,i,"bin","skillkit");if((0,A.existsSync)(a))return a}}catch{}return null}var bt;function St(){return bt===void 0&&(bt=Ie()),bt}function L(){return St()!==null||(0,A.existsSync)(Pe)}function $(n){let t=St();if(!t)return null;try{let e=(0,kt.execSync)(`${t} ${n} --json`,{encoding:"utf-8",timeout:15e3,env:{...process.env,NO_COLOR:"1",PATH:Ot()},stdio:["pipe","pipe","pipe"]}).trim(),s=e.indexOf("{"),i=e.indexOf("["),a=s===-1?i:i===-1?s:Math.min(s,i);return a===-1?null:JSON.parse(e.slice(a))}catch{return null}}function Bt(){let n=new Map;if(!L())return n;let t=$("stats");if(!t?.top_skills)return n;let e=Date.now();for(let s of t.top_skills){let i=s.daily.length>0?s.daily[s.daily.length-1]?.date:null,a=null;i&&(a=Math.floor((e-new Date(i).getTime())/(1e3*60*60*24))),n.set(s.name,{uses:s.total,lastUsed:i||null,daysSinceUsed:a,isStale:a!==null&&a>30,isHeavy:!1,daily:s.daily})}return n}function Nt(){let n=new Map;if(!L())return n;let t=$("conflicts --dry-run");if(!t||!("pairs"in t))return n;for(let e of t.pairs)n.has(e.skill_a)||n.set(e.skill_a,[]),n.has(e.skill_b)||n.set(e.skill_b,[]),n.get(e.skill_a).push({skillName:e.skill_b,similarity:e.similarity}),n.get(e.skill_b).push({skillName:e.skill_a,similarity:e.similarity});return n}function zt(n){if(!L())return[];let t=$(`trace --list --skill ${n} --limit 5`);return Array.isArray(t)?t.map(e=>({traceId:e.trace_id,timestamp:e.timestamp,tokens:e.tokens_total,cost:e.cost_estimate,duration:e.duration_ms,model:e.model||"unknown"})):[]}function Wt(){if(!L())return{oversized:[],longDesc:[]};let n=$("health");return n?.warnings?{oversized:n.warnings.oversized||[],longDesc:n.warnings.long_descriptions||[]}:{oversized:[],longDesc:[]}}function U(n){let t=St();if(!t)return{success:!1,output:"skillkit not found"};try{return{success:!0,output:(0,kt.execSync)(`${t} ${n}`,{encoding:"utf-8",timeout:3e4,env:{...process.env,NO_COLOR:"1",PATH:Ot()},stdio:["pipe","pipe","pipe"]}).trim()}}catch(e){return{success:!1,output:e instanceof Error?e.message:"unknown error"}}}function yt(n){if(!n)return"never";let t=Date.now()-new Date(n).getTime(),e=Math.floor(t/6e4);if(e<60)return`${e}m ago`;let s=Math.floor(e/60);if(s<24)return`${s}h ago`;let i=Math.floor(s/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function Vt(n,t,e=48,s=16){if(t.length===0)return;let i=Math.max(...t,1),a=t.map((o,c)=>{let d=c/(t.length-1||1)*e,m=s-o/i*s;return`${d.toFixed(1)},${m.toFixed(1)}`}),r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox",`0 0 ${e} ${s}`),r.setAttribute("width",String(e)),r.setAttribute("height",String(s)),r.classList.add("as-sparkline");let l=document.createElementNS("http://www.w3.org/2000/svg","polyline");l.setAttribute("points",a.join(" ")),l.setAttribute("fill","none"),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","1.5"),l.setAttribute("stroke-linecap","round"),l.setAttribute("stroke-linejoin","round"),r.appendChild(l),n.appendChild(r)}var Ut=require("obsidian");function N(n,t,e,s){new wt(n,t,e,s).open()}var wt=class extends Ut.Modal{title;message;onConfirm;constructor(t,e,s,i){super(t),this.title=e,this.message=s,this.onConfirm=i}onOpen(){let{contentEl:t}=this;t.addClass("as-confirm-modal"),t.createEl("p",{cls:"as-confirm-title",text:this.title}),t.createEl("p",{cls:"as-confirm-message",text:this.message});let e=t.createDiv("as-confirm-buttons");e.createEl("button",{cls:"as-confirm-cancel",text:"Cancel"}).addEventListener("click",()=>this.close()),e.createEl("button",{cls:"as-confirm-action mod-warning",text:"Confirm"}).addEventListener("click",()=>{this.close(),this.onConfirm()})}onClose(){this.contentEl.empty()}};function Ae(n){return Math.ceil(n.length/4)}function _e(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function Gt(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}function He(n){return new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}var st=class{containerEl;store;settings;saveSettings;currentItem=null;isEditing=!1;app;constructor(t,e,s,i,a){this.containerEl=t,this.store=e,this.settings=s,this.saveSettings=i,this.app=a.app}show(t){this.currentItem=t,this.isEditing=!1,this.render()}clear(){this.currentItem=null,this.containerEl.empty(),this.containerEl.addClass("as-detail");let t=this.containerEl.createDiv("as-detail-empty");(0,y.setIcon)(t.createDiv("as-detail-empty-icon"),"file-text"),t.createDiv({text:"Select a skill to view"})}render(){this.containerEl.empty(),this.containerEl.addClass("as-detail");let t=this.currentItem;if(!t)return this.clear();this.renderToolbar(t),this.isEditing?this.renderEditor(t):this.renderPreview(t)}renderToolbar(t){let e=this.containerEl.createDiv("as-detail-toolbar"),s=e.createDiv("as-toolbar-top"),i=s.createDiv("as-toolbar-left");i.createSpan({cls:"as-detail-title",text:t.name});for(let g of t.tools){let f=D.find(ft=>ft.id===g);if(!f)continue;let W=i.createSpan("as-tool-name-badge");W.setCssProps({"--tool-color":f.color}),C[g]&&j(W,g,12),W.createSpan({text:f.name})}let a=s.createDiv("as-toolbar-right"),r=a.createEl("button",{cls:"as-toolbar-btn",attr:{"aria-label":"Toggle favorite"}});(0,y.setIcon)(r,t.isFavorite?"star":"star-off"),r.addEventListener("click",()=>{this.store.toggleFavorite(t.id,this.settings),this.saveSettings(),this.render()});let l=a.createEl("button",{cls:"as-toolbar-btn",attr:{"aria-label":this.isEditing?"Preview":"Edit"}});(0,y.setIcon)(l,this.isEditing?"eye":"pencil"),l.addEventListener("click",()=>{this.isEditing=!this.isEditing,this.render()});let o=a.createEl("button",{cls:"as-toolbar-btn",attr:{"aria-label":"Show in system explorer"}});if((0,y.setIcon)(o,"folder-open"),o.addEventListener("click",()=>{Zt.shell.showItemInFolder(t.filePath)}),L()){let g=a.createEl("button",{cls:"as-toolbar-btn as-toolbar-btn-danger",attr:{"aria-label":"Remove skill"}});(0,y.setIcon)(g,"trash-2"),g.addEventListener("click",()=>{N(this.app,"Remove skill",`Remove "${t.name}"? This will delete the skill files.`,()=>{let f=U(`prune --skill ${t.name} --yes`);f.success?(new y.Notice(`Removed ${t.name}`,5e3),this.store.refresh(this.settings),this.clear()):new y.Notice(`Failed to remove: ${f.output}`,5e3)})})}let c=e.createDiv("as-detail-meta-bar"),d=Ae(t.content),m=t.content.length;if(c.createSpan({cls:"as-meta-item",text:_e(t.fileSize)}),c.createSpan({cls:"as-meta-item",text:`${Gt(m)} chars`}),c.createSpan({cls:"as-meta-item",text:`~${Gt(d)} tokens`}),c.createSpan({cls:"as-meta-item",text:He(t.lastModified)}),c.createSpan({cls:"as-meta-item as-meta-type",text:t.type}),t.usage&&t.usage.uses>0){let g=e.createDiv("as-detail-usage-bar");g.createSpan({cls:"as-usage-stat",text:`${t.usage.uses} uses`}),g.createSpan({cls:"as-usage-stat",text:`last: ${yt(t.usage.lastUsed)}`}),t.usage.isStale&&g.createSpan({cls:"as-badge-stale",text:"stale"}),t.usage.isHeavy&&g.createSpan({cls:"as-badge-heavy",text:"heavy"})}}renderFrontmatter(t,e){let s=Object.keys(e.frontmatter),i=t.createDiv("as-frontmatter");if(e.filePath){let a=i.createDiv("as-fm-prop");a.createSpan({cls:"as-fm-key",text:"path"}),a.createSpan({cls:"as-fm-value",text:e.filePath})}if(!(s.length===0&&!e.filePath))for(let a of s){let r=e.frontmatter[a];if(r==null)continue;let l=i.createDiv("as-fm-prop");l.createSpan({cls:"as-fm-key",text:a});let o=typeof r=="object"||Array.isArray(r)?JSON.stringify(r):String(r);o.length>200?l.createDiv({cls:"as-fm-value-long",text:o}):l.createSpan({cls:"as-fm-value",text:o})}}renderPreview(t){let e=this.containerEl.createDiv("as-detail-body");this.renderFrontmatter(e,t),this.renderWarnings(e,t),this.renderUsageSection(e,t),this.renderConflicts(e,t),this.renderTraces(e,t);let s=e.createDiv("as-detail-preview markdown-rendered");y.MarkdownRenderer.render(this.app,t.content,s,t.filePath,this)}renderWarnings(t,e){let s=[];if(e.warnings?.oversized&&s.push(`${e.warnings.lineCount} lines (recommended: <500)`),e.warnings?.longDesc&&s.push(`Description is ${e.warnings.descChars} chars (recommended: <1024)`),e.conflicts&&e.conflicts.length>0){let l=e.conflicts.map(o=>o.skillName).join(", ");s.push(`Conflicts with: ${l}`)}if(s.length===0)return;let i=t.createDiv("as-warnings"),a=i.createDiv("as-warnings-icon");(0,y.setIcon)(a,"alert-triangle");let r=i.createDiv("as-warnings-list");for(let l of s)r.createDiv({cls:"as-warnings-item",text:l})}renderUsageSection(t,e){if(!e.usage||e.usage.uses===0)return;let s=t.createDiv("as-usage-section"),i=s.createDiv("as-usage-left");if(i.createSpan({cls:"as-usage-count",text:String(e.usage.uses)}),i.createSpan({cls:"as-usage-label",text:"uses"}),i.createSpan({cls:"as-usage-last",text:yt(e.usage.lastUsed)}),e.usage.daily&&e.usage.daily.length>1){let a=s.createDiv("as-usage-spark");Vt(a,e.usage.daily.map(r=>r.count),80,20)}}renderConflicts(t,e){if(!e.conflicts||e.conflicts.length===0)return;let s=t.createDiv("as-conflicts-section");s.createDiv({cls:"as-section-title",text:`Conflicts (${e.conflicts.length})`});for(let i of e.conflicts){let a=s.createDiv("as-conflict-row");a.createSpan({cls:"as-conflict-name",text:i.skillName}),a.createDiv("as-conflict-bar-wrap").createDiv("as-conflict-bar").setCssProps({"--bar-w":`${(i.similarity*100).toFixed(0)}%`}),a.createSpan({cls:"as-conflict-score",text:`${(i.similarity*100).toFixed(0)}%`})}}renderTraces(t,e){if(!L())return;let s=zt(e.name);if(s.length===0)return;let i=t.createDiv("as-traces-section");i.createDiv({cls:"as-section-title",text:`Recent traces (${s.length})`});let a=i.createDiv("as-traces-table");for(let r of s){let l=a.createDiv("as-trace-row"),o=new Date(r.timestamp);l.createSpan({cls:"as-trace-date",text:o.toLocaleDateString(void 0,{month:"short",day:"numeric"})}),l.createSpan({cls:"as-trace-model",text:r.model.replace("claude-","").replace("-4-6","")}),l.createSpan({cls:"as-trace-tokens",text:`${(r.tokens/1e3).toFixed(1)}k`}),l.createSpan({cls:"as-trace-cost",text:r.cost>0?`$${r.cost.toFixed(2)}`:""}),l.createSpan({cls:"as-trace-duration",text:`${(r.duration/1e3).toFixed(1)}s`})}i.createDiv({cls:"as-traces-hint",text:"skillkit trace --list --skill "+e.name})}renderPruneAction(t,e){let s=t.createDiv("as-prune-section"),i=s.createEl("button",{cls:"as-prune-btn",text:"Remove this skill"});s.createSpan({cls:"as-prune-hint",text:"This skill hasn't been used in 30+ days"}),i.addEventListener("click",()=>{N(this.app,"Remove skill",`Remove "${e.name}"? This will delete the skill files.`,()=>{let a=U(`prune --skill ${e.name} --yes`);a.success?(new y.Notice(`Removed ${e.name}`,5e3),this.store.refresh(this.settings)):new y.Notice(`Failed to remove: ${a.output}`,5e3)})})}renderEditor(t){let e=this.containerEl.createDiv("as-detail-body as-detail-body-editor"),s=e.createEl("textarea",{cls:"as-editor-textarea"});s.value=t.content,s.spellcheck=!1,s.addEventListener("keydown",r=>{if((r.metaKey||r.ctrlKey)&&r.key==="s"&&(r.preventDefault(),this.saveFile(t,s.value)),r.key==="Tab"){r.preventDefault();let l=s.selectionStart,o=s.selectionEnd;s.value=s.value.substring(0,l)+" "+s.value.substring(o),s.selectionStart=s.selectionEnd=l+1}});let i=e.createDiv("as-save-bar");i.createEl("button",{cls:"as-save-btn",text:"Save"}).addEventListener("click",()=>{this.saveFile(t,s.value)}),i.createSpan({cls:"as-save-hint",text:"Cmd+S to save"})}saveFile(t,e){try{(0,Jt.writeFileSync)(t.filePath,e,"utf-8"),t.content=e,new y.Notice(`Saved ${t.name}`,5e3)}catch(s){new y.Notice(`Failed to save: ${s instanceof Error?s.message:String(s)}`,5e3)}}};var _=require("obsidian"),re=require("electron");var xt=require("child_process"),w=require("fs"),S=require("path"),Xt=require("os"),q=require("obsidian"),x=(0,Xt.homedir)(),Kt=(0,S.join)(x,".agents",".skill-lock.json"),$e="https://skills.sh/api";async function Dt(n){if(n.length<2)return[];try{let e=(await(0,q.requestUrl)({url:`${$e}/search?q=${encodeURIComponent(n)}&limit=30`})).json;if(!e.skills)return[];let s=se();return e.skills.map(i=>({...i,installed:s.has(i.name)}))}catch{return[]}}var Qt=new Map;async function Fe(n){let t=Qt.get(n);if(t)return t;let s=(await(0,q.requestUrl)({url:`https://api.github.com/repos/${n}`})).json.default_branch||"main",a=(await(0,q.requestUrl)({url:`https://api.github.com/repos/${n}/git/trees/${s}?recursive=1`})).json.tree.filter(l=>l.path.endsWith("/SKILL.md")).map(l=>l.path),r={branch:s,files:a};return Qt.set(n,r),r}function je(n,t,e){let s=t.split("/"),i=s[s.length-1]||n,a=new Set([i,n]);for(let r of e.split("/")){n.startsWith(r+"-")&&a.add(n.slice(r.length+1));for(let l of r.split("-"))n.startsWith(l+"-")&&a.add(n.slice(l.length+1))}return a}async function Yt(n,t,e){try{let{branch:s,files:i}=await Fe(n),a=je(t,e,n),r=i.find(c=>{let d=c.replace("/SKILL.md","").split("/").pop()||"";return a.has(d)});r||(r=i.find(c=>{let d=c.replace("/SKILL.md","").split("/").pop()||"";return t.includes(d)||d.includes(t)}));let l=r||`skills/${t}/SKILL.md`;return(await(0,q.requestUrl)({url:`https://raw.githubusercontent.com/${n}/${s}/${l}`})).text}catch{return null}}async function te(){let n=["react","next","clerk","stripe","ai"],t=new Set,e=[];for(let s of n){let i=await Dt(s);for(let a of i)t.has(a.id)||(t.add(a.id),e.push(a))}return e.sort((s,i)=>i.installs-s.installs).slice(0,20)}function Re(){let n=["/usr/local/bin","/opt/homebrew/bin",(0,S.join)(x,".local","bin"),(0,S.join)(x,".bun","bin")],t=(0,S.join)(x,".nvm","versions","node");try{for(let e of(0,w.readdirSync)(t))n.push((0,S.join)(t,e,"bin"))}catch{}return[...n,process.env.PATH||""].join(":")}function qt(){let n=(0,S.join)(x,".bun","bin","bunx");return(0,w.existsSync)(n)?n:(0,w.existsSync)("/usr/local/bin/bunx")||(0,w.existsSync)("/opt/homebrew/bin/bunx")?"bunx":"npx"}function Et(n="auto"){return n==="npx"?"npx":qt()}var ee=[{id:"claude-code",label:"Claude Code"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"github-copilot",label:"GitHub Copilot"},{id:"windsurf",label:"Windsurf"},{id:"amp",label:"Amp"},{id:"opencode",label:"OpenCode"},{id:"cline",label:"Cline"},{id:"gemini-cli",label:"Gemini CLI"},{id:"goose",label:"Goose"},{id:"kiro-cli",label:"Kiro"},{id:"roo",label:"Roo Code"},{id:"continue",label:"Continue"},{id:"antigravity",label:"Antigravity"},{id:"warp",label:"Warp"},{id:"pi",label:"Pi"},{id:"replit",label:"Replit"}],it={"claude-code":"claude-code",cursor:"cursor",codex:"codex",copilot:"github-copilot",windsurf:"windsurf",amp:"amp",opencode:"opencode",antigravity:"antigravity","claude-desktop":"claude-code",pi:"pi","global-agents":"claude-code",aider:"claude-code"};function se(){let n=new Set;if(!(0,w.existsSync)(Kt))return n;try{let t=JSON.parse((0,w.readFileSync)(Kt,"utf-8"));if(t.skills)for(let e of Object.keys(t.skills))n.add(e)}catch{}return n}var Oe=[(0,S.join)(x,".claude","skills"),(0,S.join)(x,".cursor","skills"),(0,S.join)(x,".codex","skills"),(0,S.join)(x,".codeium","windsurf","skills"),(0,S.join)(x,".config","amp","skills"),(0,S.join)(x,".config","opencode","skills"),(0,S.join)(x,".copilot","skills"),(0,S.join)(x,".agents","skills")];function Be(n){for(let t of Oe){let e=(0,S.join)(t,n);if((0,w.existsSync)(e))try{(0,w.rmSync)(e,{recursive:!0,force:!0})}catch{}}Ne(n)}function Ne(n){let t=(0,S.join)(x,".agents",".skill-lock.json");if((0,w.existsSync)(t))try{let e=JSON.parse((0,w.readFileSync)(t,"utf-8"));e.skills&&e.skills[n]&&(delete e.skills[n],(0,w.writeFileSync)(t,JSON.stringify(e,null,2)+` -`,"utf-8"))}catch{}}function nt(n){let t=se();for(let e of n)e.installed=t.has(e.name);return n}function Ct(n,t=12e4){return new Promise(e=>{(0,xt.exec)(n,{encoding:"utf-8",timeout:t,env:{...process.env,PATH:Re(),NO_COLOR:"1"}},(s,i)=>{let a=String(i??"");!s||a.includes("Done")||a.includes("Installed")||a.includes("Removed")||a.includes("Updated")?e({success:!0,output:a}):e({success:!1,output:s?.message??"Command failed"})})})}async function ie(n,t,e={}){let s=t.length>0?`-a ${t.join(" ")}`:"-a '*'",i=e.global?"-g":"",r=`${Et(e.runner||"auto")} skills add ${n} ${s} ${i} -y`.replace(/\s+/g," ").trim();return Ct(r)}async function ne(n,t="auto"){let s=`${Et(t)} skills remove ${n} -y`,i=await Ct(s,3e4);return Be(n),{success:!0,output:i.output||`Cleaned ${n}`}}async function ae(n="auto"){let e=`${Et(n)} skills update`,s=await Ct(e),i=s.output.match(/Updated (\d+) skill/);return{...s,count:i?parseInt(i[1]):0}}function Lt(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}var G=require("fs"),oe=require("path"),le=require("os");function ze(){let n=$("stats"),t=$("health"),e=$("burn"),s=$("context");return{stats:n,health:t,burn:e&&e.length>0?e[0]:null,context:s}}var Tt=(0,oe.join)((0,le.homedir)(),".skillkit","dashboard-cache.json"),H=null,O=null;function We(){if(!H&&(0,G.existsSync)(Tt))try{let n=JSON.parse((0,G.readFileSync)(Tt,"utf-8"));H=n.data,O=n.cachedAt}catch{}}function Ve(){if(H)try{(0,G.writeFileSync)(Tt,JSON.stringify({data:H,cachedAt:O},null,2),"utf-8")}catch{}}We();var at=class{containerEl;app;constructor(t,e){this.containerEl=t,this.app=e}render(){if(this.containerEl.empty(),this.containerEl.addClass("as-dashboard"),!L()){this.renderNoSkillkit();return}if(H)this.renderDashboard(H);else{let t=this.containerEl.createDiv("as-dash-loading");t.createDiv("as-dash-spinner"),t.createDiv({cls:"as-dash-loading-text",text:"Loading analytics..."}),setTimeout(()=>{let e=ze();H=e,O=Date.now(),Ve(),t.remove(),this.renderDashboard(e)},10)}}renderDashboard(t){if(this.renderActionBar(t),t.stats&&this.renderOverview(t.stats,t.health),t.stats&&this.renderTopSkills(t.stats),t.health||t.context){let e=this.containerEl.createDiv("as-dash-row");t.health&&this.renderHealth(t.health,e),t.context&&this.renderContext(t.context,e)}t.burn&&this.renderBurn(t.burn),t.health&&this.renderStale(t.health)}renderActionBar(t){let e=this.containerEl.createDiv("as-dash-action-bar");if(O){let r=Math.round((Date.now()-O)/1e3),l=r<5?"just now":r<60?`${r}s ago`:`${Math.round(r/60)}m ago`;e.createSpan({cls:"as-dash-updated",text:`Updated ${l}`})}let s=e.createDiv("as-dash-action-buttons"),i=s.createEl("button",{cls:"as-action-btn",text:"Update skills"});i.addEventListener("click",()=>{i.setText("Updating..."),i.disabled=!0,ae().then(r=>{if(r.success){let l=r.count>0?`Updated ${r.count} skill(s)`:"All skills up to date";new _.Notice(l,5e3),H=null,O=null,this.render()}else new _.Notice(`Update failed: ${r.output}`,5e3);i.setText("Update skills"),i.disabled=!1})});let a=s.createEl("button",{cls:"as-action-btn",text:"Scan sessions"});if(a.addEventListener("click",()=>{a.setText("Scanning..."),a.disabled=!0,setTimeout(()=>{let r=U("scan");r.success?(new _.Notice("Scan complete",5e3),H=null,O=null,this.render()):new _.Notice(`Scan failed: ${r.output}`,5e3),a.setText("Scan sessions"),a.disabled=!1},10)}),t.health&&t.health.usage.unused_30d>0){let r=s.createEl("button",{cls:"as-action-btn as-action-btn-danger",text:`Prune ${t.health.usage.unused_30d} stale`});r.addEventListener("click",()=>{N(this.app,"Prune stale skills",`Remove ${t.health.usage.unused_30d} unused skills? This cannot be undone.`,()=>{r.setText("Pruning..."),r.disabled=!0,setTimeout(()=>{let l=U("prune --yes");l.success?(new _.Notice("Pruned stale skills",5e3),H=null,O=null,this.render()):new _.Notice(`Prune failed: ${l.output}`,5e3),r.setText(`Prune ${t.health.usage.unused_30d} stale`),r.disabled=!1},10)})})}}renderNoSkillkit(){let t=this.containerEl.createDiv("as-dash-empty"),e=t.createDiv("as-dash-empty-icon");(0,_.setIcon)(e,"bar-chart-2"),t.createEl("h3",{text:"Dashboard requires skillkit"}),t.createEl("p",{text:"Install skillkit to unlock usage analytics, burn rate, context tax, and more."}),t.createDiv("as-dash-install-cmd").createEl("code",{text:"npm i -g @crafter/skillkit && skillkit scan"}),t.createEl("a",{cls:"as-skillkit-link",text:"Learn more",href:"https://www.npmjs.com/package/@crafter/skillkit"}).addEventListener("click",a=>{a.preventDefault(),re.shell.openExternal("https://www.npmjs.com/package/@crafter/skillkit")})}renderOverview(t,e){let s=this.containerEl.createDiv("as-dash-section");s.createDiv({cls:"as-dash-title",text:"Overview"});let i=s.createDiv("as-dash-stats");if(this.statCard(i,String(t.total_invocations),"invocations","activity"),this.statCard(i,String(t.unique_skills),"active skills","sparkles"),this.statCard(i,String(e?.installed??0),"installed","package"),this.statCard(i,String(e?.usage.unused_30d??0),"stale","alert-triangle"),t.streak&&t.streak.current>0){let a=s.createDiv("as-dash-streak-row");a.createSpan({cls:"as-streak-value",text:`${t.streak.current} day streak`}),t.streak.current>=7&&a.createSpan({cls:"as-streak-fire",text:"on fire"}),a.createSpan({cls:"as-streak-longest",text:`longest: ${t.streak.longest}d`})}if(t.velocity&&t.velocity.this_week>0){let a=s.createDiv("as-dash-velocity-row");a.createSpan({text:`This week: $${t.velocity.this_week.toFixed(0)}`}),a.createSpan({cls:"as-velocity-vs",text:`vs $${t.velocity.last_week.toFixed(0)} last week`});let r=t.velocity.change_pct,l=r>0?"as-velocity-up":r<0?"as-velocity-down":"",o=r>0?"+":"";a.createSpan({cls:`as-velocity-change ${l}`,text:`${o}${r.toFixed(0)}%`})}}statCard(t,e,s,i){let a=t.createDiv("as-stat-card"),r=a.createDiv("as-stat-icon");(0,_.setIcon)(r,i),a.createDiv({cls:"as-stat-value",text:e}),a.createDiv({cls:"as-stat-label",text:s})}renderTopSkills(t){if(t.top_skills.length===0)return;let e=this.containerEl.createDiv("as-dash-section");e.createDiv({cls:"as-dash-title",text:`Top Skills (${t.period.days}d)`});let s=t.top_skills[0]?.total||1,i=e.createDiv("as-dash-bars");for(let a of t.top_skills.slice(0,10)){let r=i.createDiv("as-bar-row");r.createSpan({cls:"as-bar-name",text:a.name}),r.createDiv("as-bar-wrap").createDiv("as-bar-fill").setCssProps({"--bar-w":`${a.total/s*100}%`}),r.createSpan({cls:"as-bar-count",text:String(a.total)})}}renderHealth(t,e){let s=(e||this.containerEl).createDiv("as-dash-section");s.createDiv({cls:"as-dash-title",text:"Health"});let i=t.usage.used_30d+t.usage.unused_30d,a=i>0?Math.round(t.usage.used_30d/i*100):0,r=s.createDiv("as-dash-health-row"),l=r.createDiv("as-donut");l.setCssProps({"--pct":`${a}`}),l.createDiv({cls:"as-donut-label",text:`${a}%`}),l.createDiv({cls:"as-donut-sub",text:"active"});let o=r.createDiv("as-health-details");o.createDiv({cls:"as-health-line",text:`${t.usage.used_30d} used in 30d`}),o.createDiv({cls:"as-health-line as-health-warn",text:`${t.usage.unused_30d} never triggered`});let d=o.createDiv("as-budget-bar").createDiv("as-budget-fill");d.setCssProps({"--bar-w":`${t.metadata.pct}%`}),t.metadata.pct>80&&d.addClass("as-budget-over"),o.createDiv({cls:"as-health-line",text:`Metadata budget: ${t.metadata.pct}%`})}renderBurn(t){let e=this.containerEl.createDiv("as-dash-section");e.createDiv({cls:"as-dash-title",text:`Burn Rate \u2014 ${t.agent} (${t.period.days}d)`});let s=e.createDiv("as-dash-stats as-dash-stats-sm");if(this.statCard(s,`$${Math.round(t.cost.total).toLocaleString()}`,"total cost","flame"),this.statCard(s,`$${Math.round(t.cost.total/(t.period.days||1)).toLocaleString()}`,"daily avg","trending-up"),this.statCard(s,`${(t.period.sessions||0).toLocaleString()}`,"sessions","terminal"),this.statCard(s,`${((t.period.api_calls||0)/1e3).toFixed(0)}k`,"API calls","zap"),t.by_model&&t.by_model.length>0){let l=e.createDiv("as-model-breakdown");for(let o of t.by_model.slice(0,4)){let c=l.createDiv("as-model-row");c.createSpan({cls:"as-model-name",text:o.model}),c.createSpan({cls:"as-model-calls",text:`${o.apiCalls.toLocaleString()} calls`}),o.costUsd>0&&c.createSpan({cls:"as-model-cost",text:`$${Math.round(o.costUsd).toLocaleString()}`})}}let i=t.by_day.slice(-14);if(i.length===0)return;let a=Math.max(...i.map(l=>l.costUsd),1),r=e.createDiv("as-burn-chart");for(let l of i){let o=r.createDiv("as-burn-col"),c=o.createDiv("as-burn-bar"),d=Math.max(2,l.costUsd/a*100);c.setCssProps({"--bar-h":`${d}%`}),c.title=`${l.date}: $${l.costUsd.toFixed(0)}`,o.createDiv({cls:"as-burn-date",text:l.date.slice(8)})}}renderContext(t,e){let s=(e||this.containerEl).createDiv("as-dash-section");s.createDiv({cls:"as-dash-title",text:"Context Tax"});let i=t.always_loaded.total_tokens,a=[{label:"CLAUDE.md",tokens:t.always_loaded.claude_md_tokens,cls:"as-ctx-claude"},{label:"Skills metadata",tokens:t.always_loaded.skill_metadata_tokens,cls:"as-ctx-skills"},{label:"Memory",tokens:t.always_loaded.memory_tokens,cls:"as-ctx-memory"}],r=s.createDiv("as-ctx-bar");for(let c of a){let d=r.createDiv(`as-ctx-part ${c.cls}`);d.setCssProps({"--bar-w":`${c.tokens/i*100}%`}),d.title=`${c.label}: ${(c.tokens/1e3).toFixed(1)}k tokens`}let l=s.createDiv("as-ctx-legend");for(let c of a){let d=l.createDiv("as-ctx-legend-item");d.createSpan({cls:`as-ctx-dot ${c.cls}`}),d.createSpan({text:`${c.label}: ${(c.tokens/1e3).toFixed(1)}k`})}let o=s.createDiv("as-ctx-costs");o.createDiv({text:`Per session (cached): $${t.session_estimate.with_cache.toFixed(2)}`}),o.createDiv({text:`Without cache: $${t.session_estimate.without_cache.toFixed(2)}`}),o.createDiv({cls:"as-ctx-savings",text:`Cache saves ${t.session_estimate.savings_pct.toFixed(0)}%`})}renderStale(t){if(t.usage.never_used.length===0)return;let e=this.containerEl.createDiv("as-dash-section");e.createDiv({cls:"as-dash-title",text:`Stale skills (${t.usage.unused_30d})`});let s=e.createDiv("as-stale-list");for(let i of t.usage.never_used.slice(0,20))s.createDiv("as-stale-item").createSpan({text:i});t.usage.never_used.length>20&&s.createDiv({cls:"as-stale-more",text:`+${t.usage.never_used.length-20} more`})}};var P=require("obsidian"),Z=require("fs"),ve=require("path"),be=require("os");var T=require("obsidian"),J=require("fs"),ge=require("path"),fe=require("os");var h=require("fs"),v=require("path"),rt=require("os"),de=require("obsidian"),pe=require("crypto");var ce=new Set(["readme.md","license","license.md","changelog.md",".ds_store","thumbs.db"]);function Ue(n){return(0,pe.createHash)("sha256").update(n).digest("hex").slice(0,12)}function Ge(n){let t=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{frontmatter:{},content:n};try{let e=(0,de.parseYaml)(t[1]);return{frontmatter:typeof e=="object"&&e?e:{},content:t[2]}}catch{return{frontmatter:{},content:n}}}function Je(n,t,e,s="auto"){if(s==="auto"){if(typeof n.name=="string"&&n.name)return n.name;let a=t.match(/^#\s+(.+)$/m);if(a)return a[1].trim()}let i=(0,v.basename)(e,(0,v.extname)(e));return i==="SKILL"?(0,v.basename)((0,v.join)(e,"..")):i}function Ze(n,t,e,s="auto"){if(!(0,h.existsSync)(n))return[];let i=[];for(let a of(0,h.readdirSync)(n,{withFileTypes:!0})){let r=(0,v.join)(n,a.name);if(!(a.isDirectory()||a.isSymbolicLink()&&(0,h.statSync)(r,{throwIfNoEntry:!1})?.isDirectory()))continue;let o=(0,v.join)(r,"SKILL.md");if(!(0,h.existsSync)(o))continue;let c=X(o,t,e,"directory-with-skillmd",s);c&&i.push(c)}return i}function Ke(n,t,e,s="auto"){if(!(0,h.existsSync)(n))return[];let i=[];for(let a of(0,h.readdirSync)(n,{withFileTypes:!0})){let r=(0,v.join)(n,a.name);if(a.isDirectory()||a.isSymbolicLink()&&(0,h.statSync)(r,{throwIfNoEntry:!1})?.isDirectory()){let d=(0,v.join)(r,"SKILL.md");if((0,h.existsSync)(d)){let f=X(d,t,e,"flat-md",s);f&&i.push(f);continue}let m=(0,h.readdirSync)(r).filter(f=>f.endsWith(".md")&&!ce.has(f.toLowerCase())),g=m.find(f=>f.toLowerCase()===`${a.name.toLowerCase()}.md`)||m[0];if(g){let f=X((0,v.join)(r,g),t,e,"flat-md",s);f&&i.push(f)}continue}let o=a.name.toLowerCase();if(!o.endsWith(".md")||ce.has(o))continue;let c=X(r,t,e,"flat-md",s);c&&i.push(c)}return i}function Qe(n,t,e,s="auto"){if(!(0,h.existsSync)(n))return[];let i=[];for(let a of(0,h.readdirSync)(n,{withFileTypes:!0})){if(!a.name.endsWith(".mdc")&&!a.name.endsWith(".md")||a.isDirectory())continue;let r=X((0,v.join)(n,a.name),t,e,"mdc",s);r&&i.push(r)}return i}function X(n,t,e,s="directory-with-skillmd",i="auto"){try{let a=(0,h.readFileSync)(n,"utf-8"),r=(0,h.statSync)(n),{frontmatter:l,content:o}=Ge(a),c=Je(l,o,n,i),d=typeof l.description=="string"?l.description:"",m;try{m=(0,h.realpathSync)(n)}catch{m=n}return{id:Ue(m),name:c,description:d,type:t,tools:[e],filePath:n,realPath:m,dirPath:(0,v.join)(n,".."),content:a,frontmatter:l,lastModified:r.mtimeMs,fileSize:r.size,isFavorite:!1,collections:[]}}catch{return null}}function Mt(n,t,e="auto"){switch(n.pattern){case"directory-with-skillmd":return Ze(n.baseDir,n.type,t,e);case"flat-md":return Ke(n.baseDir,n.type,t,e);case"mdc":return Qe(n.baseDir,n.type,t,e)}}function qe(n,t){let e=[],s=[{sub:".claude/skills",type:"skill",pattern:"directory-with-skillmd"},{sub:".claude/commands",type:"command",pattern:"flat-md"},{sub:".claude/agents",type:"agent",pattern:"flat-md"},{sub:".cursor/skills",type:"skill",pattern:"directory-with-skillmd"},{sub:".codex/skills",type:"skill",pattern:"directory-with-skillmd"}];for(let i of s){let a=(0,v.join)(n,i.sub);if(!(0,h.existsSync)(a))continue;let r={baseDir:a,type:i.type,pattern:i.pattern};e.push(...Mt(r,t))}return e}function ue(n){return n.projectsHomeDir||(0,rt.homedir)()}function Xe(n,t){let e=(0,rt.homedir)(),s=[];for(let i of[...t.paths,...t.agentPaths]){let a=(0,v.relative)(e,i.baseDir);if(a.startsWith("..")||a.startsWith("/"))continue;let r=(0,v.join)(n,a);if((0,h.existsSync)(r))try{s.push(...Mt({...i,baseDir:r},t.id))}catch{}}return s}function Ye(n){let t=ue(n);if(!(0,h.existsSync)(t))return[];let e=[];try{let s=new Set(["node_modules",".Trash","Library","Applications","Music","Movies","Pictures","Public"]);for(let i of(0,h.readdirSync)(t,{withFileTypes:!0})){if(!i.isDirectory()&&!i.isSymbolicLink()||s.has(i.name))continue;let a=(0,v.join)(t,i.name);for(let r of D){if(!r.isInstalled())continue;let l=n.tools[r.id];if(l&&!l.enabled)continue;let o=Xe(a,r);o.length>0&&e.push({items:o,toolId:r.id})}}}catch{}return e}function Pt(n,t){let e=t||(0,rt.homedir)();if(!n.startsWith(e+"/"))return"global";let i=n.slice(e.length+1).split("/");return i.length>1&&!i[0].startsWith(".")?i[0]:"global"}function he(n){let t=n.namingMode||"auto",e=new Map,s=new Map;function i(a,r){let l=e.get(a.id);if(l){l.tools.includes(r)||l.tools.push(r);return}let o=s.get(a.name);if(o){let c=e.get(o);c&&!c.tools.includes(r)&&c.tools.push(r);return}a.isFavorite=n.favorites.includes(a.id);for(let[c,d]of Object.entries(n.collections))d.includes(a.id)&&a.collections.push(c);e.set(a.id,a),s.set(a.name,a.id)}for(let a of D){if(!a.isInstalled())continue;let r=n.tools[a.id];if(r&&!r.enabled)continue;let l=[...a.paths,...a.agentPaths];for(let o of l)for(let c of Mt(o,a.id,t))i(c,a.id)}for(let a of n.customScanPaths)if((0,h.existsSync)(a))for(let r of qe(a,"claude-code"))i(r,"claude-code");if(n.projectScanEnabled)for(let{items:a,toolId:r}of Ye(n))for(let l of a)i(l,r);return e}function It(){return D.filter(n=>n.isInstalled()).map(n=>n.id)}function me(n){let t=[];for(let e of D)if(e.isInstalled())for(let s of[...e.paths,...e.agentPaths])(0,h.existsSync)(s.baseDir)&&t.push(s.baseDir);if(n?.projectScanEnabled){let e=ue(n),s=new Set(["node_modules",".Trash","Library","Applications","Music","Movies","Pictures","Public"]);try{for(let i of(0,h.readdirSync)(e,{withFileTypes:!0})){if(!i.isDirectory()&&!i.isSymbolicLink()||s.has(i.name))continue;let a=(0,v.join)(e,i.name);for(let r of[".claude/skills",".claude/commands",".claude/agents",".cursor/skills",".codex/skills"]){let l=(0,v.join)(a,r);(0,h.existsSync)(l)&&t.push(l)}}}catch{}}return t}var At={};for(let[n,t]of Object.entries(it))At[t]||(At[t]=n);var _t=(0,ge.join)((0,fe.homedir)(),".skillkit","install-prefs.json"),z=null,ot=!0;function ts(){if(!z&&(0,J.existsSync)(_t))try{let n=JSON.parse((0,J.readFileSync)(_t,"utf-8"));z=new Set(n.agents||[]),ot=n.global??!0}catch{}}function es(){try{(0,J.writeFileSync)(_t,JSON.stringify({agents:z?[...z]:[],global:ot}),"utf-8")}catch{}}ts();var lt=class extends T.Modal{skill;settings;onInstalled;selectedAgents;isGlobal;constructor(t,e,s,i){if(super(t),this.skill=e,this.settings=s,this.onInstalled=i,z)this.selectedAgents=new Set(z);else{this.selectedAgents=new Set;let a=It();for(let r of a){let l=it[r];l&&this.selectedAgents.add(l)}}this.isGlobal=ot}onOpen(){let{contentEl:t}=this;t.addClass("as-install-modal"),t.createEl("h3",{text:`Install ${this.skill.name}`}),t.createEl("p",{cls:"as-install-source",text:this.skill.source}),new T.Setting(t).setName("Install globally").setDesc("Shared across all projects (~/.agents/skills/)").addToggle(o=>o.setValue(this.isGlobal).onChange(c=>{this.isGlobal=c})),new T.Setting(t).setName("Agents").setHeading();let e=t.createDiv("as-install-scroll"),s=It(),i=new Set(s.map(o=>it[o]).filter(Boolean));for(let o of ee){let c=i.has(o.id),d=At[o.id],g=new T.Setting(e).addToggle(ft=>ft.setValue(this.selectedAgents.has(o.id)).onChange(xe=>{xe?this.selectedAgents.add(o.id):this.selectedAgents.delete(o.id)})).nameEl,f=d&&C[d]?d:C[o.id]?o.id:C[o.id+"-code"]?o.id+"-code":C[o.id+"-cli"]?o.id+"-cli":null,W=g.createSpan("as-install-agent-icon");f?j(W,f,14):W.addClass("as-install-agent-placeholder"),g.createSpan({text:o.label}),c&&g.createSpan({cls:"as-install-detected",text:"detected"})}let a=t.createDiv("as-install-footer");a.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close());let l=a.createEl("button",{cls:"mod-cta",text:"Install"});l.addEventListener("click",()=>this.doInstall(l))}doInstall(t){let e=[...this.selectedAgents];if(e.length===0){new T.Notice("Select at least one agent",5e3);return}z=new Set(this.selectedAgents),ot=this.isGlobal,es(),this.close(),new T.Notice(`Installing ${this.skill.name}...`,3e3),ie(this.skill.source,e,{runner:this.settings.packageRunner,global:this.isGlobal}).then(s=>{s.success?(new T.Notice(`Installed ${this.skill.name}`,5e3),this.skill.installed=!0,this.onInstalled()):new T.Notice(`Failed to install ${this.skill.name}`,5e3)})}onClose(){this.contentEl.empty()}};var Ht=(0,ve.join)((0,be.homedir)(),".skillkit","marketplace-popular.json"),M=null,ct="",B=null,ss=new P.Component;function is(){if(!M&&(0,Z.existsSync)(Ht))try{let n=JSON.parse((0,Z.readFileSync)(Ht,"utf-8"));M=nt(n)}catch{}}function ns(){if(M)try{(0,Z.writeFileSync)(Ht,JSON.stringify(M),"utf-8")}catch{}}is();var dt=class{containerEl;inputEl=null;listEl=null;previewEl=null;searchTimer=null;selectedSkill=null;app;settings;onRefresh;constructor(t,e,s,i){this.containerEl=t,this.app=e.app,this.settings=s,this.onRefresh=i}render(){if(!this.inputEl){this.containerEl.empty(),this.containerEl.addClass("as-marketplace");let t=this.containerEl.createDiv("as-mp-search");this.inputEl=t.createEl("input",{type:"text",placeholder:"Search skills on skills.sh...",cls:"as-mp-search-input"}),this.inputEl.addEventListener("input",()=>{this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout(()=>{this.doSearch(this.inputEl.value)},300)});let e=this.containerEl.createDiv("as-mp-body");this.listEl=e.createDiv("as-mp-list"),this.previewEl=e.createDiv("as-mp-preview"),this.previewEl.createDiv({cls:"as-mp-hint",text:"Select a skill to preview."})}this.inputEl.value=ct,ct.length>=2&&B?this.showResults(B):M?this.showPopular():this.loadPopular()}async loadPopular(){if(!this.listEl)return;this.listEl.empty(),this.listEl.createDiv({cls:"as-mp-loading",text:"Loading popular skills..."}),M=await te(),ns(),this.showPopular()}refreshList(){M&&nt(M),B&&nt(B),ct.length>=2&&B?this.showResults(B):this.showPopular()}showPopular(){if(this.listEl){if(this.listEl.empty(),!M||M.length===0){this.listEl.createDiv({cls:"as-mp-hint",text:"Search for skills to browse and install."});return}this.listEl.createDiv({cls:"as-mp-section-title",text:"Popular"});for(let t of M)this.renderSkillCard(t)}}showResults(t){if(this.listEl){if(this.listEl.empty(),t.length===0){this.listEl.createDiv({cls:"as-mp-hint",text:"No skills found."});return}for(let e of t)this.renderSkillCard(e)}}async doSearch(t){if(!this.listEl)return;if(ct=t,t.length<2){B=null,this.showPopular();return}this.listEl.empty(),this.listEl.createDiv({cls:"as-mp-loading",text:"Searching..."});let e=await Dt(t);B=e,this.showResults(e)}renderSkillCard(t){if(!this.listEl)return;let e=this.listEl.createDiv("as-mp-card");this.selectedSkill?.id===t.id&&e.addClass("is-selected");let s=e.createDiv("as-mp-card-header");s.createSpan({cls:"as-mp-card-name",text:t.name}),t.installed&&s.createSpan({cls:"as-mp-installed-badge",text:"Installed"}),e.createDiv({cls:"as-mp-card-source",text:t.source});let i=e.createDiv("as-mp-card-meta"),a=i.createSpan("as-mp-dl-icon");(0,P.setIcon)(a,"download"),i.createSpan({cls:"as-mp-card-installs",text:Lt(t.installs)}),e.addEventListener("click",()=>{this.selectedSkill=t,this.listEl&&this.listEl.querySelectorAll(".as-mp-card").forEach(r=>r.removeClass("is-selected")),e.addClass("is-selected"),this.showPreview(t)})}async showPreview(t){if(!this.previewEl)return;this.previewEl.empty();let s=this.previewEl.createDiv("as-mp-preview-header").createDiv("as-mp-preview-top"),i=s.createDiv("as-mp-preview-left");i.createDiv({cls:"as-mp-preview-name",text:t.name});let a=i.createDiv("as-mp-preview-meta");a.createSpan({cls:"as-mp-preview-source",text:t.source});let r=a.createSpan("as-mp-dl-icon");(0,P.setIcon)(r,"download"),a.createSpan({cls:"as-mp-preview-installs",text:Lt(t.installs)});let l=s.createDiv("as-mp-preview-right");if(!t.installed)this.renderInstallButton(l,t);else{l.createSpan({cls:"as-mp-installed-label",text:"Installed"});let d=l.createEl("button",{cls:"as-mp-uninstall-btn",text:"Uninstall"});d.addEventListener("click",()=>{N(this.app,"Uninstall skill",`Remove "${t.name}" from all agents?`,()=>{d.setText("Removing..."),d.disabled=!0,new P.Notice(`Removing ${t.name}...`,3e3),ne(t.name,this.settings.packageRunner).then(m=>{m.success?(new P.Notice(`Removed ${t.name}`,5e3),t.installed=!1,this.refreshList(),this.showPreview(t)):(new P.Notice(`Failed to remove ${t.name}`,5e3),d.setText("Uninstall"),d.disabled=!1)})})})}let o=this.previewEl.createDiv("as-mp-preview-content");o.createDiv({cls:"as-mp-loading",text:"Loading skill content..."});let c=await Yt(t.source,t.name,t.id);if(o.empty(),c){t.content=c;let d=o.createDiv("as-mp-rendered markdown-rendered");P.MarkdownRenderer.render(this.app,c,d,"",ss)}else o.createDiv({cls:"as-mp-hint",text:"Could not load skill content."})}renderInstallButton(t,e){t.createEl("button",{cls:"as-mp-install-btn",text:"Install"}).addEventListener("click",()=>{new lt(this.app,e,this.settings,()=>{this.refreshList(),this.showPreview(e)}).open()})}};var Y="agentfiles-view",pt=class extends ke.ItemView{store;settings;saveSettings;sidebarPanel;listPanel;detailPanel;dashboardPanel;marketplacePanel;sidebarEl;listEl;detailEl;dashboardEl;marketplaceEl;resizeHandle1;resizeHandle2;isDashboard=!1;isMarketplace=!1;updateRef=null;dragCleanup=null;constructor(t,e,s,i){super(t),this.store=e,this.settings=s,this.saveSettings=i}getViewType(){return Y}getDisplayText(){return"Agentfiles"}getIcon(){return"cpu"}onOpen(){let t=this.contentEl;t.empty(),t.addClass("as-container"),this.sidebarEl=t.createDiv("as-panel as-panel-sidebar"),this.resizeHandle1=this.createResizeHandle(t,this.sidebarEl,"--as-sidebar-width",120,400),this.listEl=t.createDiv("as-panel as-panel-list"),this.resizeHandle2=this.createResizeHandle(t,this.listEl,"--as-list-width",180,600),this.detailEl=t.createDiv("as-panel as-panel-detail"),this.dashboardEl=t.createDiv("as-panel as-panel-dashboard as-hidden"),this.marketplaceEl=t.createDiv("as-panel as-panel-marketplace as-hidden"),this.sidebarPanel=new tt(this.sidebarEl,this.store,()=>this.toggleDashboard(),()=>this.toggleMarketplace()),this.listPanel=new et(this.listEl,this.store,e=>this.onSelectItem(e)),this.detailPanel=new st(this.detailEl,this.store,this.settings,this.saveSettings,this),this.dashboardPanel=new at(this.dashboardEl,this.app),this.marketplacePanel=new dt(this.marketplaceEl,this,this.settings,()=>{this.store.refresh(this.settings)}),this.updateRef=this.store.on("updated",()=>this.renderAll()),this.renderAll()}toggleDashboard(){this.dragCleanup?.(),this.dragCleanup=null,this.isDashboard=!this.isDashboard,this.isMarketplace&&(this.isMarketplace=!1,this.marketplaceEl.addClass("as-hidden")),this.isDashboard?(this.listEl.addClass("as-hidden"),this.detailEl.addClass("as-hidden"),this.resizeHandle1.addClass("as-hidden"),this.resizeHandle2.addClass("as-hidden"),this.dashboardEl.removeClass("as-hidden"),this.dashboardPanel.render()):(this.listEl.removeClass("as-hidden"),this.detailEl.removeClass("as-hidden"),this.resizeHandle1.removeClass("as-hidden"),this.resizeHandle2.removeClass("as-hidden"),this.dashboardEl.addClass("as-hidden")),this.sidebarPanel.setDashboardActive(this.isDashboard),this.sidebarPanel.render()}toggleMarketplace(){this.dragCleanup?.(),this.dragCleanup=null,this.isMarketplace=!this.isMarketplace,this.isDashboard&&(this.isDashboard=!1,this.dashboardEl.addClass("as-hidden")),this.isMarketplace?(this.listEl.addClass("as-hidden"),this.detailEl.addClass("as-hidden"),this.resizeHandle1.addClass("as-hidden"),this.resizeHandle2.addClass("as-hidden"),this.marketplaceEl.removeClass("as-hidden"),this.marketplacePanel.render()):(this.listEl.removeClass("as-hidden"),this.detailEl.removeClass("as-hidden"),this.resizeHandle1.removeClass("as-hidden"),this.resizeHandle2.removeClass("as-hidden"),this.marketplaceEl.addClass("as-hidden")),this.sidebarPanel.setMarketplaceActive(this.isMarketplace),this.sidebarPanel.render()}renderAll(){this.sidebarPanel.render(),!this.isDashboard&&!this.isMarketplace&&(this.listPanel.render(),this.store.filteredItems.length||this.detailPanel.clear())}onSelectItem(t){this.isDashboard&&this.toggleDashboard(),this.isMarketplace&&this.toggleMarketplace(),this.listPanel.setSelected(t.id),this.listPanel.render(),this.detailPanel.show(t)}createResizeHandle(t,e,s,i,a){let r=t.createDiv("as-resize-handle"),l=0,o=0,c=m=>{let g=Math.min(a,Math.max(i,o+(m.clientX-l)));t.style.setProperty(s,`${g}px`)},d=()=>{r.removeClass("is-dragging"),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),this.dragCleanup=null};return r.addEventListener("mousedown",m=>{m.preventDefault(),l=m.clientX,o=parseInt(t.style.getPropertyValue(s))||e.offsetWidth,r.addClass("is-dragging"),document.addEventListener("mousemove",c),document.addEventListener("mouseup",d),this.dragCleanup=d}),r}onClose(){this.dragCleanup?.(),this.updateRef&&this.store.offref(this.updateRef)}};var Se=require("obsidian");var ut=class extends Se.Events{items=new Map;_filter={kind:"all"};_searchQuery="";_projectsHomeDir="";get filter(){return this._filter}get searchQuery(){return this._searchQuery}get allItems(){return Array.from(this.items.values())}get filteredItems(){let t=this.allItems;switch(this._filter.kind){case"favorites":t=t.filter(e=>e.isFavorite);break;case"tool":t=t.filter(e=>e.tools.includes(this._filter.toolId));break;case"type":t=t.filter(e=>e.type===this._filter.type);break;case"collection":t=t.filter(e=>e.collections.includes(this._filter.name));break;case"project":t=t.filter(e=>Pt(e.filePath,this._projectsHomeDir)===this._filter.project);break}if(this._searchQuery){let e=this._searchQuery.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(e))}return t.sort((e,s)=>e.name.localeCompare(s.name))}getItem(t){return this.items.get(t)}get hasSkillkit(){return L()}refresh(t){this._projectsHomeDir=t.projectsHomeDir,this.items=he(t),this.enrichWithSkillkit(),this.trigger("updated")}enrichWithSkillkit(){if(!L())return;let t=Bt(),e=Nt(),s=Wt(),i=new Set(s.oversized.map(o=>o.name)),a=new Set(s.longDesc.map(o=>o.name)),r=new Map(s.oversized.map(o=>[o.name,o.lines])),l=new Map(s.longDesc.map(o=>[o.name,o.chars]));for(let o of this.items.values()){let c=o.filePath.split("/").slice(-2,-1)[0],d=o.name.toLowerCase().replace(/\s+/g,"-"),m=t.get(o.name)||t.get(c)||t.get(d);m?(m.isHeavy=o.content.length>5e3,o.usage=m):o.usage={uses:0,lastUsed:null,daysSinceUsed:null,isStale:!0,isHeavy:o.content.length>5e3};let g=o.content.split(` -`).length,f=o.description.length;o.warnings={oversized:i.has(o.name)||g>500,longDesc:a.has(o.name)||f>1024,lineCount:r.get(o.name)??g,descChars:l.get(o.name)??f},o.conflicts=e.get(o.name)||e.get(c)||[]}}setFilter(t){this._filter=t,this.trigger("updated")}setSearch(t){this._searchQuery=t,this.trigger("updated")}toggleFavorite(t,e){let s=this.items.get(t);s&&(s.isFavorite=!s.isFavorite,s.isFavorite?e.favorites.includes(t)||e.favorites.push(t):e.favorites=e.favorites.filter(i=>i!==t),this.trigger("updated"))}getToolCounts(){let t=new Map;for(let e of this.items.values())for(let s of e.tools)t.set(s,(t.get(s)||0)+1);return t}getTypeCounts(){let t=new Map;for(let e of this.items.values())t.set(e.type,(t.get(e.type)||0)+1);return t}getProjectCounts(){let t=new Map;for(let e of this.items.values()){let s=Pt(e.filePath,this._projectsHomeDir);t.set(s,(t.get(s)||0)+1)}return t}};var ye=require("fs"),ht=class{watchers=[];debounceTimer=null;debounceMs;onChange;constructor(t,e){this.debounceMs=t,this.onChange=e}watchPaths(t){this.close();for(let e of t)try{let s=(0,ye.watch)(e,{recursive:!0},()=>this.scheduleUpdate());this.watchers.push(s)}catch{}}scheduleUpdate(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.onChange()},this.debounceMs)}close(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null);for(let t of this.watchers)try{t.close()}catch{}this.watchers=[]}};var E=require("obsidian");var mt=class extends E.PluginSettingTab{plugin;constructor(t,e){super(t,e),this.plugin=e}display(){let{containerEl:t}=this;t.empty(),new E.Setting(t).setName("File watching").setDesc("Automatically detect changes to skill files").addToggle(e=>e.setValue(this.plugin.settings.watchEnabled).onChange(async s=>{this.plugin.settings.watchEnabled=s,await this.plugin.saveSettings(),this.plugin.restartWatcher()})),new E.Setting(t).setName("Watch debounce (ms)").setDesc("Delay before re-scanning after file changes").addText(e=>e.setValue(String(this.plugin.settings.watchDebounceMs)).onChange(async s=>{let i=parseInt(s);!isNaN(i)&&i>=100&&(this.plugin.settings.watchDebounceMs=i,await this.plugin.saveSettings())})),new E.Setting(t).setName("Display names").setDesc("How skill and command names are displayed in the list").addDropdown(e=>e.addOptions({auto:"Auto (frontmatter / heading / filename)",filename:"Filename only"}).setValue(this.plugin.settings.namingMode||"auto").onChange(async s=>{this.plugin.settings.namingMode=s,await this.plugin.saveSettings(),this.plugin.refreshStore()})),new E.Setting(t).setName("Marketplace").setHeading(),new E.Setting(t).setName("Package runner").setDesc("Command used to install skills from the marketplace").addDropdown(e=>e.addOptions({auto:"Auto-detect",npx:"npx",bunx:"bunx"}).setValue(this.plugin.settings.packageRunner).onChange(async s=>{this.plugin.settings.packageRunner=s,await this.plugin.saveSettings()})),new E.Setting(t).setName("Project scanning").setHeading(),new E.Setting(t).setName("Scan projects").setDesc("Scan all directories under the projects home folder for project-level skills").addToggle(e=>e.setValue(this.plugin.settings.projectScanEnabled).onChange(async s=>{this.plugin.settings.projectScanEnabled=s,await this.plugin.saveSettings(),this.plugin.refreshStore(),this.plugin.restartWatcher()})),new E.Setting(t).setName("Projects home directory").setDesc("Root directory to scan for project-level skills. Leave empty for home directory (~).").addText(e=>e.setPlaceholder("~").setValue(this.plugin.settings.projectsHomeDir).onChange(async s=>{this.plugin.settings.projectsHomeDir=s,await this.plugin.saveSettings(),this.plugin.refreshStore(),this.plugin.restartWatcher()})),new E.Setting(t).setName("Tools").setHeading();for(let e of D){let s=e.isInstalled(),i=this.plugin.settings.tools[e.id]||{enabled:!0,customPaths:[]};new E.Setting(t).setName(e.name).setDesc(s?"Installed":"Not detected").addToggle(a=>a.setValue(s&&i.enabled).setDisabled(!s).onChange(async r=>{this.plugin.settings.tools[e.id]={...i,enabled:r},await this.plugin.saveSettings(),this.plugin.refreshStore()}))}}};var $t={tools:{},watchEnabled:!0,watchDebounceMs:500,favorites:[],collections:{},customScanPaths:[],namingMode:"auto",projectScanEnabled:!0,projectsHomeDir:"",packageRunner:"auto"};var gt=class extends we.Plugin{settings=$t;store=new ut;watcher=null;async onload(){await this.loadSettings(),this.addVaultPath(),this.registerView(Y,t=>new pt(t,this.store,this.settings,()=>this.saveSettings())),this.addRibbonIcon("cpu","Agentfiles",()=>this.activateView()),this.addCommand({id:"open",name:"Open",callback:()=>this.activateView()}),this.addSettingTab(new mt(this.app,this)),this.refreshStore(),this.startWatcher()}addVaultPath(){let t=this.app.vault.adapter;if(!t.getBasePath)return;let e=t.getBasePath();this.settings.customScanPaths.includes(e)||this.settings.customScanPaths.push(e)}onunload(){this.stopWatcher()}refreshStore(){this.store.refresh(this.settings)}startWatcher(){this.settings.watchEnabled&&(this.watcher=new ht(this.settings.watchDebounceMs,()=>this.refreshStore()),this.watcher.watchPaths(me(this.settings)))}stopWatcher(){this.watcher&&(this.watcher.close(),this.watcher=null)}restartWatcher(){this.stopWatcher(),this.startWatcher()}async activateView(){let t=this.app.workspace.getLeavesOfType(Y);if(t.length>0){await this.app.workspace.revealLeaf(t[0]);return}let e=this.app.workspace.getLeaf("tab");await e.setViewState({type:Y,active:!0}),await this.app.workspace.revealLeaf(e)}async loadSettings(){this.settings=Object.assign({},$t,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}}; +var ve=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Ct=Object.prototype.hasOwnProperty;var Lt=(n,e)=>{for(var t in e)ve(n,t,{get:e[t],enumerable:!0})},Tt=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Et(e))!Ct.call(n,i)&&i!==t&&ve(n,i,{get:()=>e[i],enumerable:!(s=xt(e,i))||s.enumerable});return n};var Mt=n=>Tt(ve({},"__esModule",{value:!0}),n);var as={};Lt(as,{default:()=>ge});module.exports=Mt(as);var wt=require("obsidian");var kt=require("obsidian");var R=require("obsidian"),je=require("electron");var Fe=require("os"),b=require("fs"),p=require("path"),u=(0,Fe.homedir)(),V=process.env.XDG_CONFIG_HOME||(0,p.join)(u,".config");function Q(n){return(0,b.existsSync)(`/Applications/${n}.app`)||(0,b.existsSync)((0,p.join)(u,"Applications",`${n}.app`))}function F(n){let e=[`/usr/local/bin/${n}`,`/opt/homebrew/bin/${n}`,(0,p.join)(u,".local","bin",n)];for(let s of e)if((0,b.existsSync)(s))return!0;let t=(0,p.join)(u,".nvm","versions","node");try{for(let s of(0,b.readdirSync)(t))if((0,b.existsSync)((0,p.join)(t,s,"bin",n)))return!0}catch{}return!1}var E=[{id:"claude-code",name:"Claude Code",color:"#f97316",icon:"brain",paths:[{baseDir:(0,p.join)(u,".claude","skills"),type:"skill",pattern:"directory-with-skillmd"},{baseDir:(0,p.join)(u,".claude","commands"),type:"command",pattern:"flat-md"}],agentPaths:[{baseDir:(0,p.join)(u,".claude","agents"),type:"agent",pattern:"flat-md"}],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".claude","settings.json"))||(0,b.existsSync)((0,p.join)(u,".claude","CLAUDE.md"))||F("claude")},{id:"cursor",name:"Cursor",color:"#3b82f6",icon:"mouse-pointer",paths:[{baseDir:(0,p.join)(u,".cursor","skills"),type:"skill",pattern:"directory-with-skillmd"},{baseDir:(0,p.join)(u,".cursor","rules"),type:"rule",pattern:"flat-md"}],agentPaths:[{baseDir:(0,p.join)(u,".cursor","agents"),type:"agent",pattern:"flat-md"}],isInstalled:()=>Q("Cursor")||(0,b.existsSync)((0,p.join)(u,".cursor","argv.json"))},{id:"windsurf",name:"Windsurf",color:"#14b8a6",icon:"wind",paths:[{baseDir:(0,p.join)(u,".codeium","windsurf","memories"),type:"memory",pattern:"flat-md"},{baseDir:(0,p.join)(u,".windsurf","rules"),type:"rule",pattern:"flat-md"}],agentPaths:[],isInstalled:()=>Q("Windsurf")||(0,b.existsSync)((0,p.join)(u,".codeium","windsurf","argv.json"))},{id:"codex",name:"Codex",color:"#22c55e",icon:"book",paths:[{baseDir:(0,p.join)(u,".codex","skills"),type:"skill",pattern:"directory-with-skillmd"},{baseDir:(0,p.join)(u,".codex","prompts"),type:"command",pattern:"flat-md"},{baseDir:(0,p.join)(u,".codex","memories"),type:"memory",pattern:"flat-md"}],agentPaths:[{baseDir:(0,p.join)(u,".codex","agents"),type:"agent",pattern:"flat-md"}],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".codex","config.toml"))||(0,b.existsSync)((0,p.join)(u,".codex","auth.json"))||F("codex")},{id:"copilot",name:"Copilot",color:"#a855f7",icon:"plane",paths:[{baseDir:(0,p.join)(u,".copilot","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".copilot"))||F("copilot")},{id:"amp",name:"Amp",color:"#ec4899",icon:"zap",paths:[{baseDir:(0,p.join)(V,"amp","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>(0,b.existsSync)((0,p.join)(V,"amp","config.json"))||(0,b.existsSync)((0,p.join)(V,"amp","settings.json"))||F("amp")},{id:"opencode",name:"OpenCode",color:"#ef4444",icon:"terminal",paths:[{baseDir:(0,p.join)(V,"opencode","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>Q("OpenCode")||(0,b.existsSync)((0,p.join)(V,"opencode","opencode.json"))||(0,b.existsSync)((0,p.join)(V,"opencode","opencode.jsonc"))||F("opencode")},{id:"pi",name:"Pi",color:"#06b6d4",icon:"sparkles",paths:[{baseDir:(0,p.join)(u,".pi","agent","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>F("pi")},{id:"antigravity",name:"Antigravity",color:"#ef4444",icon:"arrow-up-circle",paths:[{baseDir:(0,p.join)(u,".gemini","antigravity","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>Q("Antigravity")||(0,b.existsSync)((0,p.join)(u,".gemini","antigravity","skills"))||F("antigravity")},{id:"claude-desktop",name:"Claude Desktop",color:"#f97316",icon:"monitor",paths:[],agentPaths:[],isInstalled:()=>Q("Claude")},{id:"global-agents",name:"Global",color:"#a3e635",icon:"globe",paths:[{baseDir:(0,p.join)(u,".agents","skills"),type:"skill",pattern:"directory-with-skillmd"}],agentPaths:[],isInstalled:()=>(0,b.existsSync)((0,p.join)(u,".agents","skills"))},{id:"aider",name:"Aider",color:"#eab308",icon:"wrench",paths:[],agentPaths:[],isInstalled:()=>F("aider")}];var C={"claude-code":{viewBox:"0 0 24 24",paths:''},cursor:{viewBox:"0 0 466.73 532.09",paths:''},windsurf:{viewBox:"0 0 24 24",paths:''},codex:{viewBox:"0 0 24 24",paths:''},copilot:{viewBox:"0 0 24 24",paths:''},opencode:{viewBox:"0 0 24 36",paths:''},"claude-desktop":{viewBox:"0 0 24 24",paths:''},"global-agents":{viewBox:"0 0 24 24",paths:''},goose:{viewBox:"0 0 24 24",paths:''},cline:{viewBox:"0 0 24 24",paths:''},continue:{viewBox:"0 0 26 24",paths:''},"roo-code":{viewBox:"0 0 96 96",paths:''},replit:{viewBox:"0 0 24 24",paths:''},"gemini-cli":{viewBox:"0 0 24 24",paths:''}};function j(n,e,t=16){let s=C[e];if(!s)return;let i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox",s.viewBox),i.setAttribute("width",String(t)),i.setAttribute("height",String(t)),i.setAttribute("fill","none"),i.classList.add("as-tool-svg"),i.innerHTML=s.paths,n.appendChild(i)}var ee=class{containerEl;store;onToggleDashboard;onToggleMarketplace;dashboardActive=!1;marketplaceActive=!1;constructor(e,t,s,i){this.containerEl=e,this.store=t,this.onToggleDashboard=s,this.onToggleMarketplace=i}setDashboardActive(e){this.dashboardActive=e,e&&(this.marketplaceActive=!1)}setMarketplaceActive(e){this.marketplaceActive=e,e&&(this.dashboardActive=!1)}render(){this.containerEl.empty(),this.containerEl.addClass("as-sidebar"),this.renderLibrarySection(),this.renderTypeSection(),this.renderToolSection(),this.renderProjectSection(),this.renderCollectionSection(),this.store.hasSkillkit||this.renderSkillkitCta()}renderSection(e,t){let s=this.containerEl.createDiv("as-sidebar-section");s.createDiv({cls:"as-sidebar-title",text:e});for(let i of t){let a=s.createDiv("as-sidebar-item");!this.dashboardActive&&this.isActive(i.filter)&&a.addClass("is-active");let r=a.createSpan("as-sidebar-icon");(0,R.setIcon)(r,i.icon),a.createSpan({cls:"as-sidebar-label",text:i.label}),i.count!==void 0&&a.createSpan({cls:"as-sidebar-count",text:String(i.count)}),a.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.marketplaceActive&&this.onToggleMarketplace(),this.store.setFilter(i.filter)})}}renderTypeSection(){let e=this.store.getTypeCounts(),s=[{label:"Skills",icon:"sparkles",type:"skill"},{label:"Commands",icon:"terminal",type:"command"},{label:"Agents",icon:"bot",type:"agent"},{label:"Rules",icon:"scroll",type:"rule"}].filter(i=>e.has(i.type)).map(i=>({label:i.label,icon:i.icon,filter:{kind:"type",type:i.type},count:e.get(i.type)||0}));s.length>0&&this.renderSection("Types",s)}renderToolSection(){let e=this.store.getToolCounts(),t=E.filter(i=>i.isInstalled()&&e.has(i.id));if(t.length===0)return;let s=this.containerEl.createDiv("as-sidebar-section");s.createDiv({cls:"as-sidebar-title",text:"Tools"});for(let i of t){let a={kind:"tool",toolId:i.id},r=s.createDiv("as-sidebar-item");!this.dashboardActive&&this.isActive(a)&&r.addClass("is-active");let l=r.createSpan("as-sidebar-icon");C[i.id]?j(l,i.id,14):(0,R.setIcon)(l,i.icon),r.createSpan({cls:"as-sidebar-label",text:i.name}),r.createSpan({cls:"as-sidebar-count",text:String(e.get(i.id)||0)}),r.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.store.setFilter(a)})}}renderProjectSection(){let e=this.store.getProjectCounts();if(e.size===0)return;let t=[];for(let[s,i]of e)t.push({label:s,icon:"folder-git-2",filter:{kind:"project",project:s},count:i});t.sort((s,i)=>s.label.localeCompare(i.label)),this.renderSection("Projects",t)}renderCollectionSection(){let e=this.containerEl.createDiv("as-sidebar-section");e.createDiv({cls:"as-sidebar-title",text:"Collections"});let t=new Set;for(let s of this.store.allItems)for(let i of s.collections)t.add(i);if(t.size===0){e.createDiv({cls:"as-sidebar-empty",text:"No collections yet"});return}for(let s of t){let i={kind:"collection",name:s},a=e.createDiv("as-sidebar-item");!this.dashboardActive&&this.isActive(i)&&a.addClass("is-active");let r=a.createSpan("as-sidebar-icon");(0,R.setIcon)(r,"folder"),a.createSpan({cls:"as-sidebar-label",text:s}),a.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.store.setFilter(i)})}}renderLibrarySection(){let e=this.containerEl.createDiv("as-sidebar-section");e.createDiv({cls:"as-sidebar-title",text:"Library"});let t=[{label:"All Skills",icon:"layers",filter:{kind:"all"}},{label:"Favorites",icon:"star",filter:{kind:"favorites"}}],s=this.dashboardActive||this.marketplaceActive;for(let o of t){let c=e.createDiv("as-sidebar-item");!s&&this.isActive(o.filter)&&c.addClass("is-active");let d=c.createSpan("as-sidebar-icon");(0,R.setIcon)(d,o.icon),c.createSpan({cls:"as-sidebar-label",text:o.label}),c.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.marketplaceActive&&this.onToggleMarketplace(),this.store.setFilter(o.filter)})}let i=e.createDiv("as-sidebar-item");this.dashboardActive&&i.addClass("is-active");let a=i.createSpan("as-sidebar-icon");(0,R.setIcon)(a,"bar-chart-2"),i.createSpan({cls:"as-sidebar-label",text:"Dashboard"}),i.addEventListener("click",()=>{this.marketplaceActive&&this.onToggleMarketplace(),this.dashboardActive||this.onToggleDashboard()});let r=e.createDiv("as-sidebar-item");this.marketplaceActive&&r.addClass("is-active");let l=r.createSpan("as-sidebar-icon");(0,R.setIcon)(l,"shopping-bag"),r.createSpan({cls:"as-sidebar-label",text:"Marketplace"}),r.addEventListener("click",()=>{this.dashboardActive&&this.onToggleDashboard(),this.marketplaceActive||this.onToggleMarketplace()})}renderSkillkitCta(){let e=this.containerEl.createDiv("as-skillkit-cta"),t=e.createDiv("as-skillkit-icon");(0,R.setIcon)(t,"bar-chart-2"),e.createDiv({cls:"as-skillkit-title",text:"Unlock analytics"}),e.createDiv({cls:"as-skillkit-desc",text:"Install skillkit to see usage stats, stale badges, and heavy skill warnings."}),e.createDiv("as-skillkit-cmd").createEl("code",{text:"npm i -g skillkit"}),e.createEl("a",{cls:"as-skillkit-link",text:"Learn more",href:"https://www.npmjs.com/package/skillkit"}).addEventListener("click",a=>{a.preventDefault(),je.shell.openExternal("https://www.npmjs.com/package/skillkit")})}isActive(e){let t=this.store.filter;return t.kind!==e.kind?!1:t.kind==="tool"&&e.kind==="tool"?t.toolId===e.toolId:t.kind==="type"&&e.kind==="type"?t.type===e.type:t.kind==="collection"&&e.kind==="collection"?t.name===e.name:t.kind==="project"&&e.kind==="project"?t.project===e.project:!0}};var U=require("obsidian");var te=class{containerEl;store;onSelect;selectedId=null;inputEl=null;deepToggleEl=null;listEl=null;typeFilter=null;sortBy="name";dropdownEl=null;constructor(e,t,s){this.containerEl=e,this.store=t,this.onSelect=s}setSelected(e){this.selectedId=e}render(){if(!this.inputEl){this.containerEl.empty(),this.containerEl.addClass("as-list");let e=this.containerEl.createDiv("as-search");this.inputEl=e.createEl("input",{type:"text",placeholder:"Search skills...",cls:"as-search-input"}),this.inputEl.addEventListener("input",()=>{this.store.setSearch(this.inputEl.value)}),this.deepToggleEl=e.createDiv("as-deep-toggle"),(0,U.setIcon)(this.deepToggleEl,"search-code"),this.deepToggleEl.setAttribute("aria-label","Toggle deep search"),this.deepToggleEl.addEventListener("click",()=>{this.store.setDeepSearch(!this.store.deepSearch),this.updateDeepToggle()});let t=e.createDiv("as-filter-btn");(0,U.setIcon)(t,"filter"),t.setAttribute("aria-label","Filter by status"),t.addEventListener("click",i=>{i.stopPropagation(),this.toggleDropdown(t)});let s=e.createDiv("as-filter-btn");(0,U.setIcon)(s,this.sortBy==="usage"?"arrow-down-wide-narrow":"arrow-down-a-z"),s.setAttribute("aria-label",this.sortBy==="usage"?"Sorted by usage":"Sorted by name"),s.addEventListener("click",()=>{this.sortBy=this.sortBy==="name"?"usage":"name",(0,U.setIcon)(s,this.sortBy==="usage"?"arrow-down-wide-narrow":"arrow-down-a-z"),s.setAttribute("aria-label",this.sortBy==="usage"?"Sorted by usage":"Sorted by name"),this.renderList()}),this.listEl=this.containerEl.createDiv("as-list-items")}this.inputEl.value=this.store.searchQuery,this.updateDeepToggle(),this.renderList()}updateDeepToggle(){this.deepToggleEl&&(this.deepToggleEl.toggleClass("is-active",this.store.deepSearch),this.deepToggleEl.setAttribute("aria-label",this.store.deepSearch?"Deep search enabled \u2014 click to search names only":"Deep search disabled \u2014 click to search file content"))}toggleDropdown(e){if(this.dropdownEl){this.dropdownEl.remove(),this.dropdownEl=null;return}this.dropdownEl=e.createDiv("as-filter-dropdown");let t=[{id:"all",label:"All",cls:""},{id:"stale",label:"Stale",cls:"as-badge-stale"},{id:"heavy",label:"Heavy",cls:"as-badge-heavy"},{id:"oversized",label:"Oversized",cls:"as-badge-warn"},{id:"conflict",label:"Conflict",cls:"as-badge-conflict"}];for(let i of t){let a=this.dropdownEl.createDiv("as-filter-option");(i.id==="all"&&!this.typeFilter||i.id===this.typeFilter)&&a.addClass("is-active"),i.cls?a.createSpan({cls:i.cls,text:i.label}):a.setText(i.label),a.addEventListener("click",r=>{r.stopPropagation(),this.typeFilter=i.id==="all"?null:i.id,this.dropdownEl&&(this.dropdownEl.remove(),this.dropdownEl=null),this.renderList()})}let s=()=>{this.dropdownEl&&(this.dropdownEl.remove(),this.dropdownEl=null),document.removeEventListener("click",s)};setTimeout(()=>document.addEventListener("click",s),0)}renderList(){if(!this.listEl)return;this.listEl.empty();let e=this.store.filteredItems;if(this.typeFilter)switch(this.typeFilter){case"stale":e=e.filter(t=>t.usage?.isStale);break;case"heavy":e=e.filter(t=>t.usage?.isHeavy);break;case"oversized":e=e.filter(t=>t.warnings?.oversized);break;case"conflict":e=e.filter(t=>t.conflicts&&t.conflicts.length>0);break}if(this.sortBy==="usage"&&(e=[...e].sort((t,s)=>(s.usage?.uses??0)-(t.usage?.uses??0))),this.typeFilter){let t={stale:"Stale",heavy:"Heavy",oversized:"Oversized",conflict:"Conflict"},s=this.listEl.createDiv("as-active-filter");s.createSpan({text:`Showing: ${t[this.typeFilter]??this.typeFilter}`}),s.createSpan({cls:"as-filter-clear",text:"Clear"}).addEventListener("click",()=>{this.typeFilter=null,this.renderList()})}if(e.length===0){this.listEl.createDiv({cls:"as-list-empty",text:"No skills found"});return}for(let t of e)this.renderCard(this.listEl,t)}renderCard(e,t){let s=e.createDiv("as-skill-card");t.id===this.selectedId&&s.addClass("is-selected");let i=s.createDiv("as-skill-header");if(i.createSpan({cls:"as-skill-name",text:t.name}),t.isFavorite){let r=i.createSpan("as-skill-star");(0,U.setIcon)(r,"star")}t.description&&s.createDiv({cls:"as-skill-desc",text:t.description.length>80?t.description.slice(0,80)+"...":t.description});let a=s.createDiv("as-skill-meta");a.createSpan({cls:`as-type-tag as-type-${t.type}`,text:t.type});for(let r of t.tools){let l=E.find(c=>c.id===r);if(!l)continue;let o=a.createSpan("as-tool-badge");o.title=l.name,o.setAttribute("aria-label",l.name),o.setCssProps({"--tool-color":l.color}),C[r]?j(o,r,12):o.addClass("as-tool-badge-dot")}t.usage&&(t.usage.uses>0&&a.createSpan({cls:"as-usage-badge",text:`${t.usage.uses}`,attr:{"aria-label":`Used ${t.usage.uses} times`}}),t.usage.isStale&&a.createSpan({cls:"as-badge-stale",text:"stale"}),t.usage.isHeavy&&a.createSpan({cls:"as-badge-heavy",text:"heavy"})),t.warnings?.oversized&&a.createSpan({cls:"as-badge-warn",text:"oversized"}),t.conflicts&&t.conflicts.length>0&&a.createSpan({cls:"as-badge-conflict",text:"conflict"}),s.addEventListener("click",()=>{this.selectedId=t.id,this.onSelect(t)})}};var y=require("obsidian"),Je=require("fs"),Ze=require("electron");var ke=require("child_process"),_=require("fs"),k=require("path"),Re=require("os"),I=(0,Re.homedir)(),Pt=(0,k.join)(I,".skillkit","analytics.db");function Oe(){let n=["/usr/local/bin","/opt/homebrew/bin",(0,k.join)(I,".local","bin"),(0,k.join)(I,".bun","bin")],e=(0,k.join)(I,".nvm","versions","node");try{for(let s of(0,_.readdirSync)(e))n.push((0,k.join)(e,s,"bin"))}catch{}let t=(0,k.join)(I,".local","share","mise","installs");for(let s of["node","bun"])try{for(let i of(0,_.readdirSync)((0,k.join)(t,s)))n.push((0,k.join)(t,s,i,"bin"))}catch{}return[...n,process.env.PATH||""].join(":")}function It(){let n=["/usr/local/bin/skillkit","/opt/homebrew/bin/skillkit",(0,k.join)(I,".local","bin","skillkit"),(0,k.join)(I,".bun","bin","skillkit"),(0,k.join)(I,".local","share","mise","shims","skillkit")];for(let s of n)if((0,_.existsSync)(s))return s;let e=(0,k.join)(I,".nvm","versions","node");try{for(let s of(0,_.readdirSync)(e)){let i=(0,k.join)(e,s,"bin","skillkit");if((0,_.existsSync)(i))return i}}catch{}let t=(0,k.join)(I,".local","share","mise","installs");for(let s of["node","bun"])try{for(let i of(0,_.readdirSync)((0,k.join)(t,s))){let a=(0,k.join)(t,s,i,"bin","skillkit");if((0,_.existsSync)(a))return a}}catch{}return null}var be;function Se(){return be===void 0&&(be=It()),be}function L(){return Se()!==null||(0,_.existsSync)(Pt)}function $(n){let e=Se();if(!e)return null;try{let t=(0,ke.execSync)(`${e} ${n} --json`,{encoding:"utf-8",timeout:15e3,env:{...process.env,NO_COLOR:"1",PATH:Oe()},stdio:["pipe","pipe","pipe"]}).trim(),s=t.indexOf("{"),i=t.indexOf("["),a=s===-1?i:i===-1?s:Math.min(s,i);return a===-1?null:JSON.parse(t.slice(a))}catch{return null}}function Ne(){let n=new Map;if(!L())return n;let e=$("stats");if(!e?.top_skills)return n;let t=Date.now();for(let s of e.top_skills){let i=s.daily.length>0?s.daily[s.daily.length-1]?.date:null,a=null;i&&(a=Math.floor((t-new Date(i).getTime())/(1e3*60*60*24))),n.set(s.name,{uses:s.total,lastUsed:i||null,daysSinceUsed:a,isStale:a!==null&&a>30,isHeavy:!1,daily:s.daily})}return n}function Be(){let n=new Map;if(!L())return n;let e=$("conflicts --dry-run");if(!e||!("pairs"in e))return n;for(let t of e.pairs)n.has(t.skill_a)||n.set(t.skill_a,[]),n.has(t.skill_b)||n.set(t.skill_b,[]),n.get(t.skill_a).push({skillName:t.skill_b,similarity:t.similarity}),n.get(t.skill_b).push({skillName:t.skill_a,similarity:t.similarity});return n}function ze(n){if(!L())return[];let e=$(`trace --list --skill ${n} --limit 5`);return Array.isArray(e)?e.map(t=>({traceId:t.trace_id,timestamp:t.timestamp,tokens:t.tokens_total,cost:t.cost_estimate,duration:t.duration_ms,model:t.model||"unknown"})):[]}function We(){if(!L())return{oversized:[],longDesc:[]};let n=$("health");return n?.warnings?{oversized:n.warnings.oversized||[],longDesc:n.warnings.long_descriptions||[]}:{oversized:[],longDesc:[]}}function G(n){let e=Se();if(!e)return{success:!1,output:"skillkit not found"};try{return{success:!0,output:(0,ke.execSync)(`${e} ${n}`,{encoding:"utf-8",timeout:3e4,env:{...process.env,NO_COLOR:"1",PATH:Oe()},stdio:["pipe","pipe","pipe"]}).trim()}}catch(t){return{success:!1,output:t instanceof Error?t.message:"unknown error"}}}function ye(n){if(!n)return"never";let e=Date.now()-new Date(n).getTime(),t=Math.floor(e/6e4);if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let i=Math.floor(s/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function Ve(n,e,t=48,s=16){if(e.length===0)return;let i=Math.max(...e,1),a=e.map((o,c)=>{let d=c/(e.length-1||1)*t,m=s-o/i*s;return`${d.toFixed(1)},${m.toFixed(1)}`}),r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox",`0 0 ${t} ${s}`),r.setAttribute("width",String(t)),r.setAttribute("height",String(s)),r.classList.add("as-sparkline");let l=document.createElementNS("http://www.w3.org/2000/svg","polyline");l.setAttribute("points",a.join(" ")),l.setAttribute("fill","none"),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","1.5"),l.setAttribute("stroke-linecap","round"),l.setAttribute("stroke-linejoin","round"),r.appendChild(l),n.appendChild(r)}var Ue=require("obsidian");function B(n,e,t,s){new we(n,e,t,s).open()}var we=class extends Ue.Modal{title;message;onConfirm;constructor(e,t,s,i){super(e),this.title=t,this.message=s,this.onConfirm=i}onOpen(){let{contentEl:e}=this;e.addClass("as-confirm-modal"),e.createEl("p",{cls:"as-confirm-title",text:this.title}),e.createEl("p",{cls:"as-confirm-message",text:this.message});let t=e.createDiv("as-confirm-buttons");t.createEl("button",{cls:"as-confirm-cancel",text:"Cancel"}).addEventListener("click",()=>this.close()),t.createEl("button",{cls:"as-confirm-action mod-warning",text:"Confirm"}).addEventListener("click",()=>{this.close(),this.onConfirm()})}onClose(){this.contentEl.empty()}};function _t(n){return Math.ceil(n.length/4)}function At(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function Ge(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}function Ht(n){return new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}var se=class{containerEl;store;settings;saveSettings;currentItem=null;isEditing=!1;app;constructor(e,t,s,i,a){this.containerEl=e,this.store=t,this.settings=s,this.saveSettings=i,this.app=a.app}show(e){this.currentItem=e,this.isEditing=!1,this.render()}clear(){this.currentItem=null,this.containerEl.empty(),this.containerEl.addClass("as-detail");let e=this.containerEl.createDiv("as-detail-empty");(0,y.setIcon)(e.createDiv("as-detail-empty-icon"),"file-text"),e.createDiv({text:"Select a skill to view"})}render(){this.containerEl.empty(),this.containerEl.addClass("as-detail");let e=this.currentItem;if(!e)return this.clear();this.renderToolbar(e),this.isEditing?this.renderEditor(e):this.renderPreview(e)}renderToolbar(e){let t=this.containerEl.createDiv("as-detail-toolbar"),s=t.createDiv("as-toolbar-top"),i=s.createDiv("as-toolbar-left");i.createSpan({cls:"as-detail-title",text:e.name});for(let g of e.tools){let f=E.find(fe=>fe.id===g);if(!f)continue;let W=i.createSpan("as-tool-name-badge");W.setCssProps({"--tool-color":f.color}),C[g]&&j(W,g,12),W.createSpan({text:f.name})}let a=s.createDiv("as-toolbar-right"),r=a.createEl("button",{cls:"as-toolbar-btn",attr:{"aria-label":"Toggle favorite"}});(0,y.setIcon)(r,e.isFavorite?"star":"star-off"),r.addEventListener("click",()=>{this.store.toggleFavorite(e.id,this.settings),this.saveSettings(),this.render()});let l=a.createEl("button",{cls:"as-toolbar-btn",attr:{"aria-label":this.isEditing?"Preview":"Edit"}});(0,y.setIcon)(l,this.isEditing?"eye":"pencil"),l.addEventListener("click",()=>{this.isEditing=!this.isEditing,this.render()});let o=a.createEl("button",{cls:"as-toolbar-btn",attr:{"aria-label":"Show in system explorer"}});if((0,y.setIcon)(o,"folder-open"),o.addEventListener("click",()=>{Ze.shell.showItemInFolder(e.filePath)}),L()){let g=a.createEl("button",{cls:"as-toolbar-btn as-toolbar-btn-danger",attr:{"aria-label":"Remove skill"}});(0,y.setIcon)(g,"trash-2"),g.addEventListener("click",()=>{B(this.app,"Remove skill",`Remove "${e.name}"? This will delete the skill files.`,()=>{let f=G(`prune --skill ${e.name} --yes`);f.success?(new y.Notice(`Removed ${e.name}`,5e3),this.store.refresh(this.settings),this.clear()):new y.Notice(`Failed to remove: ${f.output}`,5e3)})})}let c=t.createDiv("as-detail-meta-bar"),d=_t(e.content),m=e.content.length;if(c.createSpan({cls:"as-meta-item",text:At(e.fileSize)}),c.createSpan({cls:"as-meta-item",text:`${Ge(m)} chars`}),c.createSpan({cls:"as-meta-item",text:`~${Ge(d)} tokens`}),c.createSpan({cls:"as-meta-item",text:Ht(e.lastModified)}),c.createSpan({cls:"as-meta-item as-meta-type",text:e.type}),e.usage&&e.usage.uses>0){let g=t.createDiv("as-detail-usage-bar");g.createSpan({cls:"as-usage-stat",text:`${e.usage.uses} uses`}),g.createSpan({cls:"as-usage-stat",text:`last: ${ye(e.usage.lastUsed)}`}),e.usage.isStale&&g.createSpan({cls:"as-badge-stale",text:"stale"}),e.usage.isHeavy&&g.createSpan({cls:"as-badge-heavy",text:"heavy"})}}renderFrontmatter(e,t){let s=Object.keys(t.frontmatter),i=e.createDiv("as-frontmatter");if(t.filePath){let a=i.createDiv("as-fm-prop");a.createSpan({cls:"as-fm-key",text:"path"}),a.createSpan({cls:"as-fm-value",text:t.filePath})}if(!(s.length===0&&!t.filePath))for(let a of s){let r=t.frontmatter[a];if(r==null)continue;let l=i.createDiv("as-fm-prop");l.createSpan({cls:"as-fm-key",text:a});let o=typeof r=="object"||Array.isArray(r)?JSON.stringify(r):String(r);o.length>200?l.createDiv({cls:"as-fm-value-long",text:o}):l.createSpan({cls:"as-fm-value",text:o})}}renderPreview(e){let t=this.containerEl.createDiv("as-detail-body");this.renderFrontmatter(t,e),this.renderWarnings(t,e),this.renderUsageSection(t,e),this.renderConflicts(t,e),this.renderTraces(t,e);let s=t.createDiv("as-detail-preview markdown-rendered");y.MarkdownRenderer.render(this.app,e.content,s,e.filePath,this)}renderWarnings(e,t){let s=[];if(t.warnings?.oversized&&s.push(`${t.warnings.lineCount} lines (recommended: <500)`),t.warnings?.longDesc&&s.push(`Description is ${t.warnings.descChars} chars (recommended: <1024)`),t.conflicts&&t.conflicts.length>0){let l=t.conflicts.map(o=>o.skillName).join(", ");s.push(`Conflicts with: ${l}`)}if(s.length===0)return;let i=e.createDiv("as-warnings"),a=i.createDiv("as-warnings-icon");(0,y.setIcon)(a,"alert-triangle");let r=i.createDiv("as-warnings-list");for(let l of s)r.createDiv({cls:"as-warnings-item",text:l})}renderUsageSection(e,t){if(!t.usage||t.usage.uses===0)return;let s=e.createDiv("as-usage-section"),i=s.createDiv("as-usage-left");if(i.createSpan({cls:"as-usage-count",text:String(t.usage.uses)}),i.createSpan({cls:"as-usage-label",text:"uses"}),i.createSpan({cls:"as-usage-last",text:ye(t.usage.lastUsed)}),t.usage.daily&&t.usage.daily.length>1){let a=s.createDiv("as-usage-spark");Ve(a,t.usage.daily.map(r=>r.count),80,20)}}renderConflicts(e,t){if(!t.conflicts||t.conflicts.length===0)return;let s=e.createDiv("as-conflicts-section");s.createDiv({cls:"as-section-title",text:`Conflicts (${t.conflicts.length})`});for(let i of t.conflicts){let a=s.createDiv("as-conflict-row");a.createSpan({cls:"as-conflict-name",text:i.skillName}),a.createDiv("as-conflict-bar-wrap").createDiv("as-conflict-bar").setCssProps({"--bar-w":`${(i.similarity*100).toFixed(0)}%`}),a.createSpan({cls:"as-conflict-score",text:`${(i.similarity*100).toFixed(0)}%`})}}renderTraces(e,t){if(!L())return;let s=ze(t.name);if(s.length===0)return;let i=e.createDiv("as-traces-section");i.createDiv({cls:"as-section-title",text:`Recent traces (${s.length})`});let a=i.createDiv("as-traces-table");for(let r of s){let l=a.createDiv("as-trace-row"),o=new Date(r.timestamp);l.createSpan({cls:"as-trace-date",text:o.toLocaleDateString(void 0,{month:"short",day:"numeric"})}),l.createSpan({cls:"as-trace-model",text:r.model.replace("claude-","").replace("-4-6","")}),l.createSpan({cls:"as-trace-tokens",text:`${(r.tokens/1e3).toFixed(1)}k`}),l.createSpan({cls:"as-trace-cost",text:r.cost>0?`$${r.cost.toFixed(2)}`:""}),l.createSpan({cls:"as-trace-duration",text:`${(r.duration/1e3).toFixed(1)}s`})}i.createDiv({cls:"as-traces-hint",text:"skillkit trace --list --skill "+t.name})}renderPruneAction(e,t){let s=e.createDiv("as-prune-section"),i=s.createEl("button",{cls:"as-prune-btn",text:"Remove this skill"});s.createSpan({cls:"as-prune-hint",text:"This skill hasn't been used in 30+ days"}),i.addEventListener("click",()=>{B(this.app,"Remove skill",`Remove "${t.name}"? This will delete the skill files.`,()=>{let a=G(`prune --skill ${t.name} --yes`);a.success?(new y.Notice(`Removed ${t.name}`,5e3),this.store.refresh(this.settings)):new y.Notice(`Failed to remove: ${a.output}`,5e3)})})}renderEditor(e){let t=this.containerEl.createDiv("as-detail-body as-detail-body-editor"),s=t.createEl("textarea",{cls:"as-editor-textarea"});s.value=e.content,s.spellcheck=!1,s.addEventListener("keydown",r=>{if((r.metaKey||r.ctrlKey)&&r.key==="s"&&(r.preventDefault(),this.saveFile(e,s.value)),r.key==="Tab"){r.preventDefault();let l=s.selectionStart,o=s.selectionEnd;s.value=s.value.substring(0,l)+" "+s.value.substring(o),s.selectionStart=s.selectionEnd=l+1}});let i=t.createDiv("as-save-bar");i.createEl("button",{cls:"as-save-btn",text:"Save"}).addEventListener("click",()=>{this.saveFile(e,s.value)}),i.createSpan({cls:"as-save-hint",text:"Cmd+S to save"})}saveFile(e,t){try{(0,Je.writeFileSync)(e.filePath,t,"utf-8"),e.content=t,new y.Notice(`Saved ${e.name}`,5e3)}catch(s){new y.Notice(`Failed to save: ${s instanceof Error?s.message:String(s)}`,5e3)}}};var A=require("obsidian"),rt=require("electron");var De=require("child_process"),w=require("fs"),S=require("path"),Xe=require("os"),q=require("obsidian"),x=(0,Xe.homedir)(),Ke=(0,S.join)(x,".agents",".skill-lock.json"),$t="https://skills.sh/api";async function xe(n){if(n.length<2)return[];try{let t=(await(0,q.requestUrl)({url:`${$t}/search?q=${encodeURIComponent(n)}&limit=30`})).json;if(!t.skills)return[];let s=st();return t.skills.map(i=>({...i,installed:s.has(i.name)}))}catch{return[]}}var Qe=new Map;async function Ft(n){let e=Qe.get(n);if(e)return e;let s=(await(0,q.requestUrl)({url:`https://api.github.com/repos/${n}`})).json.default_branch||"main",a=(await(0,q.requestUrl)({url:`https://api.github.com/repos/${n}/git/trees/${s}?recursive=1`})).json.tree.filter(l=>l.path.endsWith("/SKILL.md")).map(l=>l.path),r={branch:s,files:a};return Qe.set(n,r),r}function jt(n,e,t){let s=e.split("/"),i=s[s.length-1]||n,a=new Set([i,n]);for(let r of t.split("/")){n.startsWith(r+"-")&&a.add(n.slice(r.length+1));for(let l of r.split("-"))n.startsWith(l+"-")&&a.add(n.slice(l.length+1))}return a}async function Ye(n,e,t){try{let{branch:s,files:i}=await Ft(n),a=jt(e,t,n),r=i.find(c=>{let d=c.replace("/SKILL.md","").split("/").pop()||"";return a.has(d)});r||(r=i.find(c=>{let d=c.replace("/SKILL.md","").split("/").pop()||"";return e.includes(d)||d.includes(e)}));let l=r||`skills/${e}/SKILL.md`;return(await(0,q.requestUrl)({url:`https://raw.githubusercontent.com/${n}/${s}/${l}`})).text}catch{return null}}async function et(){let n=["react","next","clerk","stripe","ai"],e=new Set,t=[];for(let s of n){let i=await xe(s);for(let a of i)e.has(a.id)||(e.add(a.id),t.push(a))}return t.sort((s,i)=>i.installs-s.installs).slice(0,20)}function Rt(){let n=["/usr/local/bin","/opt/homebrew/bin",(0,S.join)(x,".local","bin"),(0,S.join)(x,".bun","bin")],e=(0,S.join)(x,".nvm","versions","node");try{for(let t of(0,w.readdirSync)(e))n.push((0,S.join)(e,t,"bin"))}catch{}return[...n,process.env.PATH||""].join(":")}function qe(){let n=(0,S.join)(x,".bun","bin","bunx");return(0,w.existsSync)(n)?n:(0,w.existsSync)("/usr/local/bin/bunx")||(0,w.existsSync)("/opt/homebrew/bin/bunx")?"bunx":"npx"}function Ee(n="auto"){return n==="npx"?"npx":qe()}var tt=[{id:"claude-code",label:"Claude Code"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"github-copilot",label:"GitHub Copilot"},{id:"windsurf",label:"Windsurf"},{id:"amp",label:"Amp"},{id:"opencode",label:"OpenCode"},{id:"cline",label:"Cline"},{id:"gemini-cli",label:"Gemini CLI"},{id:"goose",label:"Goose"},{id:"kiro-cli",label:"Kiro"},{id:"roo",label:"Roo Code"},{id:"continue",label:"Continue"},{id:"antigravity",label:"Antigravity"},{id:"warp",label:"Warp"},{id:"pi",label:"Pi"},{id:"replit",label:"Replit"}],ie={"claude-code":"claude-code",cursor:"cursor",codex:"codex",copilot:"github-copilot",windsurf:"windsurf",amp:"amp",opencode:"opencode",antigravity:"antigravity","claude-desktop":"claude-code",pi:"pi","global-agents":"claude-code",aider:"claude-code"};function st(){let n=new Set;if(!(0,w.existsSync)(Ke))return n;try{let e=JSON.parse((0,w.readFileSync)(Ke,"utf-8"));if(e.skills)for(let t of Object.keys(e.skills))n.add(t)}catch{}return n}var Ot=[(0,S.join)(x,".claude","skills"),(0,S.join)(x,".cursor","skills"),(0,S.join)(x,".codex","skills"),(0,S.join)(x,".codeium","windsurf","skills"),(0,S.join)(x,".config","amp","skills"),(0,S.join)(x,".config","opencode","skills"),(0,S.join)(x,".copilot","skills"),(0,S.join)(x,".agents","skills")];function Nt(n){for(let e of Ot){let t=(0,S.join)(e,n);if((0,w.existsSync)(t))try{(0,w.rmSync)(t,{recursive:!0,force:!0})}catch{}}Bt(n)}function Bt(n){let e=(0,S.join)(x,".agents",".skill-lock.json");if((0,w.existsSync)(e))try{let t=JSON.parse((0,w.readFileSync)(e,"utf-8"));t.skills&&t.skills[n]&&(delete t.skills[n],(0,w.writeFileSync)(e,JSON.stringify(t,null,2)+` +`,"utf-8"))}catch{}}function ne(n){let e=st();for(let t of n)t.installed=e.has(t.name);return n}function Ce(n,e=12e4){return new Promise(t=>{(0,De.exec)(n,{encoding:"utf-8",timeout:e,env:{...process.env,PATH:Rt(),NO_COLOR:"1"}},(s,i)=>{let a=String(i??"");!s||a.includes("Done")||a.includes("Installed")||a.includes("Removed")||a.includes("Updated")?t({success:!0,output:a}):t({success:!1,output:s?.message??"Command failed"})})})}async function it(n,e,t={}){let s=e.length>0?`-a ${e.join(" ")}`:"-a '*'",i=t.global?"-g":"",r=`${Ee(t.runner||"auto")} skills add ${n} ${s} ${i} -y`.replace(/\s+/g," ").trim();return Ce(r)}async function nt(n,e="auto"){let s=`${Ee(e)} skills remove ${n} -y`,i=await Ce(s,3e4);return Nt(n),{success:!0,output:i.output||`Cleaned ${n}`}}async function at(n="auto"){let t=`${Ee(n)} skills update`,s=await Ce(t),i=s.output.match(/Updated (\d+) skill/);return{...s,count:i?parseInt(i[1]):0}}function Le(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}var J=require("fs"),ot=require("path"),lt=require("os");function zt(){let n=$("stats"),e=$("health"),t=$("burn"),s=$("context");return{stats:n,health:e,burn:t&&t.length>0?t[0]:null,context:s}}var Te=(0,ot.join)((0,lt.homedir)(),".skillkit","dashboard-cache.json"),H=null,O=null;function Wt(){if(!H&&(0,J.existsSync)(Te))try{let n=JSON.parse((0,J.readFileSync)(Te,"utf-8"));H=n.data,O=n.cachedAt}catch{}}function Vt(){if(H)try{(0,J.writeFileSync)(Te,JSON.stringify({data:H,cachedAt:O},null,2),"utf-8")}catch{}}Wt();var ae=class{containerEl;app;constructor(e,t){this.containerEl=e,this.app=t}render(){if(this.containerEl.empty(),this.containerEl.addClass("as-dashboard"),!L()){this.renderNoSkillkit();return}if(H)this.renderDashboard(H);else{let e=this.containerEl.createDiv("as-dash-loading");e.createDiv("as-dash-spinner"),e.createDiv({cls:"as-dash-loading-text",text:"Loading analytics..."}),setTimeout(()=>{let t=zt();H=t,O=Date.now(),Vt(),e.remove(),this.renderDashboard(t)},10)}}renderDashboard(e){if(this.renderActionBar(e),e.stats&&this.renderOverview(e.stats,e.health),e.stats&&this.renderTopSkills(e.stats),e.health||e.context){let t=this.containerEl.createDiv("as-dash-row");e.health&&this.renderHealth(e.health,t),e.context&&this.renderContext(e.context,t)}e.burn&&this.renderBurn(e.burn),e.health&&this.renderStale(e.health)}renderActionBar(e){let t=this.containerEl.createDiv("as-dash-action-bar");if(O){let r=Math.round((Date.now()-O)/1e3),l=r<5?"just now":r<60?`${r}s ago`:`${Math.round(r/60)}m ago`;t.createSpan({cls:"as-dash-updated",text:`Updated ${l}`})}let s=t.createDiv("as-dash-action-buttons"),i=s.createEl("button",{cls:"as-action-btn",text:"Update skills"});i.addEventListener("click",()=>{i.setText("Updating..."),i.disabled=!0,at().then(r=>{if(r.success){let l=r.count>0?`Updated ${r.count} skill(s)`:"All skills up to date";new A.Notice(l,5e3),H=null,O=null,this.render()}else new A.Notice(`Update failed: ${r.output}`,5e3);i.setText("Update skills"),i.disabled=!1})});let a=s.createEl("button",{cls:"as-action-btn",text:"Scan sessions"});if(a.addEventListener("click",()=>{a.setText("Scanning..."),a.disabled=!0,setTimeout(()=>{let r=G("scan");r.success?(new A.Notice("Scan complete",5e3),H=null,O=null,this.render()):new A.Notice(`Scan failed: ${r.output}`,5e3),a.setText("Scan sessions"),a.disabled=!1},10)}),e.health&&e.health.usage.unused_30d>0){let r=s.createEl("button",{cls:"as-action-btn as-action-btn-danger",text:`Prune ${e.health.usage.unused_30d} stale`});r.addEventListener("click",()=>{B(this.app,"Prune stale skills",`Remove ${e.health.usage.unused_30d} unused skills? This cannot be undone.`,()=>{r.setText("Pruning..."),r.disabled=!0,setTimeout(()=>{let l=G("prune --yes");l.success?(new A.Notice("Pruned stale skills",5e3),H=null,O=null,this.render()):new A.Notice(`Prune failed: ${l.output}`,5e3),r.setText(`Prune ${e.health.usage.unused_30d} stale`),r.disabled=!1},10)})})}}renderNoSkillkit(){let e=this.containerEl.createDiv("as-dash-empty"),t=e.createDiv("as-dash-empty-icon");(0,A.setIcon)(t,"bar-chart-2"),e.createEl("h3",{text:"Dashboard requires skillkit"}),e.createEl("p",{text:"Install skillkit to unlock usage analytics, burn rate, context tax, and more."}),e.createDiv("as-dash-install-cmd").createEl("code",{text:"npm i -g @crafter/skillkit && skillkit scan"}),e.createEl("a",{cls:"as-skillkit-link",text:"Learn more",href:"https://www.npmjs.com/package/@crafter/skillkit"}).addEventListener("click",a=>{a.preventDefault(),rt.shell.openExternal("https://www.npmjs.com/package/@crafter/skillkit")})}renderOverview(e,t){let s=this.containerEl.createDiv("as-dash-section");s.createDiv({cls:"as-dash-title",text:"Overview"});let i=s.createDiv("as-dash-stats");if(this.statCard(i,String(e.total_invocations),"invocations","activity"),this.statCard(i,String(e.unique_skills),"active skills","sparkles"),this.statCard(i,String(t?.installed??0),"installed","package"),this.statCard(i,String(t?.usage.unused_30d??0),"stale","alert-triangle"),e.streak&&e.streak.current>0){let a=s.createDiv("as-dash-streak-row");a.createSpan({cls:"as-streak-value",text:`${e.streak.current} day streak`}),e.streak.current>=7&&a.createSpan({cls:"as-streak-fire",text:"on fire"}),a.createSpan({cls:"as-streak-longest",text:`longest: ${e.streak.longest}d`})}if(e.velocity&&e.velocity.this_week>0){let a=s.createDiv("as-dash-velocity-row");a.createSpan({text:`This week: $${e.velocity.this_week.toFixed(0)}`}),a.createSpan({cls:"as-velocity-vs",text:`vs $${e.velocity.last_week.toFixed(0)} last week`});let r=e.velocity.change_pct,l=r>0?"as-velocity-up":r<0?"as-velocity-down":"",o=r>0?"+":"";a.createSpan({cls:`as-velocity-change ${l}`,text:`${o}${r.toFixed(0)}%`})}}statCard(e,t,s,i){let a=e.createDiv("as-stat-card"),r=a.createDiv("as-stat-icon");(0,A.setIcon)(r,i),a.createDiv({cls:"as-stat-value",text:t}),a.createDiv({cls:"as-stat-label",text:s})}renderTopSkills(e){if(e.top_skills.length===0)return;let t=this.containerEl.createDiv("as-dash-section");t.createDiv({cls:"as-dash-title",text:`Top Skills (${e.period.days}d)`});let s=e.top_skills[0]?.total||1,i=t.createDiv("as-dash-bars");for(let a of e.top_skills.slice(0,10)){let r=i.createDiv("as-bar-row");r.createSpan({cls:"as-bar-name",text:a.name}),r.createDiv("as-bar-wrap").createDiv("as-bar-fill").setCssProps({"--bar-w":`${a.total/s*100}%`}),r.createSpan({cls:"as-bar-count",text:String(a.total)})}}renderHealth(e,t){let s=(t||this.containerEl).createDiv("as-dash-section");s.createDiv({cls:"as-dash-title",text:"Health"});let i=e.usage.used_30d+e.usage.unused_30d,a=i>0?Math.round(e.usage.used_30d/i*100):0,r=s.createDiv("as-dash-health-row"),l=r.createDiv("as-donut");l.setCssProps({"--pct":`${a}`}),l.createDiv({cls:"as-donut-label",text:`${a}%`}),l.createDiv({cls:"as-donut-sub",text:"active"});let o=r.createDiv("as-health-details");o.createDiv({cls:"as-health-line",text:`${e.usage.used_30d} used in 30d`}),o.createDiv({cls:"as-health-line as-health-warn",text:`${e.usage.unused_30d} never triggered`});let d=o.createDiv("as-budget-bar").createDiv("as-budget-fill");d.setCssProps({"--bar-w":`${e.metadata.pct}%`}),e.metadata.pct>80&&d.addClass("as-budget-over"),o.createDiv({cls:"as-health-line",text:`Metadata budget: ${e.metadata.pct}%`})}renderBurn(e){let t=this.containerEl.createDiv("as-dash-section");t.createDiv({cls:"as-dash-title",text:`Burn Rate \u2014 ${e.agent} (${e.period.days}d)`});let s=t.createDiv("as-dash-stats as-dash-stats-sm");if(this.statCard(s,`$${Math.round(e.cost.total).toLocaleString()}`,"total cost","flame"),this.statCard(s,`$${Math.round(e.cost.total/(e.period.days||1)).toLocaleString()}`,"daily avg","trending-up"),this.statCard(s,`${(e.period.sessions||0).toLocaleString()}`,"sessions","terminal"),this.statCard(s,`${((e.period.api_calls||0)/1e3).toFixed(0)}k`,"API calls","zap"),e.by_model&&e.by_model.length>0){let l=t.createDiv("as-model-breakdown");for(let o of e.by_model.slice(0,4)){let c=l.createDiv("as-model-row");c.createSpan({cls:"as-model-name",text:o.model}),c.createSpan({cls:"as-model-calls",text:`${o.apiCalls.toLocaleString()} calls`}),o.costUsd>0&&c.createSpan({cls:"as-model-cost",text:`$${Math.round(o.costUsd).toLocaleString()}`})}}let i=e.by_day.slice(-14);if(i.length===0)return;let a=Math.max(...i.map(l=>l.costUsd),1),r=t.createDiv("as-burn-chart");for(let l of i){let o=r.createDiv("as-burn-col"),c=o.createDiv("as-burn-bar"),d=Math.max(2,l.costUsd/a*100);c.setCssProps({"--bar-h":`${d}%`}),c.title=`${l.date}: $${l.costUsd.toFixed(0)}`,o.createDiv({cls:"as-burn-date",text:l.date.slice(8)})}}renderContext(e,t){let s=(t||this.containerEl).createDiv("as-dash-section");s.createDiv({cls:"as-dash-title",text:"Context Tax"});let i=e.always_loaded.total_tokens,a=[{label:"CLAUDE.md",tokens:e.always_loaded.claude_md_tokens,cls:"as-ctx-claude"},{label:"Skills metadata",tokens:e.always_loaded.skill_metadata_tokens,cls:"as-ctx-skills"},{label:"Memory",tokens:e.always_loaded.memory_tokens,cls:"as-ctx-memory"}],r=s.createDiv("as-ctx-bar");for(let c of a){let d=r.createDiv(`as-ctx-part ${c.cls}`);d.setCssProps({"--bar-w":`${c.tokens/i*100}%`}),d.title=`${c.label}: ${(c.tokens/1e3).toFixed(1)}k tokens`}let l=s.createDiv("as-ctx-legend");for(let c of a){let d=l.createDiv("as-ctx-legend-item");d.createSpan({cls:`as-ctx-dot ${c.cls}`}),d.createSpan({text:`${c.label}: ${(c.tokens/1e3).toFixed(1)}k`})}let o=s.createDiv("as-ctx-costs");o.createDiv({text:`Per session (cached): $${e.session_estimate.with_cache.toFixed(2)}`}),o.createDiv({text:`Without cache: $${e.session_estimate.without_cache.toFixed(2)}`}),o.createDiv({cls:"as-ctx-savings",text:`Cache saves ${e.session_estimate.savings_pct.toFixed(0)}%`})}renderStale(e){if(e.usage.never_used.length===0)return;let t=this.containerEl.createDiv("as-dash-section");t.createDiv({cls:"as-dash-title",text:`Stale skills (${e.usage.unused_30d})`});let s=t.createDiv("as-stale-list");for(let i of e.usage.never_used.slice(0,20))s.createDiv("as-stale-item").createSpan({text:i});e.usage.never_used.length>20&&s.createDiv({cls:"as-stale-more",text:`+${e.usage.never_used.length-20} more`})}};var P=require("obsidian"),K=require("fs"),vt=require("path"),bt=require("os");var T=require("obsidian"),Z=require("fs"),gt=require("path"),ft=require("os");var h=require("fs"),v=require("path"),re=require("os"),dt=require("obsidian"),pt=require("crypto");var ct=new Set(["readme.md","license","license.md","changelog.md",".ds_store","thumbs.db"]);function Ut(n){return(0,pt.createHash)("sha256").update(n).digest("hex").slice(0,12)}function Gt(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!e)return{frontmatter:{},content:n};try{let t=(0,dt.parseYaml)(e[1]);return{frontmatter:typeof t=="object"&&t?t:{},content:e[2]}}catch{return{frontmatter:{},content:n}}}function Jt(n,e,t,s="auto"){if(s==="auto"){if(typeof n.name=="string"&&n.name)return n.name;let a=e.match(/^#\s+(.+)$/m);if(a)return a[1].trim()}let i=(0,v.basename)(t,(0,v.extname)(t));return i==="SKILL"?(0,v.basename)((0,v.join)(t,"..")):i}function Zt(n,e,t,s="auto"){if(!(0,h.existsSync)(n))return[];let i=[];for(let a of(0,h.readdirSync)(n,{withFileTypes:!0})){let r=(0,v.join)(n,a.name);if(!(a.isDirectory()||a.isSymbolicLink()&&(0,h.statSync)(r,{throwIfNoEntry:!1})?.isDirectory()))continue;let o=(0,v.join)(r,"SKILL.md");if(!(0,h.existsSync)(o))continue;let c=X(o,e,t,"directory-with-skillmd",s);c&&i.push(c)}return i}function Kt(n,e,t,s="auto"){if(!(0,h.existsSync)(n))return[];let i=[];for(let a of(0,h.readdirSync)(n,{withFileTypes:!0})){let r=(0,v.join)(n,a.name);if(a.isDirectory()||a.isSymbolicLink()&&(0,h.statSync)(r,{throwIfNoEntry:!1})?.isDirectory()){let d=(0,v.join)(r,"SKILL.md");if((0,h.existsSync)(d)){let f=X(d,e,t,"flat-md",s);f&&i.push(f);continue}let m=(0,h.readdirSync)(r).filter(f=>f.endsWith(".md")&&!ct.has(f.toLowerCase())),g=m.find(f=>f.toLowerCase()===`${a.name.toLowerCase()}.md`)||m[0];if(g){let f=X((0,v.join)(r,g),e,t,"flat-md",s);f&&i.push(f)}continue}let o=a.name.toLowerCase();if(!o.endsWith(".md")||ct.has(o))continue;let c=X(r,e,t,"flat-md",s);c&&i.push(c)}return i}function Qt(n,e,t,s="auto"){if(!(0,h.existsSync)(n))return[];let i=[];for(let a of(0,h.readdirSync)(n,{withFileTypes:!0})){if(!a.name.endsWith(".mdc")&&!a.name.endsWith(".md")||a.isDirectory())continue;let r=X((0,v.join)(n,a.name),e,t,"mdc",s);r&&i.push(r)}return i}function X(n,e,t,s="directory-with-skillmd",i="auto"){try{let a=(0,h.readFileSync)(n,"utf-8"),r=(0,h.statSync)(n),{frontmatter:l,content:o}=Gt(a),c=Jt(l,o,n,i),d=typeof l.description=="string"?l.description:"",m;try{m=(0,h.realpathSync)(n)}catch{m=n}return{id:Ut(m),name:c,description:d,type:e,tools:[t],filePath:n,realPath:m,dirPath:(0,v.join)(n,".."),content:a,frontmatter:l,lastModified:r.mtimeMs,fileSize:r.size,isFavorite:!1,collections:[]}}catch{return null}}function Me(n,e,t="auto"){switch(n.pattern){case"directory-with-skillmd":return Zt(n.baseDir,n.type,e,t);case"flat-md":return Kt(n.baseDir,n.type,e,t);case"mdc":return Qt(n.baseDir,n.type,e,t)}}function qt(n,e){let t=[],s=[{sub:".claude/skills",type:"skill",pattern:"directory-with-skillmd"},{sub:".claude/commands",type:"command",pattern:"flat-md"},{sub:".claude/agents",type:"agent",pattern:"flat-md"},{sub:".cursor/skills",type:"skill",pattern:"directory-with-skillmd"},{sub:".codex/skills",type:"skill",pattern:"directory-with-skillmd"}];for(let i of s){let a=(0,v.join)(n,i.sub);if(!(0,h.existsSync)(a))continue;let r={baseDir:a,type:i.type,pattern:i.pattern};t.push(...Me(r,e))}return t}function ut(n){return n.projectsHomeDir||(0,re.homedir)()}function Xt(n,e){let t=(0,re.homedir)(),s=[];for(let i of[...e.paths,...e.agentPaths]){let a=(0,v.relative)(t,i.baseDir);if(a.startsWith("..")||a.startsWith("/"))continue;let r=(0,v.join)(n,a);if((0,h.existsSync)(r))try{s.push(...Me({...i,baseDir:r},e.id))}catch{}}return s}function Yt(n){let e=ut(n);if(!(0,h.existsSync)(e))return[];let t=[];try{let s=new Set(["node_modules",".Trash","Library","Applications","Music","Movies","Pictures","Public"]);for(let i of(0,h.readdirSync)(e,{withFileTypes:!0})){if(!i.isDirectory()&&!i.isSymbolicLink()||s.has(i.name))continue;let a=(0,v.join)(e,i.name);for(let r of E){if(!r.isInstalled())continue;let l=n.tools[r.id];if(l&&!l.enabled)continue;let o=Xt(a,r);o.length>0&&t.push({items:o,toolId:r.id})}}}catch{}return t}function Pe(n,e){let t=e||(0,re.homedir)();if(!n.startsWith(t+"/"))return"global";let i=n.slice(t.length+1).split("/");return i.length>1&&!i[0].startsWith(".")?i[0]:"global"}function ht(n){let e=n.namingMode||"auto",t=new Map,s=new Map;function i(a,r){let l=t.get(a.id);if(l){l.tools.includes(r)||l.tools.push(r);return}let o=s.get(a.name);if(o){let c=t.get(o);c&&!c.tools.includes(r)&&c.tools.push(r);return}a.isFavorite=n.favorites.includes(a.id);for(let[c,d]of Object.entries(n.collections))d.includes(a.id)&&a.collections.push(c);t.set(a.id,a),s.set(a.name,a.id)}for(let a of E){if(!a.isInstalled())continue;let r=n.tools[a.id];if(r&&!r.enabled)continue;let l=[...a.paths,...a.agentPaths];for(let o of l)for(let c of Me(o,a.id,e))i(c,a.id)}for(let a of n.customScanPaths)if((0,h.existsSync)(a))for(let r of qt(a,"claude-code"))i(r,"claude-code");if(n.projectScanEnabled)for(let{items:a,toolId:r}of Yt(n))for(let l of a)i(l,r);return t}function Ie(){return E.filter(n=>n.isInstalled()).map(n=>n.id)}function mt(n){let e=[];for(let t of E)if(t.isInstalled())for(let s of[...t.paths,...t.agentPaths])(0,h.existsSync)(s.baseDir)&&e.push(s.baseDir);if(n?.projectScanEnabled){let t=ut(n),s=new Set(["node_modules",".Trash","Library","Applications","Music","Movies","Pictures","Public"]);try{for(let i of(0,h.readdirSync)(t,{withFileTypes:!0})){if(!i.isDirectory()&&!i.isSymbolicLink()||s.has(i.name))continue;let a=(0,v.join)(t,i.name);for(let r of[".claude/skills",".claude/commands",".claude/agents",".cursor/skills",".codex/skills"]){let l=(0,v.join)(a,r);(0,h.existsSync)(l)&&e.push(l)}}}catch{}}return e}var _e={};for(let[n,e]of Object.entries(ie))_e[e]||(_e[e]=n);var Ae=(0,gt.join)((0,ft.homedir)(),".skillkit","install-prefs.json"),z=null,oe=!0;function es(){if(!z&&(0,Z.existsSync)(Ae))try{let n=JSON.parse((0,Z.readFileSync)(Ae,"utf-8"));z=new Set(n.agents||[]),oe=n.global??!0}catch{}}function ts(){try{(0,Z.writeFileSync)(Ae,JSON.stringify({agents:z?[...z]:[],global:oe}),"utf-8")}catch{}}es();var le=class extends T.Modal{skill;settings;onInstalled;selectedAgents;isGlobal;constructor(e,t,s,i){if(super(e),this.skill=t,this.settings=s,this.onInstalled=i,z)this.selectedAgents=new Set(z);else{this.selectedAgents=new Set;let a=Ie();for(let r of a){let l=ie[r];l&&this.selectedAgents.add(l)}}this.isGlobal=oe}onOpen(){let{contentEl:e}=this;e.addClass("as-install-modal"),e.createEl("h3",{text:`Install ${this.skill.name}`}),e.createEl("p",{cls:"as-install-source",text:this.skill.source}),new T.Setting(e).setName("Install globally").setDesc("Shared across all projects (~/.agents/skills/)").addToggle(o=>o.setValue(this.isGlobal).onChange(c=>{this.isGlobal=c})),new T.Setting(e).setName("Agents").setHeading();let t=e.createDiv("as-install-scroll"),s=Ie(),i=new Set(s.map(o=>ie[o]).filter(Boolean));for(let o of tt){let c=i.has(o.id),d=_e[o.id],g=new T.Setting(t).addToggle(fe=>fe.setValue(this.selectedAgents.has(o.id)).onChange(Dt=>{Dt?this.selectedAgents.add(o.id):this.selectedAgents.delete(o.id)})).nameEl,f=d&&C[d]?d:C[o.id]?o.id:C[o.id+"-code"]?o.id+"-code":C[o.id+"-cli"]?o.id+"-cli":null,W=g.createSpan("as-install-agent-icon");f?j(W,f,14):W.addClass("as-install-agent-placeholder"),g.createSpan({text:o.label}),c&&g.createSpan({cls:"as-install-detected",text:"detected"})}let a=e.createDiv("as-install-footer");a.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close());let l=a.createEl("button",{cls:"mod-cta",text:"Install"});l.addEventListener("click",()=>this.doInstall(l))}doInstall(e){let t=[...this.selectedAgents];if(t.length===0){new T.Notice("Select at least one agent",5e3);return}z=new Set(this.selectedAgents),oe=this.isGlobal,ts(),this.close(),new T.Notice(`Installing ${this.skill.name}...`,3e3),it(this.skill.source,t,{runner:this.settings.packageRunner,global:this.isGlobal}).then(s=>{s.success?(new T.Notice(`Installed ${this.skill.name}`,5e3),this.skill.installed=!0,this.onInstalled()):new T.Notice(`Failed to install ${this.skill.name}`,5e3)})}onClose(){this.contentEl.empty()}};var He=(0,vt.join)((0,bt.homedir)(),".skillkit","marketplace-popular.json"),M=null,ce="",N=null,ss=new P.Component;function is(){if(!M&&(0,K.existsSync)(He))try{let n=JSON.parse((0,K.readFileSync)(He,"utf-8"));M=ne(n)}catch{}}function ns(){if(M)try{(0,K.writeFileSync)(He,JSON.stringify(M),"utf-8")}catch{}}is();var de=class{containerEl;inputEl=null;listEl=null;previewEl=null;searchTimer=null;selectedSkill=null;app;settings;onRefresh;constructor(e,t,s,i){this.containerEl=e,this.app=t.app,this.settings=s,this.onRefresh=i}render(){if(!this.inputEl){this.containerEl.empty(),this.containerEl.addClass("as-marketplace");let e=this.containerEl.createDiv("as-mp-search");this.inputEl=e.createEl("input",{type:"text",placeholder:"Search skills on skills.sh...",cls:"as-mp-search-input"}),this.inputEl.addEventListener("input",()=>{this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout(()=>{this.doSearch(this.inputEl.value)},300)});let t=this.containerEl.createDiv("as-mp-body");this.listEl=t.createDiv("as-mp-list"),this.previewEl=t.createDiv("as-mp-preview"),this.previewEl.createDiv({cls:"as-mp-hint",text:"Select a skill to preview."})}this.inputEl.value=ce,ce.length>=2&&N?this.showResults(N):M?this.showPopular():this.loadPopular()}async loadPopular(){if(!this.listEl)return;this.listEl.empty(),this.listEl.createDiv({cls:"as-mp-loading",text:"Loading popular skills..."}),M=await et(),ns(),this.showPopular()}refreshList(){M&&ne(M),N&&ne(N),ce.length>=2&&N?this.showResults(N):this.showPopular()}showPopular(){if(this.listEl){if(this.listEl.empty(),!M||M.length===0){this.listEl.createDiv({cls:"as-mp-hint",text:"Search for skills to browse and install."});return}this.listEl.createDiv({cls:"as-mp-section-title",text:"Popular"});for(let e of M)this.renderSkillCard(e)}}showResults(e){if(this.listEl){if(this.listEl.empty(),e.length===0){this.listEl.createDiv({cls:"as-mp-hint",text:"No skills found."});return}for(let t of e)this.renderSkillCard(t)}}async doSearch(e){if(!this.listEl)return;if(ce=e,e.length<2){N=null,this.showPopular();return}this.listEl.empty(),this.listEl.createDiv({cls:"as-mp-loading",text:"Searching..."});let t=await xe(e);N=t,this.showResults(t)}renderSkillCard(e){if(!this.listEl)return;let t=this.listEl.createDiv("as-mp-card");this.selectedSkill?.id===e.id&&t.addClass("is-selected");let s=t.createDiv("as-mp-card-header");s.createSpan({cls:"as-mp-card-name",text:e.name}),e.installed&&s.createSpan({cls:"as-mp-installed-badge",text:"Installed"}),t.createDiv({cls:"as-mp-card-source",text:e.source});let i=t.createDiv("as-mp-card-meta"),a=i.createSpan("as-mp-dl-icon");(0,P.setIcon)(a,"download"),i.createSpan({cls:"as-mp-card-installs",text:Le(e.installs)}),t.addEventListener("click",()=>{this.selectedSkill=e,this.listEl&&this.listEl.querySelectorAll(".as-mp-card").forEach(r=>r.removeClass("is-selected")),t.addClass("is-selected"),this.showPreview(e)})}async showPreview(e){if(!this.previewEl)return;this.previewEl.empty();let s=this.previewEl.createDiv("as-mp-preview-header").createDiv("as-mp-preview-top"),i=s.createDiv("as-mp-preview-left");i.createDiv({cls:"as-mp-preview-name",text:e.name});let a=i.createDiv("as-mp-preview-meta");a.createSpan({cls:"as-mp-preview-source",text:e.source});let r=a.createSpan("as-mp-dl-icon");(0,P.setIcon)(r,"download"),a.createSpan({cls:"as-mp-preview-installs",text:Le(e.installs)});let l=s.createDiv("as-mp-preview-right");if(!e.installed)this.renderInstallButton(l,e);else{l.createSpan({cls:"as-mp-installed-label",text:"Installed"});let d=l.createEl("button",{cls:"as-mp-uninstall-btn",text:"Uninstall"});d.addEventListener("click",()=>{B(this.app,"Uninstall skill",`Remove "${e.name}" from all agents?`,()=>{d.setText("Removing..."),d.disabled=!0,new P.Notice(`Removing ${e.name}...`,3e3),nt(e.name,this.settings.packageRunner).then(m=>{m.success?(new P.Notice(`Removed ${e.name}`,5e3),e.installed=!1,this.refreshList(),this.showPreview(e)):(new P.Notice(`Failed to remove ${e.name}`,5e3),d.setText("Uninstall"),d.disabled=!1)})})})}let o=this.previewEl.createDiv("as-mp-preview-content");o.createDiv({cls:"as-mp-loading",text:"Loading skill content..."});let c=await Ye(e.source,e.name,e.id);if(o.empty(),c){e.content=c;let d=o.createDiv("as-mp-rendered markdown-rendered");P.MarkdownRenderer.render(this.app,c,d,"",ss)}else o.createDiv({cls:"as-mp-hint",text:"Could not load skill content."})}renderInstallButton(e,t){e.createEl("button",{cls:"as-mp-install-btn",text:"Install"}).addEventListener("click",()=>{new le(this.app,t,this.settings,()=>{this.refreshList(),this.showPreview(t)}).open()})}};var Y="agentfiles-view",pe=class extends kt.ItemView{store;settings;saveSettings;sidebarPanel;listPanel;detailPanel;dashboardPanel;marketplacePanel;sidebarEl;listEl;detailEl;dashboardEl;marketplaceEl;resizeHandle1;resizeHandle2;isDashboard=!1;isMarketplace=!1;updateRef=null;dragCleanup=null;constructor(e,t,s,i){super(e),this.store=t,this.settings=s,this.saveSettings=i}getViewType(){return Y}getDisplayText(){return"Agentfiles"}getIcon(){return"cpu"}onOpen(){let e=this.contentEl;e.empty(),e.addClass("as-container"),this.sidebarEl=e.createDiv("as-panel as-panel-sidebar"),this.resizeHandle1=this.createResizeHandle(e,this.sidebarEl,"--as-sidebar-width",120,400),this.listEl=e.createDiv("as-panel as-panel-list"),this.resizeHandle2=this.createResizeHandle(e,this.listEl,"--as-list-width",180,600),this.detailEl=e.createDiv("as-panel as-panel-detail"),this.dashboardEl=e.createDiv("as-panel as-panel-dashboard as-hidden"),this.marketplaceEl=e.createDiv("as-panel as-panel-marketplace as-hidden"),this.sidebarPanel=new ee(this.sidebarEl,this.store,()=>this.toggleDashboard(),()=>this.toggleMarketplace()),this.listPanel=new te(this.listEl,this.store,t=>this.onSelectItem(t)),this.detailPanel=new se(this.detailEl,this.store,this.settings,this.saveSettings,this),this.dashboardPanel=new ae(this.dashboardEl,this.app),this.marketplacePanel=new de(this.marketplaceEl,this,this.settings,()=>{this.store.refresh(this.settings)}),this.updateRef=this.store.on("updated",()=>this.renderAll()),this.renderAll()}toggleDashboard(){this.dragCleanup?.(),this.dragCleanup=null,this.isDashboard=!this.isDashboard,this.isMarketplace&&(this.isMarketplace=!1,this.marketplaceEl.addClass("as-hidden")),this.isDashboard?(this.listEl.addClass("as-hidden"),this.detailEl.addClass("as-hidden"),this.resizeHandle1.addClass("as-hidden"),this.resizeHandle2.addClass("as-hidden"),this.dashboardEl.removeClass("as-hidden"),this.dashboardPanel.render()):(this.listEl.removeClass("as-hidden"),this.detailEl.removeClass("as-hidden"),this.resizeHandle1.removeClass("as-hidden"),this.resizeHandle2.removeClass("as-hidden"),this.dashboardEl.addClass("as-hidden")),this.sidebarPanel.setDashboardActive(this.isDashboard),this.sidebarPanel.render()}toggleMarketplace(){this.dragCleanup?.(),this.dragCleanup=null,this.isMarketplace=!this.isMarketplace,this.isDashboard&&(this.isDashboard=!1,this.dashboardEl.addClass("as-hidden")),this.isMarketplace?(this.listEl.addClass("as-hidden"),this.detailEl.addClass("as-hidden"),this.resizeHandle1.addClass("as-hidden"),this.resizeHandle2.addClass("as-hidden"),this.marketplaceEl.removeClass("as-hidden"),this.marketplacePanel.render()):(this.listEl.removeClass("as-hidden"),this.detailEl.removeClass("as-hidden"),this.resizeHandle1.removeClass("as-hidden"),this.resizeHandle2.removeClass("as-hidden"),this.marketplaceEl.addClass("as-hidden")),this.sidebarPanel.setMarketplaceActive(this.isMarketplace),this.sidebarPanel.render()}renderAll(){this.sidebarPanel.render(),!this.isDashboard&&!this.isMarketplace&&(this.listPanel.render(),this.store.filteredItems.length||this.detailPanel.clear())}onSelectItem(e){this.isDashboard&&this.toggleDashboard(),this.isMarketplace&&this.toggleMarketplace(),this.listPanel.setSelected(e.id),this.listPanel.render(),this.detailPanel.show(e)}createResizeHandle(e,t,s,i,a){let r=e.createDiv("as-resize-handle"),l=0,o=0,c=m=>{let g=Math.min(a,Math.max(i,o+(m.clientX-l)));e.style.setProperty(s,`${g}px`)},d=()=>{r.removeClass("is-dragging"),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),this.dragCleanup=null};return r.addEventListener("mousedown",m=>{m.preventDefault(),l=m.clientX,o=parseInt(e.style.getPropertyValue(s))||t.offsetWidth,r.addClass("is-dragging"),document.addEventListener("mousemove",c),document.addEventListener("mouseup",d),this.dragCleanup=d}),r}onClose(){this.dragCleanup?.(),this.updateRef&&this.store.offref(this.updateRef)}};var St=require("obsidian");var ue=class extends St.Events{items=new Map;_filter={kind:"all"};_searchQuery="";_deepSearch=!1;_deepSearchScope="both";_projectsHomeDir="";get filter(){return this._filter}get searchQuery(){return this._searchQuery}get deepSearch(){return this._deepSearch}get allItems(){return Array.from(this.items.values())}get filteredItems(){let e=this.allItems;switch(this._filter.kind){case"favorites":e=e.filter(t=>t.isFavorite);break;case"tool":e=e.filter(t=>t.tools.includes(this._filter.toolId));break;case"type":e=e.filter(t=>t.type===this._filter.type);break;case"collection":e=e.filter(t=>t.collections.includes(this._filter.name));break;case"project":e=e.filter(t=>Pe(t.filePath,this._projectsHomeDir)===this._filter.project);break}if(this._searchQuery){let t=this._searchQuery.toLowerCase(),s=this._deepSearch&&(this._deepSearchScope==="description"||this._deepSearchScope==="both"),i=this._deepSearch&&(this._deepSearchScope==="content"||this._deepSearchScope==="both");e=e.filter(a=>a.name.toLowerCase().includes(t)||s&&a.description.toLowerCase().includes(t)||i&&a.content.toLowerCase().includes(t))}return e.sort((t,s)=>t.name.localeCompare(s.name))}getItem(e){return this.items.get(e)}get hasSkillkit(){return L()}refresh(e){this._projectsHomeDir=e.projectsHomeDir,this.items=ht(e),this.enrichWithSkillkit(),this.trigger("updated")}enrichWithSkillkit(){if(!L())return;let e=Ne(),t=Be(),s=We(),i=new Set(s.oversized.map(o=>o.name)),a=new Set(s.longDesc.map(o=>o.name)),r=new Map(s.oversized.map(o=>[o.name,o.lines])),l=new Map(s.longDesc.map(o=>[o.name,o.chars]));for(let o of this.items.values()){let c=o.filePath.split("/").slice(-2,-1)[0],d=o.name.toLowerCase().replace(/\s+/g,"-"),m=e.get(o.name)||e.get(c)||e.get(d);m?(m.isHeavy=o.content.length>5e3,o.usage=m):o.usage={uses:0,lastUsed:null,daysSinceUsed:null,isStale:!0,isHeavy:o.content.length>5e3};let g=o.content.split(` +`).length,f=o.description.length;o.warnings={oversized:i.has(o.name)||g>500,longDesc:a.has(o.name)||f>1024,lineCount:r.get(o.name)??g,descChars:l.get(o.name)??f},o.conflicts=t.get(o.name)||t.get(c)||[]}}setFilter(e){this._filter=e,this.trigger("updated")}setSearch(e){this._searchQuery=e,this.trigger("updated")}setDeepSearch(e){this._deepSearch!==e&&(this._deepSearch=e,this.trigger("updated"))}setDeepSearchScope(e){this._deepSearchScope!==e&&(this._deepSearchScope=e,this.trigger("updated"))}toggleFavorite(e,t){let s=this.items.get(e);s&&(s.isFavorite=!s.isFavorite,s.isFavorite?t.favorites.includes(e)||t.favorites.push(e):t.favorites=t.favorites.filter(i=>i!==e),this.trigger("updated"))}getToolCounts(){let e=new Map;for(let t of this.items.values())for(let s of t.tools)e.set(s,(e.get(s)||0)+1);return e}getTypeCounts(){let e=new Map;for(let t of this.items.values())e.set(t.type,(e.get(t.type)||0)+1);return e}getProjectCounts(){let e=new Map;for(let t of this.items.values()){let s=Pe(t.filePath,this._projectsHomeDir);e.set(s,(e.get(s)||0)+1)}return e}};var yt=require("fs"),he=class{watchers=[];debounceTimer=null;debounceMs;onChange;constructor(e,t){this.debounceMs=e,this.onChange=t}watchPaths(e){this.close();for(let t of e)try{let s=(0,yt.watch)(t,{recursive:!0},()=>this.scheduleUpdate());this.watchers.push(s)}catch{}}scheduleUpdate(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.onChange()},this.debounceMs)}close(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null);for(let e of this.watchers)try{e.close()}catch{}this.watchers=[]}};var D=require("obsidian");var me=class extends D.PluginSettingTab{plugin;constructor(e,t){super(e,t),this.plugin=t}display(){let{containerEl:e}=this;e.empty(),new D.Setting(e).setName("File watching").setDesc("Automatically detect changes to skill files").addToggle(t=>t.setValue(this.plugin.settings.watchEnabled).onChange(async s=>{this.plugin.settings.watchEnabled=s,await this.plugin.saveSettings(),this.plugin.restartWatcher()})),new D.Setting(e).setName("Watch debounce (ms)").setDesc("Delay before re-scanning after file changes").addText(t=>t.setValue(String(this.plugin.settings.watchDebounceMs)).onChange(async s=>{let i=parseInt(s);!isNaN(i)&&i>=100&&(this.plugin.settings.watchDebounceMs=i,await this.plugin.saveSettings())})),new D.Setting(e).setName("Display names").setDesc("How skill and command names are displayed in the list").addDropdown(t=>t.addOptions({auto:"Auto (frontmatter / heading / filename)",filename:"Filename only"}).setValue(this.plugin.settings.namingMode||"auto").onChange(async s=>{this.plugin.settings.namingMode=s,await this.plugin.saveSettings(),this.plugin.refreshStore()})),new D.Setting(e).setName("Deep search by default").setDesc("Enable deep search when the view opens (can always be toggled in the search bar)").addToggle(t=>t.setValue(this.plugin.settings.deepSearchDefault??!1).onChange(async s=>{this.plugin.settings.deepSearchDefault=s,await this.plugin.saveSettings()})),new D.Setting(e).setName("Deep search scope").setDesc("What to include when deep search is enabled").addDropdown(t=>t.addOptions({both:"Description and file content",description:"Description only",content:"File content only"}).setValue(this.plugin.settings.deepSearchScope??"both").onChange(async s=>{this.plugin.settings.deepSearchScope=s,await this.plugin.saveSettings()})),new D.Setting(e).setName("Marketplace").setHeading(),new D.Setting(e).setName("Package runner").setDesc("Command used to install skills from the marketplace").addDropdown(t=>t.addOptions({auto:"Auto-detect",npx:"npx",bunx:"bunx"}).setValue(this.plugin.settings.packageRunner).onChange(async s=>{this.plugin.settings.packageRunner=s,await this.plugin.saveSettings()})),new D.Setting(e).setName("Project scanning").setHeading(),new D.Setting(e).setName("Scan projects").setDesc("Scan all directories under the projects home folder for project-level skills").addToggle(t=>t.setValue(this.plugin.settings.projectScanEnabled).onChange(async s=>{this.plugin.settings.projectScanEnabled=s,await this.plugin.saveSettings(),this.plugin.refreshStore(),this.plugin.restartWatcher()})),new D.Setting(e).setName("Projects home directory").setDesc("Root directory to scan for project-level skills. Leave empty for home directory (~).").addText(t=>t.setPlaceholder("~").setValue(this.plugin.settings.projectsHomeDir).onChange(async s=>{this.plugin.settings.projectsHomeDir=s,await this.plugin.saveSettings(),this.plugin.refreshStore(),this.plugin.restartWatcher()})),new D.Setting(e).setName("Tools").setHeading();for(let t of E){let s=t.isInstalled(),i=this.plugin.settings.tools[t.id]||{enabled:!0,customPaths:[]};new D.Setting(e).setName(t.name).setDesc(s?"Installed":"Not detected").addToggle(a=>a.setValue(s&&i.enabled).setDisabled(!s).onChange(async r=>{this.plugin.settings.tools[t.id]={...i,enabled:r},await this.plugin.saveSettings(),this.plugin.refreshStore()}))}}};var $e={tools:{},watchEnabled:!0,watchDebounceMs:500,deepSearchDefault:!1,deepSearchScope:"both",favorites:[],collections:{},customScanPaths:[],namingMode:"auto",projectScanEnabled:!0,projectsHomeDir:"",packageRunner:"auto"};var ge=class extends wt.Plugin{settings=$e;store=new ue;watcher=null;async onload(){await this.loadSettings(),this.addVaultPath(),this.registerView(Y,e=>new pe(e,this.store,this.settings,()=>this.saveSettings())),this.addRibbonIcon("cpu","Agentfiles",()=>this.activateView()),this.addCommand({id:"open",name:"Open",callback:()=>this.activateView()}),this.addSettingTab(new me(this.app,this)),this.refreshStore(),this.store.setDeepSearch(this.settings.deepSearchDefault??!1),this.store.setDeepSearchScope(this.settings.deepSearchScope??"both"),this.startWatcher()}addVaultPath(){let e=this.app.vault.adapter;if(!e.getBasePath)return;let t=e.getBasePath();this.settings.customScanPaths.includes(t)||this.settings.customScanPaths.push(t)}onunload(){this.stopWatcher()}refreshStore(){this.store.refresh(this.settings)}startWatcher(){this.settings.watchEnabled&&(this.watcher=new he(this.settings.watchDebounceMs,()=>this.refreshStore()),this.watcher.watchPaths(mt(this.settings)))}stopWatcher(){this.watcher&&(this.watcher.close(),this.watcher=null)}restartWatcher(){this.stopWatcher(),this.startWatcher()}async activateView(){let e=this.app.workspace.getLeavesOfType(Y);if(e.length>0){await this.app.workspace.revealLeaf(e[0]);return}let t=this.app.workspace.getLeaf("tab");await t.setViewState({type:Y,active:!0}),await this.app.workspace.revealLeaf(t)}async loadSettings(){this.settings=Object.assign({},$e,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ccad2ed --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2667 @@ +{ + "name": "agentfiles", + "version": "0.3.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "agentfiles", + "version": "0.3.0", + "devDependencies": { + "@types/node": "^22.0.0", + "@typescript-eslint/eslint-plugin": "^8.57.2", + "@typescript-eslint/parser": "^8.57.2", + "esbuild": "^0.25.0", + "eslint": "9", + "eslint-plugin-obsidian": "^2.29.0", + "obsidian": "latest", + "typescript": "^5.7.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@ts-morph/common": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.26.1.tgz", + "integrity": "sha512-Sn28TGl/4cFpcM+jwsH1wLncYq3FtN/BIpem+HOygfBWPT5pAeS5dB4VFVzV8FbnOKHpDLZmvAl4AjPEev5idA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.3.2", + "minimatch": "^9.0.4", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@ts-morph/common/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@ts-morph/common/node_modules/brace-expansion": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", + "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@ts-morph/common/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@types/codemirror": { + "version": "5.60.8", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", + "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/tern": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.15.tgz", + "integrity": "sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/tern": { + "version": "0.23.9", + "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.9.tgz", + "integrity": "sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.58.0.tgz", + "integrity": "sha512-RLkVSiNuUP1C2ROIWfqX+YcUfLaSnxGE/8M+Y57lopVwg9VTYYfhuz15Yf1IzCKgZj6/rIbYTmJCUSqr76r0Wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.58.0", + "@typescript-eslint/type-utils": "8.58.0", + "@typescript-eslint/utils": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.58.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.58.0.tgz", + "integrity": "sha512-rLoGZIf9afaRBYsPUMtvkDWykwXwUPL60HebR4JgTI8mxfFe2cQTu3AGitANp4b9B2QlVru6WzjgB2IzJKiCSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.58.0", + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.58.0.tgz", + "integrity": "sha512-8Q/wBPWLQP1j16NxoPNIKpDZFMaxl7yWIoqXWYeWO+Bbd2mjgvoF0dxP2jKZg5+x49rgKdf7Ck473M8PC3V9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.58.0", + "@typescript-eslint/types": "^8.58.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.58.0.tgz", + "integrity": "sha512-W1Lur1oF50FxSnNdGp3Vs6P+yBRSmZiw4IIjEeYxd8UQJwhUF0gDgDD/W/Tgmh73mxgEU3qX0Bzdl/NGuSPEpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.58.0.tgz", + "integrity": "sha512-doNSZEVJsWEu4htiVC+PR6NpM+pa+a4ClH9INRWOWCUzMst/VA9c4gXq92F8GUD1rwhNvRLkgjfYtFXegXQF7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.58.0.tgz", + "integrity": "sha512-aGsCQImkDIqMyx1u4PrVlbi/krmDsQUs4zAcCV6M7yPcPev+RqVlndsJy9kJ8TLihW9TZ0kbDAzctpLn5o+lOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0", + "@typescript-eslint/utils": "8.58.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.58.0.tgz", + "integrity": "sha512-O9CjxypDT89fbHxRfETNoAnHj/i6IpRK0CvbVN3qibxlLdo5p5hcLmUuCCrHMpxiWSwKyI8mCP7qRNYuOJ0Uww==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.58.0.tgz", + "integrity": "sha512-7vv5UWbHqew/dvs+D3e1RvLv1v2eeZ9txRHPnEEBUgSNLx5ghdzjHa0sgLWYVKssH+lYmV0JaWdoubo0ncGYLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.58.0", + "@typescript-eslint/tsconfig-utils": "8.58.0", + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.58.0.tgz", + "integrity": "sha512-RfeSqcFeHMHlAWzt4TBjWOAtoW9lnsAGiP3GbaX9uVgTYYrMbVnGONEfUCiSss+xMHFl+eHZiipmA8WkQ7FuNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.58.0", + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.58.0.tgz", + "integrity": "sha512-XJ9UD9+bbDo4a4epraTwG3TsNPeiB9aShrUneAVXy8q4LuwowN+qu89/6ByLMINqvIMeI9H9hOHQtg/ijrYXzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.58.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", + "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-obsidian": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-obsidian/-/eslint-plugin-obsidian-2.29.0.tgz", + "integrity": "sha512-t96GJ1Sn5I1Ilm0Gu+xBl0BL+s07HUZqw4zh01U9EPKTTWSZlOy64Iermns7PMTY7L7zkp2GT1JWianxfWzF0w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@typescript-eslint/parser": "^7.18.0", + "@typescript-eslint/utils": "^7.18.0", + "lodash": "^4.17.21", + "ts-morph": "^25.0.1", + "ts-morph-extensions": "^2.29.0" + }, + "peerDependencies": { + "eslint": "8.x.x", + "eslint-plugin-obsidian": "*", + "react-obsidian": "2.x.x" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/@typescript-eslint/parser": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/@typescript-eslint/scope-manager": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/@typescript-eslint/types": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/@typescript-eslint/utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-obsidian/node_modules/brace-expansion": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", + "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint-plugin-obsidian/node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/obsidian": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.12.3.tgz", + "integrity": "sha512-HxWqe763dOqzXjnNiHmAJTRERN8KILBSqxDSEqbeSr7W8R8Jxezzbca+nz1LiiqXnMpM8lV2jzAezw3CZ4xNUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/codemirror": "5.60.8", + "moment": "2.29.4" + }, + "peerDependencies": { + "@codemirror/state": "6.5.0", + "@codemirror/view": "6.38.6" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-morph": { + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-25.0.1.tgz", + "integrity": "sha512-QJEiTdnz1YjrB3JFhd626gX4rKHDLSjSVMvGGG4v7ONc3RBwa0Eei98G9AT9uNFDMtV54JyuXsFeC+OH0n6bXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ts-morph/common": "~0.26.0", + "code-block-writer": "^13.0.3" + } + }, + "node_modules/ts-morph-extensions": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/ts-morph-extensions/-/ts-morph-extensions-2.29.0.tgz", + "integrity": "sha512-btPnkRQXe+6fNrBINNrc12aeEtKrMvy1e8FfxDXE/Uodn5C91f6CdLgZJnP89yT0B2UK4yCoqaX6K/ywp9a+xA==", + "dev": true, + "license": "ISC", + "dependencies": { + "jsonc-parser": "^3.2.1", + "ts-morph": "^25.0.1" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/src/main.ts b/src/main.ts index 060f2db..c4a7e5e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -35,6 +35,8 @@ export default class AgentfilesPlugin extends Plugin { this.addSettingTab(new AgentfilesSettingTab(this.app, this)); this.refreshStore(); + this.store.setDeepSearch(this.settings.deepSearchDefault ?? false); + this.store.setDeepSearchScope(this.settings.deepSearchScope ?? "both"); this.startWatcher(); } diff --git a/src/settings.ts b/src/settings.ts index 455617d..3f29d58 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -59,6 +59,37 @@ export class AgentfilesSettingTab extends PluginSettingTab { }) ); + new Setting(containerEl) + .setName("Deep search by default") + .setDesc( + "Enable deep search when the view opens (can always be toggled in the search bar)" + ) + .addToggle((toggle) => + toggle + .setValue(this.plugin.settings.deepSearchDefault ?? false) + .onChange(async (value) => { + this.plugin.settings.deepSearchDefault = value; + await this.plugin.saveSettings(); + }) + ); + + new Setting(containerEl) + .setName("Deep search scope") + .setDesc("What to include when deep search is enabled") + .addDropdown((drop) => + drop + .addOptions({ + both: "Description and file content", + description: "Description only", + content: "File content only", + }) + .setValue(this.plugin.settings.deepSearchScope ?? "both") + .onChange(async (value) => { + this.plugin.settings.deepSearchScope = value as "description" | "content" | "both"; + await this.plugin.saveSettings(); + }) + ); + new Setting(containerEl).setName("Marketplace").setHeading(); new Setting(containerEl) diff --git a/src/store.ts b/src/store.ts index ccb3512..7081928 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,5 +1,5 @@ import { Events } from "obsidian"; -import type { SkillItem, SidebarFilter, ChopsSettings } from "./types"; +import type { SkillItem, SidebarFilter, DeepSearchScope, ChopsSettings } from "./types"; import { scanAll, getProjectName } from "./scanner"; import { getSkillkitStatsWithDaily, getSkillConflicts, getSkillWarnings, isSkillkitAvailable } from "./skillkit"; @@ -7,6 +7,8 @@ export class SkillStore extends Events { private items: Map = new Map(); private _filter: SidebarFilter = { kind: "all" }; private _searchQuery = ""; + private _deepSearch = false; + private _deepSearchScope: DeepSearchScope = "both"; private _projectsHomeDir = ""; get filter(): SidebarFilter { @@ -17,6 +19,10 @@ export class SkillStore extends Events { return this._searchQuery; } + get deepSearch(): boolean { + return this._deepSearch; + } + get allItems(): SkillItem[] { return Array.from(this.items.values()); } @@ -50,9 +56,13 @@ export class SkillStore extends Events { if (this._searchQuery) { const q = this._searchQuery.toLowerCase(); + const searchDesc = this._deepSearch && (this._deepSearchScope === "description" || this._deepSearchScope === "both"); + const searchContent = this._deepSearch && (this._deepSearchScope === "content" || this._deepSearchScope === "both"); result = result.filter( (i) => - i.name.toLowerCase().includes(q) + i.name.toLowerCase().includes(q) || + (searchDesc && i.description.toLowerCase().includes(q)) || + (searchContent && i.content.toLowerCase().includes(q)) ); } @@ -126,6 +136,18 @@ export class SkillStore extends Events { this.trigger("updated"); } + setDeepSearch(enabled: boolean): void { + if (this._deepSearch === enabled) return; + this._deepSearch = enabled; + this.trigger("updated"); + } + + setDeepSearchScope(scope: DeepSearchScope): void { + if (this._deepSearchScope === scope) return; + this._deepSearchScope = scope; + this.trigger("updated"); + } + toggleFavorite(id: string, settings: ChopsSettings): void { const item = this.items.get(id); if (!item) return; diff --git a/src/types.ts b/src/types.ts index 688af70..517a9b7 100644 --- a/src/types.ts +++ b/src/types.ts @@ -68,10 +68,14 @@ export type SidebarFilter = export type NamingMode = "auto" | "filename"; +export type DeepSearchScope = "description" | "content" | "both"; + export interface ChopsSettings { tools: Record; watchEnabled: boolean; watchDebounceMs: number; + deepSearchDefault: boolean; + deepSearchScope: DeepSearchScope; favorites: string[]; collections: Record; customScanPaths: string[]; @@ -85,6 +89,8 @@ export const DEFAULT_SETTINGS: ChopsSettings = { tools: {}, watchEnabled: true, watchDebounceMs: 500, + deepSearchDefault: false, + deepSearchScope: "both", favorites: [], collections: {}, customScanPaths: [], diff --git a/src/views/list.ts b/src/views/list.ts index 9d3ff5b..0814ee3 100644 --- a/src/views/list.ts +++ b/src/views/list.ts @@ -10,6 +10,7 @@ export class ListPanel { private onSelect: (item: SkillItem) => void; private selectedId: string | null = null; private inputEl: HTMLInputElement | null = null; + private deepToggleEl: HTMLElement | null = null; private listEl: HTMLElement | null = null; private typeFilter: string | null = null; private sortBy: "name" | "usage" = "name"; @@ -44,6 +45,14 @@ export class ListPanel { this.store.setSearch(this.inputEl!.value); }); + this.deepToggleEl = searchContainer.createDiv("as-deep-toggle"); + setIcon(this.deepToggleEl, "search-code"); + this.deepToggleEl.setAttribute("aria-label", "Toggle deep search"); + this.deepToggleEl.addEventListener("click", () => { + this.store.setDeepSearch(!this.store.deepSearch); + this.updateDeepToggle(); + }); + const filterBtn = searchContainer.createDiv("as-filter-btn"); setIcon(filterBtn, "filter"); filterBtn.setAttribute("aria-label", "Filter by status"); @@ -66,9 +75,21 @@ export class ListPanel { } this.inputEl.value = this.store.searchQuery; + this.updateDeepToggle(); this.renderList(); } + private updateDeepToggle(): void { + if (!this.deepToggleEl) return; + this.deepToggleEl.toggleClass("is-active", this.store.deepSearch); + this.deepToggleEl.setAttribute( + "aria-label", + this.store.deepSearch + ? "Deep search enabled — click to search names only" + : "Deep search disabled — click to search file content" + ); + } + private toggleDropdown(anchor: HTMLElement): void { if (this.dropdownEl) { this.dropdownEl.remove(); diff --git a/styles.css b/styles.css index c39032d..76b471f 100644 --- a/styles.css +++ b/styles.css @@ -132,12 +132,16 @@ /* Search */ .as-search { + display: flex; + align-items: center; + gap: 4px; padding: 8px; border-bottom: 1px solid var(--background-modifier-border); } .as-search-input { - width: 100%; + flex: 1; + min-width: 0; padding: 6px 10px; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); @@ -152,6 +156,36 @@ box-shadow: 0 0 0 2px color-mix(in srgb, var(--interactive-accent) 25%, transparent); } +.as-deep-toggle { + display: flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + flex-shrink: 0; + border: 1px solid var(--background-modifier-border); + border-radius: var(--radius-s); + background: var(--background-primary); + color: var(--text-faint); + cursor: pointer; +} + +.as-deep-toggle:hover { + color: var(--text-muted); + border-color: var(--text-faint); +} + +.as-deep-toggle.is-active { + background: var(--interactive-accent); + color: var(--text-on-accent); + border-color: var(--interactive-accent); +} + +.as-deep-toggle svg { + width: 14px; + height: 14px; +} + /* List */ .as-list-items { padding: 4px;