@visulima/vis 0.0.1 → 1.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +360 -0
  2. package/LICENSE.md +91 -0
  3. package/README.md +364 -29
  4. package/dist/bin.js +2 -0
  5. package/dist/errors/index.d.ts +26 -0
  6. package/dist/errors/index.js +1 -0
  7. package/dist/generate/index.d.ts +157 -0
  8. package/dist/generate/index.js +1 -0
  9. package/dist/packem_chunks/bin.js +87 -0
  10. package/dist/packem_chunks/config.js +2 -0
  11. package/dist/packem_chunks/fix.js +53 -0
  12. package/dist/packem_chunks/handler.js +1 -0
  13. package/dist/packem_chunks/handler10.js +1 -0
  14. package/dist/packem_chunks/handler11.js +1 -0
  15. package/dist/packem_chunks/handler12.js +2 -0
  16. package/dist/packem_chunks/handler13.js +1 -0
  17. package/dist/packem_chunks/handler14.js +5 -0
  18. package/dist/packem_chunks/handler15.js +1 -0
  19. package/dist/packem_chunks/handler16.js +20 -0
  20. package/dist/packem_chunks/handler17.js +1 -0
  21. package/dist/packem_chunks/handler18.js +1 -0
  22. package/dist/packem_chunks/handler19.js +1 -0
  23. package/dist/packem_chunks/handler2.js +1 -0
  24. package/dist/packem_chunks/handler20.js +1 -0
  25. package/dist/packem_chunks/handler21.js +1 -0
  26. package/dist/packem_chunks/handler22.js +5 -0
  27. package/dist/packem_chunks/handler23.js +1 -0
  28. package/dist/packem_chunks/handler24.js +1 -0
  29. package/dist/packem_chunks/handler25.js +5 -0
  30. package/dist/packem_chunks/handler26.js +1 -0
  31. package/dist/packem_chunks/handler27.js +3 -0
  32. package/dist/packem_chunks/handler28.js +1 -0
  33. package/dist/packem_chunks/handler29.js +7 -0
  34. package/dist/packem_chunks/handler3.js +2 -0
  35. package/dist/packem_chunks/handler30.js +23 -0
  36. package/dist/packem_chunks/handler31.js +3 -0
  37. package/dist/packem_chunks/handler32.js +2 -0
  38. package/dist/packem_chunks/handler33.js +24 -0
  39. package/dist/packem_chunks/handler34.js +2 -0
  40. package/dist/packem_chunks/handler35.js +19 -0
  41. package/dist/packem_chunks/handler36.js +428 -0
  42. package/dist/packem_chunks/handler37.js +22 -0
  43. package/dist/packem_chunks/handler38.js +22 -0
  44. package/dist/packem_chunks/handler39.js +22 -0
  45. package/dist/packem_chunks/handler4.js +4 -0
  46. package/dist/packem_chunks/handler40.js +3 -0
  47. package/dist/packem_chunks/handler41.js +10 -0
  48. package/dist/packem_chunks/handler42.js +153 -0
  49. package/dist/packem_chunks/handler43.js +42 -0
  50. package/dist/packem_chunks/handler44.js +3 -0
  51. package/dist/packem_chunks/handler45.js +27 -0
  52. package/dist/packem_chunks/handler5.js +2 -0
  53. package/dist/packem_chunks/handler6.js +13 -0
  54. package/dist/packem_chunks/handler7.js +8 -0
  55. package/dist/packem_chunks/handler8.js +1 -0
  56. package/dist/packem_chunks/handler9.js +1 -0
  57. package/dist/packem_chunks/index.js +7 -0
  58. package/dist/packem_chunks/loader.js +1 -0
  59. package/dist/packem_shared/VisConfigCycleError-CAYNC7d-.js +1 -0
  60. package/dist/packem_shared/VisConfigError-B5LP1zRf.js +1 -0
  61. package/dist/packem_shared/VisConfigLoadError-CeqBSd2Z.js +2 -0
  62. package/dist/packem_shared/VisConfigNotFoundError-DZ9KC527.js +5 -0
  63. package/dist/packem_shared/VisUpdateApp-D-L4_-Iu.js +1 -0
  64. package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
  65. package/dist/packem_shared/ai-analysis-CGuy7dfE.js +67 -0
  66. package/dist/packem_shared/ai-cache-Bynt6Y9x.js +1 -0
  67. package/dist/packem_shared/cache-directory-D72ZEag2.js +1 -0
  68. package/dist/packem_shared/catalog-BVPerCwG.js +12 -0
  69. package/dist/packem_shared/dependency-scan-Du0tBu64.js +2 -0
  70. package/dist/packem_shared/docker-BcfqH4Av.js +2 -0
  71. package/dist/packem_shared/failure-log-DqYen0LC.js +2 -0
  72. package/dist/packem_shared/flakiness-DSIHZGBT.js +1 -0
  73. package/dist/packem_shared/run-summary-utils-C24Aaf9E.js +1 -0
  74. package/dist/packem_shared/runtime-check-CGHal8SO.js +1 -0
  75. package/dist/packem_shared/selectors-CfH9ZY08.js +3 -0
  76. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  77. package/dist/packem_shared/target-merge-DNa-6eWu.js +1 -0
  78. package/dist/packem_shared/toolchain-DQfTQY8E.js +5 -0
  79. package/dist/packem_shared/typosquats-DOR8izpX.js +1 -0
  80. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  81. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  82. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  83. package/index.js +601 -0
  84. package/package.json +124 -7
  85. package/schemas/project.schema.json +422 -0
  86. package/schemas/vis-config.schema.json +377 -0
@@ -0,0 +1,153 @@
1
+ var ge=Object.defineProperty;var g=(e,t)=>ge(e,"name",{value:t,configurable:!0});import{createRequire as he}from"node:module";import{dim as d,bold as k,cyan as x}from"@visulima/colorize";import{isAccessibleSync as P,ensureDirSync as b,writeFileSync as m,readJsonSync as ae}from"@visulima/fs";import{resolve as _,basename as ve,relative as W,join as c,sep as be,isAbsolute as we}from"@visulima/path";import{p as a,o as le,g as ke,c as xe}from"./bin.js";import{g as Ce}from"../packem_shared/_commonjsHelpers-D6W6KoPK.js";import{downloadTemplate as Se}from"giget";const fe=he(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,V=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}=V("node:child_process"),{createInterface:$e}=V("node:readline"),{readdirSync:_e,chmodSync:je}=V("node:fs");var Pe=Object.defineProperty,z=g((e,t)=>Pe(e,"name",{value:t,configurable:!0}),"e");const Ne={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Oe=["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=z(e=>{for(const t of Oe)if(e.startsWith(t))return!0;return!!(!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e))},"isGitUrl"),De=new Set(["sv"]),Te=z(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"),Ee=z((e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=Ne[r];return i?{args:t,source:r,type:i}:qe(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Te(e),type:"remote:npm"}},"discoverTemplate"),Ie=z(e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},"inferParentDir");var Re=Object.defineProperty,pe=g((e,t)=>Re(e,"name",{value:t,configurable:!0}),"i$1");const ne=["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=pe((e,t)=>Math.floor(e+Math.random()*(t-e+1)),"random");function J(){return ne[Me(0,ne.length-1)]}g(J,"getRandomWord");pe(J,"getRandomWord");var Le=Object.defineProperty,ze=g((e,t)=>Le(e,"name",{value:t,configurable:!0}),"o$1");const Ae=ze(()=>`${J()}-${J()}`,"randomName");var U,oe;function Ge(){return oe||(oe=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,se;function Ue(){if(se)return B;se=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 Fe=Ce(Be);var Je=Object.defineProperty,I=g((e,t)=>Je(e,"name",{value:t,configurable:!0}),"r$2");const ue=I(e=>e?Fe(e).validForNewPackages:!1,"isValidPackageName"),E=I(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),Ve=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),de=I(e=>P(e)?_e(e).every(t=>Ve.has(t)):!0,"isEmptyDir"),We=I((e,t)=>{const r=_(t,e);return{packageName:E(ve(r)),targetDir:r}},"resolveTargetDir"),He=I(e=>de(e),"canSafelyOverwrite");var Ye=Object.defineProperty,A=g((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"l$4");const T=A((e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),"ask"),F=A(async(e,t,r=!0)=>{const i=await T(e,` ${t} ${d(r?"[Y/n]":"[y/N]")} `);return i===""?r:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},"confirm"),ce=A(async(e,t,r)=>{process.stderr.write(` ${t}
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
+ `)}for(;;){const i=await T(e,`
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.")}
5
+ `)}},"select"),Ke=A(async e=>{const t=$e({input:process.stdin,output:process.stdout});try{process.stderr.write(`
6
+ ${k(x("vis create"))} ${d("— project scaffolding")}
7
+
8
+ `);const r=e.inMonorepo?[{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}]:[{hint:"Full workspace setup",label:"Vis Monorepo",value:"vis:monorepo"},{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}];let i=await ce(t,"Select a template:",r);if(i==="__custom__"&&(i=await T(t,`
9
+ ${d("Template (npm package or GitHub URL):")} `),!i))throw new Error("No template specified.");const n=Ae(),u=await T(t,`
10
+ ${d(`Project name (${n}):`)} `)||n;if(!ue(E(u)))throw new Error(`Invalid project name: "${u}". Must be a valid npm package name.`);const p=E(u),o=await T(t,` ${d(`Target directory (${p}):`)} `)||p;let l=!1;const s=_(e.cwd,o);if(!de(s)&&(l=await F(t,`Directory "${o}" is not empty. Overwrite?`,!1),!l))throw new Error("Aborted — directory not empty.");let w;e.inMonorepo||(e.defaultPm?(w=e.defaultPm,process.stderr.write(` ${d(`Package manager: ${w} (from config)`)}
11
+ `)):w=await ce(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let $=!1;e.inMonorepo||($=await F(t,"Initialize a git repository?",e.defaultGitInit??!1));const y=e.defaultEditor==="vscode",h=await F(t,"Generate VS Code configuration?",y)?"vscode":void 0;return process.stderr.write(`
12
+ `),{editor:h,gitInit:$,overwrite:l,pm:w,projectName:u,targetDir:o,template:i}}finally{t.close()}},"runInteractivePrompts");var Qe=Object.defineProperty,S=g((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"i");const Xe=S((e,t)=>{a.info("Scaffolding application via create-vite...");const r=[W(t.cwd,t.targetDir)||".",...e.args];return r.includes("--no-immediate")||r.push("--no-immediate"),le(t.pm,{additionalPackages:[],args:r,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},"executeApp"),Ze=S(e=>`${JSON.stringify({devDependencies:{typescript:"^5.0.0",vitest:"^3.0.0"},exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],main:"./dist/index.js",name:e,scripts:{build:"tsc",dev:"tsc --watch",test:"vitest run","test:watch":"vitest"},type:"module",types:"./dist/index.d.ts",version:"0.0.1"},null,4)}
13
+ `,"libraryPackageJson"),et=S(()=>`${JSON.stringify({compilerOptions:{declaration:!0,declarationMap:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,sourceMap:!0,strict:!0,target:"ES2022"},include:["src/**/*"]},null,4)}
14
+ `,"libraryTsconfig"),tt=S(e=>`/**
15
+ * ${e} — library entry point.
16
+ */
17
+
18
+ export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
19
+ `,"librarySrcIndex"),rt=S(e=>`import { describe, expect, it } from "vitest";
20
+
21
+ import { greet } from "../src/index";
22
+
23
+ describe("${e}", () => {
24
+ it("should greet", () => {
25
+ expect(greet("world")).toBe("Hello from ${e}, world!");
26
+ });
27
+ });
28
+ `,"libraryTestIndex"),it=S((e,t)=>{const{projectName:r,targetDir:i}=t;return a.info("Scaffolding library package..."),b(i),b(c(i,"src")),b(c(i,"__tests__")),m(c(i,"package.json"),Ze(r)),a.success("Created package.json"),m(c(i,"tsconfig.json"),et()),a.success("Created tsconfig.json"),m(c(i,"src","index.ts"),tt(r)),a.success("Created src/index.ts"),m(c(i,"__tests__","index.test.ts"),rt(r)),a.success("Created __tests__/index.test.ts"),m(c(i,".gitignore"),`node_modules/
29
+ dist/
30
+ .env
31
+ .DS_Store
32
+ `),a.success("Created .gitignore"),0},"executeLibrary"),at=S((e,t)=>{switch(e.type){case"builtin:app":return Xe(e,t);case"builtin:library":return it(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},"executeBuiltin");var nt=Object.defineProperty,R=g((e,t)=>nt(e,"name",{value:t,configurable:!0}),"n$1");const ot=R((e,t)=>`${JSON.stringify({bin:{[e]:"./bin/index.js"},description:t,devDependencies:{typescript:"^5.0.0"},name:e,private:!0,scripts:{build:"tsc",dev:"tsc --watch"},type:"module",version:"0.0.1"},null,4)}
33
+ `,"packageJson"),st=R(e=>`#!/usr/bin/env node
34
+
35
+ /**
36
+ * ${e} — code generator
37
+ *
38
+ * Usage: npx ${e} [options]
39
+ */
40
+
41
+ console.log("Hello from ${e}!");
42
+ `,"binIndex"),ct=R(()=>`${JSON.stringify({compilerOptions:{declaration:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,strict:!0,target:"ES2022"},include:["src/**/*","bin/**/*"]},null,4)}
43
+ `,"tsconfigJson"),lt=R(()=>`/**
44
+ * Generator core logic — export functions used by the CLI entry point.
45
+ */
46
+
47
+ export const generate = (): void => {
48
+ // TODO: Implement your generator logic here
49
+ };
50
+ `,"srcIndex"),pt=R((e,t="")=>{const{projectName:r,targetDir:i}=e;a.info("Scaffolding code generator..."),b(i),b(c(i,"bin")),b(c(i,"src")),m(c(i,"package.json"),ot(r,t||`Code generator: ${r}`)),a.success("Created package.json");const n=c(i,"bin","index.js");return m(n,st(r)),je(n,493),a.success("Created bin/index.js (executable)"),m(c(i,"tsconfig.json"),ct()),a.success("Created tsconfig.json"),m(c(i,"src","index.ts"),lt()),a.success("Created src/index.ts"),0},"executeGeneratorTemplate");var ut=Object.defineProperty,N=g((e,t)=>ut(e,"name",{value:t,configurable:!0}),"n");const dt=N(e=>`${JSON.stringify({devDependencies:{"@visulima/vis":"latest"},name:e,packageManager:"pnpm@latest",private:!0,scripts:{build:"vis run build",dev:"vis run dev",lint:"vis run lint",test:"vis run test"},type:"module",version:"0.0.0"},null,4)}
51
+ `,"rootPackageJson"),mt=N(()=>`packages:
52
+ - "apps/*"
53
+ - "packages/*"
54
+ `,"pnpmWorkspaceYaml"),gt=N(()=>`# Dependencies
55
+ node_modules/
56
+
57
+ # Build output
58
+ dist/
59
+ .output/
60
+
61
+ # Environment
62
+ .env
63
+ .env.local
64
+ .env.*.local
65
+
66
+ # IDE
67
+ .vscode/*
68
+ !.vscode/settings.json
69
+ !.vscode/extensions.json
70
+ .idea/
71
+
72
+ # OS
73
+ .DS_Store
74
+ Thumbs.db
75
+
76
+ # Logs
77
+ *.log
78
+ npm-debug.log*
79
+ pnpm-debug.log*
80
+
81
+ # Cache
82
+ .turbo/
83
+ .cache/
84
+ `,"gitignore"),ht=N(()=>`root = true
85
+
86
+ [*]
87
+ indent_style = space
88
+ indent_size = 4
89
+ end_of_line = lf
90
+ charset = utf-8
91
+ trim_trailing_whitespace = true
92
+ insert_final_newline = true
93
+
94
+ [*.{yml,yaml}]
95
+ indent_size = 2
96
+
97
+ [*.md]
98
+ trim_trailing_whitespace = false
99
+ `,"editorconfig"),ft=N(e=>`# ${e}
100
+
101
+ A monorepo powered by [vis](https://visulima.com/packages/vis).
102
+
103
+ ## Getting Started
104
+
105
+ \`\`\`bash
106
+ # Install dependencies
107
+ pnpm install
108
+
109
+ # Run all apps in development mode
110
+ pnpm dev
111
+
112
+ # Build all packages
113
+ pnpm build
114
+
115
+ # Run tests
116
+ pnpm test
117
+ \`\`\`
118
+
119
+ ## Structure
120
+
121
+ \`\`\`
122
+ ├── apps/ # Applications
123
+ ├── packages/ # Shared packages & libraries
124
+ ├── pnpm-workspace.yaml
125
+ └── package.json
126
+ \`\`\`
127
+ `,"readmeMd"),yt=N(e=>{const{projectName:t,targetDir:r}=e;return a.info("Scaffolding monorepo workspace..."),b(r),b(c(r,"apps")),b(c(r,"packages")),m(c(r,"package.json"),dt(t)),a.success("Created package.json"),m(c(r,"pnpm-workspace.yaml"),mt()),a.success("Created pnpm-workspace.yaml"),m(c(r,".gitignore"),gt()),a.success("Created .gitignore"),m(c(r,".editorconfig"),ht()),a.success("Created .editorconfig"),m(c(r,"README.md"),ft(t)),a.success("Created README.md"),m(c(r,"apps",".gitkeep"),""),m(c(r,"packages",".gitkeep"),""),0},"executeMonorepoTemplate");var vt=Object.defineProperty,H=g((e,t)=>vt(e,"name",{value:t,configurable:!0}),"s");const bt={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},wt=H((e,t,r)=>{const i=bt[e];if(!i)return t;const n=[...t];if(i.prependCommand&&!n.includes(i.prependCommand)&&n.unshift(i.prependCommand),i.args)for(const u of i.args)n.includes(u)||n.push(u);if(r&&i.monoArgs)for(const u of i.monoArgs)n.includes(u)||n.push(u);return n},"applyAutoFixes"),kt=H((e,t)=>{const r=W(t.cwd,t.targetDir)||".",i=[...e.args];i.includes(r)||i.unshift(r);const n=wt(e.source,i,t.inMonorepo);return a.info(`Running ${e.source} via ${t.pm.name} dlx...`),le(t.pm,{additionalPackages:[],args:n,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},"executeRemoteNpm"),xt=H(async(e,t)=>{const{createConfig:r}=t;a.info(`Downloading template from ${e.source}...`);try{const i=await Se(e.source,{auth:r?.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:t.targetDir,force:!0,preferOffline:r?.preferOffline,provider:r?.defaultProvider,registry:r?.registry});return a.info(`Downloaded to ${i.dir}`),0}catch(i){const n=i instanceof Error?i.message:String(i);return a.warn(`Failed to download template: ${n}`),1}},"executeRemoteGit");var $t=Object.defineProperty,_t=g((e,t)=>$t(e,"name",{value:t,configurable:!0}),"r");const jt=_t(async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return at(e,t);case"builtin:generator":return pt(t);case"builtin:monorepo":return yt(t);case"remote:git":return xt(e,t);case"remote:npm":return kt(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},"executeTemplate");var Ct=Object.defineProperty,j=g((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"m");const St=j(e=>{const t=c(e,".vscode");b(t);const r=c(t,"settings.json"),i={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(P(r))try{const p=ae(r);m(r,`${JSON.stringify({...i,...p},null,4)}
128
+ `),a.success("Merged .vscode/settings.json")}catch{a.warn("Could not merge .vscode/settings.json, skipping")}else m(r,`${JSON.stringify(i,null,4)}
129
+ `),a.success("Created .vscode/settings.json");const n=c(t,"extensions.json"),u={recommendations:["oxc.oxc-vscode"]};if(P(n))try{const p=ae(n);m(n,`${JSON.stringify({...p,recommendations:[...new Set([...p.recommendations||[],...u.recommendations])]},null,4)}
130
+ `),a.success("Merged .vscode/extensions.json")}catch{a.warn("Could not merge .vscode/extensions.json, skipping")}else m(n,`${JSON.stringify(u,null,4)}
131
+ `),a.success("Created .vscode/extensions.json")},"generateVscodeConfig"),Pt=j((e,t)=>{const r=c(e,".ai");b(r);const i=c(r,"instructions");if(P(i))return;const n=`# Project Instructions
132
+
133
+ This project was scaffolded with vis create.
134
+
135
+ ## Development
136
+
137
+ - Package manager: ${t}
138
+ - Build: \`${t} run build\`
139
+ - Test: \`${t} run test\`
140
+ - Lint: \`${t} run lint\`
141
+
142
+ ## Conventions
143
+
144
+ - Use TypeScript strict mode
145
+ - ESM modules (\`"type": "module"\`)
146
+ - Follow Angular-style conventional commits
147
+ `;m(i,n),a.success("Created .ai/instructions")},"generateAiInstructions"),Nt=j(e=>{ye("git",["init"],{cwd:e,stdio:"pipe"}).status===0?a.success("Initialized git repository"):a.warn("Failed to initialize git repository")},"initGitRepo"),Ot=j((e,t,r,i=!1)=>(a.info("Installing dependencies..."),ke(t,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:i,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},e,r)===0?(a.success("Dependencies installed"),!0):(a.warn("Dependency installation failed (you can run install manually)"),!1)),"installDependencies"),qt=j(e=>{const t=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",r=t.includes(":")?t.split(":").pop()??t:t;return E(r)||"my-project"},"extractRepoName"),Dt=j(e=>{if(a.info(""),a.info(" Built-in templates:"),a.info(` ${k(x("vis:monorepo"))} ${d("Full pnpm workspace setup")}`),a.info(` ${k(x("vis:app"))} ${d("Application scaffold via create-vite")}`),a.info(` ${k(x("vis:library"))} ${d("Reusable TypeScript library package")}`),a.info(` ${k(x("vis:generator"))} ${d("Code generator scaffold with bin entry")}`),e&&Object.keys(e).length>0){a.info(""),a.info(" Config aliases (vis.config.ts → create.templates):");for(const[t,r]of Object.entries(e))a.info(` ${k(x(t))}${" ".repeat(Math.max(1,16-t.length))}${d(r)}`)}a.info(""),a.info(" Remote templates:"),a.info(` ${d("Any npm create-* package:")} vis create vite`),a.info(` ${d("GitHub repository:")} vis create user/repo`),a.info(` ${d("GitLab / Bitbucket:")} vis create gitlab:user/repo`),a.info(` ${d("Full URL:")} vis create https://github.com/user/repo`),a.info(""),a.info(` ${d("Template args after --:")} vis create vite -- --template react-ts`),a.info("")},"listTemplates"),Tt=j((e,t,r,i)=>{const n=_(t)===_(e)?"":e;process.stderr.write(`
148
+ `),a.success("Project created successfully!"),process.stderr.write(`
149
+ `),a.notice("Next steps:"),n&&a.info(` cd ${n}`),i||a.info(` ${r} install`),a.info(` ${r} run dev`),process.stderr.write(`
150
+ `)},"printNextSteps"),Ut=j(async({argument:e,logger:t,options:r,rawUnknown:i,visConfig:n,workspaceRoot:u})=>{const p=Array.isArray(e)?e:e?[e]:[],o=n?.create;if(r.list){Dt(o?.templates);return}const l=r.cwd||u||process.cwd(),s=!!u,w=!!process.stdin.isTTY,$=xe(l);let y,h,f,O=o?.defaultEditor,M=o?.gitInit??!1,Y=[],q=$,K=!1;if(p.length===0&&w&&!r.noInteractive){const v=await Ke({cwd:l,defaultEditor:o?.defaultEditor,defaultGitInit:o?.gitInit,defaultPm:o?.defaultPm,inMonorepo:s});y=v.template,h=v.projectName,f=_(l,v.targetDir),O=v.editor??O,M=v.gitInit,K=v.overwrite,v.pm&&(q={name:v.pm,version:$.version})}else{if(p.length===0)throw new Error(`No template specified. Usage: vis create <template> [name] [-- args...]
151
+ Use --list to see available templates, or run interactively in a terminal.`);{let v=[...i??[]];if(v.length===0){const re=process.argv.slice(2),ie=re.indexOf("--");ie!==-1&&(v=re.slice(ie+1))}const C=p.indexOf("--"),te=C===-1?p:p.slice(0,C);Y=[...C===-1?[]:p.slice(C+1),...v],y=te[0],h=te[1],h||(h=qt(y)),O=r.editor==="vscode"?"vscode":O,M=!!r.gitInit||M}}if(!y)throw new Error("No template specified.");const L=o?.templates?.[y]??y,Q=Ee(L,Y);if(!f){const v=s?Ie(Q.type):".",C=We(h,_(l,v));f=C.targetDir,h=C.packageName}const X=E(h??"");if(!ue(X))throw new Error(`Invalid project name: "${h}". Use lowercase alphanumeric characters and hyphens.`);h=X;const me=_(f),G=W(_(l),me);if(G===".."||G.startsWith(`..${be}`)||we(G))throw new Error(`Target directory "${f}" is outside the working directory. Use a name without "../" path segments.`);if(!K&&!He(f))throw new Error(`Target directory "${f}" is not empty.
152
+ Use a different name or clear the directory first.`);L!==y&&a.info(`Alias: ${k(x(y))} → ${d(L)}`),a.info(`Template: ${k(x(L))}`),a.info(`Project: ${k(h)}`),a.info(`Target: ${d(f)}`),process.stderr.write(`
153
+ `);const Z=await jt(Q,{createConfig:o,cwd:l,inMonorepo:s,logger:t,pm:q,projectName:h,targetDir:f});if(Z!==0){process.exitCode=Z;return}O==="vscode"&&St(f),P(f)&&Pt(f,q.name),M&&!s&&Nt(f);let ee=!1;o?.install!==!1&&P(c(f,"package.json"))&&(ee=Ot(f,q,t,o?.preferOffline)),Tt(f,l,q.name,ee)},"execute");export{Ut as default};
@@ -0,0 +1,42 @@
1
+ var Xt=Object.defineProperty;var M=(r,e)=>Xt(r,"name",{value:e,configurable:!0});import{createRequire as Jt}from"node:module";import{runConcurrently as Ge,TerminalBuffer as Mt,readLastRunSummary as er,enforceProjectConstraints as tr,parsePartition as rr,TaskScheduler as or,createTaskGraph as ir,generateRunSummary as ct,writeChromeTrace as nr,CompositeLifeCycle as dt,defaultTaskRunner as ut,createLogReporter as sr,writeRunSummary as lr}from"@visulima/task-runner";import{M as ar,a7 as jt,a8 as cr,a9 as dr,r as ur,s as hr,aa as fr,ab as pr,d as ht}from"./bin.js";import{E as mr,a as gr}from"../packem_shared/cache-directory-D72ZEag2.js";import{F as wr}from"../packem_shared/failure-log-DqYen0LC.js";import{f as kr,l as yr,c as vr,a as br,b as Tr}from"../packem_shared/flakiness-DSIHZGBT.js";import{r as Cr}from"../packem_shared/toolchain-DQfTQY8E.js";import{r as Sr,f as $r}from"../packem_shared/selectors-CfH9ZY08.js";import{Box as u,Text as o,StaticRender as ft,renderToString as X,ScrollView as Et,Spinner as Rr,useApp as Mr,useWindowSize as jr,useInput as pt,Dialog as Er,render as Or}from"@visulima/tui";import A,{useSyncExternalStore as Fr,useState as mt,useRef as $e,useCallback as Le,useEffect as Ae,useMemo as gt}from"react";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{T as Ot,C as He,D as je,E as Ft}from"../packem_shared/symbols-CQmER5MT.js";import{duration as Pt}from"@visulima/humanizer";import{createHooks as Pr}from"hookable";import{basename as Ar,join as We,dirname as Dr,resolve as Lt,relative as Br}from"@visulima/path";const Zt=Jt(import.meta.url),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Me=M(r=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[e,t]=Se.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Se.getBuiltinModule(r)}return Zt(r)},"__cjs_getBuiltinModule"),{createInterface:xr,emitKeypressEvents:Ir}=Me("node:readline"),{appendFile:Ue}=Me("node:fs/promises"),{platform:Lr,homedir:_e}=Me("node:os"),{watch:Nr}=Me("node:fs");var qr=Object.defineProperty,me=M((r,e)=>qr(r,"name",{value:e,configurable:!0}),"i$2");const wt=me(r=>{const e=new Set;for(const t of Object.values(r.projects))for(const s of Object.keys(t.targets??{}))e.add(s);return[...e].sort()},"collectAvailableTargets"),Gr=me(r=>{const e=new Map;for(const t of r.values())for(const[s,n]of Object.entries(t))for(const d of n.aliases??[])e.has(d)||e.set(d,s);return e},"buildAliasMap"),Hr=me((r,e)=>e.get(r)??r,"resolveTargetAlias"),Ur=me((r,e)=>{if(r.length===0)return e.length;if(e.length===0)return r.length;const t=[];for(let s=0;s<=e.length;s++)t[s]=[s];for(let s=0;s<=r.length;s++)t[0][s]=s;for(let s=1;s<=e.length;s++)for(let n=1;n<=r.length;n++){const d=e[s-1]===r[n-1]?0:1;t[s][n]=Math.min(t[s-1][n]+1,t[s][n-1]+1,t[s-1][n-1]+d)}return t[e.length][r.length]},"levenshtein"),_r=me((r,e,t=3)=>At(r,e,1,t)[0],"suggestTarget"),At=me((r,e,t=3,s=3)=>{const n=[];for(const d of e){const c=Ur(r.toLowerCase(),d.toLowerCase());c<=s&&n.push({distance:c,name:d})}return n.sort((d,c)=>d.distance-c.distance||d.name.localeCompare(c.name)),n.slice(0,t).map(d=>d.name)},"suggestTargets"),Wr=me(r=>r.length===0?" (no targets found)":r.map(e=>` - ${e}`).join(`
2
+ `),"formatTargetList"),Vr=me(async r=>{if(r.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const e=xr({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
3
+ `);for(const[n,d]of r.entries())process.stdout.write(` ${String(n+1).padStart(2," ")}. ${d}
4
+ `);process.stdout.write(`
5
+ `);const t=(await new Promise(n=>{e.question("Select a target (number or name, blank to cancel): ",n)})).trim();if(t.length===0)return;const s=Number.parseInt(t,10);return Number.isFinite(s)&&s>=1&&s<=r.length?r[s-1]:r.includes(t)?t:_r(t,r)}finally{e.close()}},"promptTargetInteractively");var zr=Object.defineProperty,Ve=M((r,e)=>zr(r,"name",{value:e,configurable:!0}),"i$1");const Yr=Ve(r=>Array.isArray(r)?`[${r.join(",")}]`:typeof r=="object"&&r!==null?JSON.stringify(r):String(r),"formatValue"),Kr=Ve((r,e,t)=>e==="_"?`${r}${Array.isArray(t)?t.join(" "):String(t)}`:`${r}--${e}=${Yr(t)}`,"formatFlags"),ze=Ve((r,e,t)=>{const s=new Set(new Set(t.map(y=>y.target.target))),n=new Set(new Set(t.map(y=>y.target.project))),d=e.filter(y=>s.has(y)),c=r.filter(y=>n.has(y)),h=t.length-c.length*d.length,m=d.length===1?"target":"targets",p=d.join(", ");let l;l=c.length===1?`project ${c[0]}`:`${c.length} projects`;let P=`${m} ${p} for ${l}`;return h>0&&(P+=` and ${h} ${h===1?"task":"tasks"} ${h===1?"it depends":"they depend"} on`),P},"formatTargetsAndProjects");var Qr=Object.defineProperty,Xr=M((r,e)=>Qr(r,"name",{value:e,configurable:!0}),"c$3");const Jr={error:"red",info:"white",success:"green"},Ne=Xr(({children:r,title:e,variant:t})=>{const s=Jr[t];return a(u,{flexDirection:"column",children:[a(u,{gap:1,children:[i(o,{bold:!0,inverse:!0,children:" VIS "}),i(o,{bold:!0,color:s,children:"•"}),i(o,{children:e})]}),r]})},"Header");var Zr=Object.defineProperty,eo=M((r,e)=>Zr(r,"name",{value:e,configurable:!0}),"s$2");const Dt=eo(({cached:r,failed:e,failedIds:t,projectNames:s,skippedIds:n,succeeded:d,targets:c,tasks:h,took:m})=>{const p=ze(s,c,h);if(e===0&&(!n||n.length===0)){const l=r>0?` (${r} read from cache)`:"";return i(ft,{children:M(()=>i(Ne,{title:`Successfully ran ${p}`,variant:"success",children:a(u,{flexDirection:"column",paddingLeft:2,children:[a(o,{children:[i(o,{color:"green",children:Ot})," ",d+r," ","tasks completed",l?i(o,{dimColor:!0,children:l}):null]}),a(o,{dimColor:!0,children:[" ","Took",m]})]})}),"children")})}return i(ft,{children:M(()=>i(Ne,{title:`Ran ${p}`,variant:"error",children:a(u,{flexDirection:"column",paddingLeft:2,children:[n&&n.length>0&&a(u,{flexDirection:"column",children:[a(o,{dimColor:!0,children:[n.length," ","task",n.length===1?"":"s"," ","skipped (dependency failed or --bail)"]}),n.map(l=>a(o,{dimColor:!0,children:[" - ",l]},l)),i(o,{})]}),e>0&&a(u,{flexDirection:"column",children:[a(o,{children:[i(o,{color:"red",children:String(e)})," ","task",e===1?"":"s"," ","failed:"]}),t.map(l=>a(o,{children:[" ",i(o,{color:"red",children:He})," ",l]},l)),i(o,{})]}),a(o,{dimColor:!0,children:[" ","Took",m]})]})}),"children")})},"CommandSummary");var to=Object.defineProperty,De=M((r,e)=>to(r,"name",{value:e,configurable:!0}),"u$2");class Re{static{M(this,"TaskStore")}static{De(this,"TaskStore")}#e;#r=new Set;#o=new Map;constructor(e){this.#e={autoExitCountdown:null,cached:0,completed:0,done:!1,endTime:null,failed:0,filterActive:!1,filterText:"",focusedPanel:"tasks",interactiveMode:!1,outputs:new Map,pinnedTaskIds:[null,null],rerunRequested:!1,retryTaskId:null,rows:e.map(t=>({status:"pending",taskId:t.id})),selectedIndex:0,startTime:Date.now(),statusFilter:"all",succeeded:0,viewMode:"list"}}getSnapshot=De(()=>this.#e,"getSnapshot");subscribe=De(e=>(this.#r.add(e),()=>{this.#r.delete(e)}),"subscribe");startTasks(e){const t=[...this.#e.rows];for(const s of e){const n=t.findIndex(d=>d.taskId===s.id);n!==-1&&(t[n]={...t[n],elapsed:0,status:"running"},this.#o.set(s.id,process.hrtime()))}this.#t({...this.#e,rows:t})}endTasks(e){const t=[...this.#e.rows];let{cached:s,completed:n,failed:d,succeeded:c}=this.#e;const h=new Map(this.#e.outputs);for(const p of e){const l=t.findIndex(P=>P.taskId===p.task.id);switch(l!==-1&&(t[l]={...t[l],duration:p.startTime&&p.endTime?p.endTime-p.startTime:void 0,status:p.status}),n++,p.status){case"failure":{d++;break}case"local-cache":case"local-cache-kept-existing":case"remote-cache":{s++;break}case"success":{c++;break}}p.terminalOutput&&!h.has(p.task.id)&&h.set(p.task.id,p.terminalOutput),this.#o.delete(p.task.id)}let{selectedIndex:m}=this.#e;if(d>this.#e.failed){const p=t.findIndex(l=>l.status==="failure");p!==-1&&(m=p)}this.#t({...this.#e,cached:s,completed:n,failed:d,outputs:h,rows:t,selectedIndex:m,succeeded:c})}static#i=256*1024;addOutput(e,t){if(!t.trim())return;let s=(this.#e.outputs.get(e)??"")+t;s.length>Re.#i&&(s=s.slice(-Re.#i)),this.#e.outputs.set(e,s),this.#t({...this.#e})}setOutput(e,t){this.#e.outputs.set(e,t),this.#t({...this.#e})}markDone(){this.#t({...this.#e,done:!0,endTime:Date.now()})}tick(){if(this.#o.size===0)return;let e=!1;const t=[...this.#e.rows];for(let s=0;s<t.length;s++){const n=t[s];if(n.status==="running"){const d=this.#o.get(n.taskId);if(d){const c=process.hrtime(d),h=c[0]*1e3+c[1]/1e6;t[s]={...n,elapsed:h},e=!0}}}e&&this.#t({...this.#e,rows:t})}setSelectedIndex(e){e!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:e})}setFocusedPanel(e){e!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:e})}setFilter(e){this.#t({...this.#e,filterText:e,selectedIndex:0})}setFilterActive(e){e!==this.#e.filterActive&&this.#t({...this.#e,filterActive:e,filterText:e?this.#e.filterText:"",selectedIndex:0})}pinTask(e,t){const s=[...this.#e.pinnedTaskIds];s[e]=t,this.#t({...this.#e,pinnedTaskIds:s})}clearPins(){this.#t({...this.#e,pinnedTaskIds:[null,null]})}requestRetry(e){const t=[...this.#e.rows],s=t.findIndex(h=>h.taskId===e);let{completed:n,failed:d,succeeded:c}=this.#e;if(s!==-1){const h=t[s].status;h==="failure"?(d=Math.max(0,d-1),n=Math.max(0,n-1)):h==="success"&&(c=Math.max(0,c-1),n=Math.max(0,n-1)),t[s]={...t[s],elapsed:0,status:"running"},this.#o.set(e,process.hrtime())}this.#t({...this.#e,completed:n,done:!1,endTime:null,failed:d,interactiveMode:!1,retryTaskId:e,rows:t,succeeded:c})}acknowledgeRetry(){const e=this.#e.retryTaskId;return e&&this.#t({...this.#e,retryTaskId:null}),e}setInteractiveMode(e){e!==this.#e.interactiveMode&&this.#t({...this.#e,interactiveMode:e})}setViewMode(e){e!==this.#e.viewMode&&this.#t({...this.#e,viewMode:e})}setStatusFilter(e){this.#t({...this.#e,selectedIndex:0,statusFilter:e})}requestRerun(){this.#o.clear(),this.#t({...this.#e,autoExitCountdown:null,cached:0,completed:0,done:!1,endTime:null,failed:0,interactiveMode:!1,outputs:new Map,rerunRequested:!0,rows:this.#e.rows.map(e=>({status:"pending",taskId:e.taskId})),startTime:Date.now(),succeeded:0,viewMode:"list"})}acknowledgeRerun(){this.#e.rerunRequested&&this.#t({...this.#e,rerunRequested:!1})}#t(e){this.#e=e;for(const t of this.#r)try{t()}catch{}}}var ro=Object.defineProperty,ce=M((r,e)=>ro(r,"name",{value:e,configurable:!0}),"t$1");const oo={d:ce(()=>" d","d"),future:"in %s",h:ce(()=>" h","h"),m:ce(()=>" m","m"),mo:ce(()=>" mo","mo"),ms:ce(()=>" ms","ms"),past:"%s ago",s:ce(()=>" s","s"),w:ce(()=>" w","w"),y:ce(()=>" y","y")},Bt={delimiter:" ",language:oo,largest:2,round:!0,spacer:"",units:["h","m","s","ms"]};ce(r=>{const e=r[0]*1e3+r[1]/1e6;return Pt(e,Bt)},"formatHrtime");const we=ce(r=>Pt(r,Bt),"formatMs");var io=Object.defineProperty,xe=M((r,e)=>io(r,"name",{value:e,configurable:!0}),"n$4");const ve=xe(r=>r==="local-cache"||r==="local-cache-kept-existing"||r==="remote-cache","isCacheStatus"),Ie=xe(r=>{switch(r){case"failure":return{color:"red",icon:He};case"local-cache":case"local-cache-kept-existing":case"remote-cache":case"success":return{color:"green",icon:Ot};case"skipped":return{color:"gray",icon:je};default:return{color:"gray",icon:"?"}}},"getStatusInfo"),Nt=xe(r=>{const{color:e,icon:t}=Ie(r);return X(A.createElement(o,{color:e},t),{columns:10}).trim()},"getStatusIcon"),no=xe(r=>{const{color:e,icon:t}=Ie(r);switch(r){case"local-cache":case"local-cache-kept-existing":case"remote-cache":return X(A.createElement(o,null,A.createElement(o,{color:e},t)," ",A.createElement(o,{color:"cyan"},"[cache]")),{columns:30}).trim();case"skipped":return X(A.createElement(o,null,A.createElement(o,{dimColor:!0},t)," ",A.createElement(o,{dimColor:!0},"[skipped]")),{columns:30}).trim();default:return X(A.createElement(o,{color:e},t),{columns:10}).trim()}},"getStatusPrefix"),so=xe((r,e,t)=>{const s=t.trim();if(!s)return;const n=`
6
+ `;if(process.env.GITHUB_ACTIONS==="true")process.stdout.write(`::group::${Nt(e)} ${r}${n}`),process.stdout.write(s+n),process.stdout.write(`::endgroup::${n}`);else{const d=process.stdout.columns||80,c=X(A.createElement(o,{dimColor:!0},je.repeat(d)),{columns:d}).trim(),h=no(e),m=X(A.createElement(o,{bold:!0},r),{columns:d}).trim();process.stdout.write(`${c}${n}`),process.stdout.write(`${h} ${m}${n}`),process.stdout.write(s+n),process.stdout.write(`${c}${n}`)}},"logCommandOutputCI");var lo=Object.defineProperty,qt=M((r,e)=>lo(r,"name",{value:e,configurable:!0}),"c$2");const ao=qt(r=>r==="running"?{color:"white",icon:"•"}:r==="pending"?{color:"gray",icon:"·"}:Ie(r),"getDisplayInfo"),kt=qt(({duration:r,focused:e,interactiveMode:t,output:s,scrollRef:n,showFullscreenHint:d,status:c,taskId:h})=>{const m=c??"pending",{icon:p}=ao(m),l=e?"bold":"single",P=m==="failure"?"red":m==="success"||ve(m)?e?"green":"gray":m==="running"?e?"white":"cyan":e?"white":"gray",y=h?`${p} ${h}`:void 0,O=r===void 0?void 0:we(r),v=h?t?"Esc cancel | Enter send":e&&m==="running"&&d?"⏎ FULLSCREEN i INPUT":e&&m==="running"?"i INPUT":e&&d?"<enter> full screen":e?void 0:"<tab> or <enter> to focus":void 0;if(!h)return a(u,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",paddingX:2,paddingY:1,children:[i(o,{dimColor:!0,children:"Select a task to view output"}),i(o,{dimColor:!0,children:"Press Enter or 1/2 to pin"})]});const S=s?s.split(`
7
+ `).map(x=>x.replace(/\r$/,"")):[];return!s&&(m==="running"||m==="pending")?i(u,{borderBottomTitle:v,borderColor:P,borderStyle:l,borderTopRightTitle:O,borderTopTitle:y,flexDirection:"column",flexGrow:1,paddingX:2,paddingY:1,children:i(u,{alignItems:"center",flexGrow:1,justifyContent:"center",children:i(o,{dimColor:!0,children:"Waiting for task output..."})})}):a(u,{borderBottomTitle:v,borderColor:t?"yellow":P,borderStyle:l,borderTopRightTitle:O,borderTopTitle:y,flexDirection:"column",flexGrow:1,children:[i(u,{flexGrow:1,flexShrink:1,paddingY:1,children:i(Et,{flexGrow:1,followOutput:!0,paddingX:2,ref:n,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:S.map((x,R)=>i(o,{children:x},String(R)))})}),t&&i(u,{flexShrink:0,justifyContent:"center",paddingX:1,children:i(o,{bold:!0,color:"yellow",children:"INTERACTIVE — keystrokes forwarded to task — Esc to exit"})})]})},"OutputPanel");var co=Object.defineProperty,Ee=M((r,e)=>co(r,"name",{value:e,configurable:!0}),"u$1");const Gt=6,Ht=8,Ut=10,uo=Ee(r=>r==="running"||r==="pending"?Ft:r==="local-cache"||r==="local-cache-kept-existing"?"Local":r==="remote-cache"?"Remote":je,"getCacheLabel"),yt=Ee((r,e)=>e[0]===r?"[1]":e[1]===r?"[2]":"","getPinLabel"),vt=Ee(({compact:r,isSelected:e,pinLabel:t,row:s})=>{const{status:n,taskId:d}=s,c=e?">":" ";let h;if(n==="running")h=a(o,{bold:!0,color:"white",children:[" ",i(Rr,{type:"dots"})," "]});else if(n==="pending")h=i(o,{bold:!0,color:"gray",children:" · "});else{const{color:p,icon:l}=Ie(n);h=a(o,{bold:!0,color:p,children:[" ",l," "]})}let m=Ft;return n!=="running"&&n!=="pending"?m=s.duration===void 0?je:we(s.duration):n==="running"&&s.elapsed!==void 0&&(m=we(s.elapsed)),a(u,{children:[i(o,{children:c}),i(u,{width:Gt,children:h}),a(u,{flexGrow:1,children:[i(o,{bold:e,inverse:e,children:d}),t?i(o,{dimColor:!0,children:` ${t}`}):null]}),!r&&i(u,{justifyContent:"flex-end",width:Ht,children:i(o,{dimColor:!ve(n),children:uo(n)})}),!r&&i(u,{justifyContent:"flex-end",width:Ut,children:i(o,{dimColor:n==="pending",children:m})})]})},"TaskListRow"),bt=Ee(({compact:r,filterActive:e,filterText:t,focused:s,headerStatus:n,parallelSlots:d=3,pinnedTaskIds:c,rows:h,scrollRef:m,selectedIndex:p,title:l})=>{const P=n==="error"?"red":n==="success"?"green":s?"white":"gray",y=h[p]?.taskId,O=h.filter(x=>x.status==="running"),v=O.length>0||h.some(x=>x.status==="pending"),S=[];if(v)for(let x=0;x<d;x++){const R=O[x];R?S.push(i(vt,{compact:r,isSelected:R.taskId===y,pinLabel:yt(R.taskId,c),row:R},`par-${R.taskId}`)):S.push(a(u,{children:[i(o,{children:" "}),i(u,{width:Gt,children:i(o,{bold:!0,color:"gray",children:" · "})}),i(o,{dimColor:!0,children:"Waiting for task..."})]},`par-empty-${String(x)}`))}return a(u,{borderColor:P,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[a(u,{flexShrink:0,gap:1,paddingX:1,children:[i(o,{bold:!0,inverse:!0,children:" VIS "}),i(o,{children:l}),!r&&a(u,{flexGrow:1,gap:0,justifyContent:"flex-end",children:[i(u,{justifyContent:"flex-end",width:Ht,children:i(o,{dimColor:!0,children:"Cache"})}),i(u,{justifyContent:"flex-end",width:Ut,children:i(o,{dimColor:!0,children:"Duration"})})]})]}),i(Et,{flexGrow:1,flexShrink:1,paddingLeft:1,paddingY:1,ref:m,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:h.map(x=>i(vt,{compact:r,isSelected:x.taskId===y,pinLabel:yt(x.taskId,c),row:x},x.taskId))}),v&&i(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",borderTop:!0,flexDirection:"column",flexShrink:0,paddingLeft:1,paddingY:1,children:S}),e&&a(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",borderTop:!0,flexShrink:0,paddingX:1,children:[i(o,{bold:!0,color:"white",children:"/ "}),i(o,{children:t}),i(o,{inverse:!0,children:" "})]})]})},"TaskListPanel");var ho=Object.defineProperty,fo=M((r,e)=>ho(r,"name",{value:e,configurable:!0}),"y");const Tt=40,Ct=10,St=100,po=fo(({autoExitSeconds:r,parallelSlots:e,projectNames:t,stdinRegistry:s,store:n,targets:d,tasks:c})=>{const{exit:h}=Mr(),{columns:m,rows:p}=jr(),l=Fr(n.subscribe,n.getSnapshot),[P,y]=mt(!1),O=$e(null),v=$e(null),S=$e(null),[x,R]=mt(!1),j=$e({list:0,splitList:0,splitOutput:0}),J=Le(()=>{l.viewMode==="list"?j.current.list=v.current?.getScrollOffset()??0:l.viewMode==="split"&&(j.current.splitList=v.current?.getScrollOffset()??0,j.current.splitOutput=S.current?.getScrollOffset()??0)},[l.viewMode]),E=Le(g=>{setTimeout(()=>{if(g==="list"){const f=j.current.list;v.current?.scrollTo(f)}else if(g==="split"){const f=j.current.splitList;f>0?v.current?.scrollTo(f):v.current?.scrollTo(Math.max(0,n.getSnapshot().selectedIndex-2)),S.current?.scrollTo(j.current.splitOutput)}},0)},[n]),Z=$e(!1);Ae(()=>{l.done&&!Z.current&&(Z.current=!0,r>0&&R(!0)),!l.done&&Z.current&&(Z.current=!1,R(!1))},[l.done,r]);const D=gt(()=>{let g=l.rows;if(l.statusFilter!=="all"&&(g=g.filter(f=>l.statusFilter==="failed"?f.status==="failure":l.statusFilter==="running"?f.status==="running"||f.status==="pending":l.statusFilter==="passed"?f.status==="success"||ve(f.status):!0)),l.filterText){const f=l.filterText.toLowerCase();g=g.filter(k=>k.taskId.toLowerCase().includes(f))}return g},[l.rows,l.filterText,l.statusFilter]),z=gt(()=>l.rows.filter(g=>g.status==="running").length,[l.rows]),ee=(D[l.selectedIndex]??null)?.taskId??null,L=l.pinnedTaskIds[0]??ee,b=L?l.rows.find(g=>g.taskId===L):null,H=L?l.outputs.get(L)??"":"",_=ze(t,d,c),N=l.done?`Completed ${_} (${we((l.endTime??Date.now())-l.startTime)})`:`Running ${_}...`,W=l.done?l.failed>0?"error":"success":"running",fe=Le(g=>{v.current?.scrollTo(Math.max(0,g-2))},[]);if(Ae(()=>{l.interactiveMode&&b?.status!=="running"&&n.setInteractiveMode(!1)},[l.interactiveMode,b?.status,n]),Ae(()=>{if(!L)return;let g=m;l.viewMode==="split"&&m>=St?g=m-Math.floor(m*.4)-2:(l.viewMode==="split"||l.viewMode==="fullscreen")&&(g=m-2);const f=Math.max(1,p-4);s.get(L)?.resize?.(g,f)},[m,p,l.viewMode,L]),pt((g,f)=>{if(f.escape){n.setInteractiveMode(!1);return}if(!L)return;const k=s.get(L);if(!k){n.setInteractiveMode(!1);return}if(f.return)k.write("\r");else if(f.upArrow)k.write("\x1B[A");else if(f.downArrow)k.write("\x1B[B");else if(f.rightArrow)k.write("\x1B[C");else if(f.leftArrow)k.write("\x1B[D");else if(f.backspace)k.write("");else if(f.delete)k.write("\x1B[3~");else if(f.tab)k.write(" ");else if(f.home)k.write("\x1B[H");else if(f.end)k.write("\x1B[F");else if(f.pageUp)k.write("\x1B[5~");else if(f.pageDown)k.write("\x1B[6~");else if(f.ctrl&&g){const re=g.toUpperCase().codePointAt(0);re!==void 0&&re>=65&&re<=90&&k.write(String.fromCodePoint(re-64))}else g&&k.write(g)},{isActive:l.interactiveMode}),pt((g,f)=>{if(g==="c"&&f.ctrl){h();return}if(!x){if(P){f.escape||g==="?"?y(!1):g==="q"?(y(!1),R(!0)):f.downArrow||g==="j"?O.current?.scrollBy(1):f.upArrow||g==="k"?O.current?.scrollBy(-1):f.pageDown?O.current?.scrollBy(5):f.pageUp?O.current?.scrollBy(-5):f.home?O.current?.scrollToTop():f.end&&O.current?.scrollToBottom();return}if(g==="?"){y(!0);return}if(g==="q"){R(!0);return}if(g==="r"&&l.done){n.requestRerun();return}if(g==="R"&&l.done){const k=D[l.selectedIndex];k?.status==="failure"&&n.requestRetry(k.taskId);return}if(g==="F"&&!l.filterActive){const k=["all","failed","running","passed"],re=k.indexOf(l.statusFilter);n.setStatusFilter(k[(re+1)%k.length]);return}if(l.filterActive){if(f.escape){n.setFilterActive(!1);return}if(f.return){n.setFilterActive(!1);return}if(f.backspace){n.setFilter(l.filterText.slice(0,-1));return}if(g&&!f.ctrl&&!f.meta){n.setFilter(l.filterText+g);return}return}if(g==="i"&&b?.status==="running"&&(l.viewMode==="fullscreen"||l.viewMode==="split"&&l.focusedPanel==="output")){n.setInteractiveMode(!0);return}if(l.viewMode==="fullscreen"){if(f.escape){n.setViewMode("split"),E("split");return}if(f.downArrow||g==="j"){S.current?.scrollBy(1);return}if(f.upArrow||g==="k"){S.current?.scrollBy(-1);return}if(f.pageDown||f.ctrl&&g==="d"){S.current?.scrollBy(12);return}if(f.pageUp||f.ctrl&&g==="u"){S.current?.scrollBy(-12);return}if(f.home){S.current?.scrollToTop();return}if(f.end){S.current?.scrollToBottom();return}return}if(l.viewMode==="split"){if(f.tab){const k=l.focusedPanel==="tasks"?"output":"tasks";n.setFocusedPanel(k);return}if(l.focusedPanel==="output"){if(f.escape){n.setFocusedPanel("tasks");return}if(f.return){J(),n.setViewMode("fullscreen");return}if(f.downArrow||g==="j"){S.current?.scrollBy(1);return}if(f.upArrow||g==="k"){S.current?.scrollBy(-1);return}if(f.pageDown||f.ctrl&&g==="d"){S.current?.scrollBy(12);return}if(f.pageUp||f.ctrl&&g==="u"){S.current?.scrollBy(-12);return}if(f.home){S.current?.scrollToTop();return}if(f.end){S.current?.scrollToBottom();return}return}if(f.escape){n.setViewMode("list"),E("list");return}if(f.return){n.setFocusedPanel("output");return}}if(l.viewMode==="list"||l.viewMode==="split"&&l.focusedPanel==="tasks"){if(f.downArrow||g==="j"){const k=Math.min(l.selectedIndex+1,Math.max(0,D.length-1));n.setSelectedIndex(k),fe(k);return}if(f.upArrow||g==="k"){const k=Math.max(l.selectedIndex-1,0);n.setSelectedIndex(k),fe(k);return}if(f.return&&l.viewMode==="list"){J(),j.current.splitList=0,j.current.splitOutput=0,n.setViewMode("split"),n.setFocusedPanel("output"),E("split");return}if(g==="/"){n.setFilterActive(!0);return}if(g==="1"&&ee){n.pinTask(0,ee);return}if(g==="2"&&ee){n.pinTask(1,ee);return}if(g==="0"){n.clearPins();return}f.escape&&l.filterText&&n.setFilter("")}}},{isActive:!l.interactiveMode}),m<Tt||p<Ct)return i(u,{alignItems:"center",height:p,justifyContent:"center",width:m,children:a(o,{color:"yellow",children:["Terminal too small (",m,"x",p,"). Minimum:"," ",Tt,"x",Ct]})});const F=a(u,{gap:1,children:[l.succeeded>0&&a(o,{bold:!0,color:"green",children:["✓"," ",l.succeeded]}),l.failed>0&&a(o,{bold:!0,color:"red",children:["✗"," ",l.failed]}),z>0&&a(o,{color:"cyan",children:["◷"," ",z]}),a(o,{dimColor:!0,children:[l.rows.length," ","total"]}),l.statusFilter!=="all"&&a(o,{color:"yellow",children:["[",l.statusFilter,"]"]})]});let te;if(l.viewMode==="fullscreen")te=[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"Esc"}),i(o,{dimColor:!0,children:"BACK"})]},"esc"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"↑↓"}),i(o,{dimColor:!0,children:"SCROLL"})]},"scroll"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"^u ^d"}),i(o,{dimColor:!0,children:"PAGE"})]},"page"),...b?.status==="running"?[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"i"}),i(o,{dimColor:!0,children:"INPUT"})]},"i")]:[],a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"q"}),i(o,{dimColor:!0,children:"QUIT"})]},"q")];else if(l.done){const g=D[l.selectedIndex]?.status==="failure";te=[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"q"}),i(o,{dimColor:!0,children:"QUIT"})]},"q"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"r"}),i(o,{dimColor:!0,children:"RERUN"})]},"r"),...g?[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"R"}),i(o,{dimColor:!0,children:"RETRY"})]},"R")]:[],a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"?"}),i(o,{dimColor:!0,children:"HELP"})]},"?"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"↑↓"}),i(o,{dimColor:!0,children:"NAV"})]},"nav"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"F"}),i(o,{dimColor:!0,children:"FILTER"})]},"F"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"⏎"}),i(o,{dimColor:!0,children:l.viewMode==="list"?"OUTPUT":"FULLSCREEN"})]},"enter")]}else l.viewMode==="split"&&l.focusedPanel==="output"?te=[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"q"}),i(o,{dimColor:!0,children:"QUIT"})]},"q"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"Esc"}),i(o,{dimColor:!0,children:"BACK"})]},"esc"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"↑↓"}),i(o,{dimColor:!0,children:"SCROLL"})]},"scroll"),...b?.status==="running"?[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"i"}),i(o,{dimColor:!0,children:"INPUT"})]},"i")]:[],a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"⏎"}),i(o,{dimColor:!0,children:"FULLSCREEN"})]},"enter"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"Tab"}),i(o,{dimColor:!0,children:"PANEL"})]},"tab"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"?"}),i(o,{dimColor:!0,children:"HELP"})]},"?")]:te=[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"q"}),i(o,{dimColor:!0,children:"QUIT"})]},"q"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"?"}),i(o,{dimColor:!0,children:"HELP"})]},"?"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"↑↓"}),i(o,{dimColor:!0,children:"NAV"})]},"nav"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"/"}),i(o,{dimColor:!0,children:"FILTER"})]},"/"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"F"}),i(o,{dimColor:!0,children:"STATUS"})]},"F"),a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"⏎"}),i(o,{dimColor:!0,children:l.viewMode==="list"?"OUTPUT":"FULLSCREEN"})]},"enter"),...l.viewMode==="split"?[a(u,{gap:1,children:[i(o,{bold:!0,color:"white",children:"Tab"}),i(o,{dimColor:!0,children:"PANEL"})]},"tab")]:[]];const K=a(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,justifyContent:"space-between",children:[i(u,{flexGrow:1,flexWrap:"wrap",gap:2,paddingX:1,children:te}),i(u,{flexShrink:0,paddingX:1,children:F})]}),ne=a(Er,{backgroundColor:"#1e1e1e",footer:a(o,{dimColor:!0,children:[i(o,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",i(o,{bold:!0,color:"white",children:"?"}),"/",i(o,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:O,title:"KEYBOARD SHORTCUTS",visible:P,width:52,children:[a(u,{flexDirection:"column",marginBottom:1,children:[a(u,{marginBottom:1,children:[i(o,{dimColor:!0,children:"── "}),i(o,{bold:!0,color:"white",children:"NAVIGATION"})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","↑","/k"]}),i(o,{dimColor:!0,children:" Move up"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","↓","/j"]}),i(o,{dimColor:!0,children:" Move down"})]})]}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","Tab"]}),i(o,{dimColor:!0,children:" Switch panel (split)"})]}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","Esc"]}),i(o,{dimColor:!0,children:" Back / close"})]}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","Enter"]}),i(o,{dimColor:!0,children:" Show output / fullscreen"})]})]}),a(u,{flexDirection:"column",marginBottom:1,children:[a(u,{marginBottom:1,children:[i(o,{dimColor:!0,children:"── "}),i(o,{bold:!0,color:"white",children:"VIEWS"})]}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","Enter"]}),a(o,{dimColor:!0,children:[" ","List"," ","→"," ","Split"," ","→"," ","Fullscreen"]})]}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","Esc"]}),a(o,{dimColor:!0,children:[" ","Fullscreen"," ","→"," ","Split"," ","→"," ","List"]})]})]}),a(u,{flexDirection:"column",marginBottom:1,children:[a(u,{marginBottom:1,children:[i(o,{dimColor:!0,children:"── "}),i(o,{bold:!0,color:"white",children:"ACTIONS"})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","/"]}),i(o,{dimColor:!0,children:" Filter by text"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","F"]}),i(o,{dimColor:!0,children:" Filter by status"})]})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","1"]}),i(o,{dimColor:!0,children:"/"}),i(o,{bold:!0,color:"white",children:"2"}),i(o,{dimColor:!0,children:" Pin to output pane"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","0"]}),i(o,{dimColor:!0,children:" Clear pins"})]})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","r"]}),i(o,{dimColor:!0,children:" Rerun all (done)"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","R"]}),i(o,{dimColor:!0,children:" Retry failed task"})]})]}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","i"]}),i(o,{dimColor:!0,children:" Interactive input (running task)"})]})]}),a(u,{flexDirection:"column",marginBottom:1,children:[a(u,{marginBottom:1,children:[i(o,{dimColor:!0,children:"── "}),i(o,{bold:!0,color:"white",children:"SCROLLING"}),i(o,{dimColor:!0,children:" (output panel)"})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","↑","/k"]}),i(o,{dimColor:!0,children:" Scroll up"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","↓","/j"]}),i(o,{dimColor:!0,children:" Scroll down"})]})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","^u"]}),i(o,{dimColor:!0,children:" Page up"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","^d"]}),i(o,{dimColor:!0,children:" Page down"})]})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","Home"]}),i(o,{dimColor:!0,children:" Top"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","End"]}),i(o,{dimColor:!0,children:" Bottom"})]})]})]}),a(u,{flexDirection:"column",children:[a(u,{marginBottom:1,children:[i(o,{dimColor:!0,children:"── "}),i(o,{bold:!0,color:"white",children:"GENERAL"})]}),a(u,{children:[i(u,{width:24,children:a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","q"]}),i(o,{dimColor:!0,children:" Quit"})]})}),a(o,{children:[a(o,{bold:!0,color:"white",children:[" ","?"]}),i(o,{dimColor:!0,children:" Toggle help"})]})]})]})]}),de=i(ar,{autoExitSeconds:r>0?r:3,onCancel:M(()=>{R(!1)},"onCancel"),visible:x});if(l.viewMode==="fullscreen")return a(u,{flexDirection:"column",height:p,width:m,children:[i(u,{flexGrow:1,children:i(kt,{duration:b?.duration??b?.elapsed,focused:!0,interactiveMode:l.interactiveMode,output:H,scrollRef:S,status:b?.status,taskId:L})}),K,de,ne]});if(l.viewMode==="split"){const g=m>=St,f=i(bt,{compact:!0,filterActive:l.filterActive,filterText:l.filterText,focused:l.focusedPanel==="tasks",headerStatus:W,parallelSlots:e,pinnedTaskIds:l.pinnedTaskIds,rows:D,scrollRef:v,selectedIndex:l.selectedIndex,title:N}),k=i(kt,{duration:b?.duration??b?.elapsed,focused:l.focusedPanel==="output",interactiveMode:l.interactiveMode,output:H,scrollRef:S,showFullscreenHint:!0,status:b?.status,taskId:L});if(g){const ke=Math.floor(m*.4);return a(u,{flexDirection:"column",height:p,width:m,children:[a(u,{flexDirection:"row",flexGrow:1,children:[i(u,{width:ke,children:f}),i(u,{flexGrow:1,children:k})]}),K,de,ne]})}const re=Math.floor(p*.45);return a(u,{flexDirection:"column",height:p,width:m,children:[i(u,{height:re,children:f}),i(u,{flexGrow:1,children:k}),K,de,ne]})}return a(u,{flexDirection:"column",height:p,width:m,children:[i(u,{flexGrow:1,children:i(bt,{filterActive:l.filterActive,filterText:l.filterText,focused:!0,headerStatus:W,parallelSlots:e,pinnedTaskIds:l.pinnedTaskIds,rows:D,scrollRef:v,selectedIndex:l.selectedIndex,title:N})}),K,de,ne]})},"VisTaskRunnerApp");var mo=Object.defineProperty,ye=M((r,e)=>mo(r,"name",{value:e,configurable:!0}),"n$3");const go=ye(r=>{const{args:e,autoExit:t=!1,outputStyle:s="normal",projectNames:n,stdinRegistry:d,tasks:c}=r,h=new Re(c),m=typeof e.parallel=="number"?e.parallel:3,p=t===!0?3:typeof t=="number"?t:0;let l,P;const y=new Promise(E=>{P=E});let O;const v=ye(()=>{O&&(clearInterval(O),O=void 0)},"cleanup"),S=ye(()=>{if(d){for(const E of d.values())E.kill?.();d.clear()}},"killAllPtyProcesses"),x=ye(()=>{v(),J(),S(),process.stdout.write("\x1B[?1049l\x1B[?25h"),l?.cleanup(),process.exit(1)},"onSignal"),R=ye(()=>{const E=h.getSnapshot(),Z=we(Date.now()-E.startTime),D=E.rows.filter(L=>L.status==="failure").map(L=>L.taskId),z=process.stdout.columns||80;process.stdout.write(`
8
+ `);for(const L of E.rows){const{status:b,taskId:H}=L,_=Ie(b);let N="";switch(b){case"local-cache":case"local-cache-kept-existing":{N=" [local cache]";break}case"remote-cache":{N=" [remote cache]";break}case"skipped":{N=" [skipped]";break}}const W=X(A.createElement(o,null," ",A.createElement(o,{color:_.color},_.icon),` vis run ${H}`,N?A.createElement(o,{dimColor:!0},` ${N}`):null),{columns:z});process.stdout.write(`${W}
9
+ `)}process.stdout.write(`
10
+ `);const ee=X(A.createElement(Dt,{cached:E.cached,failed:E.failed,failedIds:D,projectNames:n,succeeded:E.succeeded,targets:e.targets,tasks:c,took:Z}),{columns:z});if(process.stdout.write(`${ee}
11
+ `),D.length>0&&s!=="quiet")for(const L of D){const b=E.outputs.get(L);if(b?.trim()){const H=X(A.createElement(o,null,`
12
+ `,A.createElement(o,{bold:!0,color:"red"},` ${He} vis run ${L}`)),{columns:z});process.stdout.write(`${H}
13
+
14
+ `);const _=b.trim().split(`
15
+ `).map(N=>` ${N}`).join(`
16
+ `);process.stdout.write(`${_}
17
+ `)}}},"printExitSummary");let j;const J=ye(()=>{j&&(clearInterval(j),j=void 0)},"clearKeepAlive");return{lifeCycle:{endCommand(){v(),h.markDone(),j||(j=setInterval(()=>{},1e3)),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume())},endTasks(E){h.endTasks(E)},printTaskTerminalOutput(E,Z,D){h.getSnapshot().outputs.has(E.id)||h.addOutput(E.id,D)},startCommand(){process.on("SIGINT",x),process.on("SIGTERM",x),j||(j=setInterval(()=>{},1e3)),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume()),l=Or(A.createElement(po,{autoExitSeconds:p,parallelSlots:m,projectNames:n,stdinRegistry:d??new Map,store:h,targets:e.targets,tasks:c}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}),l.waitUntilExit().then(()=>{J(),S(),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),R(),P()},()=>{J(),S(),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),P()})},startTasks(E){h.startTasks(E),O||(O=setInterval(()=>{h.tick()},100))}},renderIsDone:y,store:h}},"createDynamicOutputRenderer");var wo=Object.defineProperty,Ye=M((r,e)=>wo(r,"name",{value:e,configurable:!0}),"l$1");const ko=Ye(r=>r==="quiet"?"quiet":"normal","parseOutputStyle"),yo=Ye((r,e)=>{const t=r.overrides.visOptions;return t?.outputStyle==="normal"||t?.outputStyle==="quiet"?t.outputStyle:e},"resolveTaskOutputStyle");class vo{static{M(this,"StaticOutputLifeCycle")}static{Ye(this,"StaticOutputLifeCycle")}#e;#r;#o;#i=[];#t=[];#n=new Map;#s;#l;#a=0;constructor(e){this.#e=e.projectNames,this.#r=e.args.targets,this.#o=e.tasks,this.#s=e.logReporter,this.#l=e.outputStyle??"normal"}startCommand(){this.#a=Date.now();const e=process.stdout.columns||80,t=`Running ${ze(this.#e,this.#r,this.#o)}`,s=X(A.createElement(Ne,{title:t,variant:"info"}),{columns:e});process.stdout.write(s);const n=this.#o[0],d=n?.overrides?Object.entries(n.overrides).filter(([c])=>c!=="command"):[];if(d.length>0){process.stdout.write(`
18
+ With additional flags:
19
+ `);for(const[c,h]of d)process.stdout.write(`${Kr(" ",c,h)}
20
+ `)}process.stdout.write(`
21
+ `)}startTasks(e){const t=process.stdout.columns||80;for(const s of e){const n=X(A.createElement(o,null,A.createElement(o,{dimColor:!0},">"),` ${s.id}`),{columns:t});process.stdout.write(`${n}
22
+ `)}}endTasks(e){const t=process.stdout.columns||80;for(const s of e){this.#n.set(s.task.id,s),s.status==="failure"?this.#i.push(s):ve(s.status)&&this.#t.push(s);const n=Nt(s.status),d=s.startTime&&s.endTime?` (${we(s.endTime-s.startTime)})`:"",c=ve(s.status)?" [cache]":"",h=X(A.createElement(o,null,n,` ${s.task.id}`,c?A.createElement(o,{color:"cyan"},c):null,d?A.createElement(o,{dimColor:!0},d):null),{columns:t});process.stdout.write(`${h}
23
+ `)}}printTaskTerminalOutput(e,t,s){if(!(yo(e,this.#l)==="quiet"&&(t==="success"||ve(t)))){if(this.#s){this.#s.printTaskTerminalOutput(e,t,s);return}so(e.id,t,s)}}endCommand(){const e=we(Date.now()-this.#a),t=this.#o.filter(d=>!this.#n.has(d.id)).map(d=>d.id);process.stdout.write(`
24
+ `);const s=process.stdout.columns||80,n=X(A.createElement(Dt,{cached:this.#t.length,failed:this.#i.length,failedIds:this.#i.map(d=>d.task.id),projectNames:this.#e,skippedIds:t.length>0?t:void 0,succeeded:this.#n.size-this.#i.length-this.#t.length,targets:this.#r,tasks:this.#o,took:e}),{columns:s});process.stdout.write(`${n}
25
+ `)}}var bo=Object.defineProperty,Oe=M((r,e)=>bo(r,"name",{value:e,configurable:!0}),"t");const To=Oe(()=>Pr(),"createVisHooks"),Co=Oe(async(r,e)=>{if(!(!e||e.length===0))for(const t of e){if(t.hooks)for(const[s,n]of Object.entries(t.hooks)){const d=Array.isArray(n)?n:[n];for(const c of d)r.hook(s,c)}t.setup&&await t.setup(r)}},"registerPlugins");class So{static{M(this,"HookableLifeCycle")}static{Oe(this,"HookableLifeCycle")}#e;#r;#o=new Map;constructor(e,t){this.#e=e,this.#r=t}startTasks(e){for(const t of e)this.#o.set(t.id,t),this.#i("task:before",t)}endTasks(e){for(const t of e)this.#o.delete(t.task.id),this.#i("task:after",t.task,t),t.status==="failure"?this.#i("task:failure",t.task,t):$o(t.status)&&this.#i("task:cacheHit",t.task,t)}printCacheMiss(e,t){this.#i("task:cacheMiss",e,t)}onTaskStdout(e,t){this.#i("task:stdout",e,t)}onTaskStderr(e,t){this.#i("task:stderr",e,t)}#i(e,...t){Promise.resolve(this.#e.callHook(e,...t)).catch(s=>{if(this.#r)try{this.#r(e,s)}catch{}})}}const $o=Oe(r=>r==="local-cache"||r==="local-cache-kept-existing"||r==="remote-cache","isCacheStatus");var xo=Object.defineProperty,Fe=M((r,e)=>xo(r,"name",{value:e,configurable:!0}),"o");const Io=Fe(async r=>{if(process.env.VIS_NO_SHELL_HISTORY||Lr()==="win32")return;const e=process.env.SHELL;if(!e)return;const t=Ar(e);try{if(t==="zsh"){await Ro(r);return}if(t==="bash"){await Mo(r);return}t==="fish"&&await jo(r)}catch{}},"appendToShellHistory"),Ro=Fe(async r=>{const e=process.env.HISTFILE??We(process.env.ZDOTDIR??_e(),".zsh_history"),t=`: ${Math.floor(Date.now()/1e3)}:0;${r}
26
+ `;await Ue(e,t)},"writeZshHistory"),Mo=Fe(async r=>{const e=process.env.HISTFILE??We(_e(),".bash_history");await Ue(e,`${r}
27
+ `)},"writeBashHistory"),jo=Fe(async r=>{const e=We(_e(),".local","share","fish","fish_history"),t=`- cmd: ${r.replaceAll("\\","\\\\").replaceAll(`
28
+ `,String.raw`\n`)}
29
+ when: ${Math.floor(Date.now()/1e3)}
30
+ `;await Ue(e,t)},"writeFishHistory");var Eo=Object.defineProperty,Be=M((r,e)=>Eo(r,"name",{value:e,configurable:!0}),"e");const Oo=Be(r=>{const{killGracePeriodMs:e=5e3,onTimeout:t,sendSignal:s,timeoutMs:n}=r;if(n<=0)return{cancel:Be(()=>{},"cancel")};const d=Math.max(e,0);let c;const h=setTimeout(()=>{t?.(),s("SIGTERM"),d>0&&(c=setTimeout(()=>{s("SIGKILL")},d))},n);return{cancel:Be(()=>{clearTimeout(h),c&&clearTimeout(c)},"cancel")}},"scheduleTimeoutKill");var Fo=Object.defineProperty,be=M((r,e)=>Fo(r,"name",{value:e,configurable:!0}),"l");const Po=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/,/\.task-runner(?:\/|$)/],$t=be((r,e)=>{const t=new Set,s=new Set;for(const[,c]of r){const h=c.task.hashDetails?.nodes;if(h)for(const m of Object.keys(h))t.add(m),s.add(Dr(Lt(e,m)))}const n=[...s].sort(),d=[];for(const c of n)d.some(h=>c===h||c.startsWith(`${h}/`))||d.push(c);return{directories:d,files:t}},"collectTrackedWatchTargets"),Lo=be((r,e,t)=>{const s=new Set;for(const n of r){const d=Lt(e,n);for(const c of t)if(d===c||d.startsWith(`${c}/`)){const h=Br(c,d);h.length>0&&s.add(h)}}return n=>{const d=n.replaceAll("\\","/");return s.has(d)}},"createTrackedFileFilter"),Ao=be(r=>{const e=r.replaceAll("\\","/");return Po.some(t=>t.test(e))},"shouldIgnore"),xt=be(r=>{const{debounceMs:e=150,filter:t,onChange:s,paths:n}=r,d=[];let c=new Set,h;const m=be(()=>{h=void 0;const p=[...c];c=new Set,p.length!==0&&Promise.resolve(s(p)).catch(l=>{console.error("[vis watch] onChange handler failed:",l)})},"flush");for(const p of n)try{const l=Nr(p,{recursive:!0},(P,y)=>{y&&(Ao(y)||t&&!t(y)||(c.add(y),h&&clearTimeout(h),h=setTimeout(m,e)))});d.push(l)}catch(l){console.warn(`[vis watch] unable to watch ${p}: ${l.message}`)}return{close:be(()=>{h&&clearTimeout(h);for(const p of d)try{p.close()}catch{}},"close")}},"startWatcher");var Do=Object.defineProperty,Bo=M((r,e)=>Do(r,"name",{value:e,configurable:!0}),"n$1");const No=Bo((r,e)=>{const t=e?.trim();if(!t)return{filter:void 0,tasks:[...r]};const s=t.toLowerCase();return{filter:t,tasks:r.filter(n=>n.target.project.toLowerCase().includes(s))}},"applyProjectFilter");var qo=Object.defineProperty,he=M((r,e)=>qo(r,"name",{value:e,configurable:!0}),"n");const Go=[""," Watch keybinds:"," r, Enter rerun"," a rerun all (clear filter)"," p filter by project name"," q, Ctrl+C quit"," h, ? show this help",""].join(`
31
+ `),Ho=he(r=>{r.write(`${Go}
32
+ `)},"writeHelp"),Uo=he(async(r,e)=>{e.write("filter projects (empty to cancel) > ");const t=r,s=t.isRaw===!0;if(s)try{t.setRawMode?.(!1)}catch{}return await new Promise(n=>{let d="";const c=he(h=>{d+=typeof h=="string"?h:h.toString("utf8");const m=d.indexOf(`
33
+ `);if(m===-1)return;const p=d.slice(0,m).replace(/\r$/,"").trim();if(r.off("data",c),s)try{t.setRawMode?.(!0)}catch{}n(p.length>0?p:void 0)},"onData");r.on("data",c)})},"defaultPromptFilter"),_o=he(r=>{const{handlers:e}=r,t=r.input??process.stdin,s=r.output??process.stdout,n=r.promptFilter??Uo;if(!t||t.isTTY===!1)return{close:he(()=>{},"close")};Ir(t);const d=t.isRaw===!0;try{t.setRawMode?.(!0)}catch{return{close:he(()=>{},"close")}}typeof t.resume=="function"&&t.resume();let c=!1;const h=he(async p=>{if(p.ctrl===!0&&p.name==="c"){await e.onQuit();return}if(!c)switch(p.name){case"?":case"h":{await e.onHelp();break}case"a":{await e.onClearFilter();break}case"p":{c=!0;try{const l=await n(t,s);l===void 0?s.write(`filter cancelled.
34
+ `):await e.onFilter(l)}finally{c=!1}break}case"q":{await e.onQuit();break}case"r":{await e.onRerun();break}case"return":{await e.onRerun();break}}},"dispatch"),m=he((p,l)=>{h(l).catch(P=>{s.write(`[vis watch] keybind handler failed: ${P.message}
35
+ `)})},"onKeypress");return t.on("keypress",m),{close:he(()=>{if(t.off("keypress",m),!d)try{t.setRawMode?.(!1)}catch{}const p=t;if(typeof p.pause=="function")try{p.pause()}catch{}},"close")}},"installKeybinds");var Wo=Object.defineProperty,C=M((r,e)=>Wo(r,"name",{value:e,configurable:!0}),"i");const Ke="VIS_AFFECTED_FILES",_t=C((r,e,t)=>t||!e?r:e.startsWith("/")?e:`${r}/${e}`,"resolveCwd"),It=C(async(r,e,t,s)=>{const n=r.map(d=>{const c=d.overrides.command;if(!c)return;const h=d.overrides.visOptions,m=_t(e,d.projectRoot,!!h?.runFromWorkspaceRoot),p=h?.envFile?jt(m,h.envFile):{},l=t&&(h?.affectedFiles==="env"||h?.affectedFiles==="both")?{[Ke]:t.join(`
36
+ `)}:{};return{command:c,cwd:m,env:{INIT_CWD:s,...p,...l},name:d.id}}).filter(d=>d!==void 0);n.length!==0&&await Ge(n,{killOthers:["failure"]})},"runPersistentTasks"),qe=256*1024;class Vo{static{M(this,"Me")}static{C(this,"OutputRingBuffer")}#e;#r="";#o=!1;constructor(e){this.#e=e}append(e){this.#r+=e,this.#r.length>this.#e&&(this.#r=this.#r.slice(-this.#e),this.#o=!0)}toString(){return this.#o?`[...output truncated, showing last ${Math.round(this.#e/1024)}KB...]
37
+ ${this.#r}`:this.#r}}const Wt=C(r=>{const e=r.overrides.visOptions;if(e&&typeof e=="object")return e},"getTaskOptions"),Qe=C(r=>`'${r.replaceAll("'",String.raw`'\''`)}'`,"singleQuoteEscape"),zo=C((r,e,t)=>{if(!e||e.length===0||t===!1||t===void 0)return r;if(t==="args"||t==="both"){const s=e.map(Qe).join(" ");return`${r} ${s}`}return r},"buildAffectedFilesArgs"),Vt="visForwardedArgs",Yo=C((r,e)=>{const t=e.overrides[Vt];if(!Array.isArray(t)||t.length===0)return r;const s=t.map(Qe).join(" ");return`${r} ${s}`},"appendForwardedArgs"),Ko=C(async(r,e,t)=>{if(!e)return t();const s=r.get(e)??Promise.resolve();let n;const d=new Promise(h=>{n=h}),c=s.then(()=>d);r.set(e,c),await s;try{return await t()}finally{n(),r.get(e)===c&&r.delete(e)}},"withMutex"),Qo=C(r=>{let e=Math.max(0,Math.floor(r));return{claim(t){const s=Math.max(0,Math.min(t,e));return e-=s,s},get remaining(){return e}}},"createRetryBudget"),Xo=C((r,e,t)=>{const s=`${e}\0${typeof t=="string"?t:String(t)}`,n=r.get(s);if(n)return n;const d=jt(e,t);return r.set(s,d),d},"loadEnvFileCached"),Rt=C(r=>{const e=new Map;return async(t,s)=>{const{affectedFiles:n,currentOs:d,initCwd:c,lifeCycle:h,mutexPool:m,onOutput:p,onOutputReplace:l,retryBudget:P,stdinRegistry:y,workspaceRoot:O}=r,v=Wt(t),S=_t(O,s.cwd??t.projectRoot,v?.runFromWorkspaceRoot===!0),x=t.overrides.command;if(!x)return{code:0,terminalOutput:`No command configured for ${t.target.project}:${t.target.target}`};const R=Yo(x,t),j=zo(R,n,v?.affectedFiles),J=cr(v,d),E=J?`${J} -c ${Qe(j)}`:j,Z=v?.envFile?Xo(e,S,v.envFile):void 0,D={};n&&n.length>0&&(v?.affectedFiles==="env"||v?.affectedFiles==="both")&&(D[Ke]=n.join(`
38
+ `));const z={INIT_CWD:c,...Z,...s.env,...D},ee=v?.pty===!0,L=!!y,b=L||ee;b&&(t.cache=!1);const H=b?void 0:new Vo(qe),_=b?new Mt(qe):void 0;let N;const W=C(F=>{if(F.kind==="started"&&(N=F.kill,F.write&&y&&y.set(t.id,{kill:F.kill,resize:F.resize,write:F.write})),(F.kind==="stdout"||F.kind==="stderr")&&F.text!==void 0)if(F.kind==="stdout"?h?.onTaskStdout?.(t,F.text):h?.onTaskStderr?.(t,F.text),_)_.write(F.text),L&&l?.(t.id,_.toString());else{const te=`${F.text}
39
+ `;H.append(te),p?.(t.id,te)}F.kind==="close"&&y&&y.delete(t.id)},"onEvent"),fe=C(async()=>{const F=v?.retryCount??0,te=v?.retryDelay,K=P?P.claim(F):F,ne=typeof v?.timeout=="number"&&v.timeout>0?v.timeout:0,de=typeof v?.killGracePeriodMs=="number"&&v.killGracePeriodMs>=0?v.killGracePeriodMs:5e3;let g=!1;const f=Oo({killGracePeriodMs:de,onTimeout:C(()=>{g=!0},"onTimeout"),sendSignal:C(Te=>{N?.(Te)},"sendSignal"),timeoutMs:ne});let k;try{k=await Ge([{command:E,cwd:S,env:z,name:t.id,...b?{ptySize:{cols:process.stdout.columns??80,rows:process.stdout.rows??24},stdin:"pty"}:{}}],{killOthers:["failure"],onEvent:W,...K>0?{restart:{delay:te??"exponential",tries:K}}:{}})}finally{f.cancel()}const re=k.closeEvents[0],ke=_?_.toString():H.toString();return g?{code:124,terminalOutput:`${ke}
40
+ [timeout] Task "${t.id}" exceeded ${ne}ms budget.
41
+ `}:{code:re?.exitCode??1,terminalOutput:ke}},"runOnce");return m?Ko(m,v?.mutex,fe):fe()}},"createConcurrentExecutor"),Jo=C(r=>{if(!r||r.trim().length===0)return;const e=Number.parseFloat(r);return!Number.isFinite(e)||e<=0?{invalid:r}:{value:Math.floor(e)}},"parseEnvConcurrency"),Zo=C(async(r,e)=>{const t=await er(r);if(!t){e.warn("No previous run recorded yet. Run a task at least once to populate .task-runner/last-summary.json.");return}const s=(t.duration/1e3).toFixed(2);if(e.info(""),e.info(`Last run — ${t.startTime} (${s}s)`),e.info(""),e.info(` Total: ${String(t.stats.total)}`),e.info(` Succeeded: ${String(t.stats.succeeded)}`),e.info(` Cached: ${String(t.stats.cached)}`),e.info(` Failed: ${String(t.stats.failed)}`),e.info(` Skipped: ${String(t.stats.skipped)}`),e.info(""),t.stats.failed>0){const d=t.tasks.filter(c=>c.exitCode!==void 0&&c.exitCode!==0);e.info("Failed tasks:");for(const c of d){const h=c.duration??0;e.info(` × ${c.taskId} (exit ${String(c.exitCode??-1)}, ${h}ms)`)}e.info("")}const n=[...t.tasks].filter(d=>typeof d.duration=="number").sort((d,c)=>(c.duration??0)-(d.duration??0)).slice(0,5);if(n.length>0){e.info("Slowest tasks:");for(const d of n)e.info(` ${d.taskId.padEnd(40)} ${String(d.duration??0).padStart(6)}ms [${d.cacheStatus}]`);e.info("")}},"renderLastRunSummary"),gi=C(async({argument:r,logger:e,options:t,runtime:s,visConfig:n,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const c=d;if(t.lastDetails===!0){await Zo(c,e);return}const h=process.cwd(),m=await dr(c),{config:p,packageJsons:l,projectOptions:P,workspace:y}=ur(c,n,m),O=hr(c,y,l);let v=r[0];if(!v){const w=wt(y);if(process.stdout.isTTY&&process.stdin.isTTY){const T=await Vr(w);if(!T){e.info("No target selected.");return}v=T,await Io(`vis run ${T}`)}else{e.info("Available targets:"),e.info(""),e.info(Wr(w)),e.info(""),e.info("Usage: vis run <target>");return}}if(p.constraints&&!t.skipConstraints){const w=tr(O,p.constraints);if(w.length>0){for(const T of w)e.error(`[${T.rule}] ${T.message}`);throw new Error(`${w.length} project constraint violation(s) found. Use --skip-constraints to bypass.`)}}if(t.affected){const w=[v];t.parallel!==void 0&&w.push(`--parallel=${String(t.parallel)}`),t.cache||w.push("--no-cache"),t.query&&w.push(`--query=${String(t.query)}`),await s.runCommand("affected",{argv:w});return}const S=await Sr(v,y,process.cwd(),c),x=Gr(P),R=Hr(S.target,x);R!==S.target&&e.debug?.(`Resolved alias "${S.target}" → "${R}"`);let j=S.projects;const J=r.slice(1).map(String);if(t.projects){const w=new Set(t.projects.split(",").map(T=>T.trim()));if(j=j.filter(T=>w.has(T)),j.length===0)throw new Error(`No matching projects found for: ${String(t.projects)}`)}if(t.query&&(j=$r(j,y,t.query),j.length===0)){e.info(`Query "${String(t.query)}" matched no projects.`);return}const E=fr(),Z=process.env[Ke],D=Z?Z.split(`
42
+ `).filter(Boolean):void 0,z=[],ee=new Map;for(const w of j){const T=P.get(w)?.[R];if(!T)continue;const $=T.options;if(!$?.internal){if(!pr($,!!ht)){e.debug?.(`Skipping ${w}:${R} — runInCI filter`);continue}z.push(w),ee.set(w,T)}}if(z.length===0){const w=wt(y),T=Object.entries(y.projects).filter(([,$])=>$.targets?.[R]!==void 0).map(([$])=>$);if(e.error(`No projects have the "${R}" target.`),T.length>0){e.info(""),e.info(`Target "${R}" exists in these projects but was filtered out:`);for(const $ of T.slice(0,5))e.info(` - ${$}`);T.length>5&&e.info(` …and ${T.length-5} more`)}else{const $=At(R,w,3);$.length>0&&(e.info(""),e.info($.length===1?`Did you mean "${$[0]}"?`:`Did you mean one of: ${$.map(q=>`"${q}"`).join(", ")}?`)),e.info(""),e.info("Run `vis run` without arguments to see all available targets.")}return}const L=t.pty===!0;let b=z.map(w=>{const T=y.projects[w],$=ee.get(w),q={project:w,target:R},G=`${w}:${R}`,ue=L?{...$.options,pty:$.options?.pty??!0}:$.options;return{cache:$.cache,id:G,outputs:$.outputs??[],overrides:{command:$.command,...J.length>0?{[Vt]:J}:{},...ue?{visOptions:ue}:{}},parallelism:$.parallelism,projectRoot:T?.root,target:q}});const H=[],_=[];for(const w of b)Wt(w)?.persistent?(w.cache=!1,H.push(w)):_.push(w);b=_;const N=rr(t.partition);if(N&&(b=or.partitionTasks(b,N),e.info(`Partition ${N.index}/${N.total}: running ${b.length} task(s)`),b.length===0)){e.info("No tasks assigned to this partition.");return}const W=ir(b,{projectGraph:O,targetDefaults:p.targetDefaults,workspace:y});if(t.dryRun){const w=Object.keys(W.tasks).length,T=W.roots.length;e.info(`Execution plan (${String(w)} task(s), ${String(T)} root(s)):`),e.info("");const $=new Set,q=C((G,ue)=>{if($.has(G))return;$.add(G);for(const ge of W.dependencies[G]??[])q(ge,ue+1);const se=W.tasks[G],oe=" ".repeat(ue+1);e.info(`${oe}${G}${se?.cache===!1?" (no-cache)":""}`)},"walkPlan");for(const G of W.roots)q(G,0);H.length>0&&(e.info(""),e.info(` + ${String(H.length)} persistent task(s) (run after graph completes)`)),e.info("");return}await Cr(c,p.toolchain,{error:C(w=>{e.error(w)},"error"),info:C(w=>{e.info(w)},"info"),warn:C(w=>{e.warn(w)},"warn")},!!t.skipToolchain);const fe=Date.now(),F=To(),te=C((w,T)=>{const $=T instanceof Error?T.message:String(T);e.warn(`Plugin error in ${w}: ${$}`)},"onHookError");await Co(F,p.plugins);const K=typeof t.profile=="string"?t.profile:void 0,ne=C(async w=>{if(!K)return;const T=ct(w,W,fe),$=K.startsWith("/")?K:`${c}/${K}`;await nr(T,$),e.info(`Profile written to ${K}`)},"maybeWriteProfile"),de=p.taskRunnerOptions??{},g=mr(c,t.cacheDir,de.cacheDirectory,p.sharedWorktreeCache),f=gr(g,c,p.branchScopedCache),k=Jo(process.env.VIS_RUN_CONCURRENCY_LIMIT);k&&"invalid"in k&&e.warn(`VIS_RUN_CONCURRENCY_LIMIT=${k.invalid} is not a positive number; falling back to default concurrency.`);const re=k&&"value"in k?k.value:void 0,ke=t.parallel??re??3,Te={dryRun:t.dryRun??!1,parallel:ke,skipNxCache:!t.cache,summarize:t.summarize??!1,...de,cacheDirectory:f},zt=process.stdout.isTTY&&!ht,Yt=p.tui?.autoExit??!1,Xe={args:{parallel:Te.parallel,targets:[R]},autoExit:Yt,projectNames:z,tasks:b},Je=typeof t.retryBudget=="number"?t.retryBudget:void 0,Ze=Je===void 0?void 0:Qo(Je),et=new So(F,te),tt=new wr(c),rt=ko(typeof t.outputStyle=="string"?t.outputStyle.toLowerCase():void 0);if(await F.callHook("run:before",{tasks:b,workspaceRoot:c}),zt){const w=new Map,T=go({...Xe,outputStyle:rt,stdinRegistry:w}),{lifeCycle:$,store:q}=T,G=new dt([$,et,tt]),ue=Rt({affectedFiles:D,currentOs:E,initCwd:h,lifeCycle:G,mutexPool:new Map,onOutput:C((I,B)=>{q.addOutput(I,B)},"onOutput"),onOutputReplace:C((I,B)=>{q.setOutput(I,B)},"onOutputReplace"),retryBudget:Ze,stdinRegistry:w,workspaceRoot:c});let se="rerun",oe=null,ge=new Map;for(;se!=="quit";){if(se==="rerun")ge=await ut(b,Te,{lifeCycle:G,projectGraph:O,taskExecutor:ue,taskGraph:W,workspaceRoot:c});else if(se==="retry"&&oe){const I=b.find(Y=>Y.id===oe),B=I?.overrides.command;if(I&&B){const Y=I.projectRoot??c,pe=Y.startsWith("/")?Y:`${c}/${Y}`;G.startTasks?.([I]);const ie=new Mt(qe),le=(await Ge([{command:B,cwd:pe,name:I.id,ptySize:{cols:process.stdout.columns??80,rows:process.stdout.rows??24},stdin:"pty"}],{onEvent:C(U=>{U.kind==="started"&&U.write&&w.set(I.id,{kill:U.kill,resize:U.resize,write:U.write}),(U.kind==="stdout"||U.kind==="stderr")&&U.text&&(ie.write(U.text),q.setOutput(I.id,ie.toString())),U.kind==="close"&&w.delete(I.id)},"onEvent")})).closeEvents[0];G.endTasks?.([{code:le?.exitCode??1,status:le?.exitCode===0?"success":"failure",task:I,terminalOutput:q.getSnapshot().outputs.get(I.id)}])}else I&&G.endTasks?.([{code:1,status:"failure",task:I,terminalOutput:`No command configured for ${I.id}`}]);oe=null,q.markDone()}se=await new Promise(I=>{const B=q.subscribe(()=>{const Y=q.getSnapshot();Y.rerunRequested&&(q.acknowledgeRerun(),B(),I("rerun")),Y.retryTaskId&&(oe=q.acknowledgeRetry(),B(),I("retry"))});T.renderIsDone.then(()=>{B(),I("quit")},()=>{B(),I("quit")})})}await T.renderIsDone,await F.callHook("run:after",ge),await ne(ge),H.length>0&&!t.failFast&&await It(H,c,D,h)}else{const w=new Map,T=typeof t.log=="string"?t.log.toLowerCase():"",$=T==="labeled"||T==="grouped"||T==="interleaved"?T:void 0,q=$?sr($):void 0,G=new dt([new vo({...Xe,logReporter:q,outputStyle:rt}),et,tt]),ue=Rt({affectedFiles:D,currentOs:E,initCwd:h,lifeCycle:G,mutexPool:w,retryBudget:Ze,workspaceRoot:c}),se=C(async()=>{const I=Date.now(),B=await ut(b,Te,{lifeCycle:G,projectGraph:O,taskExecutor:ue,taskGraph:W,workspaceRoot:c}),Y=Date.now()-I;if(t.summarize){const ae=ct(B,W,fe);await lr(ae,c)}let pe=!1;for(const[,ae]of B)ae.status==="failure"&&(pe=!0);const ie=kr(B,Y),le=yr(c),U=vr(c,Y,le);return e.info(""),e.info(` ${ie}${U?` ${U}`:""}`),{hasFailure:pe,results:B,runHistory:le}},"runOnce"),oe=await se();await F.callHook("run:after",oe.results),await ne(oe.results);const{hasFailure:ge}=oe;if(t.watch){const I=z.map(V=>{const Q=y.projects[V]?.root;if(Q)return Q.startsWith("/")?Q:`${c}/${Q}`}).filter(V=>V!==void 0),B=b;let Y;const pe=C(V=>{const Q=No(B,V);return Y=Q.filter,b=Q.tasks,Q.tasks.length},"applyFilter");let ie=!1,le=oe.results;const U=C(()=>{const V=$t(le,c);if(V.directories.length>0&&V.files.size>0){const Q=Lo(V.files,c,V.directories);return{handle:xt({filter:Q,onChange:ot,paths:V.directories}),mode:"tracked"}}return{handle:xt({onChange:ot,paths:I}),mode:"roots"}},"buildHandle");let ae;const ot=C(async V=>{if(!ie){ie=!0;try{e.info(`Change detected in ${V.length} file(s), rerunning…`),le=(await se()).results,ae?.close(),ae=U().handle}finally{ie=!1}}},"onChangeHandler"),it=U();ae=it.handle;const Kt=it.mode==="tracked"?`Watching ${String($t(le,c).files.size)} tracked file(s)`:`Watching ${String(I.length)} project root(s)`;e.info(`${Kt} — edit a file to rerun, press h for keybinds, q to quit.`);const Pe=C(async()=>{if(!ie){ie=!0;try{if(b.length===0){e.info("No tasks match the active filter — press a to clear it.");return}le=(await se()).results,ae?.close(),ae=U().handle}finally{ie=!1}}},"triggerRerun");await new Promise(V=>{let Q=!1,nt;const st=C(()=>{lt()},"onSigint"),lt=C(()=>{Q||(Q=!0,nt?.close(),process.off("SIGINT",st),ae?.close(),V())},"exit");process.on("SIGINT",st),nt=_o({handlers:{onClearFilter:C(async()=>{const Ce=pe(void 0);e.info(`Filter cleared — running ${String(Ce)} task(s).`),await Pe()},"onClearFilter"),onFilter:C(async Ce=>{const Qt=Y,at=pe(Ce);if(at===0){e.info(`Filter "${Ce}" matched no projects — keeping previous filter.`),pe(Qt);return}e.info(`Filter "${Ce}" matched ${String(at)} task(s).`),await Pe()},"onFilter"),onHelp:C(()=>{Ho(process.stdout)},"onHelp"),onQuit:C(()=>{lt()},"onQuit"),onRerun:Pe}})});return}if(ge){if(t.flaky!==!1){const I=br(c,{minRuns:2},oe.runHistory);if(I.length>0){e.info(""),e.info("Flaky tasks (based on historical runs):"),e.info("");for(const B of Tr(I))e.info(` ${B}`);e.info("")}}throw new Error("Some tasks failed.")}H.length>0&&!t.failFast&&await It(H,c,D,h)}},"execute");export{Qo as createRetryBudget,gi as default};