@visulima/vis 1.0.0-alpha.30 → 1.0.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bin.js +290 -290
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler35.js +1 -1
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler37.js +1 -1
- package/dist/packem_chunks/handler38.js +1 -1
- package/dist/packem_chunks/handler39.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler42.js +1 -1
- package/dist/packem_chunks/handler43.js +1 -1
- package/dist/packem_chunks/handler44.js +1 -1
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +37 -37
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/Table-3pFgIUZ2-DABgc6rj.js +12 -0
- package/dist/packem_shared/{advisories-BxXiKFbL.js → advisories-CGKZo9Rx.js} +1 -1
- package/dist/packem_shared/{cyclonedx-BpGVHqSW.js → cyclonedx-BilSFCNY.js} +1 -1
- package/dist/packem_shared/{docker-CTE3s4LW.js → docker-EJiTY0Sz.js} +1 -1
- package/dist/packem_shared/{index-D1xC1Y_R.js → index-BnANMQ7k.js} +1 -1
- package/dist/packem_shared/{index-hoWfZmNo.js → index-K8aQuMvx.js} +1 -1
- package/dist/packem_shared/{lifecycle-CXaqPGAQ.js → lifecycle-Buigdp7P.js} +2 -2
- package/dist/packem_shared/{osv-bloom-DSZcHLsM.js → osv-bloom-0Vu8YRhg.js} +1 -1
- package/dist/packem_shared/{provenance-DkCA8BrN.js → provenance-D8vU1u2L.js} +1 -1
- package/dist/packem_shared/{registry-keys-Mixm4eAY.js → registry-keys-E3cZn4FI.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-D5E72FfN.js → resolve-explicit-cPzwdiEE.js} +1 -1
- package/dist/packem_shared/{s1ngularity-Qxc6tRRI.js → s1ngularity-DBcjspCC.js} +1 -1
- package/dist/packem_shared/{scan-progress-DVtCtI2z.js → scan-progress-CTVVf9WW.js} +1 -1
- package/dist/packem_shared/{signatures-byuFrtAH.js → signatures-ChTfrQvT.js} +1 -1
- package/dist/packem_shared/{typosquats-BiDxQj7R.js → typosquats-acxQ7blw.js} +1 -1
- package/dist/packem_shared/{watch-loop-C31Ar7BX.js → watch-loop-BpA_pxU9.js} +1 -1
- package/index.d.ts +201 -201
- package/index.js +52 -52
- package/package.json +10 -10
- package/dist/packem_shared/Table-DoSoazT6-DwnyTUsA.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ge=Object.defineProperty;var g=(e,t)=>ge(e,"name",{value:t,configurable:!0});import{createRequire as he}from"node:module";import{E as d,j as k,q as x}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{d as b,E as m,s as ie}from"./config.js";import{l as O,C as _,Q as ve,z as W,M as c,y as be,a as we}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{p as a}from"./bin.js";import{B as ce,y as ke,A as xe}from"../packem_shared/pm-runner-DmKT2FqF.js";import{g as Ce}from"../packem_shared/_commonjsHelpers-CLblCigl.js";import{f as Se}from"../packem_shared/giget-CcEy_Elm.js";const fe=he(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=g(e=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[t,r]=D.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return D.getBuiltinModule(e)}return fe(e)},"__cjs_getBuiltinModule"),{spawnSync:ye}=J("node:child_process"),{createInterface:$e}=J("node:readline"),{readdirSync:_e,chmodSync:je}=J("node:fs");var Oe=Object.defineProperty,L=g((e,t)=>Oe(e,"name",{value:t,configurable:!0}),"e");const Pe={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Ne=["https://github.com/","https://gitlab.com/","https://bitbucket.org/","https://raw.githubusercontent.com/","https://git.sr.ht/","git@github.com:","git@gitlab.com:","git@bitbucket.org:","git@git.sr.ht:","github:","gh:","gitlab:","bitbucket:","sourcehut:","git:","http://","https://"],qe=L(e=>{for(const t of Ne)if(e.startsWith(t))return!0;return!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},"isGitUrl"),De=new Set(["sv"]),Ee=L(e=>{if(De.has(e)||e.startsWith("create-")||e.startsWith("@")&&e.includes("/create-"))return e;if(e.startsWith("@")){const t=e.indexOf("/");if(t!==-1){const r=e.slice(0,t),i=e.slice(t+1);return`${r}/create-${i}`}return e}return`create-${e}`},"expandCreateShorthand"),Te=L((e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=Pe[r];return i?{args:t,source:r,type:i}:qe(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Ee(e),type:"remote:npm"}},"discoverTemplate"),Ie=L(e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},"inferParentDir");var Re=Object.defineProperty,le=g((e,t)=>Re(e,"name",{value:t,configurable:!0}),"i$1");const ae=["ability","able","about","above","abroad","absence","absolute","absolutely","absorb","academic","accept","access","accompany","accomplish","according","account","accurate","achieve","achievement","acid","acknowledge","acquire","across","act","action","active","activist","activity","actor","actress","actual","actually","adapt","add","addition","additional","address","adequate","adjust","adjustment","administration","administrator","admire","admission","admit","adolescent","adopt","adult","advance","advanced","advantage","adventure","advertising","advice","advise","adviser","advocate","affair","affect","afford","after","afternoon","again","against","age","agency","agenda","agent","ago","agree","agreement","agricultural","ahead","aid","aide","aim","air","aircraft","airline","airport","album","alive","all","alliance","allow","ally","almost","alone","along","already","also","alter","alternative","although","always","amazing","among","amount","analysis","analyst","analyze","ancient","and","angle","animal","anniversary","announce","annual","another","answer","anticipate","any","anybody","anymore","anyone","anything","anyway","anywhere","apart","apartment","apparent","apparently","appeal","appear","appearance","apple","application","apply","appoint","appointment","appreciate","approach","appropriate","approval","approve","approximately","architect","area","argue","argument","arise","arm","armed","around","arrange","arrangement","arrival","arrive","art","article","artist","artistic","aside","ask","asleep","aspect","assert","assess","assessment","asset","assign","assignment","assist","assistance","assistant","associate","association","assume","assumption","assure","athlete","athletic","atmosphere","attach","attempt","attend","attention","attitude","attorney","attract","attractive","attribute","audience","author","authority","auto","available","average","avoid","award","aware","awareness","away","awesome","baby","back","background","bag","bake","balance","ball","ban","band","bank","bar","barely","barrel","base","baseball","basic","basically","basis","basket","basketball","bathroom","battery","beach","bean","bear","beat","beautiful","beauty","because","become","bed","bedroom","beer","before","begin","beginning","behavior","behind","being","belief","believe","bell","belong","below","belt","bench","bend","beneath","benefit","beside","besides","best","bet","better","between","beyond","big","bike","bill","billion","bind","biological","bird","birth","birthday","bit","bite","black","blade","blanket","blind","block","blow","blue","board","boat","body","bond","bone","book","boom","boot","border","born","borrow","boss","both","bother","bottle","bottom","boundary","bowl","box","boy","boyfriend","brain","branch","brand","bread","break","breakfast","breast","breath","breathe","brick","bridge","brief","briefly","bright","brilliant","bring","broad","brother","brown","brush","buck","budget","build","building","bullet","bunch","bury","bus","business","busy","but","butter","button","buy","buyer","cabin","cabinet","cable","cake","calculate","call","camera","camp","campaign","campus","can","candidate","cap","capability","capable","capacity","capital","captain","capture","car","carbon","card","care","career","careful","carefully","carrier","carry","case","cash","cast","cat","catch","category","cause","ceiling","celebrate","celebration","celebrity","cell","center","central","century","ceremony","certain","certainly","chain","chair","chairman","challenge","chamber","champion","championship","chance","change","changing","channel","chapter","character","characteristic","characterize","charge","charity","chart","chase","cheap","check","cheek","cheese","chef","chemical","chest","chicken","chief","child","childhood","chip","chocolate","choice","cholesterol","choose","church","cigarette","circle","circumstance","cite","citizen","city","civil","civilian","claim","class","classic","classroom","clean","clear","clearly","client","climate","climb","clinic","clinical","clock","close","closely","closer","clothes","clothing","cloud","club","clue","cluster","coach","coal","coalition","coast","coat","code","coffee","cognitive","cold","colleague","collect","collection","collective","college","colonial","color","column","combination","combine","come","comedy","comfort","comfortable","command","commander","comment","commercial","commission","commit","commitment","committee","common","communicate","communication","community","company","compare","comparison","compete","competition","competitive","competitor","complete","completely","complex","complicated","component","compose","composition","comprehensive","computer","concentrate","concentration","concept","concern","concerned","concert","conclude","conclusion","concrete","condition","conduct","conference","confidence","confident","confirm","confront","confusion","congressional","connect","connection","consciousness","consensus","consequence","conservative","consider","considerable","consideration","consist","consistent","constant","constantly","constitute","constitutional","construct","construction","consultant","consume","consumer","consumption","contact","contain","container","contemporary","content","contest","context","continue","continued","contract","contrast","contribute","contribution","control","convention","conventional","conversation","convert","conviction","convince","cook","cookie","cooking","cool","cooperation","cop","cope","copy","core","corn","corner","corporate","corporation","correct","correspondent","cost","cotton","couch","could","council","counselor","count","counter","country","county","couple","courage","course","court","cousin","cover","coverage","cow","crack","craft","cream","create","creation","creative","creature","credit","crew","criteria","crop","cross","crowd","crucial","cultural","culture","cup","curious","current","currently","curriculum","custom","customer","cut","cycle","dad","daily","dance","dare","dark","darkness","data","date","daughter","day","deal","dealer","dear","debate","decade","decide","decision","deck","declare","decrease","deep","deeply","deer","defend","defendant","defense","defensive","define","definitely","definition","degree","delay","deliver","delivery","demand","democracy","democratic","demonstrate","demonstration","deny","department","depend","dependent","depending","depict","depth","deputy","derive","describe","description","desert","deserve","design","designer","desire","desk","desperate","despite","detail","detailed","detect","determine","develop","developing","development","device","devote","dialogue","diet","differ","difference","different","differently","difficult","difficulty","dig","digital","dimension","dining","dinner","direct","direction","directly","director","disability","disagree","disappear","discipline","discourse","discover","discovery","discuss","discussion","dish","dismiss","display","distance","distant","distinct","distinction","distinguish","distribute","distribution","district","diverse","diversity","divide","division","doctor","document","dog","domestic","dominant","dominate","door","double","down","downtown","dozen","draft","drag","drama","dramatic","dramatically","draw","drawing","dream","dress","drink","drive","driver","drop","dry","due","during","dust","duty","each","eager","ear","early","earn","earnings","earth","ease","easily","east","eastern","easy","eat","economic","economics","economist","economy","edge","edition","editor","educate","education","educational","educator","effect","effective","effectively","efficiency","efficient","effort","egg","eight","either","elderly","elect","election","electric","electricity","electronic","element","elementary","eliminate","elite","else","elsewhere","embrace","emerge","emission","emotion","emotional","emphasis","emphasize","employ","employee","employer","employment","empty","enable","encounter","encourage","end","energy","enforcement","engage","engine","engineer","engineering","enhance","enjoy","enormous","enough","ensure","enter","enterprise","entertainment","entire","entirely","entrance","entry","environment","environmental","episode","equal","equally","equipment","era","escape","especially","essay","essential","essentially","establish","establishment","estate","estimate","etc","ethics","ethnic","evaluate","evaluation","even","evening","event","eventually","ever","every","everybody","everyday","everyone","everything","everywhere","evidence","evolution","evolve","exact","exactly","examination","examine","example","exceed","excellent","except","exception","exchange","exciting","executive","exercise","exhibit","exhibition","exist","existence","existing","expand","expansion","expect","expectation","expense","expensive","experience","experiment","expert","explain","explanation","explore","expose","express","expression","extend","extension","extensive","extent","external","extra","extraordinary","extreme","extremely","eye","fabric","face","facility","fact","factor","factory","faculty","fade","fair","fairly","faith","fall","false","familiar","family","famous","fan","fantasy","far","farm","farmer","fashion","fast","fate","father","favor","favorite","feature","federal","fee","feed","feel","feeling","fellow","female","fence","few","fewer","fiber","fiction","field","fifteen","fifth","fifty","figure","file","fill","film","final","finally","finance","financial","find","finding","fine","finger","finish","firm","first","fish","fishing","fit","fitness","five","fix","flag","flame","flat","flavor","flesh","flight","float","floor","flow","flower","fly","focus","folk","follow","following","food","foot","football","for","force","foreign","forest","forever","forget","form","formal","formation","former","formula","forth","fortune","forward","found","foundation","founder","four","fourth","frame","framework","free","freedom","freeze","frequency","frequent","frequently","fresh","friend","friendly","friendship","from","front","fruit","fuel","full","fully","fun","function","fund","fundamental","funding","funeral","funny","furniture","furthermore","future","gain","galaxy","gallery","game","gap","garage","garden","garlic","gas","gate","gather","gaze","gear","gender","gene","general","generally","generate","generation","genetic","gentleman","gently","gesture","get","ghost","giant","gift","gifted","girl","girlfriend","give","given","glad","glance","glass","global","glove","goal","gold","golden","golf","good","government","governor","grab","grade","gradually","graduate","grain","grand","grandfather","grandmother","grant","grass","grave","gray","great","greatest","green","grocery","ground","group","grow","growing","growth","guarantee","guard","guess","guest","guide","guideline","guy","habit","habitat","hair","half","hall","hand","handful","handle","hang","happen","happy","hard","hardly","hat","have","head","headline","headquarters","health","healthy","hear","hearing","heart","heat","heaven","heavily","heavy","heel","height","helicopter","hello","help","helpful","here","heritage","hero","herself","hey","hide","high","highlight","highly","highway","hill","himself","hip","hire","historian","historic","historical","history","hit","hold","hole","holiday","holy","home","honest","honey","honor","hope","horizon","horse","hospital","host","hot","hotel","hour","house","household","housing","how","however","huge","human","humor","hundred","hungry","hunter","hunting","husband","hypothesis","ice","idea","ideal","identification","identify","identity","ignore","illustrate","image","imagination","imagine","immediate","immediately","immigrant","immigration","impact","implement","implication","imply","importance","important","impose","impossible","impress","impression","impressive","improve","improvement","incentive","incident","include","including","income","incorporate","increase","increased","increasing","increasingly","incredible","indeed","independence","independent","index","indicate","indication","individual","industrial","industry","infant","inflation","influence","inform","information","ingredient","initial","initially","initiative","inner","innocent","inquiry","inside","insight","insist","inspire","install","instance","instead","institution","institutional","instruction","instructor","instrument","insurance","intellectual","intelligence","intend","intense","intensity","intention","interaction","interest","interested","interesting","internal","international","interpret","interpretation","intervention","interview","into","introduce","introduction","invest","investigate","investigation","investigator","investment","investor","invite","involve","involved","involvement","iron","island","issue","item","its","itself","jacket","jet","job","join","joint","joke","journal","journalist","journey","joy","judge","judgment","juice","jump","junior","jury","just","justice","justify","keep","key","kick","kid","kind","king","kiss","kitchen","knee","knife","knock","know","knowledge","lab","label","labor","laboratory","lady","lake","land","landscape","language","lap","large","largely","last","late","later","latter","laugh","launch","law","lawn","lawsuit","lawyer","lay","layer","lead","leader","leadership","leading","leaf","league","lean","learn","learning","least","leather","leave","left","leg","legacy","legal","legend","legislation","legitimate","lemon","length","less","lesson","let","letter","level","liberal","library","license","lie","life","lifestyle","lifetime","lift","light","like","likely","limit","limitation","limited","line","link","lip","list","listen","literally","literary","literature","little","live","living","load","loan","local","locate","location","lock","long","look","loose","lose","lost","lot","lots","loud","love","lovely","lover","low","lower","luck","lucky","lunch","lung","machine","magazine","mail","main","mainly","maintain","maintenance","major","majority","make","maker","makeup","male","mall","man","manage","management","manager","manner","manufacturer","manufacturing","many","map","margin","mark","market","marketing","marriage","married","marry","mask","mass","massive","master","match","material","math","matter","may","maybe","mayor","meal","mean","meaning","meanwhile","measure","measurement","meat","mechanism","media","medical","medication","medicine","medium","meet","meeting","member","membership","memory","mental","mention","menu","mere","merely","message","metal","meter","method","middle","might","military","milk","million","mind","mine","minister","minor","minority","minute","miracle","mirror","miss","missile","mission","mix","mixture","mode","model","moderate","modern","modest","mom","moment","money","monitor","month","mood","moon","moral","more","moreover","morning","mortgage","most","mostly","mother","motion","motivation","motor","mount","mountain","mouse","mouth","move","movement","movie","much","multiple","muscle","museum","music","musical","musician","must","mutual","myself","mystery","myth","naked","name","narrative","narrow","nation","national","native","natural","naturally","nature","near","nearby","nearly","necessarily","necessary","neck","need","negative","negotiate","negotiation","neighbor","neighborhood","neither","nerve","net","network","never","nevertheless","new","newly","news","newspaper","next","nice","night","nine","nobody","nod","nomination","none","nonetheless","nor","normal","normally","north","northern","nose","not","note","nothing","notice","notion","novel","now","nowhere","nuclear","number","numerous","nurse","nut","object","objective","obligation","observation","observe","observer","obtain","obvious","obviously","occasion","occasionally","occupation","occupy","occur","ocean","odd","odds","off","offer","office","officer","official","often","oil","okay","old","once","one","ongoing","onion","online","only","onto","open","opening","operate","operating","operation","operator","opinion","opponent","opportunity","oppose","opposite","opposition","option","orange","order","ordinary","organic","organization","organize","orientation","origin","original","originally","other","others","otherwise","ought","our","ourselves","out","outcome","outside","oven","over","overall","overcome","overlook","owe","own","owner","pace","pack","package","page","paint","painter","painting","pair","pale","palm","pan","panel","pant","paper","parent","park","parking","part","participant","participate","participation","particular","particularly","partly","partner","partnership","party","pass","passage","passenger","passion","past","patch","path","patient","pattern","pause","pay","payment","peace","peak","peer","people","pepper","per","perceive","percentage","perception","perfect","perfectly","perform","performance","perhaps","period","permanent","permission","permit","person","personal","personality","personally","personnel","perspective","persuade","pet","phase","phenomenon","philosophy","phone","photo","photograph","photographer","phrase","physical","physically","physician","piano","pick","picture","pie","piece","pile","pilot","pine","pink","pipe","pitch","place","plan","plane","planet","planning","plant","plastic","plate","platform","play","player","please","pleasure","plenty","plot","plus","pocket","poem","poet","poetry","point","pole","police","policy","political","politically","politician","politics","poll","pool","pop","popular","population","porch","port","portion","portrait","portray","pose","position","positive","possess","possibility","possible","possibly","post","pot","potato","potential","potentially","pound","pour","powder","power","powerful","practical","practice","pray","prayer","precisely","predict","prefer","preference","pregnancy","pregnant","preparation","prepare","prescription","presence","present","presentation","preserve","president","presidential","press","pretend","pretty","prevent","previous","previously","price","pride","priest","primarily","primary","prime","principal","principle","print","prior","priority","privacy","private","probably","procedure","proceed","process","produce","producer","product","production","profession","professional","professor","profile","profit","program","progress","project","prominent","promise","promote","prompt","proof","proper","properly","property","proportion","proposal","propose","proposed","prosecutor","prospect","protect","protection","protein","protest","proud","prove","provide","provider","province","provision","psychological","psychologist","psychology","public","publication","publicly","publish","publisher","pull","purchase","pure","purpose","pursue","push","put","qualify","quality","quarter","quarterback","question","quick","quickly","quiet","quietly","quit","quite","quote","race","racial","radical","radio","rail","rain","raise","range","rank","rapid","rapidly","rare","rarely","rate","rather","rating","ratio","raw","reach","react","reaction","read","reader","reading","ready","real","reality","realize","really","reason","reasonable","recall","receive","recent","recently","recipe","recognition","recognize","recommend","recommendation","record","recording","recover","recovery","recruit","red","reduce","reduction","refer","reference","reflect","reflection","reform","refugee","refuse","regard","regarding","regardless","regime","region","regional","register","regular","regularly","regulate","regulation","reinforce","relate","relation","relationship","relative","relatively","relax","release","relevant","relief","religion","religious","rely","remain","remaining","remarkable","remember","remind","remote","remove","repeat","repeatedly","replace","reply","report","reporter","represent","representation","representative","reputation","request","require","requirement","research","researcher","resemble","reservation","resident","resist","resolution","resolve","resort","resource","respect","respond","respondent","response","responsibility","responsible","rest","restaurant","restore","restriction","result","retain","retire","retirement","return","reveal","revenue","review","revolution","rhythm","rice","rich","rid","ride","rifle","right","ring","rise","river","road","rock","role","roll","romantic","roof","room","root","rope","rose","roughly","round","route","routine","row","rub","rule","run","running","rural","rush","sacred","safe","safety","sake","salad","salary","sale","sales","salt","same","sample","sanction","sand","satellite","satisfaction","satisfy","sauce","save","saving","say","scale","scenario","scene","schedule","scheme","scholar","scholarship","school","science","scientific","scientist","scope","score","screen","script","sea","search","season","seat","second","secret","secretary","section","sector","secure","security","see","seed","seek","seem","segment","seize","select","selection","self","sell","senator","send","senior","sense","sensitive","sentence","separate","sequence","series","serious","seriously","serve","service","session","set","setting","settle","settlement","seven","several","shade","shadow","shake","shall","shape","share","sharp","sheet","shelf","shell","shelter","shift","shine","ship","shirt","shoe","shop","shopping","shore","short","shortly","shot","should","shoulder","shout","show","shower","shrug","shut","side","sigh","sight","sign","signal","significance","significant","significantly","silence","silent","silver","similar","similarly","simple","simply","since","sing","singer","single","sink","sir","sister","sit","site","situation","six","size","ski","skill","skin","sky","sleep","slice","slide","slight","slightly","slip","slow","slowly","small","smart","smell","smile","smooth","snap","snow","soccer","social","society","soft","software","soil","solar","solid","solution","solve","some","somebody","somehow","someone","something","sometimes","somewhat","somewhere","son","song","soon","sophisticated","sorry","sort","soul","sound","soup","source","south","southern","space","speak","speaker","special","specialist","species","specific","specifically","speech","speed","spend","spending","spin","spirit","spiritual","split","spokesman","sport","spot","spread","spring","square","squeeze","stability","stable","staff","stage","stair","stake","stand","standard","standing","star","stare","start","state","statement","station","statistics","status","stay","steady","steal","steel","step","stick","still","stir","stock","stomach","stone","stop","storage","store","storm","story","straight","strange","stranger","strategic","strategy","stream","street","strength","strengthen","stretch","string","strip","strong","strongly","structure","student","studio","study","stuff","style","subject","submit","subsequent","substance","substantial","succeed","success","successful","successfully","such","sudden","suddenly","sue","sufficient","sugar","suggest","suggestion","suit","summer","summit","sun","super","supply","support","supporter","suppose","supposed","sure","surely","surface","surgery","surprise","surprised","surprising","surprisingly","surround","survey","survival","survive","survivor","sustain","swear","sweep","sweet","swim","swing","switch","symbol","system","table","tablespoon","tactic","tail","take","tale","talent","talk","tall","tank","tap","tape","target","task","taste","tax","taxpayer","tea","teach","teacher","teaching","team","tear","teaspoon","technical","technique","technology","teen","teenager","telephone","telescope","television","tell","temperature","temporary","ten","tend","tendency","tennis","tent","term","terms","territory","test","testify","testimony","testing","text","than","thank","thanks","that","the","theater","their","them","theme","themselves","then","theory","therapy","there","therefore","thick","thin","thing","think","thinking","third","thirty","though","thought","thousand","three","throat","through","throughout","throw","ticket","tie","tight","time","tiny","tip","tire","tired","tissue","title","today","toe","together","tomato","tomorrow","tone","tongue","tonight","too","tool","tooth","top","topic","toss","total","totally","touch","tough","tour","tourist","tournament","tower","town","toy","trace","track","trade","tradition","traditional","traffic","trail","train","training","transfer","transform","transformation","transition","translate","transportation","travel","treat","treatment","treaty","tree","tremendous","trend","trial","tribe","trip","troop","truck","true","truly","trust","truth","try","tube","tunnel","turn","twelve","twenty","twice","twin","two","type","typical","typically","ultimate","ultimately","unable","uncle","under","undergo","understand","understanding","unfortunately","uniform","union","unique","unit","universal","universe","university","unknown","unless","unlike","unlikely","until","unusual","upon","upper","urban","urge","use","used","useful","user","usual","usually","utility","vacation","valley","valuable","value","variable","variation","variety","various","vary","vast","vegetable","vehicle","venture","version","versus","very","vessel","veteran","via","victory","video","view","viewer","village","virtually","virtue","visible","vision","visit","visitor","visual","vital","voice","volume","volunteer","vote","voter","wage","wait","wake","walk","wall","wander","want","warm","warn","warning","wash","watch","water","wave","way","wealth","wealthy","wear","weather","wedding","week","weekend","weekly","weigh","weight","welcome","welfare","well","west","western","wet","what","whatever","wheel","when","whenever","where","whereas","whether","which","while","whisper","white","who","whole","whom","whose","why","wide","widely","widespread","wife","wild","will","willing","win","wind","window","wine","wing","winner","winter","wipe","wire","wisdom","wise","wish","with","withdraw","within","without","witness","woman","wonder","wonderful","wood","wooden","word","work","worker","working","works","workshop","world","worried","worth","would","wrap","write","writer","writing","yard","yeah","year","yell","yellow","yes","yesterday","yield","young","your","yours","yourself","youth","zone"],Me=le((e,t)=>Math.floor(e+Math.random()*(t-e+1)),"random");function F(){return ae[Me(0,ae.length-1)]}g(F,"getRandomWord");le(F,"getRandomWord");var ze=Object.defineProperty,Le=g((e,t)=>ze(e,"name",{value:t,configurable:!0}),"o$1");const Ae=Le(()=>`${F()}-${F()}`,"randomName");var U,ne;function Ge(){return ne||(ne=1,U=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]),U}g(Ge,"requireBuiltinModules");var B,oe;function Ue(){if(oe)return B;oe=1;var e=Object.defineProperty,t=g((o,l)=>e(o,"name",{value:l,configurable:!0}),"i");const r=Ge();var i=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),n=["node_modules","favicon.ico"];function u(o){var l=[],s=[];if(o===null)return s.push("name cannot be null"),p(l,s);if(o===void 0)return s.push("name cannot be undefined"),p(l,s);if(typeof o!="string")return s.push("name must be a string"),p(l,s);if(o.length||s.push("name length must be greater than zero"),o.startsWith(".")&&s.push("name cannot start with a period"),o.startsWith("-")&&s.push("name cannot start with a hyphen"),o.match(/^_/)&&s.push("name cannot start with an underscore"),o.trim()!==o&&s.push("name cannot contain leading or trailing spaces"),n.forEach(function(h){o.toLowerCase()===h&&s.push(h+" is not a valid package name")}),r.includes(o.toLowerCase())&&l.push(o+" is a core module name"),o.length>214&&l.push("name can no longer contain more than 214 characters"),o.toLowerCase()!==o&&l.push("name can no longer contain capital letters"),/[~'!()*]/.test(o.split("/").slice(-1)[0])&&l.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(o)!==o){var w=o.match(i);if(w){var $=w[1],y=w[2];if(y.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent($)===$&&encodeURIComponent(y)===y)return p(l,s)}s.push("name can only contain URL-friendly characters")}return p(l,s)}g(u,"validate"),t(u,"validate");var p=t(function(o,l){var s={validForNewPackages:l.length===0&&o.length===0,validForOldPackages:l.length===0,warnings:o,errors:l};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s},"done");return B=u,B}g(Ue,"requireLib");var Be=Ue();const Ve=Ce(Be);var Fe=Object.defineProperty,I=g((e,t)=>Fe(e,"name",{value:t,configurable:!0}),"r$2");const pe=I(e=>e?Ve(e).validForNewPackages:!1,"isValidPackageName"),T=I(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),Je=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),ue=I(e=>O(e)?_e(e).every(t=>Je.has(t)):!0,"isEmptyDir"),We=I((e,t)=>{const r=_(t,e);return{packageName:T(ve(r)),targetDir:r}},"resolveTargetDir"),He=I(e=>ue(e),"canSafelyOverwrite");var Ye=Object.defineProperty,A=g((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"l$4");const E=A((e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),"ask"),V=A(async(e,t,r=!0)=>{const i=await E(e,` ${t} ${d(r?"[Y/n]":"[y/N]")} `);return i===""?r:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},"confirm"),se=A(async(e,t,r)=>{process.stderr.write(` ${t}
|
|
1
|
+
var ge=Object.defineProperty;var g=(e,t)=>ge(e,"name",{value:t,configurable:!0});import{createRequire as he}from"node:module";import{E as d,j as k,q as x}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{b,E as m,s as ie}from"./config.js";import{l as O,C as _,Q as ve,z as W,M as c,y as be,a as we}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{p as a}from"./bin.js";import{B as ce,y as ke,A as xe}from"../packem_shared/pm-runner-DmKT2FqF.js";import{g as Ce}from"../packem_shared/_commonjsHelpers-CLblCigl.js";import{f as Se}from"../packem_shared/giget-CcEy_Elm.js";const fe=he(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=g(e=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[t,r]=D.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return D.getBuiltinModule(e)}return fe(e)},"__cjs_getBuiltinModule"),{spawnSync:ye}=J("node:child_process"),{createInterface:$e}=J("node:readline"),{readdirSync:_e,chmodSync:je}=J("node:fs");var Oe=Object.defineProperty,L=g((e,t)=>Oe(e,"name",{value:t,configurable:!0}),"e");const Pe={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Ne=["https://github.com/","https://gitlab.com/","https://bitbucket.org/","https://raw.githubusercontent.com/","https://git.sr.ht/","git@github.com:","git@gitlab.com:","git@bitbucket.org:","git@git.sr.ht:","github:","gh:","gitlab:","bitbucket:","sourcehut:","git:","http://","https://"],qe=L(e=>{for(const t of Ne)if(e.startsWith(t))return!0;return!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},"isGitUrl"),De=new Set(["sv"]),Ee=L(e=>{if(De.has(e)||e.startsWith("create-")||e.startsWith("@")&&e.includes("/create-"))return e;if(e.startsWith("@")){const t=e.indexOf("/");if(t!==-1){const r=e.slice(0,t),i=e.slice(t+1);return`${r}/create-${i}`}return e}return`create-${e}`},"expandCreateShorthand"),Te=L((e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=Pe[r];return i?{args:t,source:r,type:i}:qe(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Ee(e),type:"remote:npm"}},"discoverTemplate"),Ie=L(e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},"inferParentDir");var Re=Object.defineProperty,le=g((e,t)=>Re(e,"name",{value:t,configurable:!0}),"i$1");const ae=["ability","able","about","above","abroad","absence","absolute","absolutely","absorb","academic","accept","access","accompany","accomplish","according","account","accurate","achieve","achievement","acid","acknowledge","acquire","across","act","action","active","activist","activity","actor","actress","actual","actually","adapt","add","addition","additional","address","adequate","adjust","adjustment","administration","administrator","admire","admission","admit","adolescent","adopt","adult","advance","advanced","advantage","adventure","advertising","advice","advise","adviser","advocate","affair","affect","afford","after","afternoon","again","against","age","agency","agenda","agent","ago","agree","agreement","agricultural","ahead","aid","aide","aim","air","aircraft","airline","airport","album","alive","all","alliance","allow","ally","almost","alone","along","already","also","alter","alternative","although","always","amazing","among","amount","analysis","analyst","analyze","ancient","and","angle","animal","anniversary","announce","annual","another","answer","anticipate","any","anybody","anymore","anyone","anything","anyway","anywhere","apart","apartment","apparent","apparently","appeal","appear","appearance","apple","application","apply","appoint","appointment","appreciate","approach","appropriate","approval","approve","approximately","architect","area","argue","argument","arise","arm","armed","around","arrange","arrangement","arrival","arrive","art","article","artist","artistic","aside","ask","asleep","aspect","assert","assess","assessment","asset","assign","assignment","assist","assistance","assistant","associate","association","assume","assumption","assure","athlete","athletic","atmosphere","attach","attempt","attend","attention","attitude","attorney","attract","attractive","attribute","audience","author","authority","auto","available","average","avoid","award","aware","awareness","away","awesome","baby","back","background","bag","bake","balance","ball","ban","band","bank","bar","barely","barrel","base","baseball","basic","basically","basis","basket","basketball","bathroom","battery","beach","bean","bear","beat","beautiful","beauty","because","become","bed","bedroom","beer","before","begin","beginning","behavior","behind","being","belief","believe","bell","belong","below","belt","bench","bend","beneath","benefit","beside","besides","best","bet","better","between","beyond","big","bike","bill","billion","bind","biological","bird","birth","birthday","bit","bite","black","blade","blanket","blind","block","blow","blue","board","boat","body","bond","bone","book","boom","boot","border","born","borrow","boss","both","bother","bottle","bottom","boundary","bowl","box","boy","boyfriend","brain","branch","brand","bread","break","breakfast","breast","breath","breathe","brick","bridge","brief","briefly","bright","brilliant","bring","broad","brother","brown","brush","buck","budget","build","building","bullet","bunch","bury","bus","business","busy","but","butter","button","buy","buyer","cabin","cabinet","cable","cake","calculate","call","camera","camp","campaign","campus","can","candidate","cap","capability","capable","capacity","capital","captain","capture","car","carbon","card","care","career","careful","carefully","carrier","carry","case","cash","cast","cat","catch","category","cause","ceiling","celebrate","celebration","celebrity","cell","center","central","century","ceremony","certain","certainly","chain","chair","chairman","challenge","chamber","champion","championship","chance","change","changing","channel","chapter","character","characteristic","characterize","charge","charity","chart","chase","cheap","check","cheek","cheese","chef","chemical","chest","chicken","chief","child","childhood","chip","chocolate","choice","cholesterol","choose","church","cigarette","circle","circumstance","cite","citizen","city","civil","civilian","claim","class","classic","classroom","clean","clear","clearly","client","climate","climb","clinic","clinical","clock","close","closely","closer","clothes","clothing","cloud","club","clue","cluster","coach","coal","coalition","coast","coat","code","coffee","cognitive","cold","colleague","collect","collection","collective","college","colonial","color","column","combination","combine","come","comedy","comfort","comfortable","command","commander","comment","commercial","commission","commit","commitment","committee","common","communicate","communication","community","company","compare","comparison","compete","competition","competitive","competitor","complete","completely","complex","complicated","component","compose","composition","comprehensive","computer","concentrate","concentration","concept","concern","concerned","concert","conclude","conclusion","concrete","condition","conduct","conference","confidence","confident","confirm","confront","confusion","congressional","connect","connection","consciousness","consensus","consequence","conservative","consider","considerable","consideration","consist","consistent","constant","constantly","constitute","constitutional","construct","construction","consultant","consume","consumer","consumption","contact","contain","container","contemporary","content","contest","context","continue","continued","contract","contrast","contribute","contribution","control","convention","conventional","conversation","convert","conviction","convince","cook","cookie","cooking","cool","cooperation","cop","cope","copy","core","corn","corner","corporate","corporation","correct","correspondent","cost","cotton","couch","could","council","counselor","count","counter","country","county","couple","courage","course","court","cousin","cover","coverage","cow","crack","craft","cream","create","creation","creative","creature","credit","crew","criteria","crop","cross","crowd","crucial","cultural","culture","cup","curious","current","currently","curriculum","custom","customer","cut","cycle","dad","daily","dance","dare","dark","darkness","data","date","daughter","day","deal","dealer","dear","debate","decade","decide","decision","deck","declare","decrease","deep","deeply","deer","defend","defendant","defense","defensive","define","definitely","definition","degree","delay","deliver","delivery","demand","democracy","democratic","demonstrate","demonstration","deny","department","depend","dependent","depending","depict","depth","deputy","derive","describe","description","desert","deserve","design","designer","desire","desk","desperate","despite","detail","detailed","detect","determine","develop","developing","development","device","devote","dialogue","diet","differ","difference","different","differently","difficult","difficulty","dig","digital","dimension","dining","dinner","direct","direction","directly","director","disability","disagree","disappear","discipline","discourse","discover","discovery","discuss","discussion","dish","dismiss","display","distance","distant","distinct","distinction","distinguish","distribute","distribution","district","diverse","diversity","divide","division","doctor","document","dog","domestic","dominant","dominate","door","double","down","downtown","dozen","draft","drag","drama","dramatic","dramatically","draw","drawing","dream","dress","drink","drive","driver","drop","dry","due","during","dust","duty","each","eager","ear","early","earn","earnings","earth","ease","easily","east","eastern","easy","eat","economic","economics","economist","economy","edge","edition","editor","educate","education","educational","educator","effect","effective","effectively","efficiency","efficient","effort","egg","eight","either","elderly","elect","election","electric","electricity","electronic","element","elementary","eliminate","elite","else","elsewhere","embrace","emerge","emission","emotion","emotional","emphasis","emphasize","employ","employee","employer","employment","empty","enable","encounter","encourage","end","energy","enforcement","engage","engine","engineer","engineering","enhance","enjoy","enormous","enough","ensure","enter","enterprise","entertainment","entire","entirely","entrance","entry","environment","environmental","episode","equal","equally","equipment","era","escape","especially","essay","essential","essentially","establish","establishment","estate","estimate","etc","ethics","ethnic","evaluate","evaluation","even","evening","event","eventually","ever","every","everybody","everyday","everyone","everything","everywhere","evidence","evolution","evolve","exact","exactly","examination","examine","example","exceed","excellent","except","exception","exchange","exciting","executive","exercise","exhibit","exhibition","exist","existence","existing","expand","expansion","expect","expectation","expense","expensive","experience","experiment","expert","explain","explanation","explore","expose","express","expression","extend","extension","extensive","extent","external","extra","extraordinary","extreme","extremely","eye","fabric","face","facility","fact","factor","factory","faculty","fade","fair","fairly","faith","fall","false","familiar","family","famous","fan","fantasy","far","farm","farmer","fashion","fast","fate","father","favor","favorite","feature","federal","fee","feed","feel","feeling","fellow","female","fence","few","fewer","fiber","fiction","field","fifteen","fifth","fifty","figure","file","fill","film","final","finally","finance","financial","find","finding","fine","finger","finish","firm","first","fish","fishing","fit","fitness","five","fix","flag","flame","flat","flavor","flesh","flight","float","floor","flow","flower","fly","focus","folk","follow","following","food","foot","football","for","force","foreign","forest","forever","forget","form","formal","formation","former","formula","forth","fortune","forward","found","foundation","founder","four","fourth","frame","framework","free","freedom","freeze","frequency","frequent","frequently","fresh","friend","friendly","friendship","from","front","fruit","fuel","full","fully","fun","function","fund","fundamental","funding","funeral","funny","furniture","furthermore","future","gain","galaxy","gallery","game","gap","garage","garden","garlic","gas","gate","gather","gaze","gear","gender","gene","general","generally","generate","generation","genetic","gentleman","gently","gesture","get","ghost","giant","gift","gifted","girl","girlfriend","give","given","glad","glance","glass","global","glove","goal","gold","golden","golf","good","government","governor","grab","grade","gradually","graduate","grain","grand","grandfather","grandmother","grant","grass","grave","gray","great","greatest","green","grocery","ground","group","grow","growing","growth","guarantee","guard","guess","guest","guide","guideline","guy","habit","habitat","hair","half","hall","hand","handful","handle","hang","happen","happy","hard","hardly","hat","have","head","headline","headquarters","health","healthy","hear","hearing","heart","heat","heaven","heavily","heavy","heel","height","helicopter","hello","help","helpful","here","heritage","hero","herself","hey","hide","high","highlight","highly","highway","hill","himself","hip","hire","historian","historic","historical","history","hit","hold","hole","holiday","holy","home","honest","honey","honor","hope","horizon","horse","hospital","host","hot","hotel","hour","house","household","housing","how","however","huge","human","humor","hundred","hungry","hunter","hunting","husband","hypothesis","ice","idea","ideal","identification","identify","identity","ignore","illustrate","image","imagination","imagine","immediate","immediately","immigrant","immigration","impact","implement","implication","imply","importance","important","impose","impossible","impress","impression","impressive","improve","improvement","incentive","incident","include","including","income","incorporate","increase","increased","increasing","increasingly","incredible","indeed","independence","independent","index","indicate","indication","individual","industrial","industry","infant","inflation","influence","inform","information","ingredient","initial","initially","initiative","inner","innocent","inquiry","inside","insight","insist","inspire","install","instance","instead","institution","institutional","instruction","instructor","instrument","insurance","intellectual","intelligence","intend","intense","intensity","intention","interaction","interest","interested","interesting","internal","international","interpret","interpretation","intervention","interview","into","introduce","introduction","invest","investigate","investigation","investigator","investment","investor","invite","involve","involved","involvement","iron","island","issue","item","its","itself","jacket","jet","job","join","joint","joke","journal","journalist","journey","joy","judge","judgment","juice","jump","junior","jury","just","justice","justify","keep","key","kick","kid","kind","king","kiss","kitchen","knee","knife","knock","know","knowledge","lab","label","labor","laboratory","lady","lake","land","landscape","language","lap","large","largely","last","late","later","latter","laugh","launch","law","lawn","lawsuit","lawyer","lay","layer","lead","leader","leadership","leading","leaf","league","lean","learn","learning","least","leather","leave","left","leg","legacy","legal","legend","legislation","legitimate","lemon","length","less","lesson","let","letter","level","liberal","library","license","lie","life","lifestyle","lifetime","lift","light","like","likely","limit","limitation","limited","line","link","lip","list","listen","literally","literary","literature","little","live","living","load","loan","local","locate","location","lock","long","look","loose","lose","lost","lot","lots","loud","love","lovely","lover","low","lower","luck","lucky","lunch","lung","machine","magazine","mail","main","mainly","maintain","maintenance","major","majority","make","maker","makeup","male","mall","man","manage","management","manager","manner","manufacturer","manufacturing","many","map","margin","mark","market","marketing","marriage","married","marry","mask","mass","massive","master","match","material","math","matter","may","maybe","mayor","meal","mean","meaning","meanwhile","measure","measurement","meat","mechanism","media","medical","medication","medicine","medium","meet","meeting","member","membership","memory","mental","mention","menu","mere","merely","message","metal","meter","method","middle","might","military","milk","million","mind","mine","minister","minor","minority","minute","miracle","mirror","miss","missile","mission","mix","mixture","mode","model","moderate","modern","modest","mom","moment","money","monitor","month","mood","moon","moral","more","moreover","morning","mortgage","most","mostly","mother","motion","motivation","motor","mount","mountain","mouse","mouth","move","movement","movie","much","multiple","muscle","museum","music","musical","musician","must","mutual","myself","mystery","myth","naked","name","narrative","narrow","nation","national","native","natural","naturally","nature","near","nearby","nearly","necessarily","necessary","neck","need","negative","negotiate","negotiation","neighbor","neighborhood","neither","nerve","net","network","never","nevertheless","new","newly","news","newspaper","next","nice","night","nine","nobody","nod","nomination","none","nonetheless","nor","normal","normally","north","northern","nose","not","note","nothing","notice","notion","novel","now","nowhere","nuclear","number","numerous","nurse","nut","object","objective","obligation","observation","observe","observer","obtain","obvious","obviously","occasion","occasionally","occupation","occupy","occur","ocean","odd","odds","off","offer","office","officer","official","often","oil","okay","old","once","one","ongoing","onion","online","only","onto","open","opening","operate","operating","operation","operator","opinion","opponent","opportunity","oppose","opposite","opposition","option","orange","order","ordinary","organic","organization","organize","orientation","origin","original","originally","other","others","otherwise","ought","our","ourselves","out","outcome","outside","oven","over","overall","overcome","overlook","owe","own","owner","pace","pack","package","page","paint","painter","painting","pair","pale","palm","pan","panel","pant","paper","parent","park","parking","part","participant","participate","participation","particular","particularly","partly","partner","partnership","party","pass","passage","passenger","passion","past","patch","path","patient","pattern","pause","pay","payment","peace","peak","peer","people","pepper","per","perceive","percentage","perception","perfect","perfectly","perform","performance","perhaps","period","permanent","permission","permit","person","personal","personality","personally","personnel","perspective","persuade","pet","phase","phenomenon","philosophy","phone","photo","photograph","photographer","phrase","physical","physically","physician","piano","pick","picture","pie","piece","pile","pilot","pine","pink","pipe","pitch","place","plan","plane","planet","planning","plant","plastic","plate","platform","play","player","please","pleasure","plenty","plot","plus","pocket","poem","poet","poetry","point","pole","police","policy","political","politically","politician","politics","poll","pool","pop","popular","population","porch","port","portion","portrait","portray","pose","position","positive","possess","possibility","possible","possibly","post","pot","potato","potential","potentially","pound","pour","powder","power","powerful","practical","practice","pray","prayer","precisely","predict","prefer","preference","pregnancy","pregnant","preparation","prepare","prescription","presence","present","presentation","preserve","president","presidential","press","pretend","pretty","prevent","previous","previously","price","pride","priest","primarily","primary","prime","principal","principle","print","prior","priority","privacy","private","probably","procedure","proceed","process","produce","producer","product","production","profession","professional","professor","profile","profit","program","progress","project","prominent","promise","promote","prompt","proof","proper","properly","property","proportion","proposal","propose","proposed","prosecutor","prospect","protect","protection","protein","protest","proud","prove","provide","provider","province","provision","psychological","psychologist","psychology","public","publication","publicly","publish","publisher","pull","purchase","pure","purpose","pursue","push","put","qualify","quality","quarter","quarterback","question","quick","quickly","quiet","quietly","quit","quite","quote","race","racial","radical","radio","rail","rain","raise","range","rank","rapid","rapidly","rare","rarely","rate","rather","rating","ratio","raw","reach","react","reaction","read","reader","reading","ready","real","reality","realize","really","reason","reasonable","recall","receive","recent","recently","recipe","recognition","recognize","recommend","recommendation","record","recording","recover","recovery","recruit","red","reduce","reduction","refer","reference","reflect","reflection","reform","refugee","refuse","regard","regarding","regardless","regime","region","regional","register","regular","regularly","regulate","regulation","reinforce","relate","relation","relationship","relative","relatively","relax","release","relevant","relief","religion","religious","rely","remain","remaining","remarkable","remember","remind","remote","remove","repeat","repeatedly","replace","reply","report","reporter","represent","representation","representative","reputation","request","require","requirement","research","researcher","resemble","reservation","resident","resist","resolution","resolve","resort","resource","respect","respond","respondent","response","responsibility","responsible","rest","restaurant","restore","restriction","result","retain","retire","retirement","return","reveal","revenue","review","revolution","rhythm","rice","rich","rid","ride","rifle","right","ring","rise","river","road","rock","role","roll","romantic","roof","room","root","rope","rose","roughly","round","route","routine","row","rub","rule","run","running","rural","rush","sacred","safe","safety","sake","salad","salary","sale","sales","salt","same","sample","sanction","sand","satellite","satisfaction","satisfy","sauce","save","saving","say","scale","scenario","scene","schedule","scheme","scholar","scholarship","school","science","scientific","scientist","scope","score","screen","script","sea","search","season","seat","second","secret","secretary","section","sector","secure","security","see","seed","seek","seem","segment","seize","select","selection","self","sell","senator","send","senior","sense","sensitive","sentence","separate","sequence","series","serious","seriously","serve","service","session","set","setting","settle","settlement","seven","several","shade","shadow","shake","shall","shape","share","sharp","sheet","shelf","shell","shelter","shift","shine","ship","shirt","shoe","shop","shopping","shore","short","shortly","shot","should","shoulder","shout","show","shower","shrug","shut","side","sigh","sight","sign","signal","significance","significant","significantly","silence","silent","silver","similar","similarly","simple","simply","since","sing","singer","single","sink","sir","sister","sit","site","situation","six","size","ski","skill","skin","sky","sleep","slice","slide","slight","slightly","slip","slow","slowly","small","smart","smell","smile","smooth","snap","snow","soccer","social","society","soft","software","soil","solar","solid","solution","solve","some","somebody","somehow","someone","something","sometimes","somewhat","somewhere","son","song","soon","sophisticated","sorry","sort","soul","sound","soup","source","south","southern","space","speak","speaker","special","specialist","species","specific","specifically","speech","speed","spend","spending","spin","spirit","spiritual","split","spokesman","sport","spot","spread","spring","square","squeeze","stability","stable","staff","stage","stair","stake","stand","standard","standing","star","stare","start","state","statement","station","statistics","status","stay","steady","steal","steel","step","stick","still","stir","stock","stomach","stone","stop","storage","store","storm","story","straight","strange","stranger","strategic","strategy","stream","street","strength","strengthen","stretch","string","strip","strong","strongly","structure","student","studio","study","stuff","style","subject","submit","subsequent","substance","substantial","succeed","success","successful","successfully","such","sudden","suddenly","sue","sufficient","sugar","suggest","suggestion","suit","summer","summit","sun","super","supply","support","supporter","suppose","supposed","sure","surely","surface","surgery","surprise","surprised","surprising","surprisingly","surround","survey","survival","survive","survivor","sustain","swear","sweep","sweet","swim","swing","switch","symbol","system","table","tablespoon","tactic","tail","take","tale","talent","talk","tall","tank","tap","tape","target","task","taste","tax","taxpayer","tea","teach","teacher","teaching","team","tear","teaspoon","technical","technique","technology","teen","teenager","telephone","telescope","television","tell","temperature","temporary","ten","tend","tendency","tennis","tent","term","terms","territory","test","testify","testimony","testing","text","than","thank","thanks","that","the","theater","their","them","theme","themselves","then","theory","therapy","there","therefore","thick","thin","thing","think","thinking","third","thirty","though","thought","thousand","three","throat","through","throughout","throw","ticket","tie","tight","time","tiny","tip","tire","tired","tissue","title","today","toe","together","tomato","tomorrow","tone","tongue","tonight","too","tool","tooth","top","topic","toss","total","totally","touch","tough","tour","tourist","tournament","tower","town","toy","trace","track","trade","tradition","traditional","traffic","trail","train","training","transfer","transform","transformation","transition","translate","transportation","travel","treat","treatment","treaty","tree","tremendous","trend","trial","tribe","trip","troop","truck","true","truly","trust","truth","try","tube","tunnel","turn","twelve","twenty","twice","twin","two","type","typical","typically","ultimate","ultimately","unable","uncle","under","undergo","understand","understanding","unfortunately","uniform","union","unique","unit","universal","universe","university","unknown","unless","unlike","unlikely","until","unusual","upon","upper","urban","urge","use","used","useful","user","usual","usually","utility","vacation","valley","valuable","value","variable","variation","variety","various","vary","vast","vegetable","vehicle","venture","version","versus","very","vessel","veteran","via","victory","video","view","viewer","village","virtually","virtue","visible","vision","visit","visitor","visual","vital","voice","volume","volunteer","vote","voter","wage","wait","wake","walk","wall","wander","want","warm","warn","warning","wash","watch","water","wave","way","wealth","wealthy","wear","weather","wedding","week","weekend","weekly","weigh","weight","welcome","welfare","well","west","western","wet","what","whatever","wheel","when","whenever","where","whereas","whether","which","while","whisper","white","who","whole","whom","whose","why","wide","widely","widespread","wife","wild","will","willing","win","wind","window","wine","wing","winner","winter","wipe","wire","wisdom","wise","wish","with","withdraw","within","without","witness","woman","wonder","wonderful","wood","wooden","word","work","worker","working","works","workshop","world","worried","worth","would","wrap","write","writer","writing","yard","yeah","year","yell","yellow","yes","yesterday","yield","young","your","yours","yourself","youth","zone"],Me=le((e,t)=>Math.floor(e+Math.random()*(t-e+1)),"random");function F(){return ae[Me(0,ae.length-1)]}g(F,"getRandomWord");le(F,"getRandomWord");var ze=Object.defineProperty,Le=g((e,t)=>ze(e,"name",{value:t,configurable:!0}),"o$1");const Ae=Le(()=>`${F()}-${F()}`,"randomName");var U,ne;function Ge(){return ne||(ne=1,U=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]),U}g(Ge,"requireBuiltinModules");var B,oe;function Ue(){if(oe)return B;oe=1;var e=Object.defineProperty,t=g((o,l)=>e(o,"name",{value:l,configurable:!0}),"i");const r=Ge();var i=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),n=["node_modules","favicon.ico"];function u(o){var l=[],s=[];if(o===null)return s.push("name cannot be null"),p(l,s);if(o===void 0)return s.push("name cannot be undefined"),p(l,s);if(typeof o!="string")return s.push("name must be a string"),p(l,s);if(o.length||s.push("name length must be greater than zero"),o.startsWith(".")&&s.push("name cannot start with a period"),o.startsWith("-")&&s.push("name cannot start with a hyphen"),o.match(/^_/)&&s.push("name cannot start with an underscore"),o.trim()!==o&&s.push("name cannot contain leading or trailing spaces"),n.forEach(function(h){o.toLowerCase()===h&&s.push(h+" is not a valid package name")}),r.includes(o.toLowerCase())&&l.push(o+" is a core module name"),o.length>214&&l.push("name can no longer contain more than 214 characters"),o.toLowerCase()!==o&&l.push("name can no longer contain capital letters"),/[~'!()*]/.test(o.split("/").slice(-1)[0])&&l.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(o)!==o){var w=o.match(i);if(w){var $=w[1],y=w[2];if(y.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent($)===$&&encodeURIComponent(y)===y)return p(l,s)}s.push("name can only contain URL-friendly characters")}return p(l,s)}g(u,"validate"),t(u,"validate");var p=t(function(o,l){var s={validForNewPackages:l.length===0&&o.length===0,validForOldPackages:l.length===0,warnings:o,errors:l};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s},"done");return B=u,B}g(Ue,"requireLib");var Be=Ue();const Ve=Ce(Be);var Fe=Object.defineProperty,I=g((e,t)=>Fe(e,"name",{value:t,configurable:!0}),"r$2");const pe=I(e=>e?Ve(e).validForNewPackages:!1,"isValidPackageName"),T=I(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),Je=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),ue=I(e=>O(e)?_e(e).every(t=>Je.has(t)):!0,"isEmptyDir"),We=I((e,t)=>{const r=_(t,e);return{packageName:T(ve(r)),targetDir:r}},"resolveTargetDir"),He=I(e=>ue(e),"canSafelyOverwrite");var Ye=Object.defineProperty,A=g((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"l$4");const E=A((e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),"ask"),V=A(async(e,t,r=!0)=>{const i=await E(e,` ${t} ${d(r?"[Y/n]":"[y/N]")} `);return i===""?r:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},"confirm"),se=A(async(e,t,r)=>{process.stderr.write(` ${t}
|
|
2
2
|
`);for(const[i,n]of r.entries()){const u=k(x(` ${String(i+1)}.`)),p=n.hint?d(` — ${n.hint}`):"";process.stderr.write(`${u} ${n.label}${p}
|
|
3
3
|
`)}for(;;){const i=await E(e,`
|
|
4
4
|
${d(`Enter choice (1-${String(r.length)}):`)} `),n=Number.parseInt(i,10);if(n>=1&&n<=r.length)return r[n-1].value;const u=r.find(p=>p.value===i||p.label.toLowerCase()===i.toLowerCase());if(u)return u.value;process.stderr.write(` ${d("Invalid choice. Try again.")}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var he=Object.defineProperty;var D=(e,s)=>he(e,"name",{value:s,configurable:!0});import{createRequire as ke}from"node:module";import{I as w,j as v,E as u,q as R,e as x,T as b}from"../packem_shared/Table-
|
|
1
|
+
var he=Object.defineProperty;var D=(e,s)=>he(e,"name",{value:s,configurable:!0});import{createRequire as ke}from"node:module";import{I as w,j as v,E as u,q as R,e as x,T as b}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{M as W,l as F,B as Pe,C as G,z as P}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{s as j,E as ve,d as I}from"./config.js";import{o as re}from"../packem_shared/index-DH-5hsrC.js";import{V as pe,t as te,a3 as C,aO as we,aN as L,an as K,aP as De,b as oe,aW as se,ag as be,a as xe,aX as Ne,aY as Je,aZ as Te,a_ as Se}from"./bin.js";const ye=ke(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$e=D(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[s,o]=z.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return z.getBuiltinModule(e)}return ye(e)},"__cjs_getBuiltinModule"),{readFileSync:ie,writeFileSync:ee}=$e("node:fs");var Re=Object.defineProperty,O=D((e,s)=>Re(e,"name",{value:s,configurable:!0}),"r$3");const We=O(e=>/[*?[\]{}!]/.test(e),"isGlob"),je=O(e=>typeof e=="string"?e:e.reason,"ruleReason"),Me=O(e=>typeof e=="string"?void 0:e.replacement,"ruleReplacement"),ae=O((e,s)=>e.some(o=>re(o,s)),"matchesAnyGlob"),ne=O((e,s)=>{if(typeof e=="string")return!0;const o=Array.isArray(e.packages)&&e.packages.length>0,t=Array.isArray(e.paths)&&e.paths.length>0;return!!(!o&&!t||o&&s.packageName!==void 0&&ae(e.packages,s.packageName)||t&&ae(e.paths,s.packageDir))},"ruleAppliesToInstance"),Ee=O((e,s)=>{const o=s[e.depName];if(o!==void 0&&ne(o,e))return{pattern:e.depName,rule:o};for(const[t,r]of Object.entries(s))if(We(t)&&re(t,e.depName)&&ne(r,e))return{pattern:t,rule:r}},"findMatchingRule"),Fe=O((e,s)=>{if(Object.keys(s).length===0)return[];const o=[];for(const t of e){if(t.isInternal)continue;const r=Ee(t,s);r&&o.push({depName:t.depName,depType:t.depType,matchedPattern:r.pattern,packageDir:t.packageDir,packageJsonPath:t.packageJsonPath,packageName:t.packageName,reason:je(r.rule),replacement:Me(r.rule),specifier:t.specifier})}return o},"lintBannedDeps");var Ie=Object.defineProperty,_=D((e,s)=>Ie(e,"name",{value:s,configurable:!0}),"m");const Ce=new Set(["dependencies","devDependencies","peerDependencies"]),Ve=_(e=>e.startsWith("catalog:"),"isCatalogReference"),Ae=_(e=>e.startsWith("workspace:"),"isWorkspaceReference"),Oe=_((e,s)=>{if(!e)return!1;for(const o of e.values())if(o.has(s))return!0;return!1},"isPinnedInAnyCatalog"),He=_((e,s={})=>{const o=s.min??3,t=new Set(s.ignoreDeps),r=e.filter(i=>i.isInternal||!Ce.has(i.depType)||Ae(i.specifier)||s.dep!==void 0&&i.depName!==s.dep?!1:!t.has(i.depName)),n=new Map;for(const i of r){const p=n.get(i.depName);p?p.push(i):n.set(i.depName,[i])}const a=[];for(const[i,p]of n){if(Oe(s.catalogs,i)||p.some(m=>Ve(m.specifier)))continue;const c=new Map;for(const m of p){let d=c.get(m.specifier);d||(d=new Set,c.set(m.specifier,d)),d.add(m.packageJsonPath)}const f=[...c.entries()].sort((m,d)=>m[1].size!==d[1].size?d[1].size-m[1].size:m[0].localeCompare(d[0]))[0];!f||f[1].size<o||a.push({catalogName:"default",depName:i,instanceCount:f[1].size,specifier:f[0]})}return a.sort((i,p)=>i.depName.localeCompare(p.depName))},"proposeCatalogAdditions"),_e=_((e,s)=>{if(s.length===0)return;const o=W(e,"pnpm-workspace.yaml"),t=F(o)?ie(o,"utf8"):"",r=t.includes(`\r
|
|
2
2
|
`)?`\r
|
|
3
3
|
`:`
|
|
4
4
|
`,n=s.filter(d=>d.catalogName==="default").sort((d,g)=>d.depName.localeCompare(g.depName));if(n.length===0)return;const a=t.length>0?t.split(r):[],i=a.findIndex(d=>/^catalog\s*:\s*$/.test(d));if(i===-1){const d=["catalog:"];for(const $ of n)d.push(` ${$.depName}: "${$.specifier}"`);let g=0;for(;g<a.length&&(a[g]??"").trim().length===0;)g+=1;const h=[...a.slice(0,g),...d,"",...a.slice(g)].join(r);return ee(o,h.endsWith(r)?h:`${h}${r}`),o}let p=a.length;const c=new Set;for(let d=i+1;d<a.length;d+=1){const g=a[d]??"",h=g.trimStart();if(g.length===0)continue;if(g.length-h.length===0&&h.length>0&&!h.startsWith("#")){p=d;break}const $=/^([\w./@-]+)\s*:/.exec(h);$?.[1]&&c.add($[1])}const f=[];for(const d of n)c.has(d.depName)||f.push(` ${d.depName}: "${d.specifier}"`);if(f.length===0)return;const m=[...a.slice(0,p),...f,...a.slice(p)].join(r);return ee(o,m.endsWith(r)?m:`${m}${r}`),o},"applyCatalogProposals"),ze=_((e,s)=>{if(s.length===0)return"";const o=W(e,"pnpm-workspace.yaml"),t=F(o)?ie(o,"utf8"):"",r=[...s].sort((i,p)=>i.depName.localeCompare(p.depName)),n=["--- pnpm-workspace.yaml","+++ pnpm-workspace.yaml"],a=t.includes(`\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Pt=Object.defineProperty;var T=(e,t)=>Pt(e,"name",{value:t,configurable:!0});import{createRequire as It}from"node:module";import{I as we,e as Me,E as v,T as Re,j as ce,q as Te}from"../packem_shared/Table-
|
|
1
|
+
var Pt=Object.defineProperty;var T=(e,t)=>Pt(e,"name",{value:t,configurable:!0});import{createRequire as It}from"node:module";import{I as we,e as Me,E as v,T as Re,j as ce,q as Te}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{m as Ot,a$ as Nt,a5 as s,a6 as u,n as r,l as We,aG as Ft,aH as Mt,aI as Et,aF as zt,w as L,af as Bt,aJ as Lt,aK as Je,b0 as Vt,r as _t,T as ot,h as Gt,a as lt,c as at,j as Ut,v as Ht,f as Kt,p as d,a7 as N,k as Yt,R as Wt,a4 as ct,s as Jt}from"./bin.js";import{M as J,l as Ae,B as qt,a as Xt,C as dt}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{s as pt,b as ei,j as ti}from"./config.js";import{x as Xe,A as ht,L as ii,F as si,T as ri,U as ni,a as oi,I as li}from"./handler41.js";import{A as gt,y as ai}from"../packem_shared/pm-runner-DmKT2FqF.js";import{c as ci}from"../packem_shared/runtime-check-CilFOqUU.js";import{s as di}from"../packem_shared/scan-progress-CTVVf9WW.js";import{f as ui,l as pi,r as hi}from"../packem_shared/dependency-scan-BUbOcMwX.js";import{n as ft}from"../packem_shared/spinner-C8xs6QZv.js";import{g as gi,r as fi}from"../packem_shared/tabs-xZkm6Y_J.js";import{u as mi}from"../packem_shared/use-measured-height-Lea6TCVD.js";import{s as xi}from"../packem_shared/verify-cLcZwKqe.js";const Dt=It(import.meta.url),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nt=T(e=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[t,i]=Se.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return Se.getBuiltinModule(e)}return Dt(e)},"__cjs_getBuiltinModule"),{statSync:Qt,rmSync:qe,writeFileSync:Zt,readFileSync:ut}=nt("node:fs"),{spawnSync:Ee}=nt("node:child_process");var yi=Object.defineProperty,Pe=T((e,t)=>yi(e,"name",{value:t,configurable:!0}),"r$2");const Ve=Pe(()=>J(Ot(),"doctor"),"getCacheDirectory"),ki=1800*1e3,Qe=Pe(e=>{if(!e)return"";try{return String(Qt(e).mtimeMs)}catch{return""}},"safeMtime"),wi=2,vi=Pe(e=>{const t=JSON.stringify({configMtime:Qe(e.configPath),lockfileMtime:Qe(e.lockfilePath),schema:wi,sections:[...e.sections].toSorted(),socketEnabled:e.socketEnabled,workspaceRoot:e.workspaceRoot});return Nt(Buffer.from(t))},"buildDoctorCacheKey"),bi=Pe(e=>{const t=J(Ve(),`${e}.json`);if(Ae(t))try{const i=pt(t);if(Date.now()-i.createdAt>i.ttlMs){qe(t,{force:!0});return}return{...i.results,sections:new Set(i.results.sections)}}catch{qe(t,{force:!0});return}},"readDoctorCache"),ji=Pe((e,t,i=ki)=>{ei(Ve());const o={createdAt:Date.now(),results:{...t,sections:[...t.sections]},ttlMs:i};Zt(J(Ve(),`${e}.json`),JSON.stringify(o,void 0,2),"utf8")},"writeDoctorCache");var $i=Object.defineProperty,M=T((e,t)=>$i(e,"name",{value:t,configurable:!0}),"n$1");const Oe="orphans",Si=M(()=>{if(process.platform!=="linux")return{id:"inotify",message:"inotify capacity check skipped (not Linux).",status:"skip"};let e;try{const t=ut("/proc/sys/fs/inotify/max_user_watches","utf8").trim(),i=Number.parseInt(t,10);Number.isFinite(i)&&i>0&&(e=i)}catch{return{id:"inotify",message:"Could not read /proc/sys/fs/inotify/max_user_watches.",status:"warn"}}return e===void 0?{id:"inotify",message:"inotify max_user_watches reported a non-numeric value.",status:"warn"}:e<65536?{detail:{maxWatches:e},id:"inotify",message:`inotify watcher limit is ${String(e)} — large monorepos can exhaust this. Bump now with \`sudo sysctl fs.inotify.max_user_watches=524288\` and persist via \`/etc/sysctl.d/99-vis.conf\` so it survives reboot.`,status:"warn"}:{detail:{maxWatches:e},id:"inotify",message:`inotify capacity OK (${String(e)} watches).`,status:"ok"}},"checkInotifyCapacity"),Ci=M(()=>{const e=!!process.stdin.isTTY,t=!!process.stdout.isTTY;return e&&t?{id:"tty",message:"Interactive TTY available — watch keybinds enabled.",status:"ok"}:!e&&!t?{id:"tty",message:"No TTY on stdin/stdout — running in CI / piped mode (keybinds disabled).",status:"skip"}:{detail:{stdin:String(e),stdout:String(t)},id:"tty",message:e?"stdin is a TTY but stdout is not — output is being captured; keybinds still work.":"stdout is a TTY but stdin is not — keybinds disabled (input is piped).",status:"skip"}},"checkTtyAvailability"),Ri=M(()=>{const e=process.pid;try{return process.platform==="win32"?yt(e):xt(e)}catch{return[]}},"listOrphanPids"),Ti=M(()=>{const e=process.pid;let t;try{t=process.platform==="win32"?yt(e):xt(e)}catch{return{id:Oe,message:"Could not enumerate processes (ps/tasklist failed).",status:"warn"}}if(t.length===0)return{id:Oe,message:"No orphaned vis/task-runner processes detected.",status:"ok"};if(t.length<=2)return{detail:{count:t.length,pids:t.join(",")},id:Oe,message:`${String(t.length)} possibly orphaned process(es) detected (PIDs: ${t.join(", ")}). Likely benign.`,status:"skip"};const i=process.platform==="win32"?t.map(o=>`taskkill /F /PID ${String(o)}`).join(" & "):`kill ${t.join(" ")}`;return{detail:{count:t.length,pids:t.join(",")},id:"orphans",message:`${String(t.length)} possibly orphaned vis/task-runner processes — run \`vis doctor --fix\` to clean them up, or kill them manually: ${i}`,status:"warn"}},"checkOrphanedRunners"),Ai=M((e={})=>{const t=e.enumerate??Ri,i=e.force===!0?"SIGKILL":"SIGTERM",o=e.kill??Ni,n=t(),l=[],c=[];for(const p of n)try{o(p,i),l.push(p)}catch(a){const g=a.code??a.message;if(g==="ESRCH"){l.push(p);continue}c.push({pid:p,reason:g})}return{failed:c,killed:l}},"killOrphanedRunners"),Pi=M(e=>Ee("taskkill",e,{encoding:"utf8"}),"defaultTaskkillRunner"),Ii=M((e,t)=>{process.kill(e,t)},"defaultProcessKill"),Di=M((e,t,i=Pi)=>{const o=t==="SIGKILL"?["/F","/PID",String(e)]:["/PID",String(e)],n=i(o);if(n.error)throw n.error;if(typeof n.status=="number"&&n.status!==0){const l=n.status===128?"ESRCH":`taskkill exited with code ${String(n.status)}`,c=new Error(l);throw c.code=l,c}},"killViaTaskkill"),Oi=M((e,t,i=Ii)=>{i(e,t)},"killViaSignal"),Ni=M((e,t)=>{if(process.platform==="win32"){Di(e,t);return}Oi(e,t)},"defaultKill"),mt=M((e,t)=>{const i=Ee(e,t,{encoding:"utf8"});if(i.error)throw i.error;if(typeof i.status=="number"&&i.status!==0)throw new Error(`${e} exited with code ${String(i.status)}`);return typeof i.stdout=="string"?i.stdout:""},"runProcessListing"),xt=M(e=>{const t=mt("ps",["-Ao","pid=,command="]),i=[];for(const o of t.split(`
|
|
2
2
|
`)){if(o.length===0)continue;const n=/^\s*(\d+)\s+(.+)$/.exec(o);if(!n)continue;const l=Number.parseInt(n[1]??"",10),c=(n[2]??"").toLowerCase();!Number.isFinite(l)||l===e||(/(?:^|[ /])vis-native(?:\s|$|[-.])/.test(c)||/(?:^|[ /])vis\s+run\b/.test(c)||/(?:^|[ /])task-runner(?:\s|$|[-.])/.test(c))&&i.push(l)}return i},"listOrphansUnix"),yt=M(e=>{const t=mt("tasklist",["/FO","CSV","/NH"]),i=[];for(const o of t.split(/\r?\n/)){if(o.length===0)continue;const n=o.split(/","/).map(p=>p.replaceAll(/^"|"$/g,"")),l=(n[0]??"").toLowerCase(),c=Number.parseInt(n[1]??"",10);!Number.isFinite(c)||c===e||(l==="vis.exe"||l.startsWith("vis-native")||l.includes("task-runner"))&&i.push(c)}return i},"listOrphansWindows"),Fi=M(()=>{let e;try{const t=Ee("watchman",["--version"],{encoding:"utf8",timeout:2e3});if(t.error||typeof t.status=="number"&&t.status!==0)throw t.error??new Error("watchman exited non-zero");e=typeof t.stdout=="string"?t.stdout.trim():void 0}catch{return{id:"watchman",message:"Watchman not found — `vis` uses native fs.watch (fine for small repos). Install Watchman + `fb-watchman` to scale watch mode on large monorepos.",status:"skip"}}return{detail:e?{version:e}:void 0,id:"watchman",message:e?`Watchman available (${e}) — scalable watch backend in use.`:"Watchman available — scalable watch backend in use.",status:"ok"}},"checkWatchmanAvailability"),Mi=M((e=process.cwd())=>{let t="";try{t=ut(J(e,".gitattributes"),"utf8")}catch(i){if(i.code!=="ENOENT")return{id:"git-lfs",message:"Could not read .gitattributes.",status:"warn"}}if(!t.includes("filter=lfs"))return{id:"git-lfs",message:"No Git LFS tracking declared in .gitattributes.",status:"skip"};try{const i=Ee("git",["lfs","version"],{encoding:"utf8",timeout:2e3});if(i.error||typeof i.status=="number"&&i.status!==0)throw i.error??new Error("git-lfs not available")}catch{return{id:"git-lfs",message:"Repo tracks files via Git LFS but `git-lfs` is not installed — checked-out LFS files are pointer stubs, not real content. Install git-lfs and run `git lfs pull`.",status:"warn"}}return{id:"git-lfs",message:"Git LFS tracking declared and `git-lfs` is installed.",status:"ok"}},"checkGitLfsTracking"),Ei=M(e=>[Si(),Ci(),Fi(),Mi(e),Ti()],"runRuntimeDiagnostics");var zi=Object.defineProperty,ke=T((e,t)=>zi(e,"name",{value:t,configurable:!0}),"s$2");const ye=[{id:"dependencies",label:"Deps"},{id:"security",label:"Security"},{id:"optimization",label:"Optimize"},{id:"runtime",label:"Runtime"}],Fe=["dependencies","security","optimization","runtime"],me=ke(e=>{const t=new Map;for(const i of Fe)t.set(i,[]);for(const i of e)t.get(i.section).push(i);for(const[i,o]of t)o.length===0&&t.delete(i);return t},"groupBySection"),xe=ke((e,t,i,o)=>{let n=e.filter(l=>l.section===t);if(o&&(n=n.filter(l=>l.severity===o)),i){const l=i.toLowerCase();n=n.filter(c=>c.title.toLowerCase().includes(l))}return[...n]},"filterFindings"),Bi=ke(e=>{const t={dependencies:"idle",optimization:"idle",runtime:"idle",security:"idle"};for(const i of Fe)e.has(i)&&(t[i]="idle");return t},"initialStatus");class Ze{static{T(this,"DoctorStore")}static{ke(this,"DoctorStore")}#e;#i=new Set;constructor(t=[]){const i=Array.isArray(t)?{findings:t}:t,o=i.findings??[],n=i.activeSections??new Set(Fe),l=Fe.find(a=>n.has(a))??"dependencies",c=xe(o,l,"",void 0),p=Bi(n);if(o.length>0)for(const a of o)p[a.section]="done";this.#e={all:o,entries:c,filterActive:!1,filterText:"",filterType:l,focusedPanel:"list",grouped:me(c),pendingAction:void 0,sectionError:{},sectionMessage:{},sectionStatus:p,selectedIndex:0,severityFilter:void 0}}getSnapshot=ke(()=>this.#e,"getSnapshot");subscribe=ke(t=>(this.#i.add(t),()=>{this.#i.delete(t)}),"subscribe");setSelectedIndex(t){const i=Math.max(0,Math.min(t,this.#e.entries.length-1));i!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:i})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}setFilterType(t){if(t===this.#e.filterType)return;const i=xe(this.#e.all,t,this.#e.filterText,this.#e.severityFilter);this.#t({...this.#e,entries:i,filterType:t,grouped:me(i),selectedIndex:0})}setFilter(t){const i=xe(this.#e.all,this.#e.filterType,t,this.#e.severityFilter);this.#t({...this.#e,entries:i,filterText:t,grouped:me(i),selectedIndex:0})}setFilterActive(t){if(t===this.#e.filterActive)return;if(t){this.#t({...this.#e,filterActive:!0});return}const i=xe(this.#e.all,this.#e.filterType,"",this.#e.severityFilter);this.#t({...this.#e,entries:i,filterActive:!1,filterText:"",grouped:me(i),selectedIndex:0})}setPendingAction(t){this.#t({...this.#e,pendingAction:t})}setSeverityFilter(t){if(t===this.#e.severityFilter)return;const i=xe(this.#e.all,this.#e.filterType,this.#e.filterText,t);this.#t({...this.#e,entries:i,grouped:me(i),selectedIndex:0,severityFilter:t})}startSection(t,i){this.#t({...this.#e,sectionMessage:{...this.#e.sectionMessage,[t]:i},sectionStatus:{...this.#e.sectionStatus,[t]:"running"}})}completeSection(t,i){const o=[...this.#e.all,...i],n=xe(o,this.#e.filterType,this.#e.filterText,this.#e.severityFilter),l={...this.#e.sectionMessage};delete l[t],this.#t({...this.#e,all:o,entries:n,grouped:me(n),sectionMessage:l,sectionStatus:{...this.#e.sectionStatus,[t]:"done"}})}failSection(t,i){this.#t({...this.#e,sectionError:{...this.#e.sectionError,[t]:i},sectionStatus:{...this.#e.sectionStatus,[t]:"error"}})}#t(t){this.#e=t;for(const i of this.#i)try{i()}catch{}}}var Li=Object.defineProperty,kt=T((e,t)=>Li(e,"name",{value:t,configurable:!0}),"r$1");const et={error:0,warn:1},Vi=kt(e=>!!e.acceptedRisk,"isAcknowledged"),wt=kt(e=>{const t=[];if(e.sections.has("dependencies")){for(const i of e.outdated)t.push({entry:i,id:`outdated:${i.packageName}`,kind:"outdated",section:"dependencies",severity:"warn",subtitle:`${i.currentRange} → ${i.newRange} (${i.updateType})`,title:i.packageName});for(const i of e.duplicates)t.push({id:`duplicate:${i.name}`,kind:"duplicate",pkg:i,section:"dependencies",severity:"warn",subtitle:`${String(i.versions.length)} versions installed`,title:i.name})}if(e.sections.has("security"))for(const i of e.outdated){if(i.vulnerabilities&&i.vulnerabilities.length>0){const o=i.vulnerabilities[0],n=Vi(i)?"warn":"error",l=i.vulnerabilities.length;t.push({entry:i,id:`vuln:${i.packageName}`,kind:"vulnerability",packageName:i.packageName,section:"security",severity:n,subtitle:l===1?`${o.severity} · ${o.id}`:`${String(l)} advisories · top: ${o.severity} ${o.id}`,title:i.packageName})}if(i.socketReport&&i.socketReport.alerts.length>0){const o=Math.round(i.socketReport.score.overall*100);t.push({entry:i,id:`socket:${i.packageName}`,kind:"socket",packageName:i.packageName,section:"security",severity:"warn",subtitle:`${String(i.socketReport.alerts.length)} alert${i.socketReport.alerts.length===1?"":"s"} · score ${String(o)}%`,title:i.packageName})}}if(e.sections.has("optimization"))for(const i of e.optimizations)t.push({entry:i,id:`opt:${i.packageName}`,kind:"optimization",section:"optimization",severity:"warn",subtitle:`${i.category} → ${i.replacement}`,title:i.packageName});if(e.sections.has("runtime"))for(const i of e.runtime)i.status==="warn"&&t.push({diagnostic:i,id:`runtime:${i.id}`,kind:"runtime",section:"runtime",severity:"warn",title:i.message});return t.sort((i,o)=>{if(i.section!==o.section){const n=["dependencies","security","optimization","runtime"];return n.indexOf(i.section)-n.indexOf(o.section)}return et[i.severity]-et[o.severity]}),t},"flattenFindings"),vt={dependencies:"Dependencies",optimization:"Optimization",runtime:"Runtime",security:"Security"};var _i=Object.defineProperty,Gi=T((e,t)=>_i(e,"name",{value:t,configurable:!0}),"a$2");const Ui={error:"red",warn:"yellow"},Hi={error:"✖",warn:"⚠"},Ki={error:" ERROR ",warn:" WARN "},Yi=Gi(({children:e,hint:t,message:i,severity:o,title:n})=>{const l=Ui[o];return s.jsxs(u,{borderColor:l,borderStyle:"single",flexDirection:"column",flexShrink:0,paddingX:1,children:[s.jsxs(u,{gap:1,children:[s.jsx(r,{backgroundColor:l,bold:!0,color:"black",children:Ki[o]}),s.jsx(r,{bold:!0,color:l,children:Hi[o]}),s.jsx(r,{bold:!0,wrap:"truncate-end",children:n})]}),s.jsx(r,{wrap:"truncate-end",children:i}),t?s.jsx(r,{dimColor:!0,wrap:"truncate-end",children:t}):null,e]})},"ConfigBanner");var Wi=Object.defineProperty,te=T((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"d$2");const Ji={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},qi={critical:"red",high:"red",low:"gray",medium:"yellow"},Xi={major:"red",minor:"yellow",patch:"green"},R=te(({children:e,label:t,width:i=14})=>s.jsxs(u,{children:[s.jsx(u,{width:i,children:s.jsxs(r,{dimColor:!0,children:[t,":"]})}),typeof e=="string"?s.jsx(r,{children:e}):e]}),"FieldRow"),ne=te(({children:e})=>s.jsx(u,{marginTop:1,children:s.jsx(r,{bold:!0,color:"white",children:e})}),"SectionTitle"),Qi=te(({finding:e})=>{const{entry:t}=e,i=Xi[t.updateType]??"white";return s.jsxs(u,{flexDirection:"column",children:[s.jsx(R,{label:"Current",children:t.currentRange}),s.jsxs(R,{label:"Target",children:[s.jsx(r,{children:t.newRange}),s.jsxs(r,{bold:!0,color:i,children:[" (",t.updateType,")"]})]}),s.jsx(R,{label:"Catalog",children:t.catalogName}),t.acceptedRisk?s.jsx(R,{label:"Risk ack",children:s.jsx(r,{dimColor:!0,children:t.acceptedRisk.reason??"(no reason recorded)"})}):null,s.jsx(ne,{children:"Action"}),s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis update"})," ","to apply this change."]})]})},"OutdatedDetail"),Zi=te(({finding:e})=>s.jsxs(u,{flexDirection:"column",children:[s.jsx(R,{label:"Versions",children:s.jsx(r,{children:String(e.pkg.versions.length)})}),s.jsx(ne,{children:"Installed versions"}),e.pkg.versions.map(t=>s.jsxs(r,{children:[" · ",t]},t)),s.jsx(ne,{children:"Action"}),s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis dedupe"})," ","to consolidate to a single resolution."]})]}),"DuplicateDetail"),es=te(({finding:e})=>{const t=e.entry.vulnerabilities??[];return s.jsxs(u,{flexDirection:"column",children:[s.jsx(R,{label:"Package",children:e.packageName}),s.jsx(R,{label:"Current",children:e.entry.currentRange}),s.jsx(R,{label:"Advisories",children:String(t.length)}),e.entry.acceptedRisk?s.jsx(R,{label:"Risk ack",children:s.jsx(r,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,t.map(i=>{const o=Ji[i.severity]??"gray";return s.jsxs(u,{flexDirection:"column",marginTop:1,children:[s.jsxs(u,{children:[s.jsx(r,{bold:!0,color:o,children:i.severity}),s.jsx(r,{children:" "}),s.jsx(r,{children:i.id}),typeof i.cvssScore=="number"?s.jsxs(r,{dimColor:!0,children:[" · CVSS ",i.cvssScore.toFixed(1)]}):null]}),s.jsx(r,{wrap:"wrap",children:i.summary}),i.fixedVersions.length>0?s.jsxs(r,{dimColor:!0,children:["Fixed in: ",i.fixedVersions.join(", ")]}):null,i.aliases&&i.aliases.length>0?s.jsxs(r,{dimColor:!0,children:["Aliases: ",i.aliases.join(", ")]}):null]},i.id)})]})},"VulnerabilityDetail"),ts=te(({finding:e})=>{const t=e.entry.socketReport;if(!t)return s.jsx(r,{dimColor:!0,children:"No Socket report attached."});const i=Math.round(t.score.overall*100),o=We(t.score.overall);return s.jsxs(u,{flexDirection:"column",children:[s.jsx(R,{label:"Package",children:e.packageName}),s.jsx(R,{label:"Overall",children:s.jsxs(r,{color:o,children:[String(i),"%"]})}),s.jsx(R,{label:"Alerts",children:String(t.alerts.length)}),e.entry.acceptedRisk?s.jsx(R,{label:"Risk ack",children:s.jsx(r,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,s.jsx(ne,{children:"Score breakdown"}),Object.entries(t.score).map(([n,l])=>{if(n==="overall")return null;const c=typeof l=="number"?l:0,p=Math.round(c*100),a=We(c);return s.jsxs(u,{children:[s.jsx(u,{width:14,children:s.jsxs(r,{dimColor:!0,children:[n,":"]})}),s.jsxs(r,{color:a,children:[String(p),"%"]})]},n)}),s.jsx(ne,{children:"Alerts"}),t.alerts.map((n,l)=>{const c=qi[n.severity]??"gray";return s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{children:[s.jsx(r,{bold:!0,color:c,children:n.severity}),s.jsx(r,{children:" "}),s.jsx(r,{children:n.type})]}),n.props?s.jsx(r,{dimColor:!0,wrap:"wrap",children:JSON.stringify(n.props)}):null]},`${n.type}-${String(l)}`)})]})},"SocketDetail"),is=te(({finding:e})=>{const{entry:t}=e;return s.jsxs(u,{flexDirection:"column",children:[s.jsx(R,{label:"Package",children:t.packageName}),s.jsx(R,{label:"Category",children:t.category}),s.jsx(R,{label:"Replacement",children:t.replacement}),t.overrideSpec?s.jsx(R,{label:"Override",children:t.overrideSpec}):null,s.jsx(R,{label:"Codemod",children:s.jsx(r,{color:t.hasCodemod?"green":"gray",children:t.hasCodemod?"available":"not available"})}),t.docUrl?s.jsx(R,{label:"Guide",children:s.jsx(r,{color:"cyan",underline:!0,children:t.docUrl})}):null,s.jsx(ne,{children:"Action"}),t.hasCodemod?s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis optimize"})," ","to apply the codemod interactively."]}):t.overrideSpec?s.jsxs(r,{dimColor:!0,children:["Run"," ",s.jsx(r,{bold:!0,color:"white",children:"vis optimize"})," ","to install the package override."]}):t.docUrl?s.jsx(r,{dimColor:!0,children:"No automated codemod. Open the migration guide above for the recommended alternative and steps."}):s.jsx(r,{dimColor:!0,children:"No automated codemod. Consult the package's docs or the e18e module-replacements guide for an alternative."})]})},"OptimizationDetail"),ss=te(({finding:e})=>{const{diagnostic:t}=e,i=t.status==="warn"?"yellow":t.status==="ok"?"green":"gray";return s.jsxs(u,{flexDirection:"column",children:[s.jsx(R,{label:"Check",children:t.id}),s.jsx(R,{label:"Status",children:s.jsx(r,{color:i,children:t.status})}),s.jsx(ne,{children:"Message"}),s.jsx(r,{wrap:"wrap",children:t.message}),t.detail&&Object.keys(t.detail).length>0?s.jsxs(s.Fragment,{children:[s.jsx(ne,{children:"Details"}),Object.entries(t.detail).map(([o,n])=>s.jsxs(u,{children:[s.jsx(u,{width:20,children:s.jsxs(r,{dimColor:!0,children:[o,":"]})}),s.jsx(r,{children:String(n)})]},o))]}):null]})},"RuntimeDetail"),rs=te(({finding:e,focused:t,scrollRef:i})=>{const o=t?"white":"gray";if(!e)return s.jsx(u,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:s.jsx(r,{dimColor:!0,children:"No finding selected"})});let n;switch(e.kind){case"duplicate":{n=s.jsx(Zi,{finding:e});break}case"optimization":{n=s.jsx(is,{finding:e});break}case"outdated":{n=s.jsx(Qi,{finding:e});break}case"runtime":{n=s.jsx(ss,{finding:e});break}case"socket":{n=s.jsx(ts,{finding:e});break}case"vulnerability":{n=s.jsx(es,{finding:e});break}default:{n=s.jsx(r,{dimColor:!0,children:"Unknown finding kind."});break}}return s.jsxs(u,{borderColor:o,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[s.jsxs(u,{flexShrink:0,paddingTop:1,paddingX:2,children:[s.jsx(r,{bold:!0,color:"white",children:e.title}),s.jsxs(r,{dimColor:!0,children:[" ",vt[e.section]]})]}),s.jsxs(Ft,{flexGrow:1,flexShrink:1,paddingX:2,ref:i,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[s.jsx(r,{}),n]})]})},"DoctorDetailPanel");var ns=Object.defineProperty,Ie=T((e,t)=>ns(e,"name",{value:t,configurable:!0}),"c$2");const bt={error:"red",warn:"yellow"},os={error:"✖",warn:"⚠"},ls=Ie(e=>e.kind==="outdated"||e.kind==="vulnerability"||e.kind==="socket"?!!e.entry.acceptedRisk:!1,"hasAcceptedRisk"),as=Ie(({finding:e,isSelected:t})=>{const i=bt[e.severity],o=ls(e);return s.jsxs(u,{flexShrink:0,height:1,children:[s.jsx(r,{children:t?">":" "}),s.jsxs(r,{color:i,children:[" ",os[e.severity]," "]}),s.jsx(u,{flexGrow:1,children:s.jsx(r,{bold:t,inverse:t,wrap:"truncate",children:e.title})}),o?s.jsx(r,{color:"cyan",children:" ack"}):null,e.subtitle?s.jsxs(r,{dimColor:!0,wrap:"truncate",children:[" ",e.subtitle]}):null]})},"FindingRow"),cs=Ie(({count:e,section:t})=>s.jsxs(u,{flexShrink:0,height:1,marginTop:1,children:[s.jsx(r,{dimColor:!0,children:"▼ "}),s.jsx(r,{bold:!0,color:"white",children:vt[t].toUpperCase()}),s.jsxs(r,{dimColor:!0,children:[" (",e,")"]})]}),"SectionHeader"),ds=Ie(({count:e,label:t,status:i})=>s.jsxs(r,{children:[t,i==="running"?s.jsxs(r,{children:[" ",s.jsx(ft,{type:"dots"})]}):null,i==="error"?s.jsx(r,{bold:!0,color:"red",children:" ✖"}):s.jsxs(r,{dimColor:!0,children:[" (",String(e),")"]})]}),"TabLabel"),us=Ie(({elapsedMs:e,entries:t,filterActive:i,filterText:o,filterType:n,focused:l,fromCache:c=!1,grouped:p,onViewportHeightChange:a,scrollOffset:g,sectionCounts:y,sectionMessage:w,sectionStatus:A,selectedIndex:E,severityFilter:h,totalAll:P,viewportHeight:z})=>{const q=l?"white":"gray",{measuredHeight:V,ref:B}=mi(z,a);let S=0,G=0;for(const b of t)b.severity==="error"?S+=1:b.severity==="warn"&&(G+=1);const U=[];S>0&&U.push(`${String(S)} error${S===1?"":"s"}`),G>0&&U.push(`${String(G)} warn${G===1?"":"s"}`);const oe=U.length>0?` (${U.join(", ")})`:"",ie=(e/1e3).toFixed(1),_=[];for(const[b,j]of p){_.push(s.jsx(cs,{count:j.length,section:b},`hdr-${b}`));for(const X of j){const C=t.indexOf(X);_.push(s.jsx(as,{finding:X,isSelected:C===E},X.id))}}let F=0;for(const[,b]of p)F+=2+b.length;const K=F>V&&V>0;return s.jsxs(u,{borderColor:q,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[s.jsxs(u,{flexShrink:0,gap:1,paddingX:1,children:[s.jsx(r,{bold:!0,inverse:!0,children:" DOCTOR "}),s.jsxs(r,{wrap:"truncate",children:[t.length,t.length===P?"":`/${String(P)}`," finding",t.length===1?"":"s",oe]}),h?s.jsx(r,{bold:!0,color:bt[h],inverse:!0,children:` ${h.toUpperCase()} ONLY `}):null,c?s.jsx(r,{bold:!0,color:"cyan",inverse:!0,children:" CACHED "}):null,s.jsxs(r,{dimColor:!0,children:[" · ",ie,"s"]})]}),s.jsx(u,{flexShrink:0,paddingX:1,paddingY:1,children:s.jsx(gi,{isFocused:l,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:T(()=>{},"onChange"),showIndex:!1,value:n,children:ye.map(({id:b,label:j})=>s.jsx(fi,{name:b,children:s.jsx(ds,{count:y[b],label:j,status:A[b]})},b))})}),(()=>{const b=Object.keys(A).filter(j=>A[j]==="running"&&w[j]).map(j=>w[j]);return b.length===0?null:s.jsx(u,{flexShrink:0,paddingX:1,children:s.jsxs(r,{dimColor:!0,wrap:"truncate",children:[s.jsx(ft,{type:"dots"})," ",b.join(" · ")]})})})(),i&&s.jsxs(u,{flexShrink:0,paddingX:1,children:[s.jsx(r,{bold:!0,color:"white",children:"/ "}),s.jsx(r,{children:o}),s.jsx(r,{inverse:!0,children:" "})]}),s.jsxs(u,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:B,children:[s.jsx(u,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:s.jsx(u,{flexDirection:"column",marginTop:-g,children:_.length>0?_:s.jsx(u,{marginTop:1,children:s.jsx(r,{dimColor:!0,children:"No findings match the current filter."})})})}),K&&s.jsx(u,{flexShrink:0,marginLeft:1,marginRight:1,children:s.jsx(Mt,{contentHeight:F,placement:"inset",scrollOffset:g,style:"block",viewportHeight:V})})]},`list-${n}-${o}`)]})},"DoctorListPanel");var ps=Object.defineProperty,ze=T((e,t)=>ps(e,"name",{value:t,configurable:!0}),"g$1");const hs=ze(e=>{if(e.kind==="outdated")return{command:`vis update ${e.entry.packageName}`,description:`Update ${e.entry.packageName} to ${e.entry.newRange}`};if(e.kind==="duplicate")return{command:`vis dedupe ${e.pkg.name}`,description:`Dedupe ${e.pkg.name} (${String(e.pkg.versions.length)} versions)`}},"buildUpdateAction"),gs=ze(e=>{if(e.kind==="optimization")return{command:`vis optimize ${e.entry.packageName}`,description:`Replace ${e.entry.packageName} with ${e.entry.replacement}`}},"buildOptimizeAction"),fs=ze(e=>{if(e.kind!=="outdated"&&e.kind!=="vulnerability"&&e.kind!=="socket")return;const t=e.kind==="outdated"?e.entry.packageName:e.packageName,i=["// Add to vis.config.ts:","security: {"," acceptedRisks: {",` "${t}": {`,' reason: "explain why this risk is acceptable",',' expiresAt: "YYYY-MM-DD",'," },"," },","},"].join(`
|
|
3
3
|
`);return{command:i,configSnippet:i,description:`Acknowledge risk for ${t}`}},"buildAckAction"),ms=100,xs=40,ys=10,ks=ze(({autoExitSeconds:e=0,banner:t,fromCache:i=!1,startedAt:o,store:n})=>{const{exit:l}=Et(),{columns:c,rows:p}=zt(),a=L.useSyncExternalStore(n.subscribe,n.getSnapshot),[g,y]=L.useState(!1),[w,A]=L.useState(!1),[E,h]=L.useState(0),[P,z]=L.useState(()=>Date.now());L.useEffect(()=>{const x=setInterval(()=>{z(Date.now())},1e3);return()=>{clearInterval(x)}},[]);const q=P-o,V=L.useRef(null),B=L.useRef(null),S=a.entries[a.selectedIndex]??null,G=L.useMemo(()=>{const x={dependencies:0,optimization:0,runtime:0,security:0};for(const m of a.all)x[m.section]+=1;return x},[a.all]),U=t?t.hint?5:4:0,oe=L.useMemo(()=>{for(const x of Object.keys(a.sectionStatus))if(a.sectionStatus[x]==="running"&&a.sectionMessage[x])return 1;return 0},[a.sectionStatus,a.sectionMessage]),ie=c>=ms,_=ie?Math.max(1,p-U-2):Math.floor(p*.55),F=Math.max(1,_-6-oe-(a.filterActive?1:0)),[K,b]=L.useState(F),j=K>0?K:F,X=L.useMemo(()=>{let x=0;for(const[,m]of a.grouped)x+=2+m.length;return x},[a.grouped]),C=Math.max(0,X-j),le=Math.min(E,C),ue=L.useCallback(x=>{let m=0,k=0;for(const[,$e]of a.grouped){m+=2;for(let ae=0;ae<$e.length;ae++){if(k===x)return m;m+=1,k+=1}}return m},[a.grouped]),I=L.useCallback(x=>{const m=ue(x);h(k=>m>k+j-2?Math.min(C,Math.max(0,m-j+2)):m<k+1?Math.max(0,m-1):k)},[ue,j,C]);if(L.useEffect(()=>{B.current?.scrollToTop()},[S?.id]),Bt((x,m)=>{if(x==="c"&&m.ctrl){l();return}if(!w){if(g){m.escape||x==="?"?y(!1):x==="q"?(y(!1),A(!0)):m.downArrow||x==="j"?V.current?.scrollBy(1):(m.upArrow||x==="k")&&V.current?.scrollBy(-1);return}if(x==="?"){y(!0);return}if(x==="q"){A(!0);return}if(m.tab){n.setFocusedPanel(a.focusedPanel==="list"?"detail":"list");return}if(a.filterActive){if(m.escape||m.return){n.setFilterActive(!1);return}if(m.backspace){h(0),n.setFilter(a.filterText.slice(0,-1));return}x&&!m.ctrl&&!m.meta&&(h(0),n.setFilter(a.filterText+x));return}if(a.focusedPanel==="list"&&(m.leftArrow||m.rightArrow)){const k=ye.findIndex(ae=>ae.id===a.filterType),$e=m.rightArrow?(k+1)%ye.length:(k-1+ye.length)%ye.length;h(0),B.current?.scrollToTop(),n.setFilterType(ye[$e].id);return}if(a.focusedPanel==="list"){if(m.downArrow||x==="j"){const k=Math.min(a.selectedIndex+1,a.entries.length-1);n.setSelectedIndex(k),I(k);return}if(m.upArrow||x==="k"){const k=Math.max(a.selectedIndex-1,0);n.setSelectedIndex(k),I(k);return}if(m.pageDown){const k=Math.min(a.selectedIndex+10,a.entries.length-1);n.setSelectedIndex(k),I(k);return}if(m.pageUp){const k=Math.max(a.selectedIndex-10,0);n.setSelectedIndex(k),I(k);return}if(m.home){n.setSelectedIndex(0),h(0);return}if(m.end){const k=a.entries.length-1;n.setSelectedIndex(k),I(k);return}if(x==="/"){n.setFilterActive(!0);return}if(x==="e"){n.setSeverityFilter(a.severityFilter==="error"?void 0:"error"),h(0);return}if(x==="w"){n.setSeverityFilter(a.severityFilter==="warn"?void 0:"warn"),h(0);return}if(x==="u"&&S){const k=hs(S);k&&(n.setPendingAction(k),l());return}if(x==="o"&&S){const k=gs(S);k&&(n.setPendingAction(k),l());return}if(x==="a"&&S){const k=fs(S);k&&(n.setPendingAction(k),l());return}if(x==="d"){n.setFocusedPanel("detail");return}return}if(m.escape||m.leftArrow){n.setFocusedPanel("list");return}if(m.downArrow||x==="j"){B.current?.scrollBy(1);return}if(m.upArrow||x==="k"){B.current?.scrollBy(-1);return}if(m.pageDown){B.current?.scrollBy(10);return}if(m.pageUp){B.current?.scrollBy(-10);return}if(m.home){B.current?.scrollToTop();return}m.end&&B.current?.scrollToBottom()}},{isActive:!0}),c<xs||p<ys)return s.jsx(u,{alignItems:"center",height:p,justifyContent:"center",width:c,children:s.jsxs(r,{color:"yellow",children:["Terminal too small (",c,"x",p,")"]})});const Q=a.focusedPanel==="detail",ee=[s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"q"}),s.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"?"}),s.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"↑↓"}),s.jsx(r,{dimColor:!0,children:Q?"SCROLL":"NAV"})]},"nav"),Q?s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"←/Esc"}),s.jsx(r,{dimColor:!0,children:"LIST"})]},"lr"):s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"←→"}),s.jsx(r,{dimColor:!0,children:"SECTION"})]},"lr"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"/"}),s.jsx(r,{dimColor:!0,children:"SEARCH"})]},"search"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"e/w"}),s.jsx(r,{dimColor:!0,children:"SEVERITY"})]},"sev"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"u/o/a"}),s.jsx(r,{dimColor:!0,children:"ACTION"})]},"actions"),s.jsxs(u,{gap:1,children:[s.jsx(r,{bold:!0,color:"white",children:"Tab"}),s.jsx(r,{dimColor:!0,children:"PANEL"})]},"tab")],pe=s.jsx(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:s.jsx(u,{gap:2,overflow:"hidden",paddingX:1,children:ee})}),he=s.jsxs(Lt,{footer:s.jsxs(r,{dimColor:!0,children:[s.jsx(r,{bold:!0,color:"white",children:"↑↓"})," scroll ",s.jsx(r,{bold:!0,color:"white",children:"?"}),"/",s.jsx(r,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:V,title:"DOCTOR — KEYBOARD SHORTCUTS",visible:g,width:56,children:[s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),s.jsxs(u,{children:[s.jsx(u,{width:26,children:s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" ↑/k "}),s.jsx(r,{dimColor:!0,children:"Move up"})]})}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" ↓/j "}),s.jsx(r,{dimColor:!0,children:"Move down"})]})]}),s.jsxs(u,{children:[s.jsx(u,{width:26,children:s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" PgUp"}),s.jsx(r,{dimColor:!0,children:" Jump up 10"})]})}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" PgDn"}),s.jsx(r,{dimColor:!0,children:" Jump down 10"})]})]}),s.jsxs(u,{children:[s.jsx(u,{width:26,children:s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" Home"}),s.jsx(r,{dimColor:!0,children:" Jump to top"})]})}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" End"}),s.jsx(r,{dimColor:!0,children:" Jump to bottom"})]})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" Tab"}),s.jsx(r,{dimColor:!0,children:" Switch panel"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" →/←"}),s.jsx(r,{dimColor:!0,children:" Section tabs (list) / Focus list (detail)"})]})]}),s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"FILTER"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" /"}),s.jsx(r,{dimColor:!0,children:" Open text filter (Esc/Enter to close)"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" e"}),s.jsx(r,{dimColor:!0,children:" Toggle errors-only filter"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" w"}),s.jsx(r,{dimColor:!0,children:" Toggle warns-only filter"})]})]}),s.jsxs(u,{flexDirection:"column",marginBottom:1,children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" u"}),s.jsx(r,{dimColor:!0,children:" Exit + suggest update / dedupe command"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" o"}),s.jsx(r,{dimColor:!0,children:" Exit + suggest optimize command"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" a"}),s.jsx(r,{dimColor:!0,children:" Exit + print risk-ack snippet"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" d"}),s.jsx(r,{dimColor:!0,children:" Focus detail panel"})]})]}),s.jsxs(u,{flexDirection:"column",children:[s.jsxs(u,{marginBottom:1,children:[s.jsx(r,{dimColor:!0,children:"── "}),s.jsx(r,{bold:!0,color:"white",children:"EXIT"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" q"}),s.jsx(r,{dimColor:!0,children:" Quit (with countdown)"})]}),s.jsxs(r,{children:[s.jsx(r,{bold:!0,color:"white",children:" Ctrl+C"}),s.jsx(r,{dimColor:!0,children:" Quit immediately"})]})]})]}),ge=s.jsx(us,{elapsedMs:q,entries:a.entries,filterActive:a.filterActive,filterText:a.filterText,filterType:a.filterType,focused:a.focusedPanel==="list",fromCache:i,grouped:a.grouped,onViewportHeightChange:b,scrollOffset:le,sectionCounts:G,sectionMessage:a.sectionMessage,sectionStatus:a.sectionStatus,selectedIndex:a.selectedIndex,severityFilter:a.severityFilter,totalAll:a.all.length,viewportHeight:j}),fe=t?s.jsx(Yi,{hint:t.hint,message:t.message,severity:t.severity,title:t.title}):null,je=s.jsx(rs,{finding:S,focused:a.focusedPanel==="detail",scrollRef:B});if(ie){const x=Math.floor(c*.4);return s.jsxs(u,{flexDirection:"column",height:p,width:c,children:[fe,s.jsxs(u,{flexDirection:"row",flexGrow:1,children:[s.jsx(u,{flexGrow:1,children:ge}),s.jsx(u,{width:x,children:je})]}),pe,s.jsx(Je,{autoExitSeconds:e||3,onCancel:T(()=>{A(!1)},"onCancel"),visible:w}),he]})}return s.jsxs(u,{flexDirection:"column",height:p,width:c,children:[fe,s.jsx(u,{height:_,children:ge}),s.jsx(u,{flexGrow:1,children:je}),pe,s.jsx(Je,{autoExitSeconds:e||3,onCancel:T(()=>{A(!1)},"onCancel"),visible:w}),he]})},"VisDoctorApp");var ws=Object.defineProperty,ve=T((e,t)=>ws(e,"name",{value:t,configurable:!0}),"n");const vs=ve(e=>e.replaceAll(/[$()+.?[\\\]^{|}]/g,String.raw`\$&`),"escapeRegex"),bs=ve(e=>{const t=e.split("*").map(i=>vs(i));return new RegExp(`^${t.join(".*")}$`,"i")},"compilePattern"),js=ve(e=>e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0).map(t=>bs(t)):[],"parseFilterPatterns"),Ne=ve((e,t)=>{for(const i of t)if(i.test(e))return!0;return!1},"matchesAny"),$s=ve((e,t,i)=>{if(t.length===0)return e;const o=e.outdated.filter(g=>Ne(g.packageName,t)),n=e.duplicates.filter(g=>Ne(g.name,t)),l=e.optimizations.filter(g=>Ne(g.packageName,t));let c=0,p=0,a=0;for(const g of o)g.vulnerabilities&&(c+=g.vulnerabilities.length),g.socketReport&&(p+=g.socketReport.alerts.length,g.socketReport.score.overall<i&&(a+=1));return{...e,duplicates:n,optimizations:l,outdated:o,socketIssues:{alerts:p,lowScore:a},vulnCount:c}},"applyFilter"),jt=ve((e,t)=>t.length===0?[...e]:e.filter(i=>{if(i.kind==="runtime")return!0;const o=i.kind==="duplicate"?i.pkg.name:i.kind==="outdated"||i.kind==="optimization"?i.entry.packageName:i.packageName;return Ne(o,t)}),"filterFindingsByPattern");var Ss=Object.defineProperty,be=T((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"r");const $t=["dependencies","security","optimization","runtime"],tt=be(e=>{const t=new Set;if(!e)return t;for(const i of e.split(",")){const o=i.trim().toLowerCase();$t.includes(o)&&t.add(o)}return t},"parseSectionList"),Cs=be((e,t)=>{if(e!==void 0&&e!=="")return tt(e);const i=tt(t);return new Set($t.filter(o=>!i.has(o)))},"resolveSections"),St=be(e=>{const t={micro:0,native:0,preferred:0,socket:0,total:e.length};for(const i of e)switch(i.category){case"micro-utility":{t.micro+=1;break}case"native":{t.native+=1;break}case"preferred":{t.preferred+=1;break}case"socket":{t.socket+=1;break}}return t},"summarizeOptimizations"),re=be((e,t)=>{if(!e.sections.has(t))return"skip";switch(t){case"dependencies":return e.outdated.length>0||e.duplicates.length>0?"warn":"ok";case"optimization":return e.optimizations.length>0?"warn":"ok";case"runtime":return e.runtime.some(i=>i.status==="warn")?"warn":"ok";case"security":return e.vulnCount>0||e.socketIssues.alerts>0?"error":e.socketIssues.lowScore>0?"warn":"ok";default:return"ok"}},"sectionStatus"),Rs=be((e,t)=>{const i=St(e.optimizations),o={dependencies:re(e,"dependencies"),optimization:re(e,"optimization"),runtime:re(e,"runtime"),security:re(e,"security")},n=new Set([...Object.values(o),e.supplyChain.status]),l=n.has("error")?"error":n.has("warn")?"warn":"ok";return{dependencies:{duplicates:e.duplicates.length,installed:e.installedCount,outdated:e.outdated.length,status:o.dependencies},elapsedMs:e.elapsedMs,optimizations:{microUtilities:i.micro,native:i.native,preferred:i.preferred,socket:i.socket,status:o.optimization,total:i.total},packageManager:t,runtime:e.runtime.map(c=>({detail:c.detail,id:c.id,message:c.message,status:c.status})),runtimeStatus:o.runtime,security:{alerts:e.socketIssues.alerts,lowScorePackages:e.socketIssues.lowScore,status:o.security,vulnerabilities:e.vulnCount},status:l,supplyChain:{findings:e.supplyChain.findings.map(c=>({detail:c.detail,label:c.label,severity:c.severity})),status:e.supplyChain.status},workspaces:e.workspaceCount}},"buildJsonPayload"),it=be((e,t)=>{const i=e.runtime.some(n=>n.status==="warn"),o=e.vulnCount>0||e.socketIssues.alerts>0;return t?o||e.outdated.length>0||e.duplicates.length>0||i:o},"shouldFail");var Ts=Object.defineProperty,Be=T((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"u$1");const As=["aube-workspace.yaml","pnpm-workspace.yaml"],Ce=Be(e=>typeof e=="boolean"?e:void 0,"asBool"),Ps=Be(e=>{if(e==="no-downgrade"||e==="off")return e},"asTrustPolicy"),Is=Be(e=>{const t={allowBuildsCount:0,blockExoticSubdeps:void 0,jailBuilds:void 0,minimumReleaseAge:void 0,minimumReleaseAgeStrict:void 0,paranoid:void 0,source:void 0,strictDepBuilds:void 0,trustPolicy:void 0};for(const i of As){const o=J(e,i);if(!Ae(o))continue;let n;try{n=Vt(qt(o))}catch{continue}if(typeof n!="object"||n===null)continue;const l=n;return t.source=i,t.paranoid=Ce(l.paranoid),t.trustPolicy=Ps(l.trustPolicy),t.blockExoticSubdeps=Ce(l.blockExoticSubdeps),t.jailBuilds=Ce(l.jailBuilds),t.strictDepBuilds=Ce(l.strictDepBuilds),t.minimumReleaseAgeStrict=Ce(l.minimumReleaseAgeStrict),typeof l.minimumReleaseAge=="number"&&Number.isFinite(l.minimumReleaseAge)&&(t.minimumReleaseAge=l.minimumReleaseAge),l.allowBuilds&&typeof l.allowBuilds=="object"&&!Array.isArray(l.allowBuilds)&&(t.allowBuildsCount=Object.keys(l.allowBuilds).length),t}return t},"readAubeSecurityPosture"),Ds=Be(e=>e.paranoid?{...e,jailBuilds:!0,minimumReleaseAgeStrict:!0,strictDepBuilds:!0,trustPolicy:"no-downgrade"}:e,"applyAubeParanoidOverrides");var Os=Object.defineProperty,_e=T((e,t)=>Os(e,"name",{value:t,configurable:!0}),"i");const Ns=/^(@[\w./-]+\/[\w./-]+|[\w.-]+)@(.+)$/,Fs=_e(e=>{const t=Ns.exec(e);if(t)return{name:t[1],version:t[2]}},"parsePatchKey"),Ms=_e((e,t)=>{let i;try{if(t==="pnpm"){const n=J(e,"pnpm-workspace.yaml");Ae(n)&&(i=_t(n)?.patchedDependencies)}else if(t==="bun"){const n=J(e,"package.json");Ae(n)&&(i=pt(n)?.patchedDependencies)}}catch{return[]}if(!i||typeof i!="object")return[];const o=[];for(const[n,l]of Object.entries(i)){if(typeof l!="string"||l.length===0)continue;const c=Fs(n);c&&o.push({name:c.name,patchFile:l,resolvedPatchFile:Xt(l)?l:dt(e,l),version:c.version})}return o},"readPatchedDependencies"),Es=_e(e=>{const t=[];for(const i of e)Ae(i.resolvedPatchFile)||t.push({entry:i,kind:"missing-file"});return t},"findPatchIssues");var zs=Object.defineProperty,Ct=T((e,t)=>zs(e,"name",{value:t,configurable:!0}),"c");const st=Ct(e=>e.some(t=>t.severity==="error")?"error":e.some(t=>t.severity==="warn")?"warn":"ok","rollUpStatus"),Bs=Ct((e,t={})=>{const i=[],o=e?.security;if(!o)return i.push({detail:"Use defineConfig() from '@visulima/vis/config' to apply secure defaults.",label:"No security config — running with the PM's native defaults",severity:"warn"}),{findings:i,status:st(i)};const n=o.policies?.firstSeen?.minutes,l=o.policies?.publisherChange,c=o.policies?.installScripts;n===void 0?i.push({detail:"Set security.policies.firstSeen.minutes to block packages published in the last N minutes (mitigates supply-chain attacks).",label:"policies.firstSeen.minutes is not set",severity:"warn"}):n===0?i.push({detail:"New packages can be installed immediately after publishing. Consider setting a non-zero cooldown.",label:"policies.firstSeen.minutes is explicitly 0",severity:"warn"}):i.push({label:`policies.firstSeen.minutes: ${String(n)} minutes`,severity:"ok"}),l?.mode===void 0||l.mode==="off"?i.push({detail:"Packages whose trust level has decreased will not be blocked. Consider 'no-downgrade'.",label:`policies.publisherChange.mode: ${l?.mode??"not set"}`,severity:"warn"}):i.push({label:`policies.publisherChange.mode: ${l.mode}`,severity:"ok"}),o.blockExoticSubdeps===void 0||!o.blockExoticSubdeps?i.push({detail:"Transitive dependencies can pull code from git repos or tarball URLs. Set to true to block.",label:`blockExoticSubdeps: ${String(o.blockExoticSubdeps??!1)}`,severity:"warn"}):i.push({label:"blockExoticSubdeps: true",severity:"ok"});const p=c?.allow?Object.keys(c.allow).length:0;if(p===0?i.push({detail:"Lifecycle scripts are blocked by default. List trusted packages here to opt them back in (e.g. esbuild, @prisma/client).",label:"policies.installScripts.allow: not configured",severity:"warn"}):i.push({label:`policies.installScripts.allow: ${String(p)} ${p===1?"entry":"entries"}`,severity:"ok"}),c?.strict&&p===0&&i.push({detail:"All dependencies with build scripts will be blocked. Run 'vis approve-builds' to populate the allow list.",label:"policies.installScripts.strict is on but allow is empty",severity:"error"}),t.workspaceRoot){const a=xi(t.workspaceRoot);if(a.length>0){const g=[...new Set(a.map(y=>y.tool))].sort((y,w)=>y.localeCompare(w)).join(", ");i.push({detail:"Run `vis migrate verify` for the full list, then re-run `vis migrate <tool>` to clean up.",label:`${String(a.length)} leftover ${a.length===1?"reference":"references"} to ${g}`,severity:"warn"})}}if(t.workspaceRoot&&t.packageManager==="aube"){const a=Is(t.workspaceRoot),g=Ds(a),y=g.source?` (from ${g.source})`:"";g.paranoid===!0&&i.push({detail:"Forces jailBuilds, trustPolicy=no-downgrade, minimumReleaseAgeStrict, strictStoreIntegrity, and strictDepBuilds on.",label:`aube paranoid: true${y}`,severity:"ok"}),g.trustPolicy==="off"&&i.push({detail:"Trust downgrades between releases will not be blocked. Set trustPolicy: no-downgrade in aube-workspace.yaml.",label:`aube trustPolicy: off${y}`,severity:"warn"}),g.blockExoticSubdeps===!1&&i.push({detail:"Transitive deps from git+, file:, and tarball URLs will not be blocked. Re-enable with blockExoticSubdeps: true.",label:`aube blockExoticSubdeps: false${y}`,severity:"warn"}),g.minimumReleaseAge===0&&i.push({detail:"Newly published versions are not held in a cooling window. Restore with minimumReleaseAge: 1440 (24h) or higher.",label:`aube minimumReleaseAge: 0${y}`,severity:"warn"}),g.jailBuilds===!0&&i.push({label:`aube jailBuilds: true${y}`,severity:"ok"}),g.strictDepBuilds===!0&&i.push({label:`aube strictDepBuilds: true${y}`,severity:"ok"}),g.allowBuildsCount>0&&i.push({label:`aube allowBuilds: ${String(g.allowBuildsCount)} ${g.allowBuildsCount===1?"entry":"entries"}${y}`,severity:"ok"})}if(t.workspaceRoot&&t.packageManager){const a=Ms(t.workspaceRoot,t.packageManager);if(a.length>0){const g=Es(a);if(g.length===0)i.push({label:`patchedDependencies: ${String(a.length)} ${a.length===1?"entry":"entries"} resolved`,severity:"ok"});else for(const y of g)i.push({detail:`Referenced from ${t.packageManager==="pnpm"?"pnpm-workspace.yaml":"package.json"} but the file is not present at ${y.entry.patchFile}.`,label:`patchedDependencies: missing patch file for ${y.entry.name}@${y.entry.version}`,severity:"error"})}}return{findings:i,status:st(i)}},"buildSupplyChainPosture");var Ls=Object.defineProperty,$=T((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"u");const H=$(e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${String(Math.round(e))}ms`,"fmtDuration"),De=$(async(e,t,i,o)=>{if(!e)return i();e.start(t);const n=Date.now();try{const l=await i(),c=Date.now()-n,{status:p,summary:a}=o(l,c);return e.finish(t,p,a),l}catch(l){const c=Date.now()-n,p=l instanceof Error?l.message:String(l);throw e.finish(t,"error",`${p} (${H(c)})`),l}},"tracked"),Vs=$((e,t)=>{const i={duplicates:t.duplicates,elapsedMs:0,installedCount:0,optimizations:t.optimizations,outdated:t.outdated,runtime:t.runtime,sections:new Set([e]),socketIssues:{alerts:0,lowScore:0},supplyChain:{findings:[],status:"ok"},vulnCount:0,workspaceCount:0};return wt(i)},"buildSectionFindings"),rt=$(async e=>{const{filterPatterns:t,installed:i,progress:o,resolveCodemods:n,sections:l,store:c,visConfig:p,workspaceRoot:a}=e,g=l.has("dependencies"),y=l.has("security"),w=l.has("optimization"),A=l.has("runtime"),E=$((f,D)=>jt(Vs(f,D),t),"sectionFindings"),h=gt(a),{packageManager:P}=ot(a),z=Xe(J(a,"package.json"),!1),q=ht(a),V=new Set(z);for(const f of q){const D=Xe(J(dt(a,f),"package.json"),!1);for(const O of D)V.add(O)}const B=Gt(a),S=lt(a,P),G=at(p?.security,{minimumScore:p?.security?.policies?.score?.minimum}),U=p?.security?.policies?.score?.minimum??ct,oe=p?.security?.acceptedRisks,ie=ii(a,h.name),_={exclude:[],ignore:[],include:[],includeLocked:!1,includePrerelease:!1,security:!0,target:"latest"},F=g?ui(a,h.name):[],K=w?si(V):[],b=w?ri(V,ie,h,!1):[],j=new Set(K.map(f=>f.packageName)),X=b.filter(f=>!j.has(f.packageName)),C=[...K,...X],le=A?Ei(a):[];c&&(g&&c.startSection("dependencies",S.size>0?"checking outdated catalog dependencies":"scanning duplicates"),y&&c.startSection("security",i.length>0?`scanning ${String(i.length)} packages for advisories`:"no installed packages to scan"),w&&c.startSection("optimization","matching e18e + socket overrides"),A&&c.startSection("runtime","running runtime diagnostics")),c&&A&&c.completeSection("runtime",E("runtime",{duplicates:[],optimizations:[],outdated:[],runtime:le}));const ue=(g||y)&&S.size>0?De(o,"outdated",()=>Ut(S,_,B,void 0,a,G,oe),(f,D)=>{const O=f.outdated.length;return{status:O>0?"warn":"ok",summary:O>0?`${String(O)} outdated · ${H(D)}`:`up to date · ${H(D)}`}}):Promise.resolve({failed:[],ignored:[],outdated:[]}),I=y&&i.length>0?De(o,"vulnerabilities",()=>Ht(i.map(f=>({name:f.name,version:f.version}))),(f,D)=>{let O=0;for(const se of f.values())O+=se.length;return{status:O>0?"error":"ok",summary:O>0?`${String(O)} found · ${H(D)}`:`none found · ${H(D)}`}}):Promise.resolve(new Map),Q=y&&G.length>0&&i.length>0?De(o,"socket",()=>Kt(G,i.map(f=>({name:f.name,version:f.version}))),(f,D)=>{let O=0,se=0;for(const Ye of f.values())O+=Ye.alerts.length,Ye.score.overall<U&&(se+=1);const Ke=O+se;return{status:Ke>0?"warn":"ok",summary:Ke>0?`${String(O)} alert${O===1?"":"s"}, ${String(se)} low-score · ${H(D)}`:`clean · ${H(D)}`}}):Promise.resolve(new Map);let ee,pe,he,ge;const fe=ue.catch(f=>(ee=f instanceof Error?f.message:String(f),c||d.warn(`Outdated scan failed: ${ee}`),{failed:[],ignored:[],outdated:[]})),je=I.catch(f=>(pe=f instanceof Error?f.message:String(f),c||d.warn(`Vulnerability scan failed: ${pe}`),new Map)),x=Q.catch(f=>(he=f instanceof Error?f.message:String(f),c||d.warn(`Socket scan failed: ${he}`),new Map)),m=c&&g?fe.then(f=>{if(ee){c.failSection("dependencies",ee);return}c.completeSection("dependencies",E("dependencies",{duplicates:F,optimizations:[],outdated:f.outdated,runtime:[]}))}):void 0,k=c&&y?Promise.all([fe,je,x]).then(([f])=>{const D=ee??pe??he;if(D){c.failSection("security",D);return}c.completeSection("security",E("security",{duplicates:[],optimizations:[],outdated:f.outdated,runtime:[]}))}):void 0,$e=(async()=>{if(n&&w&&C.length>0&&await De(o,"codemods",async()=>(await ni(C),C),(f,D)=>{const O=f.filter(se=>se.hasCodemod||se.category==="socket").length;return{status:"ok",summary:`${String(O)} auto-fixable · ${H(D)}`}}).catch(f=>{ge=f instanceof Error?f.message:String(f)}),c&&w){if(ge){c.failSection("optimization",ge);return}c.completeSection("optimization",E("optimization",{duplicates:[],optimizations:C,outdated:[],runtime:[]}))}})(),[ae,Tt,At]=await Promise.all([fe,je,x]);await Promise.all([m,k,$e]);let Ue=0,He=0;if(y&&G.length>0)for(const f of At.values())Ue+=f.alerts.length,f.score.overall<U&&(He+=1);let Le=0;if(y){for(const f of ae.outdated)f.vulnerabilities&&f.vulnerabilities.length>0&&(Le+=f.vulnerabilities.length);for(const f of Tt.values())Le+=f.length}return{duplicates:F,installedCount:i.length,optimizations:w?C:[],outdated:g?ae.outdated:[],runtime:le,sections:l,socketIssues:{alerts:Ue,lowScore:He},supplyChain:Bs(p,{packageManager:P,workspaceRoot:a}),vulnCount:Le,workspaceCount:q.length}},"streamScans"),_s=$(e=>{switch(e){case"error":return Re(N.failure);case"skip":return v(N.dash);case"warn":return Me(N.warning);default:return we(N.success)}},"sectionIcon"),de=$((e,t)=>{const i=process.stderr.columns??80,o=Math.max(20,Math.min(i-2,60)),n=N.dash.repeat(2),l=`${_s(t)} ${ce(e)}`,c=l.replaceAll(/\[[0-9;]*m/g,"").length,p=Math.max(0,o-c-n.length-2);return`${n} ${l} ${v(N.dash.repeat(p))}`},"heading"),W=$(e=>` ${we(N.success)} ${e}`,"itemOk"),Z=$(e=>` ${Me(N.warning)} ${e}`,"itemWarn"),Ge=$(e=>` ${Re(N.failure)} ${e}`,"itemError"),Rt=$(e=>` ${v(N.dash)} ${v(e)}`,"itemSkip"),Y=$((e,t,i)=>{const o=`${ce(String(e))} ${v(t)}`;return i?`${o} ${v(`(${i})`)}`:o},"countLine"),Gs=$(e=>{if(e.sections.has("dependencies")){if(d.log(""),d.log(de("Dependencies",re(e,"dependencies"))),d.log(W(Y(e.installedCount,"packages installed"))),e.outdated.length>0){const t=e.outdated.filter(l=>l.updateType==="major").length,i=e.outdated.filter(l=>l.updateType==="minor").length,o=e.outdated.filter(l=>l.updateType==="patch").length,n=[];t>0&&n.push(`${String(t)} major`),i>0&&n.push(`${String(i)} minor`),o>0&&n.push(`${String(o)} patch`),d.log(Z(Y(e.outdated.length,"outdated",n.join(", "))))}else d.log(W("All dependencies up to date"));e.duplicates.length>0?d.log(Z(Y(e.duplicates.length,"packages with duplicate versions"))):d.log(W("No duplicate dependencies"))}},"displayDependencies"),Us=$(e=>{e.sections.has("security")&&(d.log(""),d.log(de("Security",re(e,"security"))),e.vulnCount>0?d.log(Ge(Y(e.vulnCount,`vulnerabilit${e.vulnCount===1?"y":"ies"} found`))):d.log(W("No known vulnerabilities")),e.socketIssues.alerts>0&&d.log(Z(Y(e.socketIssues.alerts,`Socket.dev security alert${e.socketIssues.alerts===1?"":"s"}`))),e.socketIssues.lowScore>0&&d.log(Z(Y(e.socketIssues.lowScore,`package${e.socketIssues.lowScore===1?"":"s"} with low security score`))),e.socketIssues.alerts===0&&e.socketIssues.lowScore===0&&e.vulnCount===0&&d.log(W("No security issues detected")))},"displaySecurity"),Hs=$(e=>{if(!e.sections.has("optimization"))return;d.log(""),d.log(de("Optimization",re(e,"optimization")));const t=St(e.optimizations);if(t.total===0){d.log(W("No optimizations available"));return}t.native>0&&d.log(Z(Y(t.native,"replaceable with native APIs"))),t.preferred>0&&d.log(Z(Y(t.preferred,"with lighter alternatives"))),t.micro>0&&d.log(Z(Y(t.micro,"trivial micro-utilities"))),t.socket>0&&d.log(Z(Y(t.socket,"@socketregistry overrides available")))},"displayOptimization"),Ks=$(e=>{d.log(""),d.log(de("Supply Chain",e.supplyChain.status));for(const t of e.supplyChain.findings){const i=t.severity==="ok"?W(t.label):t.severity==="error"?Ge(t.label):Z(t.label);d.log(i),t.detail&&d.log(` ${v(N.arrow)} ${v(t.detail)}`)}e.supplyChain.status!=="ok"&&d.log(` ${v(N.arrow)} ${v("Configure with security.* in vis.config.ts. See `vis check --security-config` for details.")}`)},"displaySupplyChain"),Ys=$(e=>{if(e.sections.has("runtime")){d.log(""),d.log(de("Runtime",re(e,"runtime")));for(const t of e.runtime)t.status==="ok"?d.log(W(t.message)):t.status==="skip"?d.log(Rt(t.message)):d.log(Z(t.message))}},"displayRuntime"),Ws=$((e,t)=>{const i=e.vulnCount,o=e.runtime.filter(l=>l.status==="warn").length,n=e.outdated.length+e.duplicates.length+e.optimizations.length+o;if(t){if(i===0&&n===0)d.success(`Everything looks good! ${v(`(${H(e.elapsedMs)})`)}`);else{const l=[];i>0&&l.push(Re(`${String(i)} security`)),n>0&&l.push(Me(`${String(n)} improvement${n===1?"":"s"}`)),d.log(`${Re(N.failure)} ${l.join(", ")} ${v(`(${H(e.elapsedMs)})`)}`)}return}d.log(""),d.log(de("Summary","ok")),i===0&&n===0?d.success(`Everything looks good! ${v(`(${H(e.elapsedMs)})`)}`):(i>0&&d.error(`${String(i)} security issue${i===1?"":"s"}`),n>0&&d.log(` ${Te(N.arrow)} ${ce(String(n))} ${v(`improvement${n===1?"":"s"} available`)} ${v(`(${H(e.elapsedMs)})`)}`))},"displaySummary"),Js=$(e=>{const t=[];if(e.outdated.length>0&&t.push("vis update — update outdated dependencies"),(e.vulnCount>0||e.socketIssues.alerts>0)&&t.push("vis audit — detailed security analysis"),e.optimizations.length>0&&t.push("vis optimize — apply optimizations interactively"),e.duplicates.length>0&&t.push("vis dedupe — reduce duplicate versions"),t.length>0){d.log(""),d.log(ce("Next steps:"));for(const i of t)d.log(` ${v(N.arrow)} ${i}`)}d.log("")},"displayActions"),qs=$((e,t)=>{t||(Gs(e),Us(e),Hs(e),Ys(e),Ks(e)),Ws(e,t)},"displayResults"),Xs=$((e,t,i,o,n)=>{const l=[],c=e.has("dependencies"),p=e.has("security"),a=e.has("optimization");return(c||p)&&t>0&&l.push({id:"outdated",label:"Outdated catalog dependencies"}),p&&o>0&&l.push({id:"vulnerabilities",label:"Known vulnerabilities (OSV)"}),p&&i&&o>0&&l.push({id:"socket",label:"Socket.dev supply-chain reports"}),a&&n&&l.push({id:"codemods",label:"Codemod availability"}),l},"planScanTasks"),Qs=$(e=>{if(d.log(""),d.log(`${ce(Te("vis doctor"))} ${v("— project health check")}`),d.log(W(`Detected ${e.packageManagerName} v${e.packageManagerVersion}`)),e.workspaceCount!==void 0&&e.workspaceCount>0&&d.log(W(Y(e.workspaceCount,`workspace package${e.workspaceCount===1?"":"s"}`))),e.runtimeFindings.length===0)d.log(W(`Node.js ${e.nodeVersion}`));else{for(const t of e.runtimeFindings){const i=t.severity==="error"?Re:Me;d.log(Ge(`Runtime: ${i(t.message)}`))}d.log(` ${v(N.arrow)} Run ${we("vis toolchain install")} to install pinned versions, or ${we("vis toolchain status")} for the per-tool breakdown.`)}d.log("")},"printBanner"),fr=$(async({logger:e,options:t,visConfig:i,visConfigError:o,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root.");const l=t.format==="json"||t.json===!0,c=Cs(t.only,t.skip),p=!!t.quiet,a=t.progress===!1,g=js(t.filter);if(c.size===0){d.error("No sections selected. Check your --only / --skip values."),process.exitCode=2;return}const y=Date.now(),w=gt(n),A=ci(n),E=!!process.stdout.isTTY,h=!l&&E&&!Jt&&!p&&!a;!l&&!h&&Qs({nodeVersion:process.versions.node,packageManagerName:w.name,packageManagerVersion:w.version,runtimeFindings:A,workspaceCount:void 0});const P=lt(n,ot(n).packageManager),z=pi(n,w.name),q=z.length,V=at(i?.security).length>0,B=i?.security?.policies?.score?.minimum??ct,S=ht(n);if(!l&&!p&&!h){const I=S.length>0?v(` · ${String(S.length)} workspace package${S.length===1?"":"s"}`):"";d.log(`${v("·")} ${v("Found")} ${ce(String(q))} ${v(`installed package${q===1?"":"s"}`)}${I}`)}const G=o?{hint:o.file?`Continuing with default settings — fix or regenerate ${o.file} (vis init --force).`:"Continuing with default settings.",message:o.message,severity:"error",title:o.file?`Failed to load ${o.file}`:"Failed to load vis.config"}:void 0,U=hi(n,w.name)?.file,oe=U?J(n,U):void 0,ie=ti(n),_=t.cache!==!1&&!t.fix?vi({configPath:ie,lockfilePath:oe,sections:c,socketEnabled:V,workspaceRoot:n}):void 0,F=_?bi(_):void 0,K=F!==void 0;let b,j;if(h){const I=F?new Ze({activeSections:c,findings:jt(wt(F),g)}):new Ze({activeSections:c}),Q=Yt(Wt.createElement(ks,{banner:G,fromCache:K,startedAt:y,store:I}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0});try{b=F??await rt({filterPatterns:g,installed:z,resolveCodemods:!!t.fix,sections:c,store:I,visConfig:i,workspaceRoot:n})}catch(ee){throw Q.unmount(),ee}await Q.waitUntilExit(),j=I.getSnapshot().pendingAction}else if(F)b=F;else{const I=Xs(c,P.size,V,q,!!t.fix),Q=di(I,{live:!l&&!p&&!a});try{b=await rt({filterPatterns:g,installed:z,progress:Q,resolveCodemods:!!t.fix,sections:c,visConfig:i,workspaceRoot:n})}finally{Q.stop()}}const X={...b,elapsedMs:Date.now()-y};if(_&&!K)try{ji(_,X)}catch{}const C=$s(X,g,B);if(l){process.stdout.write(`${JSON.stringify(Rs(C,w.name),void 0,2)}
|
|
4
4
|
`),t.exitCode&&it(C,!!t.strict)&&(process.exitCode=1);return}K&&!p&&d.log(`${v("·")} Cached results (use --no-cache to refresh)`),g.length>0&&!p&&d.log(`${v("·")} Filter active: ${Te(t.filter??"")}`),qs(C,p);const le=C.runtime.some(I=>I.id===Oe&&I.status==="warn"),ue=C.sections.has("optimization")&&C.optimizations.length>0;t.fix&&(ue||le)?await Zs({force:!!t.fixForce,logger:e,pm:w,recoverOrphans:le,results:C,useEditorconfig:i?.editorconfig??!0,workspaceRoot:n}):p||Js(C),j&&(process.stdout.write(`
|