@skill-map/cli 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/bin/sm.js +3 -3
- package/dist/cli/tutorial/sm-tutorial.md +22 -4
- package/dist/cli.js +7958 -6881
- package/dist/cli.js.map +1 -1
- package/dist/conformance/index.d.ts +1 -1
- package/dist/conformance/index.js.map +1 -1
- package/dist/index.js +1612 -1400
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +583 -421
- package/dist/kernel/index.js +1612 -1400
- package/dist/kernel/index.js.map +1 -1
- package/dist/ui/{chunk-GXRWH2VL.js → chunk-2TPMJJYQ.js} +1 -1
- package/dist/ui/chunk-4BVLXZO3.js +61 -0
- package/dist/ui/{chunk-MPMBTIUR.js → chunk-BMAKIDAV.js} +30 -30
- package/dist/ui/{chunk-VVOEPDQD.js → chunk-GJJZ5QH6.js} +1 -1
- package/dist/ui/chunk-I7EELB7M.js +1 -0
- package/dist/ui/chunk-K47RR2IO.js +251 -0
- package/dist/ui/{chunk-OPPQMCMQ.js → chunk-KRNW54CI.js} +1 -1
- package/dist/ui/chunk-NJ4PSNK3.js +965 -0
- package/dist/ui/{chunk-W2EFGI3J.js → chunk-OU26UMVW.js} +1 -1
- package/dist/ui/chunk-QGRY6MDS.js +123 -0
- package/dist/ui/chunk-SCSYN7U2.js +1 -0
- package/dist/ui/index.html +3 -3
- package/dist/ui/main-CVCJMGY5.js +2 -0
- package/dist/ui/{styles-M2FETVAG.css → styles-ALBMEXCF.css} +1 -1
- package/package.json +8 -7
- package/dist/ui/chunk-25AWRVIC.js +0 -965
- package/dist/ui/chunk-6FTVUS57.js +0 -123
- package/dist/ui/chunk-MF2M6GYF.js +0 -1
- package/dist/ui/chunk-N366HMME.js +0 -1
- package/dist/ui/chunk-V3SZQETX.js +0 -61
- package/dist/ui/chunk-W62WVNU4.js +0 -251
- package/dist/ui/main-NIYE2VFS.js +0 -2
package/dist/ui/main-NIYE2VFS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as q,b as ze,c as We}from"./chunk-MF2M6GYF.js";import{a as Se,b as Ae,c as Ce,d as Te,e as xe,f as Re,g as Ee,h as Me,i as $e,j as Fe,m as S,n as je,o as Ue}from"./chunk-V3SZQETX.js";import{a as A,b as Be,c as He,d as Ke,e as Qe,f as Je}from"./chunk-N366HMME.js";import{$b as _e,B as me,Ba as ge,Ea as he,Ha as fe,Ia as ve,J as k,Ja as w,Kc as Le,Lc as Oe,Ma as D,Mc as De,N as j,Na as $,O as s,S as W,Sa as g,Sb as m,T as B,Ta as l,Ua as c,Va as f,X as H,aa as ue,ba as R,bd as X,c as de,ca as K,cb as G,cd as Y,d as pe,eb as E,f as z,gb as _,gd as Z,hd as p,id as Ne,ja as Q,m as O,na as a,qc as Ie,rc as Pe,sb as ye,sc as F,tc as ke,ub as be,uc as we,va as J,vb as u,wb as h,xb as V}from"./chunk-25AWRVIC.js";import"./chunk-3R7E3HPC.js";import"./chunk-Q7L6LLAK.js";var Ge=[{path:"",pathMatch:"full",redirectTo:"graph"},{path:"graph",loadComponent:()=>import("./chunk-W62WVNU4.js").then(n=>n.GraphView),data:{title:"Graph"}},{path:"list",loadComponent:()=>import("./chunk-MPMBTIUR.js").then(n=>n.ListView),data:{title:"List"}},{path:"**",redirectTo:"graph"}];var I={errors:{unknownMode:n=>`SKILL_MAP_MODE: unknown value "${n}"`,restPrefix:n=>`BFF error [${n}]: `,malformedResponse:"BFF returned a malformed response",demoFetchFailed:(n,e)=>`Demo bundle fetch failed for "${n}": ${e}`,demoParseFailed:(n,e)=>`Demo bundle parse failed for "${n}": ${e}`,graphFormatNotInDemo:n=>`Graph format "${n}" is not bundled in demo mode (only "ascii").`}};var v={connected:n=>`[ws] connected to ${n}`,closed:(n,e)=>`[ws] closed (code=${n}, reason="${e}")`,malformedFrame:n=>`[ws] malformed frame dropped: ${n}`,socketError:n=>`[ws] socket error: ${n}`,reconnectScheduled:(n,e)=>`[ws] reconnect attempt ${e} scheduled in ${n}ms`,reconnectGiveUp:n=>`[ws] giving up after ${n} failed reconnect attempts`};var Ve=[1e3,2e3,4e3,8e3,16e3,3e4],ce=10,at=new Set([1e3,1001]);function lt(){return typeof window>"u"||!window.location?"ws://127.0.0.1:4242/ws":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}var C=class n{mode=s(A);destroyRef=s(H);subject=new pe;socket=null;reconnectTimer=null;reconnectAttempt=0;disposed=!1;socketFactory=e=>new WebSocket(e);url=lt();events$;_setSocketFactory(e){this.socketFactory=e}_setUrl(e){this.url=e}constructor(){this.mode!=="live"?this.events$=z:this.events$=new de(e=>{!this.socket&&!this.disposed&&this.connect();let t=this.subject.subscribe(e);return()=>t.unsubscribe()}).pipe(me({resetOnRefCountZero:!1})),this.destroyRef.onDestroy(()=>this.disconnect())}disconnect(){if(!this.disposed){if(this.disposed=!0,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.socket){try{this.socket.close(1e3,"client disconnect")}catch{}this.socket=null}this.subject.complete()}}ngOnDestroy(){this.disconnect()}connect(){if(this.disposed)return;let e;try{e=this.socketFactory(this.url)}catch(t){let i=t instanceof Error?t.message:String(t);console.warn(v.socketError(i)),this.scheduleReconnect();return}this.socket=e,e.onopen=()=>{this.reconnectAttempt=0,console.info(v.connected(this.url))},e.onmessage=t=>{this.handleFrame(t.data)},e.onerror=t=>{let i=typeof t=="object"&&t!==null&&"message"in t?String(t.message??"unknown"):"unknown";console.warn(v.socketError(i))},e.onclose=t=>{console.info(v.closed(t.code,t.reason)),this.socket=null,!this.disposed&&(at.has(t.code)||this.scheduleReconnect())}}handleFrame(e){if(typeof e!="string"){console.warn(v.malformedFrame("non-string frame"));return}let t;try{t=JSON.parse(e)}catch(i){let r=i instanceof Error?i.message:String(i);console.warn(v.malformedFrame(r));return}if(!We(t)){console.warn(v.malformedFrame("envelope shape"));return}this.subject.next(t)}scheduleReconnect(){if(this.disposed)return;if(this.reconnectAttempt>=ce){console.warn(v.reconnectGiveUp(ce)),this.subject.error(new Error(v.reconnectGiveUp(ce)));return}let e=Math.min(this.reconnectAttempt,Ve.length-1),t=Ve[e];this.reconnectAttempt+=1,console.info(v.reconnectScheduled(t,this.reconnectAttempt)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}get _reconnectAttempt(){return this.reconnectAttempt}static \u0275fac=function(t){return new(t||n)};static \u0275prov=k({token:n,factory:n.\u0275fac,providedIn:"root"})};function ee(n){let e=new TextEncoder().encode(n),t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var d="/api",te=class n{http;ws;kindRegistry;contributionsRegistry;constructor(e,t,i,r){this.http=e??s(F),this.ws=t??s(C),this.kindRegistry=i??s(S),this.contributionsRegistry=r??s(q)}async health(){return this.getJson(`${d}/health`)}async loadScan(){let[e]=await Promise.all([this.getJson(`${d}/scan`),this.listNodes({limit:0}).catch(()=>null)]);return e}async runScan(){return this.patchJson(`${d}/scan`,{},"POST")}async listNodes(e={}){let t=dt(e),i=await this.getJson(`${d}/nodes${t}`);return this.ingestRegistry(i.kindRegistry),this.ingestContributionsRegistry(i.contributionsRegistry),i}async getNode(e,t={}){let i=ee(e),r=t.includeBody?"?include=body":"";try{let o=await this.getJson(`${d}/nodes/${i}${r}`);return this.ingestRegistry(o.kindRegistry),this.ingestContributionsRegistry(o.contributionsRegistry),o}catch(o){if(o instanceof p&&o.code==="not-found")return null;throw o}}async listLinks(e={}){let t=pt(e),i=await this.getJson(`${d}/links${t}`);return this.ingestRegistry(i.kindRegistry),this.ingestContributionsRegistry(i.contributionsRegistry),i}async listIssues(e={}){let t=mt(e),i=await this.getJson(`${d}/issues${t}`);return this.ingestRegistry(i.kindRegistry),this.ingestContributionsRegistry(i.contributionsRegistry),i}async loadGraph(e="ascii"){let t=`${d}/graph?format=${encodeURIComponent(e)}`;try{return await O(this.http.get(t,{responseType:"text"}))}catch(i){throw this.translateError(i)}}async loadConfig(){let e=await this.getJson(`${d}/config`);return this.ingestRegistry(e.kindRegistry),this.ingestContributionsRegistry(e.contributionsRegistry),e.value}async listPlugins(){let e=await this.getJson(`${d}/plugins`);return this.ingestRegistry(e.kindRegistry),this.ingestContributionsRegistry(e.contributionsRegistry),e}async setPluginEnabled(e,t){let i=await this.patchJson(`${d}/plugins/${encodeURIComponent(e)}`,{enabled:t});return this.ingestRegistry(i.kindRegistry),this.ingestContributionsRegistry(i.contributionsRegistry),i}async setPluginExtensionEnabled(e,t,i){let r=await this.patchJson(`${d}/plugins/${encodeURIComponent(e)}/extensions/${encodeURIComponent(t)}`,{enabled:i});return this.ingestRegistry(r.kindRegistry),this.ingestContributionsRegistry(r.contributionsRegistry),r}async applyPluginChanges(e){let t=await this.patchJson(`${d}/plugins`,{changes:e});return this.ingestRegistry(t.kindRegistry),this.ingestContributionsRegistry(t.contributionsRegistry),t}async getPreferences(){return await this.getJson(`${d}/preferences`)}async setPreferences(e){return await this.patchJson(`${d}/preferences`,e)}async getProjectPreferences(){return await this.getJson(`${d}/project-preferences`)}async setProjectPreferences(e){return await this.patchJson(`${d}/project-preferences`,e)}async setFavorite(e){let t=ee(e);try{await O(this.http.put(`${d}/favorites/${t}`,null))}catch(i){throw this.translateError(i)}}async unsetFavorite(e){let t=ee(e);try{await O(this.http.delete(`${d}/favorites/${t}`))}catch(i){throw this.translateError(i)}}ingestRegistry(e){e&&this.kindRegistry.ingest(e)}ingestContributionsRegistry(e){this.contributionsRegistry.setRegistry(e)}async lookupContribution(e,t,i){let r=new URLSearchParams({path:i});try{return(await this.getJson(`${d}/contributions/${encodeURIComponent(e)}/${encodeURIComponent(t)}?${r.toString()}`)).items[0]??null}catch{return null}}events(){return this.ws.events$}async getJson(e){try{return await O(this.http.get(e))}catch(t){throw this.translateError(t)}}async patchJson(e,t,i="PATCH"){try{let r=i==="POST"?this.http.post(e,t):this.http.patch(e,t);return await O(r)}catch(r){throw this.translateError(r)}}translateError(e){if(e instanceof p)return e;if(e instanceof Pe){let i=ut(e.error);return i?new p(i.error.code,i.error.message,i.error.details):new p("internal",e.message||I.errors.malformedResponse)}let t=e instanceof Error?e.message:String(e);return new p("internal",t)}static \u0275fac=function(t){return new(t||n)(j(F),j(C),j(S),j(q))};static \u0275prov=k({token:n,factory:n.\u0275fac,providedIn:"root"})};function dt(n){let e=new URLSearchParams;n.kind&&n.kind.length>0&&e.set("kind",n.kind.join(",")),n.hasIssues!==void 0&&e.set("hasIssues",String(n.hasIssues)),n.path&&e.set("path",n.path),n.limit!==void 0&&e.set("limit",String(n.limit)),n.offset!==void 0&&e.set("offset",String(n.offset));let t=e.toString();return t?`?${t}`:""}function pt(n){let e=new URLSearchParams;n.kind&&n.kind.length>0&&e.set("kind",n.kind.join(",")),n.from&&e.set("from",n.from),n.to&&e.set("to",n.to);let t=e.toString();return t?`?${t}`:""}function mt(n){let e=new URLSearchParams;n.severity&&e.set("severity",n.severity),n.analyzerId&&e.set("analyzerId",n.analyzerId),n.node&&e.set("node",n.node);let t=e.toString();return t?`?${t}`:""}function ut(n){if(typeof n!="object"||n===null)return null;let e=n;if(e.ok!==!1)return null;let t=e.error;if(typeof t!="object"||t===null)return null;let i=t;return typeof i.code!="string"||typeof i.message!="string"?null:{ok:!1,error:{code:i.code,message:i.message,details:i.details}}}var gt="data.json",ht="data.meta.json",ne=class{constructor(e=globalThis.fetch.bind(globalThis),t){this.fetchImpl=e;this.kindRegistry=t??s(S)}metaPromise=null;dataPromise=null;kindRegistry;async health(){return(await this.loadMeta()).health}async loadScan(){let[e,t]=await Promise.all([this.loadData(),this.loadMeta()]);return this.kindRegistry.ingest(t.nodes.kindRegistry),e}async listNodes(e={}){let t=await this.loadMeta();if(ft(e))return this.kindRegistry.ingest(t.nodes.kindRegistry),t.nodes;let i=await this.loadData(),r=i.issues,o=i.nodes;if(e.kind&&e.kind.length>0){let T=new Set(e.kind);o=o.filter(x=>T.has(x.kind))}if(e.path){let T=bt(e.path);o=o.filter(x=>T.test(x.path))}if(e.hasIssues===!0){let T=Xe(r);o=o.filter(x=>T.has(x.path))}else if(e.hasIssues===!1){let T=Xe(r);o=o.filter(x=>!T.has(x.path))}let y=o.length,P=e.offset??0,N=e.limit??1e3,b=o.slice(P,P+N);return this.kindRegistry.ingest(t.nodes.kindRegistry),{schemaVersion:"1",kind:"nodes",items:b,filters:{kind:e.kind??null,hasIssues:e.hasIssues??null,path:e.path?[e.path]:null},counts:{total:y,returned:b.length,page:{offset:P,limit:N}},kindRegistry:t.nodes.kindRegistry}}async getNode(e,t={}){let[i,r]=await Promise.all([this.loadData(),this.loadMeta()]),o=i.nodes.find(b=>b.path===e);if(!o)return null;let y=i.links.filter(b=>b.target===e),P=i.links.filter(b=>b.source===e),N=i.issues.filter(b=>b.nodeIds.includes(e));return this.kindRegistry.ingest(r.nodes.kindRegistry),{schemaVersion:"1",kind:"node",item:o,links:{incoming:y,outgoing:P},issues:N,kindRegistry:r.nodes.kindRegistry}}async listLinks(e={}){let t=await this.loadMeta();if(vt(e))return this.kindRegistry.ingest(t.links.kindRegistry),t.links;let r=(await this.loadData()).links;if(e.kind&&e.kind.length>0){let o=new Set(e.kind);r=r.filter(y=>o.has(y.kind))}return e.from&&(r=r.filter(o=>o.source===e.from)),e.to&&(r=r.filter(o=>o.target===e.to)),this.kindRegistry.ingest(t.links.kindRegistry),{schemaVersion:"1",kind:"links",items:r,filters:{kind:e.kind??null,from:e.from??null,to:e.to??null},counts:{total:r.length,returned:r.length},kindRegistry:t.links.kindRegistry}}async listIssues(e={}){let t=await this.loadMeta();if(yt(e))return this.kindRegistry.ingest(t.issues.kindRegistry),t.issues;let r=(await this.loadData()).issues;return e.severity&&(r=r.filter(o=>o.severity===e.severity)),e.analyzerId&&(r=r.filter(o=>o.analyzerId===e.analyzerId)),e.node&&(r=r.filter(o=>o.nodeIds.includes(e.node))),this.kindRegistry.ingest(t.issues.kindRegistry),{schemaVersion:"1",kind:"issues",items:r,filters:{severity:e.severity??null,analyzerId:e.analyzerId??null,node:e.node??null},counts:{total:r.length,returned:r.length},kindRegistry:t.issues.kindRegistry}}async loadGraph(e="ascii"){if(e!=="ascii")throw new p("bad-query",I.errors.graphFormatNotInDemo(e));return(await this.loadMeta()).graph.ascii}async loadConfig(){let e=await this.loadMeta();return this.kindRegistry.ingest(e.config.kindRegistry),e.config.value}async listPlugins(){let e=await this.loadMeta();return this.kindRegistry.ingest(e.plugins.kindRegistry),e.plugins}async setFavorite(e){throw new p("demo-readonly","Favorites are not available in demo mode (static bundle is immutable).")}async unsetFavorite(e){throw new p("demo-readonly","Favorites are not available in demo mode (static bundle is immutable).")}async setPluginEnabled(e,t){throw new p("demo-readonly","Plugin toggles are not available in demo mode (static bundle is immutable).")}async setPluginExtensionEnabled(e,t,i){throw new p("demo-readonly","Plugin toggles are not available in demo mode (static bundle is immutable).")}async applyPluginChanges(e){throw new p("demo-readonly","Plugin toggles are not available in demo mode (static bundle is immutable).")}async runScan(){throw new p("demo-readonly","Manual scan is not available in demo mode (static bundle is immutable).")}async getPreferences(){return{updateCheck:{enabled:!0}}}async setPreferences(e){throw new p("demo-readonly","Preference toggles are not available in demo mode (static bundle is immutable).")}async getProjectPreferences(){return{scan:{includeHome:!1,extraRoots:[],referencePaths:[]}}}async setProjectPreferences(e){throw new p("demo-readonly","Project preferences are not available in demo mode (static bundle is immutable).")}async lookupContribution(){return null}events(){return z}loadMeta(){return this.metaPromise||(this.metaPromise=this.fetchJson(ht)),this.metaPromise}loadData(){return this.dataPromise||(this.dataPromise=this.fetchJson(gt)),this.dataPromise}async fetchJson(e){let t;try{t=await this.fetchImpl(e)}catch(i){let r=i instanceof Error?i.message:String(i);throw new p("internal",I.errors.demoFetchFailed(e,r))}if(!t.ok)throw new p("internal",I.errors.demoFetchFailed(e,`HTTP ${t.status}`));try{return await t.json()}catch(i){let r=i instanceof Error?i.message:String(i);throw new p("internal",I.errors.demoParseFailed(e,r))}}};function ft(n){return!(n.kind&&n.kind.length>0||n.hasIssues!==void 0||n.path||n.offset!==void 0&&n.offset!==0||n.limit!==void 0)}function vt(n){return!(n.kind&&n.kind.length>0||n.from||n.to)}function yt(n){return!(n.severity||n.analyzerId||n.node)}function Xe(n){let e=new Set;for(let t of n)for(let i of t.nodeIds)e.add(i);return e}function bt(n){let t=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp(`^${t}$`)}function Ye(){let n=s(A);if(n==="live")return new te(s(F),s(C));if(n==="demo")return new ne;let e=n;throw new Error(I.errors.unknownMode(String(e)))}var Ze={providers:[ue(),Ee(Ge,Me()),ke(we()),Oe({}),he(async()=>{let n=s(Le),[{default:e},{definePreset:t}]=await Promise.all([import("./chunk-FWFBO7KA.js"),import("./chunk-UJOZYR5I.js")]),i=t(e,{semantic:{primary:{50:"#F5F3FF",100:"#EDE9FE",200:"#DDD6FE",300:"#C4B5FD",400:"#A78BFA",500:"#8B5CF6",600:"#7C3AED",700:"#6D28D9",800:"#4C1D95",900:"#2E1065",950:"#1E0A4D"}}});n.setThemeConfig({theme:{preset:i,options:{darkModeSelector:".app-dark"}}})}),{provide:A,useFactory:Be},{provide:Z,useFactory:Ye}]};var ie={brand:"skill-map",alpha:"ALPHA - do not use in production",nav:{graph:"Graph",list:"List",searchLabel:"Search nodes (coming soon)",searchTooltip:"Search \u2014 coming soon",listLabel:"List view (coming soon)",listTooltip:"List \u2014 coming soon"},actions:{},badge:{nodes:"nodes",graphInfo:(n,e)=>`Run scan
|
|
2
|
-
${n.toLocaleString()} nodes \xB7 ${e.toLocaleString()} links`,graphInfoA11y:(n,e)=>`Graph contains ${n} nodes and ${e} links`},a11y:{viewSwitcher:"View switcher"},viewportWarning:{title:"Looks like you're on a small screen",subtitle:"skill-map is built for desktop",body:"The graph and inspector need room to breathe. Pop this open on a screen at least 768px wide \u2014 see you there."}};var M={toggleToAuto:"Switch to auto theme (follow system)",toggleToLight:"Switch to light theme",toggleToDark:"Switch to dark theme",currentAuto:"Auto theme (follows system)",currentLight:"Light theme",currentDark:"Dark theme"};var L={available:"Update available",tooltip:n=>`v${n} is available. Run \`npm i -g @skill-map/cli@latest\` to update.`,a11yLabel:n=>`Update available: version ${n}`,versionLabel:n=>`v${n}`,versionTooltip:n=>`skill-map CLI v${n}`,versionA11yLabel:n=>`Running version ${n}`};var re="sm-debug-slots",_t="debug-slots",It="is-debug-slots",oe=class n{visible=R(!1);constructor(){this.visible.set(this.resolveInitial()),K(()=>{let e=this.visible();document.documentElement.classList.toggle(It,e)})}toggle(){let e=!this.visible();this.visible.set(e);try{localStorage.setItem(re,e?"1":"0")}catch{}}resolveInitial(){let t=new URLSearchParams(window.location.search).get(_t);if(t==="1"||t==="true"){try{localStorage.setItem(re,"1")}catch{}return!0}if(t==="0"||t==="false"){try{localStorage.setItem(re,"0")}catch{}return!1}try{return localStorage.getItem(re)==="1"}catch{return!1}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=k({token:n,factory:n.\u0275fac,providedIn:"root"})};var qe="search",et="kinds",tt="stabilities",nt="hasIssues",it="staleOnly",se=class n{filters=s(Ue);router=s(Te);activatedRoute=s(Ae);kindRegistry=s(S);destroyRef=s(H);suppressUrlReadback=!1;constructor(){this.applyUrlToFilters(this.currentParams()),this.router.events.pipe(De(this.destroyRef)).subscribe(e=>{if(e instanceof Se){if(this.suppressUrlReadback)return;this.applyUrlToFilters(this.currentParams())}}),K(()=>{let e=this.computeQueryParams();this.writeQueryParams(e)})}currentParams(){let e=this.router.parseUrl(this.router.url),t=new URLSearchParams;for(let[i,r]of Object.entries(e.queryParams))Array.isArray(r)?t.set(i,r.join(",")):r!=null&&t.set(i,String(r));return this.activatedRoute,t}applyUrlToFilters(e){let t=e.get(qe)??"";t!==this.filters.searchText()&&this.filters.setSearchText(t);let i=Pt(e.get(et),this.kindRegistry.kinds().map(P=>P.name));rt(i,this.filters.selectedKinds())||this.filters.setKinds(i);let r=kt(e.get(tt));rt(r,this.filters.selectedStabilities())||this.filters.setStabilities(r);let o=e.get(nt)==="true";o!==this.filters.hasIssuesOnly()&&this.filters.setHasIssuesOnly(o);let y=e.get(it)==="true";y!==this.filters.staleOnly()&&this.filters.setStaleOnly(y)}computeQueryParams(){let e=this.filters.searchText().trim(),t=this.filters.selectedKinds(),i=this.filters.selectedStabilities(),r=this.filters.hasIssuesOnly(),o=this.filters.staleOnly();return{[qe]:e.length>0?e:null,[et]:t.length>0?t.join(","):null,[tt]:i.length>0?i.join(","):null,[nt]:r?"true":null,[it]:o?"true":null}}writeQueryParams(e){let t=this.currentParams(),i=new Map(Object.entries(e)),r=!1;for(let[o,y]of i)if((t.get(o)??null)!==y){r=!0;break}r&&(this.suppressUrlReadback=!0,this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:e,queryParamsHandling:"merge",replaceUrl:!0}).finally(()=>{setTimeout(()=>{this.suppressUrlReadback=!1},0)}))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=k({token:n,factory:n.\u0275fac,providedIn:"root"})};function Pt(n,e){if(!n)return[];let t=new Set(e);return n.split(",").map(i=>i.trim()).filter(i=>t.has(i))}function kt(n){if(!n)return[];let e=new Set(je);return n.split(",").map(t=>t.trim()).filter(t=>e.has(t))}function rt(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}var ot={body:"You are viewing a static demo of skill-map's UI. Install it:",installCommand:"npm i -g @skill-map/cli",homeCta:"\u2190 Back to skill-map.dev",homeHref:"/",dismissAria:"Dismiss demo banner"};function At(n,e){if(n&1){let t=G();l(0,"div",0),f(1,"span",1),l(2,"p",2),u(3),l(4,"code",3),u(5),c()(),l(6,"a",4),u(7),c(),l(8,"p-button",5),E("onClick",function(){W(t);let r=_();return B(r.dismiss())}),c()()}if(n&2){let t=_();a(3),V(" ",t.texts.body," "),a(2),h(t.texts.installCommand),a(),g("href",t.texts.homeHref,Q),a(),h(t.texts.homeCta),a(),g("ariaLabel",t.texts.dismissAria)("text",!0)("rounded",!0)}}var st="sm.demoBannerDismissed",ae=class n{mode=s(A);texts=ot;dismissed=R(this.readDismissed());visible=m(()=>this.mode==="demo"&&!this.dismissed());dismiss(){this.dismissed.set(!0);try{globalThis.localStorage?.setItem(st,"1")}catch{}}readDismissed(){if(this.mode!=="demo")return!0;try{return globalThis.localStorage?.getItem(st)==="1"}catch{return!1}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=J({type:n,selectors:[["sm-demo-banner"]],decls:1,vars:1,consts:[["role","status","data-testid","demo-banner",1,"demo-banner"],["aria-hidden","true",1,"demo-banner__icon","fa-solid","fa-circle-info"],[1,"demo-banner__body"],["data-testid","demo-banner-install",1,"demo-banner__cmd"],["data-testid","demo-banner-home",1,"demo-banner__home",3,"href"],["icon","fa-solid fa-xmark","severity","secondary","size","small","data-testid","demo-banner-dismiss",3,"onClick","ariaLabel","text","rounded"]],template:function(t,i){t&1&&D(0,At,9,7,"div",0),t&2&&$(i.visible()?0:-1)},dependencies:[Y,X],styles:["[_nghost-%COMP%]{display:block}.demo-banner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.5rem 1rem;border-bottom:1px solid var(--p-content-border-color);background:var(--p-highlight-background);color:var(--p-text-color);font-size:.875rem}.demo-banner__icon[_ngcontent-%COMP%]{font-size:1.1rem;color:var(--p-primary-color)}.demo-banner__body[_ngcontent-%COMP%]{flex:1 1 auto;margin:0;line-height:1.4}.demo-banner__cmd[_ngcontent-%COMP%]{font-family:var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);background:var(--p-content-background);border:1px solid var(--p-content-border-color);border-radius:.25rem;padding:.05rem .4rem;font-size:.85em;margin-left:.25rem}.demo-banner__home[_ngcontent-%COMP%]{color:var(--p-primary-color);font-weight:500;text-decoration:none;white-space:nowrap}.demo-banner__home[_ngcontent-%COMP%]:hover, .demo-banner__home[_ngcontent-%COMP%]:focus-visible{text-decoration:underline}"],changeDetection:0})};var Ct=()=>[import("./chunk-6FTVUS57.js").then(n=>n.SettingsModal)];function Tt(n,e){if(n&1&&(l(0,"span",10),u(1),c()),n&2){let t=_();g("pTooltip",t.versionTooltip()),w("aria-label",t.versionA11y()),a(),h(t.versionLabel())}}function xt(n,e){if(n&1&&(l(0,"a",12),f(1,"i",27),l(2,"span"),u(3),c()()),n&2){let t=_();g("pTooltip",t.updateChipTooltip()),w("aria-label",t.updateChipA11y()),a(3),h(t.updateChipText)}}function Rt(n,e){if(n&1&&(l(0,"p",13),u(1),c()),n&2){let t=_();a(),h(t.rootLabel())}}function Et(n,e){if(n&1){let t=G();l(0,"sm-settings-modal",28),E("visibleChange",function(r){W(t);let o=_();return B(o.settingsOpen.set(r))}),c()}if(n&2){let t=_();g("visible",t.settingsOpen())}}var le=class n{loader=s(Ne);theme=s(Je);dataSource=s(Z);scanTrigger=s(Ke);_filterUrlSync=s(se);_debugSlots=s(oe);updateCheck=s(Qe);texts=ie;settingsTexts=He;settingsOpen=R(!1);openSettings(){this.settingsOpen.set(!0)}scanning=this.scanTrigger.scanning;scanError=this.scanTrigger.scanError;triggerScan(){return this.scanTrigger.run()}updateChipText=L.available;updateChipTooltip=m(()=>L.tooltip(this.updateCheck.latest()??""));updateChipA11y=m(()=>L.a11yLabel(this.updateCheck.latest()??""));versionLabel=m(()=>L.versionLabel(this.updateCheck.current()??""));versionTooltip=m(()=>L.versionTooltip(this.updateCheck.current()??""));versionA11y=m(()=>L.versionA11yLabel(this.updateCheck.current()??""));count=this.loader.count;linkCount=m(()=>this.loader.scan()?.links?.length??0);graphInfoTooltip=m(()=>ie.badge.graphInfo(this.count(),this.linkCount()));graphInfoA11y=m(()=>ie.badge.graphInfoA11y(this.count(),this.linkCount()));rootLabel=m(()=>{let e=this.healthCwd();if(e&&e!==".")return e;let t=this.loader.scan()?.roots??[];if(t.length===0)return"";let i=t[0].replace(/[\\/]+$/,"");return!i||i==="."?"":i});healthCwd=R(null);isDevMode=_e();themeMode=this.theme.mode;markSrc=m(()=>this.theme.resolved()==="dark"?"skill-map-mark-light.svg":"skill-map-mark-dark.svg");themeIcon=m(()=>{switch(this.themeMode()){case"auto":return"pi pi-desktop";case"light":return"pi pi-sun";case"dark":return"fa-regular fa-moon"}});themeLabel=m(()=>{switch(this.themeMode()){case"auto":return M.toggleToLight;case"light":return M.toggleToDark;case"dark":return M.toggleToAuto}});themeTooltip=m(()=>{switch(this.themeMode()){case"auto":return M.currentAuto;case"light":return M.currentLight;case"dark":return M.currentDark}});ngOnInit(){this.loader.load(),this.updateCheck.load(),this.loadHealth()}async loadHealth(){try{let e=await this.dataSource.health();this.healthCwd.set(e.cwd)}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`App: /api/health probe failed (${t})`)}}toggleTheme(){this.theme.toggle()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=J({type:n,selectors:[["app-root"]],decls:41,vars:35,consts:[["role","alert","data-testid","viewport-warning",1,"viewport-warning"],[1,"viewport-warning__card"],["aria-hidden","true",1,"fa-solid","fa-desktop","viewport-warning__icon"],[1,"viewport-warning__title"],[1,"viewport-warning__subtitle"],[1,"viewport-warning__body"],["data-testid","shell",1,"shell"],["data-testid","shell-topbar",1,"shell__topbar"],[1,"shell__brand"],["alt","","aria-hidden","true",1,"shell__brand-mark",3,"src"],["tooltipPosition","bottom","data-testid","shell-version",1,"shell__version",3,"pTooltip"],[1,"shell__alpha"],["href","https://www.npmjs.com/package/@skill-map/cli","target","_blank","rel","noopener noreferrer","tooltipPosition","bottom","data-testid","shell-update-chip",1,"shell__update-chip",3,"pTooltip"],[1,"shell__tag"],["data-testid","shell-nav",1,"shell__nav"],["type","button","tooltipPosition","bottom","disabled","","data-testid","nav-search",1,"shell__nav-search",3,"pTooltip"],["aria-hidden","true",1,"pi","pi-search"],["data-debug-slot","topbar.nav.start",1,"sm-debug-slot"],["slot","topbar.nav.start",3,"node"],["routerLink","/graph","routerLinkActive","is-active","data-testid","nav-graph"],["type","button","tooltipPosition","bottom","disabled","","data-testid","nav-list",1,"shell__nav-disabled",3,"pTooltip"],[1,"shell__actions"],["type","button","tooltipPosition","bottom","data-testid","shell-refresh",1,"shell__refresh",3,"click","pTooltip","disabled"],["aria-hidden","true"],["severity","secondary","size","small","data-testid","action-theme-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded"],["icon","pi pi-sliders-h","severity","secondary","size","small","data-testid","action-settings",3,"onClick","ariaLabel","pTooltip","text","rounded"],[1,"shell__main"],["aria-hidden","true",1,"pi","pi-download"],[3,"visibleChange","visible"]],template:function(t,i){if(t&1&&(l(0,"div",0)(1,"div",1),f(2,"i",2),l(3,"h2",3),u(4),c(),l(5,"p",4),u(6),c(),l(7,"p",5),u(8),c()()(),l(9,"div",6),f(10,"sm-demo-banner"),l(11,"header",7)(12,"div",8),f(13,"img",9),l(14,"div")(15,"h1"),u(16),D(17,Tt,2,3,"span",10),l(18,"span",11),u(19),c(),D(20,xt,4,3,"a",12),c(),D(21,Rt,2,1,"p",13),c()(),l(22,"nav",14)(23,"button",15),f(24,"i",16),c(),l(25,"div",17),f(26,"sm-view-contributions-host",18),c(),l(27,"a",19),u(28),c(),l(29,"button",20),u(30),c()(),l(31,"div",21)(32,"button",22),E("click",function(){return i.triggerScan()}),f(33,"i",23),c(),l(34,"p-button",24),E("onClick",function(){return i.toggleTheme()}),c(),l(35,"p-button",25),E("onClick",function(){return i.openSettings()}),c()()(),l(36,"main",26),f(37,"router-outlet"),c(),ge(38,Et,1,1),fe(39,38,Ct),c()),t&2){let r;a(4),h(i.texts.viewportWarning.title),a(2),h(i.texts.viewportWarning.subtitle),a(2),h(i.texts.viewportWarning.body),a(5),g("src",i.markSrc(),Q),a(3),V(" ",i.texts.brand," "),a(),$((r=i.updateCheck.current())?17:-1,r),a(),w("aria-label",i.texts.alpha),a(),h(i.texts.alpha),a(),$(i.updateCheck.isOutdated()&&!i.isDevMode?20:-1),a(),$(i.rootLabel()?21:-1),a(),w("aria-label",i.texts.a11y.viewSwitcher),a(),g("pTooltip",i.texts.nav.searchTooltip),w("aria-label",i.texts.nav.searchLabel),a(3),g("node",null),a(2),h(i.texts.nav.graph),a(),g("pTooltip",i.texts.nav.listTooltip),w("aria-label",i.texts.nav.listLabel),a(),h(i.texts.nav.list),a(2),ye("is-spinning",i.scanning()),g("pTooltip",i.graphInfoTooltip())("disabled",i.scanning()),w("aria-label",i.graphInfoA11y()),a(),be(i.scanning()?"pi pi-sync pi-spin":"pi pi-sync"),a(),g("icon",i.themeIcon())("ariaLabel",i.themeLabel())("pTooltip",i.themeTooltip())("text",!0)("rounded",!0),a(),g("ariaLabel",i.settingsTexts.a11y.triggerLabel)("pTooltip",i.settingsTexts.triggerTooltip)("text",!0)("rounded",!0),a(4),ve(i.settingsOpen())}},dependencies:[Ce,xe,Re,Y,X,Fe,$e,ae,ze],styles:["[_nghost-%COMP%]{display:block;height:100dvh;--shell-topbar-bg: #FFFFFF;--shell-topbar-border: var(--sm-violet-100);--shell-topbar-text: var(--sm-violet-800);--shell-topbar-text-strong: var(--sm-violet-900);--shell-topbar-text-muted: var(--sm-violet-600);--shell-topbar-hover-bg: color-mix(in srgb, var(--sm-violet-500) 10%, transparent);--shell-topbar-active-bg: var(--sm-violet-100);--shell-topbar-active-text: var(--sm-violet-800);--shell-topbar-badge-bg: var(--sm-violet-100)}.app-dark[_nghost-%COMP%], .app-dark [_nghost-%COMP%]{--shell-topbar-bg: #1A1B22;--shell-topbar-border: color-mix(in srgb, var(--sm-violet-300) 8%, transparent);--shell-topbar-text: var(--sm-violet-100);--shell-topbar-text-strong: var(--sm-violet-100);--shell-topbar-text-muted: var(--sm-violet-300);--shell-topbar-hover-bg: color-mix(in srgb, var(--sm-violet-400) 12%, transparent);--shell-topbar-active-bg: color-mix(in srgb, var(--sm-violet-500) 22%, transparent);--shell-topbar-active-text: var(--sm-violet-100);--shell-topbar-badge-bg: color-mix(in srgb, var(--sm-violet-500) 14%, transparent)}.shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100dvh}.shell__topbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.75rem 1.5rem;background:var(--shell-topbar-bg);border-bottom:1px solid var(--shell-topbar-border);color:var(--shell-topbar-text)}.shell__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem}.shell__brand-mark[_ngcontent-%COMP%]{width:2rem;height:2rem;display:block}.shell__brand[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600;letter-spacing:-.01em;color:var(--shell-topbar-text-strong)}.shell__alpha[_ngcontent-%COMP%]{font-family:Geist,system-ui,sans-serif;font-weight:600;font-size:10px;line-height:1;letter-spacing:.06em;text-transform:uppercase;color:#ad322b;background:#ad322b14;border-radius:3px;padding:4px 8px;margin-left:8px;-webkit-user-select:none;user-select:none;display:inline-block;vertical-align:middle;white-space:nowrap}.app-dark[_nghost-%COMP%] .shell__alpha[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .shell__alpha[_ngcontent-%COMP%]{color:#e07570;background:#cf464024}.shell__version[_ngcontent-%COMP%]{display:inline-block;margin-left:6px;padding:2px 6px;border-radius:3px;font-family:var(--p-monospace-font-family, ui-monospace, monospace);font-size:11px;line-height:1;font-weight:500;letter-spacing:.02em;color:var(--p-text-muted-color);background:var(--p-content-hover-background);vertical-align:middle;-webkit-user-select:text;user-select:text}.shell__update-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:3px 8px;font-size:11px;line-height:1;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--p-primary-color);background:var(--p-primary-50);border:1px solid var(--p-primary-200);border-radius:999px;text-decoration:none;transition:background-color .12s ease,color .12s ease;vertical-align:middle}.shell__update-chip[_ngcontent-%COMP%]:hover, .shell__update-chip[_ngcontent-%COMP%]:focus-visible{background:var(--p-primary-100);color:var(--p-primary-700)}.shell__update-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:12px;transform:translateY(1px)}.app-dark[_nghost-%COMP%] .shell__update-chip[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .shell__update-chip[_ngcontent-%COMP%]{color:var(--p-primary-300);background:#ffffff0a;border-color:var(--p-primary-700)}.shell__tag[_ngcontent-%COMP%]{margin:.35rem 0 0;font-size:.72rem;color:var(--shell-topbar-text-muted);letter-spacing:.02em;text-transform:uppercase}.shell__nav[_ngcontent-%COMP%]{display:flex;gap:.25rem;margin-left:auto}.shell__nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:.5rem .9rem;border-radius:.5rem;font-size:.9rem;font-weight:500;color:var(--shell-topbar-text-muted);transition:background .15s ease,color .15s ease}.shell__nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background:var(--shell-topbar-hover-bg);color:var(--shell-topbar-text-strong)}.shell__nav[_ngcontent-%COMP%] a.is-active[_ngcontent-%COMP%]{background:var(--shell-topbar-active-bg);color:var(--shell-topbar-active-text)}.shell__nav-disabled[_ngcontent-%COMP%]{padding:.5rem .9rem;border:none;background:transparent;border-radius:.5rem;font-size:.9rem;font-weight:500;color:var(--shell-topbar-text-muted);cursor:not-allowed;opacity:.55;font-family:inherit}.shell__nav-search[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:none;border-radius:.5rem;background:transparent;color:var(--shell-topbar-text-muted);cursor:not-allowed;opacity:.55;transition:background .15s ease,color .15s ease,opacity .15s ease}.shell__nav-search[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--shell-topbar-hover-bg);color:var(--shell-topbar-text-strong);opacity:1}.shell__nav-search[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.95rem}.shell__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;--p-button-text-secondary-color: var(--shell-topbar-text-muted);--p-button-text-secondary-hover-color: var(--shell-topbar-text-strong);--p-button-text-secondary-hover-background: var(--shell-topbar-hover-bg);--p-button-text-secondary-active-color: var(--shell-topbar-text-strong);--p-button-text-secondary-active-background: var(--shell-topbar-hover-bg)}.shell__refresh[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;border-radius:999px;background:transparent;color:var(--shell-topbar-text-muted);cursor:pointer;transition:background .15s ease,color .15s ease}.shell__refresh[_ngcontent-%COMP%]:hover:not(:disabled), .shell__refresh[_ngcontent-%COMP%]:focus-visible:not(:disabled){background:var(--shell-topbar-hover-bg);color:var(--shell-topbar-text-strong);outline:none}.shell__refresh[_ngcontent-%COMP%]:disabled{cursor:progress;opacity:.7}.shell__refresh[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1rem}.shell__main[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;width:100%}@media(max-width:1280px){.shell__topbar[_ngcontent-%COMP%]{gap:1rem;padding:.5rem 1rem}.shell__tag[_ngcontent-%COMP%]{display:none}.shell__nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:.4rem .7rem;font-size:.85rem}}.viewport-warning[_ngcontent-%COMP%]{display:none}@media(max-width:767px){.viewport-warning[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:1.5rem;background:var(--sm-bg-content)}.viewport-warning__card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.85rem;max-width:22rem}.viewport-warning__icon[_ngcontent-%COMP%]{font-size:3rem;color:var(--p-primary-color);margin-bottom:.25rem}.viewport-warning__title[_ngcontent-%COMP%]{margin:0;font-size:1.35rem;font-weight:700;color:var(--p-text-color);line-height:1.25}.viewport-warning__subtitle[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:500;color:var(--p-primary-color);line-height:1.35}.viewport-warning__body[_ngcontent-%COMP%]{margin:0;color:var(--p-text-muted-color);line-height:1.5;font-size:.9rem}.shell[_ngcontent-%COMP%]{display:none}}"],changeDetection:0})};Ie(le,Ze).catch(n=>console.error(n));
|