@visulima/vis 1.0.0-alpha.2 → 1.0.0-alpha.21

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 (147) hide show
  1. package/CHANGELOG.md +840 -14
  2. package/LICENSE.md +7667 -0
  3. package/README.md +322 -19
  4. package/dist/bin.js +1 -146
  5. package/dist/config/index.d.ts +2795 -0
  6. package/dist/config/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 +1295 -0
  10. package/dist/packem_chunks/config.js +19 -0
  11. package/dist/packem_chunks/doctor-probe.js +2 -0
  12. package/dist/packem_chunks/fix.js +11 -0
  13. package/dist/packem_chunks/handler.js +1 -0
  14. package/dist/packem_chunks/handler10.js +1 -0
  15. package/dist/packem_chunks/handler11.js +5 -0
  16. package/dist/packem_chunks/handler12.js +1 -0
  17. package/dist/packem_chunks/handler13.js +27 -0
  18. package/dist/packem_chunks/handler14.js +5 -0
  19. package/dist/packem_chunks/handler15.js +1 -0
  20. package/dist/packem_chunks/handler16.js +1 -0
  21. package/dist/packem_chunks/handler17.js +1 -0
  22. package/dist/packem_chunks/handler18.js +1 -0
  23. package/dist/packem_chunks/handler19.js +1 -0
  24. package/dist/packem_chunks/handler2.js +2 -0
  25. package/dist/packem_chunks/handler20.js +5 -0
  26. package/dist/packem_chunks/handler21.js +2 -0
  27. package/dist/packem_chunks/handler22.js +2 -0
  28. package/dist/packem_chunks/handler23.js +18 -0
  29. package/dist/packem_chunks/handler24.js +1 -0
  30. package/dist/packem_chunks/handler25.js +1 -0
  31. package/dist/packem_chunks/handler26.js +5 -0
  32. package/dist/packem_chunks/handler27.js +1 -0
  33. package/dist/packem_chunks/handler28.js +3 -0
  34. package/dist/packem_chunks/handler29.js +1 -0
  35. package/dist/packem_chunks/handler3.js +4 -0
  36. package/dist/packem_chunks/handler30.js +7 -0
  37. package/dist/packem_chunks/handler31.js +33 -0
  38. package/dist/packem_chunks/handler32.js +3 -0
  39. package/dist/packem_chunks/handler33.js +1 -0
  40. package/dist/packem_chunks/handler34.js +26 -0
  41. package/dist/packem_chunks/handler35.js +3 -0
  42. package/dist/packem_chunks/handler36.js +7 -0
  43. package/dist/packem_chunks/handler37.js +22 -0
  44. package/dist/packem_chunks/handler38.js +428 -0
  45. package/dist/packem_chunks/handler39.js +6 -0
  46. package/dist/packem_chunks/handler4.js +8 -0
  47. package/dist/packem_chunks/handler40.js +24 -0
  48. package/dist/packem_chunks/handler41.js +10 -0
  49. package/dist/packem_chunks/handler42.js +153 -0
  50. package/dist/packem_chunks/handler43.js +25 -0
  51. package/dist/packem_chunks/handler44.js +24 -0
  52. package/dist/packem_chunks/handler45.js +213 -0
  53. package/dist/packem_chunks/handler46.js +3 -0
  54. package/dist/packem_chunks/handler47.js +27 -0
  55. package/dist/packem_chunks/handler48.js +167 -0
  56. package/dist/packem_chunks/handler49.js +34 -0
  57. package/dist/packem_chunks/handler5.js +1 -0
  58. package/dist/packem_chunks/handler6.js +1 -0
  59. package/dist/packem_chunks/handler7.js +1 -0
  60. package/dist/packem_chunks/handler8.js +1 -0
  61. package/dist/packem_chunks/handler9.js +2 -0
  62. package/dist/packem_chunks/heal-accept.js +10 -0
  63. package/dist/packem_chunks/heal.js +14 -0
  64. package/dist/packem_chunks/help-command.js +18 -0
  65. package/dist/packem_chunks/index.js +7 -0
  66. package/dist/packem_chunks/keys-refresh.js +4 -0
  67. package/dist/packem_chunks/list.js +3 -0
  68. package/dist/packem_chunks/loader.js +1 -0
  69. package/dist/packem_chunks/prune.js +3 -0
  70. package/dist/packem_chunks/run.js +1 -0
  71. package/dist/packem_chunks/status.js +2 -0
  72. package/dist/packem_chunks/sync.js +2 -0
  73. package/dist/packem_chunks/sync2.js +2 -0
  74. package/dist/packem_chunks/tar.js +3 -0
  75. package/dist/packem_chunks/tripwire.js +2 -0
  76. package/dist/packem_shared/advisories-DsynpacV.js +1 -0
  77. package/dist/packem_shared/ai-analysis-uYuTIIXi.js +68 -0
  78. package/dist/packem_shared/ai-cache-DuwHYx2O.js +1 -0
  79. package/dist/packem_shared/ai-fix-DzrA-dVz.js +43 -0
  80. package/dist/packem_shared/applyDefaults-BOVDw1jD.js +1 -0
  81. package/dist/packem_shared/build-scripts-DsWMSWDs.js +1 -0
  82. package/dist/packem_shared/cache-directory-DQak1Vjc.js +1 -0
  83. package/dist/packem_shared/cyclonedx-CiHXuG8M.js +4 -0
  84. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  85. package/dist/packem_shared/dependency-scan-DC3nAFHS.js +1 -0
  86. package/dist/packem_shared/docker-B-CIN_nj.js +60 -0
  87. package/dist/packem_shared/failure-log-C3LEMmkq.js +2 -0
  88. package/dist/packem_shared/flakiness-Dq6K4ymq.js +1 -0
  89. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  90. package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +1 -0
  91. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  92. package/dist/packem_shared/lifecycle-Dv3nAtoD.js +2 -0
  93. package/dist/packem_shared/lockfile-C5DYMHVq.js +1 -0
  94. package/dist/packem_shared/manifests-B0fMp872.js +1 -0
  95. package/dist/packem_shared/min-release-age-BFozFonQ.js +34 -0
  96. package/dist/packem_shared/native-config-sync-Dvi1g2nQ.js +21 -0
  97. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  98. package/dist/packem_shared/registry-keys-CewRFW0e.js +1 -0
  99. package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +5 -0
  100. package/dist/packem_shared/run-summary-utils-BaBGP3bo.js +1 -0
  101. package/dist/packem_shared/runtime-check-BusAwPb2.js +1 -0
  102. package/dist/packem_shared/scan-progress-CMynp3eA.js +2 -0
  103. package/dist/packem_shared/selectors-B2ISH581.js +3 -0
  104. package/dist/packem_shared/signatures-5ZdjJ2Pu.js +2 -0
  105. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  106. package/dist/packem_shared/toolchain-Cc3cwyLP.js +5 -0
  107. package/dist/packem_shared/typosquats-BCeR-sLf.js +1 -0
  108. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  109. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  110. package/dist/packem_shared/verify-07kUNTuP.js +1 -0
  111. package/dist/packem_shared/vis-update-app-CFrlJ3mW.js +1 -0
  112. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  113. package/index.d.ts +358 -0
  114. package/index.js +609 -0
  115. package/package.json +57 -22
  116. package/schemas/project.schema.json +872 -0
  117. package/schemas/vis-config.schema.json +4306 -0
  118. package/skills/vis/SKILL.md +96 -0
  119. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  120. package/templates/buildkite-ci/template.yml +20 -0
  121. package/dist/ai-analysis.d.ts +0 -40
  122. package/dist/ai-cache.d.ts +0 -21
  123. package/dist/bin.d.ts +0 -1
  124. package/dist/catalog.d.ts +0 -110
  125. package/dist/commands/affected.d.ts +0 -3
  126. package/dist/commands/ai.d.ts +0 -3
  127. package/dist/commands/analyze.d.ts +0 -3
  128. package/dist/commands/check.d.ts +0 -3
  129. package/dist/commands/graph.d.ts +0 -3
  130. package/dist/commands/hook/constants.d.ts +0 -8
  131. package/dist/commands/hook/index.d.ts +0 -3
  132. package/dist/commands/hook/install.d.ts +0 -7
  133. package/dist/commands/hook/migrate.d.ts +0 -27
  134. package/dist/commands/hook/uninstall.d.ts +0 -3
  135. package/dist/commands/migrate/constants.d.ts +0 -12
  136. package/dist/commands/migrate/deps.d.ts +0 -32
  137. package/dist/commands/migrate/index.d.ts +0 -3
  138. package/dist/commands/migrate/json.d.ts +0 -20
  139. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  140. package/dist/commands/migrate/types.d.ts +0 -20
  141. package/dist/commands/run.d.ts +0 -3
  142. package/dist/commands/staged.d.ts +0 -3
  143. package/dist/commands/update.d.ts +0 -3
  144. package/dist/config.d.ts +0 -40
  145. package/dist/config.js +0 -1
  146. package/dist/package-manager.d.ts +0 -23
  147. package/dist/workspace.d.ts +0 -58
@@ -0,0 +1 @@
1
+ var rr=Object.defineProperty;var d=(t,e)=>rr(t,"name",{value:e,configurable:!0});import{createRequire as nr}from"node:module";const sr=nr(import.meta.url),Ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,or=d(t=>{if(typeof Ht<"u"&&Ht.versions&&Ht.versions.node){const[e,r]=Ht.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ht.getBuiltinModule(t)}return sr(t)},"__cjs_getBuiltinModule"),{createRequire:ir}=or("node:module");var ur=Object.defineProperty,kt=d((t,e)=>ur(t,"name",{value:e,configurable:!0}),"r$1"),ar=Object.defineProperty,wt=kt((t,e)=>ar(t,"name",{value:e,configurable:!0}),"r"),lr=Object.defineProperty,Ot=wt((t,e)=>lr(t,"name",{value:e,configurable:!0}),"t");function Qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}d(Qt,"p");kt(Qt,"f");wt(Qt,"getDefaultExportFromCjs");Ot(Qt,"getDefaultExportFromCjs");function Se(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}d(Se,"f$1");kt(Se,"l");wt(Se,"getDefaultExportFromNamespaceIfPresent");Ot(Se,"getDefaultExportFromNamespaceIfPresent");function xe(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}d(xe,"l$1");kt(xe,"s");wt(xe,"getDefaultExportFromNamespaceIfNotNamed");Ot(xe,"getDefaultExportFromNamespaceIfNotNamed");function Ce(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=Ot(wt(kt(d(function s(){var l=!1;try{l=this instanceof s}catch{}return l?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)},"u"),"n"),"a"),"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var l=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,l.get?l:{enumerable:!0,get:Ot(function(){return t[s]},"get")})}),r}d(Ce,"s");kt(Ce,"m");wt(Ce,"getAugmentedNamespace");Ot(Ce,"getAugmentedNamespace");var cr=Object.defineProperty,_t=d((t,e)=>cr(t,"name",{value:e,configurable:!0}),"lt$1"),pr=Object.defineProperty,at=_t((t,e)=>pr(t,"name",{value:e,configurable:!0}),"ut"),De={},ve,Ne;function Pt(){if(Ne)return ve;Ne=1;const t="[^\\\\/]",e=Symbol("unignore"),r="\\.",s="\\+",l="\\?",a="\\/",c="(?=.)",y="[^/]",p=`(?:${a}|$)`,b=`(?:^|${a})`,R=`${r}{1,2}${p}`,T=`(?!${r})`,H=`(?!${b}${R})`,k=`(?!${r}{0,1}${p})`,D=`(?!${R})`,x=`[^.${a}]`,w=`${y}*?`,it="/",F={DOT_LITERAL:r,PLUS_LITERAL:s,QMARK_LITERAL:l,SLASH_LITERAL:a,ONE_CHAR:c,QMARK:y,END_ANCHOR:p,DOTS_SLASH:R,NO_DOT:T,NO_DOTS:H,NO_DOT_SLASH:k,NO_DOTS_SLASH:D,QMARK_NO_DOT:x,STAR:w,START_ANCHOR:b,SEP:it},K={...F,SLASH_LITERAL:"[\\\\/]",QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},h={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ve={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:h,UNIGNORE:e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?K:F}},ve}d(Pt,"_t$1");_t(Pt,"bt");at(Pt,"requireConstants");var Ie;function Tt(){return Ie||(Ie=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:l}=Pt();t.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),t.hasRegexChars=a=>s.test(a),t.isRegexChar=a=>a.length===1&&t.hasRegexChars(a),t.escapeRegex=a=>a.replace(l,"\\$1"),t.toPosixSlashes=a=>a.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const a=navigator.platform.toLowerCase();return a==="win32"||a==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=a=>a.replace(r,c=>c==="\\"?"":c),t.escapeLast=(a,c,y)=>{const p=a.lastIndexOf(c,y);return p===-1?a:a[p-1]==="\\"?t.escapeLast(a,c,p-1):`${a.slice(0,p)}\\${a.slice(p)}`},t.removePrefix=(a,c={})=>{let y=a;return y.startsWith("./")&&(y=y.slice(2),c.prefix="./"),y},t.wrapOutput=(a,c={},y={})=>{const p=y.contains?"":"^",b=y.contains?"":"$";let R=`${p}(?:${a})${b}`;return c.negated===!0&&(R=`(?:^(?!${R}).*$)`),R},t.basename=(a,{windows:c}={})=>{const y=a.split(c?/[\\/]/:"/"),p=y[y.length-1];return p===""?y[y.length-2]:p}})(De)),De}d(Tt,"Et$1");_t(Tt,"yt");at(Tt,"requireUtils");var _e,Fe;function Oe(){if(Fe)return _e;Fe=1;var t=Object.defineProperty,e=at((h,A)=>t(h,"name",{value:A,configurable:!0}),"k");const r=Tt(),{CHAR_ASTERISK:s,CHAR_AT:l,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:c,CHAR_DOT:y,CHAR_EXCLAMATION_MARK:p,CHAR_FORWARD_SLASH:b,CHAR_LEFT_CURLY_BRACE:R,CHAR_LEFT_PARENTHESES:T,CHAR_LEFT_SQUARE_BRACKET:H,CHAR_PLUS:k,CHAR_QUESTION_MARK:D,CHAR_RIGHT_CURLY_BRACE:x,CHAR_RIGHT_PARENTHESES:w,CHAR_RIGHT_SQUARE_BRACKET:it}=Pt(),F=e(h=>h===b||h===a,"isPathSeparator"),K=e(h=>{h.isPrefix!==!0&&(h.depth=h.isGlobstar?1/0:1)},"depth");return _e=e((h,A)=>{const n=A||{},E=h.length-1,C=n.parts===!0||n.scanToEnd===!0,m=[],v=[],O=[];let Z=h,rt=-1,Q=0,lt=0,tt=!1,ct=!1,U=!1,yt=!1,mt=!1,pt=!1,G=!1,ht=!1,Rt=!1,et=!1,J=0,st,P,I={value:"",depth:0,isGlob:!1};const u=e(()=>rt>=E,"eos"),nt=e(()=>Z.charCodeAt(rt+1),"peek"),z=e(()=>(st=P,Z.charCodeAt(++rt)),"advance");for(;rt<E;){P=z();let M;if(P===a){G=I.backslashes=!0,P=z(),P===R&&(pt=!0);continue}if(pt===!0||P===R){for(J++;u()!==!0&&(P=z());){if(P===a){G=I.backslashes=!0,z();continue}if(P===R){J++;continue}if(pt!==!0&&P===y&&(P=z())===y){if(tt=I.isBrace=!0,U=I.isGlob=!0,et=!0,C===!0)continue;break}if(pt!==!0&&P===c){if(tt=I.isBrace=!0,U=I.isGlob=!0,et=!0,C===!0)continue;break}if(P===x&&(J--,J===0)){pt=!1,tt=I.isBrace=!0,et=!0;break}}if(C===!0)continue;break}if(P===b){if(m.push(rt),v.push(I),I={value:"",depth:0,isGlob:!1},et===!0)continue;if(st===y&&rt===Q+1){Q+=2;continue}lt=rt+1;continue}if(n.noext!==!0&&(P===k||P===l||P===s||P===D||P===p)&&nt()===T){if(U=I.isGlob=!0,yt=I.isExtglob=!0,et=!0,P===p&&rt===Q&&(Rt=!0),C===!0){for(;u()!==!0&&(P=z());){if(P===a){G=I.backslashes=!0,P=z();continue}if(P===w){U=I.isGlob=!0,et=!0;break}}continue}break}if(P===s){if(st===s&&(mt=I.isGlobstar=!0),U=I.isGlob=!0,et=!0,C===!0)continue;break}if(P===D){if(U=I.isGlob=!0,et=!0,C===!0)continue;break}if(P===H){for(;u()!==!0&&(M=z());){if(M===a){G=I.backslashes=!0,z();continue}if(M===it){ct=I.isBracket=!0,U=I.isGlob=!0,et=!0;break}}if(C===!0)continue;break}if(n.nonegate!==!0&&P===p&&rt===Q){ht=I.negated=!0,Q++;continue}if(n.noparen!==!0&&P===T){if(U=I.isGlob=!0,C===!0){for(;u()!==!0&&(P=z());){if(P===T){G=I.backslashes=!0,P=z();continue}if(P===w){et=!0;break}}continue}break}if(U===!0){if(et=!0,C===!0)continue;break}}n.noext===!0&&(yt=!1,U=!1);let X=Z,o="",i="";Q>0&&(o=Z.slice(0,Q),Z=Z.slice(Q),lt-=Q),X&&U===!0&&lt>0?(X=Z.slice(0,lt),i=Z.slice(lt)):U===!0?(X="",i=Z):X=Z,X&&X!==""&&X!=="/"&&X!==Z&&F(X.charCodeAt(X.length-1))&&(X=X.slice(0,-1)),n.unescape===!0&&(i&&(i=r.removeBackslashes(i)),X&&G===!0&&(X=r.removeBackslashes(X)));const ut={prefix:o,input:h,start:Q,base:X,glob:i,isBrace:tt,isBracket:ct,isGlob:U,isExtglob:yt,isGlobstar:mt,negated:ht,negatedExtglob:Rt};if(n.tokens===!0&&(ut.maxDepth=0,F(P)||v.push(I),ut.tokens=v),n.parts===!0||n.tokens===!0){let M;for(let q=0;q<m.length;q++){const dt=M?M+1:Q,ot=m[q],bt=h.slice(dt,ot);n.tokens&&(q===0&&Q!==0?(v[q].isPrefix=!0,v[q].value=o):v[q].value=bt,K(v[q]),ut.maxDepth+=v[q].depth),(q!==0||bt!=="")&&O.push(bt),M=ot}if(M&&M+1<h.length){const q=h.slice(M+1);O.push(q),n.tokens&&(v[v.length-1].value=q,K(v[v.length-1]),ut.maxDepth+=v[v.length-1].depth)}ut.slashes=m,ut.parts=O}return ut},"scan"),_e}d(Oe,"Nt$1");_t(Oe,"wt");at(Oe,"requireScan");var me,Me;function ke(){if(Me)return me;Me=1;var t=Object.defineProperty,e=at((h,A)=>t(h,"name",{value:A,configurable:!0}),"y");const r=Pt(),s=Tt(),{MAX_LENGTH:l,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:y,REPLACEMENTS:p}=r,b=e((h,A)=>typeof A.expandRange=="function"?A.expandRange(...h,A):(h.sort(),`[${h.join("-")}]`),"expandRange"),R=e((h,A)=>`Missing ${h}: "${A}" - use "\\\\${A}" to match literal characters`,"syntaxError"),T=e(h=>{const A=[];let n=0,E=0,C=0,m="",v=!1;for(const O of h){if(v===!0){m+=O,v=!1;continue}if(O==="\\"){m+=O,v=!0;continue}if(O==='"'){C=C===1?0:1,m+=O;continue}if(C===0){if(O==="[")n++;else if(O==="]"&&n>0)n--;else if(n===0){if(O==="(")E++;else if(O===")"&&E>0)E--;else if(O==="|"&&E===0){A.push(m),m="";continue}}}m+=O}return A.push(m),A},"splitTopLevel"),H=e(h=>{let A=!1;for(const n of h){if(A===!0){A=!1;continue}if(n==="\\"){A=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},"isPlainBranch"),k=e(h=>{let A=h.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(A)&&(A=A.slice(2,-1),n=!0);if(H(A))return A.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),D=e(h=>{const A=h.map(k).filter(Boolean);for(let n=0;n<A.length;n++)for(let E=n+1;E<A.length;E++){const C=A[n],m=A[E],v=C[0];if(!(!v||C!==v.repeat(C.length)||m!==v.repeat(m.length))&&(C===m||C.startsWith(m)||m.startsWith(C)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),x=e((h,A=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let n=0,E=0,C=0,m=!1;for(let v=1;v<h.length;v++){const O=h[v];if(m===!0){m=!1;continue}if(O==="\\"){m=!0;continue}if(O==='"'){C=C===1?0:1;continue}if(C!==1){if(O==="["){n++;continue}if(O==="]"&&n>0){n--;continue}if(!(n>0)){if(O==="("){E++;continue}if(O===")"&&(E--,E===0))return A===!0&&v!==h.length-1?void 0:{type:h[0],body:h.slice(2,v),end:v}}}}},"parseRepeatedExtglob"),w=e(h=>{let A=0;const n=[];for(;A<h.length;){const E=x(h.slice(A),!1);if(!E||E.type!=="*")return;const C=T(E.body).map(v=>v.trim());if(C.length!==1)return;const m=k(C[0]);if(!m||m.length!==1)return;n.push(m),A+=E.end+1}return n.length<1?void 0:`${n.length===1?s.escapeRegex(n[0]):`[${n.map(E=>s.escapeRegex(E)).join("")}]`}*`},"getStarExtglobSequenceOutput"),it=e(h=>{let A=0,n=h.trim(),E=x(n);for(;E;)A++,n=E.body.trim(),E=x(n);return A},"repeatedExtglobRecursion"),F=e((h,A)=>{if(A.maxExtglobRecursion===!1)return{risky:!1};const n=typeof A.maxExtglobRecursion=="number"?A.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,E=T(h).map(C=>C.trim());if(E.length>1&&(E.some(C=>C==="")||E.some(C=>/^[*?]+$/.test(C))||D(E)))return{risky:!0};for(const C of E){const m=w(C);if(m)return{risky:!0,safeOutput:m};if(it(C)>n)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),K=e((h,A)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=p[h]||h;const n={...A},E=typeof n.maxLength=="number"?Math.min(l,n.maxLength):l;let C=h.length;if(C>E)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${E}`);const m={type:"bos",value:"",output:n.prepend||""},v=[m],O=n.capture?"":"?:",Z=r.globChars(n.windows),rt=r.extglobChars(Z),{DOT_LITERAL:Q,PLUS_LITERAL:lt,SLASH_LITERAL:tt,ONE_CHAR:ct,DOTS_SLASH:U,NO_DOT:yt,NO_DOT_SLASH:mt,NO_DOTS_SLASH:pt,QMARK:G,QMARK_NO_DOT:ht,STAR:Rt,START_ANCHOR:et}=Z,J=e(g=>`(${O}(?:(?!${et}${g.dot?U:Q}).)*?)`,"globstar"),st=n.dot?"":yt,P=n.dot?G:ht;let I=n.bash===!0?J(n):Rt;n.capture&&(I=`(${I})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const u={input:h,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:v};h=s.removePrefix(h,u),C=h.length;const nt=[],z=[],X=[];let o=m,i;const ut=e(()=>u.index===C-1,"eos"),M=u.peek=(g=1)=>h[u.index+g],q=u.advance=()=>h[++u.index]||"",dt=e(()=>h.slice(u.index+1),"remaining"),ot=e((g="",j=0)=>{u.consumed+=g,u.index+=j},"consume"),bt=e(g=>{u.output+=g.output!=null?g.output:g.value,ot(g.value)},"append"),tr=e(()=>{let g=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)q(),u.start++,g++;return g%2===0?!1:(u.negated=!0,u.start++,!0)},"negate"),Wt=e(g=>{u[g]++,X.push(g)},"increment"),At=e(g=>{u[g]--,X.pop()},"decrement"),L=e(g=>{if(o.type==="globstar"){const j=u.braces>0&&(g.type==="comma"||g.type==="brace"),f=g.extglob===!0||nt.length&&(g.type==="pipe"||g.type==="paren");g.type!=="slash"&&g.type!=="paren"&&!j&&!f&&(u.output=u.output.slice(0,-o.output.length),o.type="star",o.value="*",o.output=I,u.output+=o.output)}if(nt.length&&g.type!=="paren"&&(nt[nt.length-1].inner+=g.value),(g.value||g.output)&&bt(g),o&&o.type==="text"&&g.type==="text"){o.output=(o.output||o.value)+g.value,o.value+=g.value;return}g.prev=o,v.push(g),o=g},"push"),Xt=e((g,j)=>{const f={...rt[j],conditions:1,inner:""};f.prev=o,f.parens=u.parens,f.output=u.output,f.startIndex=u.index,f.tokensIndex=v.length;const N=(n.capture?"(":"")+f.open;Wt("parens"),L({type:g,value:j,output:u.output?"":ct}),L({type:"paren",extglob:!0,value:q(),output:N}),nt.push(f)},"extglobOpen"),er=e(g=>{const j=h.slice(g.startIndex,u.index+1),f=h.slice(g.startIndex+2,u.index),N=F(f,n);if((g.type==="plus"||g.type==="star")&&N.risky){const B=N.safeOutput?(g.output?"":ct)+(n.capture?`(${N.safeOutput})`:N.safeOutput):void 0,ft=v[g.tokensIndex];ft.type="text",ft.value=j,ft.output=B||s.escapeRegex(j);for(let gt=g.tokensIndex+1;gt<v.length;gt++)v[gt].value="",v[gt].output="",delete v[gt].suffix;u.output=g.output+ft.output,u.backtrack=!0,L({type:"paren",extglob:!0,value:i,output:""}),At("parens");return}let W=g.close+(n.capture?")":""),Y;if(g.type==="negate"){let B=I;if(g.inner&&g.inner.length>1&&g.inner.includes("/")&&(B=J(n)),(B!==I||ut()||/^\)+$/.test(dt()))&&(W=g.close=`)$))${B}`),g.inner.includes("*")&&(Y=dt())&&/^\.[^\\/.]+$/.test(Y)){const ft=K(Y,{...A,fastpaths:!1}).output;W=g.close=`)${ft})${B})`}g.prev.type==="bos"&&(u.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:i,output:W}),At("parens")},"extglobClose");if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let g=!1,j=h.replace(y,(f,N,W,Y,B,ft)=>Y==="\\"?(g=!0,f):Y==="?"?N?N+Y+(B?G.repeat(B.length):""):ft===0?P+(B?G.repeat(B.length):""):G.repeat(W.length):Y==="."?Q.repeat(W.length):Y==="*"?N?N+Y+(B?I:""):I:N?f:`\\${f}`);return g===!0&&(n.unescape===!0?j=j.replace(/\\/g,""):j=j.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),j===h&&n.contains===!0?(u.output=h,u):(u.output=s.wrapOutput(j,u,A),u)}for(;!ut();){if(i=q(),i==="\0")continue;if(i==="\\"){const f=M();if(f==="/"&&n.bash!==!0||f==="."||f===";")continue;if(!f){i+="\\",L({type:"text",value:i});continue}const N=/^\\+/.exec(dt());let W=0;if(N&&N[0].length>2&&(W=N[0].length,u.index+=W,W%2!==0&&(i+="\\")),n.unescape===!0?i=q():i+=q(),u.brackets===0){L({type:"text",value:i});continue}}if(u.brackets>0&&(i!=="]"||o.value==="["||o.value==="[^")){if(n.posix!==!1&&i===":"){const f=o.value.slice(1);if(f.includes("[")&&(o.posix=!0,f.includes(":"))){const N=o.value.lastIndexOf("["),W=o.value.slice(0,N),Y=o.value.slice(N+2),B=a[Y];if(B){o.value=W+B,u.backtrack=!0,q(),!m.output&&v.indexOf(o)===1&&(m.output=ct);continue}}}(i==="["&&M()!==":"||i==="-"&&M()==="]")&&(i=`\\${i}`),i==="]"&&(o.value==="["||o.value==="[^")&&(i=`\\${i}`),n.posix===!0&&i==="!"&&o.value==="["&&(i="^"),o.value+=i,bt({value:i});continue}if(u.quotes===1&&i!=='"'){i=s.escapeRegex(i),o.value+=i,bt({value:i});continue}if(i==='"'){u.quotes=u.quotes===1?0:1,n.keepQuotes===!0&&L({type:"text",value:i});continue}if(i==="("){Wt("parens"),L({type:"paren",value:i});continue}if(i===")"){if(u.parens===0&&n.strictBrackets===!0)throw new SyntaxError(R("opening","("));const f=nt[nt.length-1];if(f&&u.parens===f.parens+1){er(nt.pop());continue}L({type:"paren",value:i,output:u.parens?")":"\\)"}),At("parens");continue}if(i==="["){if(n.nobracket===!0||!dt().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(R("closing","]"));i=`\\${i}`}else Wt("brackets");L({type:"bracket",value:i});continue}if(i==="]"){if(n.nobracket===!0||o&&o.type==="bracket"&&o.value.length===1){L({type:"text",value:i,output:`\\${i}`});continue}if(u.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(R("opening","["));L({type:"text",value:i,output:`\\${i}`});continue}At("brackets");const f=o.value.slice(1);if(o.posix!==!0&&f[0]==="^"&&!f.includes("/")&&(i=`/${i}`),o.value+=i,bt({value:i}),n.literalBrackets===!1||s.hasRegexChars(f))continue;const N=s.escapeRegex(o.value);if(u.output=u.output.slice(0,-o.value.length),n.literalBrackets===!0){u.output+=N,o.value=N;continue}o.value=`(${O}${N}|${o.value})`,u.output+=o.value;continue}if(i==="{"&&n.nobrace!==!0){Wt("braces");const f={type:"brace",value:i,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};z.push(f),L(f);continue}if(i==="}"){const f=z[z.length-1];if(n.nobrace===!0||!f){L({type:"text",value:i,output:i});continue}let N=")";if(f.dots===!0){const W=v.slice(),Y=[];for(let B=W.length-1;B>=0&&(v.pop(),W[B].type!=="brace");B--)W[B].type!=="dots"&&Y.unshift(W[B].value);N=b(Y,n),u.backtrack=!0}if(f.comma!==!0&&f.dots!==!0){const W=u.output.slice(0,f.outputIndex),Y=u.tokens.slice(f.tokensIndex);f.value=f.output="\\{",i=N="\\}",u.output=W;for(const B of Y)u.output+=B.output||B.value}L({type:"brace",value:i,output:N}),At("braces"),z.pop();continue}if(i==="|"){nt.length>0&&nt[nt.length-1].conditions++,L({type:"text",value:i});continue}if(i===","){let f=i;const N=z[z.length-1];N&&X[X.length-1]==="braces"&&(N.comma=!0,f="|"),L({type:"comma",value:i,output:f});continue}if(i==="/"){if(o.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",v.pop(),o=m;continue}L({type:"slash",value:i,output:tt});continue}if(i==="."){if(u.braces>0&&o.type==="dot"){o.value==="."&&(o.output=Q);const f=z[z.length-1];o.type="dots",o.output+=i,o.value+=i,f.dots=!0;continue}if(u.braces+u.parens===0&&o.type!=="bos"&&o.type!=="slash"){L({type:"text",value:i,output:Q});continue}L({type:"dot",value:i,output:Q});continue}if(i==="?"){if(!(o&&o.value==="(")&&n.noextglob!==!0&&M()==="("&&M(2)!=="?"){Xt("qmark",i);continue}if(o&&o.type==="paren"){const f=M();let N=i;(o.value==="("&&!/[!=<:]/.test(f)||f==="<"&&!/<([!=]|\w+>)/.test(dt()))&&(N=`\\${i}`),L({type:"text",value:i,output:N});continue}if(n.dot!==!0&&(o.type==="slash"||o.type==="bos")){L({type:"qmark",value:i,output:ht});continue}L({type:"qmark",value:i,output:G});continue}if(i==="!"){if(n.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){Xt("negate",i);continue}if(n.nonegate!==!0&&u.index===0){tr();continue}}if(i==="+"){if(n.noextglob!==!0&&M()==="("&&M(2)!=="?"){Xt("plus",i);continue}if(o&&o.value==="("||n.regex===!1){L({type:"plus",value:i,output:lt});continue}if(o&&(o.type==="bracket"||o.type==="paren"||o.type==="brace")||u.parens>0){L({type:"plus",value:i});continue}L({type:"plus",value:lt});continue}if(i==="@"){if(n.noextglob!==!0&&M()==="("&&M(2)!=="?"){L({type:"at",extglob:!0,value:i,output:""});continue}L({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const f=c.exec(dt());f&&(i+=f[0],u.index+=f[0].length),L({type:"text",value:i});continue}if(o&&(o.type==="globstar"||o.star===!0)){o.type="star",o.star=!0,o.value+=i,o.output=I,u.backtrack=!0,u.globstar=!0,ot(i);continue}let g=dt();if(n.noextglob!==!0&&/^\([^?]/.test(g)){Xt("star",i);continue}if(o.type==="star"){if(n.noglobstar===!0){ot(i);continue}const f=o.prev,N=f.prev,W=f.type==="slash"||f.type==="bos",Y=N&&(N.type==="star"||N.type==="globstar");if(n.bash===!0&&(!W||g[0]&&g[0]!=="/")){L({type:"star",value:i,output:""});continue}const B=u.braces>0&&(f.type==="comma"||f.type==="brace"),ft=nt.length&&(f.type==="pipe"||f.type==="paren");if(!W&&f.type!=="paren"&&!B&&!ft){L({type:"star",value:i,output:""});continue}for(;g.slice(0,3)==="/**";){const gt=h[u.index+4];if(gt&&gt!=="/")break;g=g.slice(3),ot("/**",3)}if(f.type==="bos"&&ut()){o.type="globstar",o.value+=i,o.output=J(n),u.output=o.output,u.globstar=!0,ot(i);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!Y&&ut()){u.output=u.output.slice(0,-(f.output+o.output).length),f.output=`(?:${f.output}`,o.type="globstar",o.output=J(n)+(n.strictSlashes?")":"|$)"),o.value+=i,u.globstar=!0,u.output+=f.output+o.output,ot(i);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&g[0]==="/"){const gt=g[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(f.output+o.output).length),f.output=`(?:${f.output}`,o.type="globstar",o.output=`${J(n)}${tt}|${tt}${gt})`,o.value+=i,u.output+=f.output+o.output,u.globstar=!0,ot(i+q()),L({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&g[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${tt}|${J(n)}${tt})`,u.output=o.output,u.globstar=!0,ot(i+q()),L({type:"slash",value:"/",output:""});continue}if(B&&g[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${tt}|${J(n)}${tt})`,u.output+=o.output,u.globstar=!0,ot(i+q()),L({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-o.output.length),o.type="globstar",o.output=J(n),o.value+=i,u.output+=o.output,u.globstar=!0,ot(i);continue}const j={type:"star",value:i,output:I};if(n.bash===!0){j.output=".*?",(o.type==="bos"||o.type==="slash")&&(j.output=st+j.output),L(j);continue}if(o&&(o.type==="bracket"||o.type==="paren")&&n.regex===!0){j.output=i,L(j);continue}(u.index===u.start||o.type==="slash"||o.type==="dot")&&(o.type==="dot"?(u.output+=mt,o.output+=mt):n.dot===!0?(u.output+=pt,o.output+=pt):(u.output+=st,o.output+=st),M()!=="*"&&(u.output+=ct,o.output+=ct)),L(j)}for(;u.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(R("closing","]"));u.output=s.escapeLast(u.output,"["),At("brackets")}for(;u.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(R("closing",")"));u.output=s.escapeLast(u.output,"("),At("parens")}for(;u.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(R("closing","}"));u.output=s.escapeLast(u.output,"{"),At("braces")}if(n.strictSlashes!==!0&&(o.type==="star"||o.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${tt}?`}),u.backtrack===!0){u.output="";for(const g of u.tokens)u.output+=g.output!=null?g.output:g.value,g.suffix&&(u.output+=g.suffix)}return u},"parse");return K.fastpaths=(h,A)=>{const n={...A},E=typeof n.maxLength=="number"?Math.min(l,n.maxLength):l,C=h.length;if(C>E)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${E}`);h=p[h]||h;const{DOT_LITERAL:m,SLASH_LITERAL:v,ONE_CHAR:O,DOTS_SLASH:Z,NO_DOT:rt,NO_DOTS:Q,NO_DOTS_SLASH:lt,STAR:tt,START_ANCHOR:ct}=r.globChars(n.windows),U=n.dot?Q:rt,yt=n.dot?lt:rt,mt=n.capture?"":"?:",pt={negated:!1,prefix:""};let G=n.bash===!0?".*?":tt;n.capture&&(G=`(${G})`);const ht=e(st=>st.noglobstar===!0?G:`(${mt}(?:(?!${ct}${st.dot?Z:m}).)*?)`,"globstar"),Rt=e(st=>{switch(st){case"*":return`${U}${O}${G}`;case".*":return`${m}${O}${G}`;case"*.*":return`${U}${G}${m}${O}${G}`;case"*/*":return`${U}${G}${v}${O}${yt}${G}`;case"**":return U+ht(n);case"**/*":return`(?:${U}${ht(n)}${v})?${yt}${O}${G}`;case"**/*.*":return`(?:${U}${ht(n)}${v})?${yt}${G}${m}${O}${G}`;case"**/.*":return`(?:${U}${ht(n)}${v})?${m}${O}${G}`;default:{const P=/^(.*?)\.(\w+)$/.exec(st);if(!P)return;const I=Rt(P[1]);return I?I+m+P[2]:void 0}}},"create"),et=s.removePrefix(h,pt);let J=Rt(et);return J&&n.strictSlashes!==!0&&(J+=`${v}?`),J},me=K,me}d(ke,"It$1");_t(ke,"Bt");at(ke,"requireParse");var Re,Be;function we(){if(Be)return Re;Be=1;var t=Object.defineProperty,e=at((p,b)=>t(p,"name",{value:b,configurable:!0}),"h");const r=Oe(),s=ke(),l=Tt(),a=Pt(),c=e(p=>p&&typeof p=="object"&&!Array.isArray(p),"isObject"),y=e((p,b,R=!1)=>{if(Array.isArray(p)){const F=p.map(K=>y(K,b,R));return e(K=>{for(const h of F){const A=h(K);if(A)return A}return!1},"arrayMatcher")}const T=c(p)&&p.tokens&&p.input;if(p===""||typeof p!="string"&&!T)throw new TypeError("Expected pattern to be a non-empty string");const H=b||{},k=H.windows,D=T?y.compileRe(p,b):y.makeRe(p,b,!1,!0),x=D.state;delete D.state;let w=e(()=>!1,"isIgnored");if(H.ignore){const F={...b,ignore:null,onMatch:null,onResult:null};w=y(H.ignore,F,R)}const it=e((F,K=!1)=>{const{isMatch:h,match:A,output:n}=y.test(F,D,b,{glob:p,posix:k}),E={glob:p,state:x,regex:D,posix:k,input:F,output:n,match:A,isMatch:h};if(typeof H.onResult=="function"&&H.onResult(E),h===!1)return E.isMatch=!1,K?E:!1;t:if(w(F)){if(typeof H.onIgnore=="function"&&H.onIgnore(E)===a.UNIGNORE){E.isMatch=!0;break t}return E.isMatch=!1,K?E:!1}return typeof H.onMatch=="function"&&H.onMatch(E),K?E:!0},"matcher");return R&&(it.state=x),it},"picomatch");return y.test=(p,b,R,{glob:T,posix:H}={})=>{if(typeof p!="string")throw new TypeError("Expected input to be a string");if(p==="")return{isMatch:!1,output:""};const k=R||{},D=k.format||(H?l.toPosixSlashes:null);let x=p===T,w=x&&D?D(p):p;return x===!1&&(w=D?D(p):p,x=w===T),(x===!1||k.capture===!0)&&(k.matchBase===!0||k.basename===!0?x=y.matchBase(p,b,R,H):x=b.exec(w)),{isMatch:!!x,match:x,output:w}},y.matchBase=(p,b,R)=>(b instanceof RegExp?b:y.makeRe(b,R)).test(l.basename(p)),y.isMatch=(p,b,R)=>y(b,R)(p),y.parse=(p,b)=>Array.isArray(p)?p.map(R=>y.parse(R,b)):s(p,{...b,fastpaths:!1}),y.scan=(p,b)=>r(p,b),y.compileRe=(p,b,R=!1,T=!1)=>{if(R===!0)return p.output;const H=b||{},k=H.contains?"":"^",D=H.contains?"":"$";let x=`${k}(?:${p.output})${D}`;p&&p.negated===!0&&(x=`^(?!${x}).*$`);const w=y.toRegex(x,b);return T===!0&&(w.state=p),w},y.makeRe=(p,b={},R=!1,T=!1)=>{if(!p||typeof p!="string")throw new TypeError("Expected a non-empty string");let H={negated:!1,fastpaths:!0};return b.fastpaths!==!1&&(p[0]==="."||p[0]==="*")&&(H.output=s.fastpaths(p,b)),H.output||(H=s(p,b)),y.compileRe(H,b,R,T)},y.toRegex=(p,b)=>{try{const R=b||{};return new RegExp(p,R.flags||(R.nocase?"i":""))}catch(R){if(b&&b.debug===!0)throw R;return/$^/}},y.constants=a,Re=y,Re}d(we,"wt");_t(we,"Gt");at(we,"requirePicomatch$1");var Ee,Ge;function Pe(){if(Ge)return Ee;Ge=1;var t=Object.defineProperty,e=at((a,c)=>t(a,"name",{value:c,configurable:!0}),"c");const r=we(),s=Tt();function l(a,c,y=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:s.isWindows()}),r(a,c,y)}return d(l,"D"),_t(l,"D"),at(l,"picomatch"),e(l,"picomatch"),Object.assign(l,r),Ee=l,Ee}d(Pe,"Pt$1");_t(Pe,"Mt");at(Pe,"requirePicomatch");var hr=Pe();const Et=Qt(hr);var fr=Object.defineProperty,S=d((t,e)=>fr(t,"name",{value:e,configurable:!0}),"u"),gr=Object.defineProperty,$=S((t,e)=>gr(t,"name",{value:e,configurable:!0}),"l");const yr=ir(import.meta.url),Lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,It=$(t=>{if(typeof Lt<"u"&&Lt.versions&&Lt.versions.node){const[e,r]=Lt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Lt.getBuiltinModule(t)}return yr(t)},"__cjs_getBuiltinModule"),je=It("fs"),dr={...je,default:je},{statSync:br,stat:Ar,realpathSync:vr,realpath:_r,readdirSync:mr,readdir:Rr}=It("fs"),{sep:Ke,basename:Er,dirname:$e,resolve:We,normalize:$r,relative:Sr,posix:$t,isAbsolute:xr}=It("path"),{fileURLToPath:Cr}=It("url"),{createRequire:Or}=It("module");var kr=Object.defineProperty,_=$((t,e)=>kr(t,"name",{value:e,configurable:!0}),"r"),Ue=Or(import.meta.url);function zt(t){let e=$r(t);return e.length>1&&e[e.length-1]===Ke&&(e=e.substring(0,e.length-1)),e}d(zt,"H");S(zt,"tt");$(zt,"M$1");_(zt,"cleanPath");const wr=/[\\/]/g;function Ft(t,e){return t.replace(wr,e)}d(Ft,"M");S(Ft,"T");$(Ft,"D$1");_(Ft,"convertSlashes");const Pr=/^[a-z]:[\\/]$/i;function Zt(t){return t==="/"||Pr.test(t)}d(Zt,"J");S(Zt,"et");$(Zt,"T$1");_(Zt,"isRootDirectory");function xt(t,e){const{resolvePaths:r,normalizePath:s,pathSeparator:l}=e,a=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=We(t)),(s||a)&&(t=zt(t)),t===".")return"";const c=t[t.length-1]!==l;return Ft(c?t+l:t,l)}d(xt,"q");S(xt,"q");$(xt,"w");_(xt,"normalizePath");function Mt(t,e){return e+t}d(Mt,"B");S(Mt,"I");$(Mt,"P");_(Mt,"joinPathWithBasePath");function Yt(t,e){return function(r,s){return s.startsWith(t)?s.slice(t.length)+r:Ft(Sr(t,s),e.pathSeparator)+e.pathSeparator+r}}d(Yt,"K");S(Yt,"st");$(Yt,"X");_(Yt,"joinPathWithRelativePath");function Vt(t){return t}d(Vt,"V");S(Vt,"rt");$(Vt,"H");_(Vt,"joinPath");function Jt(t,e,r){return e+t+r}d(Jt,"X");S(Jt,"nt");$(Jt,"U$1");_(Jt,"joinDirectoryPath");function te(t,e){const{relativePaths:r,includeBasePath:s}=e;return r&&t?Yt(t,e):s?Mt:Vt}d(te,"Z");S(te,"it");$(te,"J");_(te,"build$7");function ee(t){return function(e,r){r.push(e.substring(t.length)||".")}}d(ee,"tt");S(ee,"ot");$(ee,"K$1");_(ee,"pushDirectoryWithRelativePath");function re(t){return function(e,r,s){const l=e.substring(t.length)||".";s.every(a=>a(l,!0))&&r.push(l)}}d(re,"et");S(re,"ut");$(re,"V");_(re,"pushDirectoryFilterWithRelativePath");const Tr=_((t,e)=>{e.push(t||".")},"pushDirectory"),Hr=_((t,e,r)=>{const s=t||".";r.every(l=>l(s,!0))&&e.push(s)},"pushDirectoryFilter"),Lr=_(()=>{},"empty$2");function ne(t,e){const{includeDirs:r,filters:s,relativePaths:l}=e;return r?l?s&&s.length?re(t):ee(t):s&&s.length?Hr:Tr:Lr}d(ne,"st");S(ne,"lt");$(ne,"st$1");_(ne,"build$6");const Dr=_((t,e,r,s)=>{s.every(l=>l(t,!1))&&r.files++},"pushFileFilterAndCount"),Nr=_((t,e,r,s)=>{s.every(l=>l(t,!1))&&e.push(t)},"pushFileFilter"),Ir=_((t,e,r,s)=>{r.files++},"pushFileCount"),Fr=_((t,e)=>{e.push(t)},"pushFile"),Mr=_(()=>{},"empty$1");function se(t){const{excludeFiles:e,filters:r,onlyCounts:s}=t;return e?Mr:r&&r.length?s?Dr:Nr:s?Ir:Fr}d(se,"it");S(se,"at");$(se,"ut$1");_(se,"build$5");const Br=_(t=>t,"getArray"),Gr=_(()=>[""].slice(0,0),"getArrayGroup");function oe(t){return t.group?Gr:Br}d(oe,"nt");S(oe,"ct");$(oe,"ct$1");_(oe,"build$4");const jr=_((t,e,r)=>{t.push({directory:e,files:r,dir:e})},"groupFiles"),Ur=_(()=>{},"empty");function ie(t){return t.group?jr:Ur}d(ie,"rt");S(ie,"ht");$(ie,"ft$1");_(ie,"build$3");const qr=_(function(t,e,r){const{queue:s,fs:l,options:{suppressErrors:a}}=e;s.enqueue(),l.realpath(t,(c,y)=>{if(c)return s.dequeue(a?null:c,e);l.stat(y,(p,b)=>{if(p)return s.dequeue(a?null:p,e);if(b.isDirectory()&&Bt(t,y,e))return s.dequeue(null,e);r(b,y),s.dequeue(null,e)})})},"resolveSymlinksAsync"),Kr=_(function(t,e,r){const{queue:s,fs:l,options:{suppressErrors:a}}=e;s.enqueue();try{const c=l.realpathSync(t),y=l.statSync(c);if(y.isDirectory()&&Bt(t,c,e))return;r(y,c)}catch(c){if(!a)throw c}},"resolveSymlinks");function ue(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Kr:qr}d(ue,"ot");S(ue,"pt");$(ue,"gt$1");_(ue,"build$2");function Bt(t,e,r){if(r.options.useRealPaths)return ae(e,r);let s=$e(t),l=1;for(;s!==r.root&&l<2;){const a=r.symlinks.get(s);a&&(a===e||a.startsWith(e)||e.startsWith(a))?l++:s=$e(s)}return r.symlinks.set(t,e),l>1}d(Bt,"_");S(Bt,"L");$(Bt,"E$1");_(Bt,"isRecursive");function ae(t,e){return e.visited.includes(t+e.options.pathSeparator)}d(ae,"lt");S(ae,"ft");$(ae,"dt$1");_(ae,"isRecursiveUsingRealPaths");const Wr=_(t=>t.counts,"onlyCountsSync"),Xr=_(t=>t.groups,"groupsSync"),Qr=_(t=>t.paths,"defaultSync"),zr=_(t=>t.paths.slice(0,t.options.maxFiles),"limitFilesSync"),Zr=_((t,e,r)=>(St(e,r,t.counts,t.options.suppressErrors),null),"onlyCountsAsync"),Yr=_((t,e,r)=>(St(e,r,t.paths,t.options.suppressErrors),null),"defaultAsync"),Vr=_((t,e,r)=>(St(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),"limitFilesAsync"),Jr=_((t,e,r)=>(St(e,r,t.groups,t.options.suppressErrors),null),"groupsAsync");function St(t,e,r,s){e(t&&!s?t:null,r)}d(St,"A");S(St,"j");$(St,"y");_(St,"report");function le(t,e){const{onlyCounts:r,group:s,maxFiles:l}=t;return r?e?Wr:Zr:s?e?Xr:Jr:l?e?zr:Vr:e?Qr:Yr}d(le,"at");S(le,"gt");$(le,"Et");_(le,"build$1");const Xe={withFileTypes:!0},tn=_((t,e,r,s,l)=>{if(t.queue.enqueue(),s<0)return t.queue.dequeue(null,t);const{fs:a}=t;t.visited.push(e),t.counts.directories++,a.readdir(e||".",Xe,(c,y=[])=>{l(y,r,s),t.queue.dequeue(t.options.suppressErrors?null:c,t)})},"walkAsync"),en=_((t,e,r,s,l)=>{const{fs:a}=t;if(s<0)return;t.visited.push(e),t.counts.directories++;let c=[];try{c=a.readdirSync(e||".",Xe)}catch(y){if(!t.options.suppressErrors)throw y}l(c,r,s)},"walkSync");function ce(t){return t?en:tn}d(ce,"ut");S(ce,"yt");$(ce,"xt$1");_(ce,"build");var rn=class{static{d(this,"De")}static{S(this,"we")}static{$(this,"_t")}static{_(this,"Queue")}count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},nn=class{static{d(this,"Ae")}static{S(this,"$e")}static{$(this,"At")}static{_(this,"Counter")}_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},sn=class{static{d(this,"Ee")}static{S(this,"Se")}static{$(this,"Wt")}static{_(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},Qe=class{static{d(this,"Dt")}static{S(this,"mt")}static{$(this,"q")}static{_(this,"Walker")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=le(e,this.isSynchronous),this.root=xt(t,e),this.state={root:Zt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new nn,options:e,queue:new rn((s,l)=>this.callbackInvoker(l,s,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new sn,fs:e.fs||dr},this.joinPath=te(this.root,e),this.pushDirectory=ne(this.root,e),this.pushFile=se(e),this.getArray=oe(e),this.groupFiles=ie(e),this.resolveSymlink=ue(e,this.isSynchronous),this.walkDirectory=ce(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=_((t,e,r)=>{const{paths:s,options:{filters:l,resolveSymlinks:a,excludeSymlinks:c,exclude:y,maxFiles:p,signal:b,useRealPaths:R,pathSeparator:T},controller:H}=this.state;if(H.aborted||b&&b.aborted||p&&s.length>p)return;const k=this.getArray(this.state.paths);for(let D=0;D<t.length;++D){const x=t[D];if(x.isFile()||x.isSymbolicLink()&&!a&&!c){const w=this.joinPath(x.name,e);this.pushFile(w,k,this.state.counts,l)}else if(x.isDirectory()){let w=Jt(x.name,e,this.state.options.pathSeparator);if(y&&y(x.name,w))continue;this.pushDirectory(w,s,l),this.walkDirectory(this.state,w,w,r-1,this.walk)}else if(this.resolveSymlink&&x.isSymbolicLink()){let w=Mt(x.name,e);this.resolveSymlink(w,this.state,(it,F)=>{if(it.isDirectory()){if(F=xt(F,this.state.options),y&&y(x.name,R?F:w+T))return;this.walkDirectory(this.state,F,R?F:w+T,r-1,this.walk)}else{F=R?F:w;const K=Er(F),h=xt($e(F),this.state.options);F=this.joinPath(K,h),this.pushFile(F,k,this.state.counts,l)}})}}this.groupFiles(this.state.groups,e,k)},"walk")};function pe(t,e){return new Promise((r,s)=>{Gt(t,e,(l,a)=>{if(l)return s(l);r(a)})})}d(pe,"ct");S(pe,"bt");$(pe,"Ct");_(pe,"promise");function Gt(t,e,r){new Qe(t,e,r).start()}d(Gt,"T");S(Gt,"G");$(Gt,"x");_(Gt,"callback");function he(t,e){return new Qe(t,e).start()}d(he,"ht");S(he,"vt");$(he,"jt");_(he,"sync");var qe=class{static{d(this,"kt")}static{S(this,"J")}static{$(this,"F")}static{_(this,"APIBuilder")}constructor(t,e){this.root=t,this.options=e}withPromise(){return pe(this.root,this.options)}withCallback(t){Gt(this.root,this.options,t)}sync(){return he(this.root,this.options)}};let ze=null;try{Ue.resolve("picomatch"),ze=Ue("picomatch")}catch{}var on=class{static{d(this,"We")}static{S(this,"ke")}static{$(this,"$t")}static{_(this,"Builder")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Ke,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new qe(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new qe(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const r=this.globFunction||ze;if(!r)throw new Error("Please specify a glob function to use glob matching.");var s=this.globCache[t.join("\0")];return s||(s=r(t,...e),this.globCache[t.join("\0")]=s),this.options.filters.push(l=>s(l)),this}},un=Object.defineProperty,V=$((t,e)=>un(t,"name",{value:e,configurable:!0}),"a");const an=Array.isArray,Ze=/\\/g,Ye=process.platform==="win32",ln=/^(\/?\.\.)+$/;function Dt(t,e={}){const r=t.length,s=Array(r),l=Array(r);let a,c;for(a=0;a<r;a++){const y=jt(t[a]);s[a]=y;const p=y.length,b=Array(p);for(c=0;c<p;c++)b[c]=Et(y[c],e);l[a]=b}return y=>{const p=y.split("/");if(p[0]===".."&&ln.test(y))return!0;for(a=0;a<r;a++){const b=s[a],R=l[a],T=p.length,H=Math.min(T,b.length);for(c=0;c<H;){const k=b[c];if(k.includes("/"))return!0;if(!R[c](p[c]))break;if(!e.noglobstar&&k==="**")return!0;c++}if(c===T)return!0}return!1}}d(Dt,"R");S(Dt,"B");$(Dt,"D");V(Dt,"getPartialMatcher");const cn=/^[A-Z]:\/$/i,pn=Ye?t=>cn.test(t):t=>t==="/";function Nt(t,e,r){if(t===e||e.startsWith(`${t}/`)){if(r){const l=t.length+ +!pn(t);return(a,c)=>a.slice(l,c?-1:void 0)||"."}const s=e.slice(t.length+1);return s?(l,a)=>{if(l===".")return s;const c=`${s}/${l}`;return a?c.slice(0,-1):c}:(l,a)=>a&&l!=="."?l.slice(0,-1):l}return r?s=>$t.relative(t,s)||".":s=>$t.relative(t,`${e}/${s}`)||"."}d(Nt,"O");S(Nt,"M");$(Nt,"M");V(Nt,"buildFormat");function fe(t,e){if(e.startsWith(`${t}/`)){const r=e.slice(t.length+1);return s=>`${r}/${s}`}return r=>{const s=$t.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&s!==""?`${s}/`:s||"."}}d(fe,"pt");S(fe,"St");$(fe,"at");V(fe,"buildRelative");const hn={parts:!0};function jt(t){var e;const r=Et.scan(t,hn);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}d(jt,"I");S(jt,"z");$(jt,"N");V(jt,"splitPattern");const fn=/\\(?![()[\]{}!+@])/g;function Te(t){return Ve(t)}d(Te,"qt");S(Te,"Ee");$(Te,"ut");V(Te,"convertPosixPathToPattern");function He(t){return Je(t).replace(fn,"/")}d(He,"jt");S(He,"Re");$(He,"ft");V(He,"convertWin32PathToPattern");const gn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,yn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ve=V(t=>t.replace(gn,"\\$&"),"escapePosixPath"),Je=V(t=>t.replace(yn,"\\$&"),"escapeWin32Path"),dn=Ye?Je:Ve;function ge(t,e){if(e?.caseSensitiveMatch===!1)return!0;const r=Et.scan(t);return r.isGlob||r.negated}d(ge,"ft");S(ge,"Dt");$(ge,"k");V(ge,"isDynamicPattern");function vt(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}d(vt,"D");S(vt,"D");$(vt,"E");V(vt,"log");function Ut(t){return typeof t=="string"?[t]:t??[]}d(Ut,"L");S(Ut,"U");$(Ut,"W");V(Ut,"ensureStringArray");const bn=/^(\/?\.\.)+/,An=/\\(?=[()[\]{}!*+?@|])/g;function Ct(t,e,r,s){var l;const a=e.cwd;let c=t;t[t.length-1]==="/"&&(c=t.slice(0,-1));const y=c.lastIndexOf("/"),p=(y===-1?c:c.slice(y+1)).startsWith("!(");c[c.length-1]!=="*"&&!p&&e.expandDirectories&&(c+="/**");const b=dn(a);c=xr(c.replace(An,""))?$t.relative(b,c):$t.normalize(c);const R=(l=bn.exec(c))===null||l===void 0?void 0:l[0],T=jt(c);if(R){const k=(R.length+1)/3;let D=0;const x=b.split("/");for(;D<k&&T[D+k]===x[x.length+D-k];)c=c.slice(0,(k-D-1)*3)+c.slice((k-D)*3+T[D+k].length+1)||".",D++;const w=$t.join(a,R.slice(D*3));w[0]!=="."&&r.root.length>w.length&&(r.root=w,r.depthOffset=-k+D)}if(!s&&r.depthOffset>=0){var H;(H=r.commonPath)!==null&&H!==void 0||(r.commonPath=T);const k=[],D=Math.min(r.commonPath.length,T.length);for(let x=0;x<D;x++){const w=T[x];if(w==="**"&&!T[x+1]){k.pop();break}if(x===T.length-1||w!==r.commonPath[x]||ge(w))break;k.push(w)}r.depthOffset=k.length,r.commonPath=k,r.root=k.length>0?$t.join(a,...k):a}return c}d(Ct,"j");S(Ct,"E");$(Ct,"$");V(Ct,"normalizePattern");function ye(t,e,r){const s=[],l=[],a=[];for(const c of t.ignore)c&&(c[0]!=="!"||c[1]==="("?l.push(Ct(c,t,r,!0)):a.push(c.slice(1)));for(const c of e)c&&(c[0]!=="!"||c[1]==="("?s.push(Ct(c,t,r,!1)):(c[1]!=="!"||c[2]==="(")&&l.push(Ct(c.slice(1),t,r,!0)));return{match:s,ignore:l,unignore:a}}d(ye,"gt");S(ye,"xt");$(ye,"St");V(ye,"processPatterns");function de(t,e){const r=t.cwd,s={root:r,depthOffset:0},l=ye(t,e,s);t.debug&&vt("internal processing patterns:",l);const{absolute:a,caseSensitiveMatch:c,debug:y,dot:p,followSymbolicLinks:b,onlyDirectories:R}=t,T=s.root.replace(Ze,""),H={dot:p,nobrace:t.braceExpansion===!1,nocase:!c,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},k=l.unignore.length>0,D=k?Et(l.unignore,H):void 0,x=k?Dt(l.unignore,H):void 0,w=Et(l.match,{...H,ignore:l.ignore,onIgnore:D?m=>D(m.output)&&Et.constants.UNIGNORE:void 0}),it=Et(l.ignore,H),F=Dt(l.match,H),K=Nt(r,T,a),h=a?K:Nt(r,T,!0),A=l.match.length>0&&l.match.every(m=>m==="**"||m==="**/*"),n=l.ignore.length>0||k||!A?(m,v)=>{const O=h(v,!0);return O==="."||x&&x(O)?!1:!F(O)||it(O)}:void 0;let E;t.deep!==void 0&&(E=Math.round(t.deep-s.depthOffset));const C=new on({filters:[y?(m,v)=>{const O=K(m,v),Z=w(O);return Z&&vt(`matched ${O}`),Z}:(m,v)=>{const O=K(m,v);return w(O)}],exclude:y&&n?(m,v)=>{const O=n(m,v);return vt(`${O?"skipped":"crawling"} ${v}`),O}:n,fs:t.fs,pathSeparator:"/",relativePaths:!a,resolvePaths:a,includeBasePath:a,resolveSymlinks:b,excludeSymlinks:!b,excludeFiles:R,includeDirs:R||!t.onlyFiles,maxDepth:E,signal:t.signal}).crawl(T);return t.debug&&vt("internal properties:",{...s,root:T}),[C,r!==T&&!a&&fe(r,T)]}d(de,"dt");S(de,"At");$(de,"vt");V(de,"buildCrawler");function qt(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}d(qt,"z");S(qt,"N");$(qt,"U");V(qt,"formatPaths");const vn={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function be(t){const e={...vn,...t};return e.cwd=(e.cwd instanceof URL?Cr(e.cwd):We(e.cwd)).replace(Ze,"/"),e.ignore=Ut(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Rr,readdirSync:e.fs.readdirSync||mr,realpath:e.fs.realpath||_r,realpathSync:e.fs.realpathSync||vr,stat:e.fs.stat||Ar,statSync:e.fs.statSync||br}),e.debug&&vt("globbing with options:",e),e}d(be,"yt");S(be,"_t");$(be,"pt");V(be,"getOptions");function Kt(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const s=an(t)||typeof t=="string",l=Ut((r=s?t:t.patterns)!==null&&r!==void 0?r:"**/*"),a=be(s?e:t);return l.length>0?de(a,l):[]}d(Kt,"G");S(Kt,"Q");$(Kt,"G");V(Kt,"getCrawler");async function Ae(t,e){const[r,s]=Kt(t,e);return r?qt(await r.withPromise(),s):[]}d(Ae,"mt");S(Ae,"Ie");$(Ae,"bt");V(Ae,"glob");function Le(t,e){const[r,s]=Kt(t,e);return r?qt(r.sync(),s):[]}d(Le,"vt");S(Le,"Le");$(Le,"xt");V(Le,"globSync");var _n=Object.defineProperty,mn=d((t,e)=>_n(t,"name",{value:e,configurable:!0}),"r"),Rn=Object.defineProperty,En=mn((t,e)=>Rn(t,"name",{value:e,configurable:!0}),"r"),$n=Object.defineProperty,Sn=En((t,e)=>$n(t,"name",{value:e,configurable:!0}),"r");const On=Sn(async(t,e)=>await Ae(t,e),"glob");export{On as i};
@@ -0,0 +1 @@
1
+ var ce=Object.defineProperty;var f=(e,t)=>ce(e,"name",{value:t,configurable:!0});var le=Object.defineProperty,M=f((e,t)=>le(e,"name",{value:t,configurable:!0}),"i$6");const U=M(e=>{const t=new Set,n=[e];for(let r=0;r<n.length;r++){const o=n[r];if(t.has(o))continue;t.add(o);const{children:a}=o;if(a?.length)for(let i=0,u=a.length;i<u;i++)n.push(a[i])}return Array.from(t)},"getNodes"),pe=M(e=>{let t="";const n=U(e);for(let r=0,o=n.length;r<o;r++){const a=n[r];if(!a.regex)continue;const i=a.regex.flags;if(t||(t=i),t!==i)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${i}"`)}return t},"getNodeFlags"),T=M((e,t,n)=>{const r=n.get(e);if(r!==void 0)return r;const o=e.partial??t;let a="";if(e.regex&&(a+=o?"(?:$|":"",a+=e.regex.source),e.children?.length){const i=$e(e.children.map(u=>T(u,t,n)).filter(Boolean));if(i?.length){const u=e.children.some(w=>!w.regex||!(w.partial??t)),p=i.length>1||o&&(!a.length||u);a+=p?o?"(?:$|":"(?:":"",a+=i.join("|"),a+=p?")":""}}return e.regex&&(a+=o?")":""),n.set(e,a),a},"getNodeSourceWithCache"),fe=M((e,t)=>{const n=new Map,r=U(e);for(let o=r.length-1;o>=0;o--){const a=T(r[o],t,n);if(!(o>0))return a}return""},"getNodeSource"),$e=M(e=>Array.from(new Set(e)),"uniq");var ge=Object.defineProperty,de=f((e,t)=>ge(e,"name",{value:t,configurable:!0}),"a$6");const B=de((e,t,n)=>B.compile(e,n).test(t),"graphmatch");B.compile=(e,t)=>{const n=t?.partial??!1,r=fe(e,n),o=pe(e);return new RegExp(`^(?:${r})$`,o)};var he=Object.defineProperty,xe=f((e,t)=>he(e,"name",{value:t,configurable:!0}),"r$2");const me=xe((e,t)=>{const n=B.compile(e,t),r=`${n.source.slice(0,-1)}[\\\\/]?$`,o=n.flags;return new RegExp(r,o)},"compile");var ve=Object.defineProperty,be=f((e,t)=>ve(e,"name",{value:t,configurable:!0}),"n$1");const ye=be(e=>{const t=e.map(r=>r.source).join("|")||"$^",n=e[0]?.flags;return new RegExp(t,n)},"merge");var je=Object.defineProperty,h=f((e,t)=>je(e,"name",{value:t,configurable:!0}),"e$1");const X=h(e=>Array.isArray(e),"isArray"),z=h(e=>typeof e=="function","isFunction"),we=h(e=>e.length===0,"isFunctionNullary"),ke=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return n=>(n.length===0||n.length===1)&&t.test(e.call(n))})(),Me=h(e=>typeof e=="number","isNumber"),ze=h(e=>typeof e=="object"&&e!==null,"isObject"),Oe=h(e=>e instanceof RegExp,"isRegExp"),Pe=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Ae=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),Y=h(e=>typeof e=="string","isString"),m=h(e=>e===void 0,"isUndefined"),Ee=h(e=>{const t=new Map;return n=>{const r=t.get(n);if(r!==void 0)return r;const o=e(n);return t.set(n,o),o}},"memoize");var Re=Object.defineProperty,c=f((e,t)=>Re(e,"name",{value:t,configurable:!0}),"s");const D=c((e,t,n={})=>{const r={cache:{},input:e,index:0,indexBacktrackMax:0,options:n,output:[]},o=g(t)(r),a=Math.max(r.index,r.indexBacktrackMax);if(o&&r.index===e.length)return r.output;throw new Error(`Failed to parse at index ${a}`)},"parse");c((e,t,n={})=>{const r={cache:{},input:e,index:0,indexBacktrackMax:0,options:n,output:[]};return g(t)(r)&&r.index===e.length},"validate");const s=c((e,t)=>X(e)?Ie(e,t):Y(e)?G(e,t):Se(e,t),"match"),Ie=c((e,t)=>{const n={};for(const r of e){if(r.length!==1)throw new Error(`Invalid character: "${r}"`);const o=r.charCodeAt(0);n[o]=!0}return r=>{const o=r.input;let a=r.index,i=a;for(;i<o.length&&o.charCodeAt(i)in n;)i+=1;if(i>a){if(!m(t)&&!r.options.silent){const u=o.slice(a,i),p=z(t)?t(u,o,`${a}`):t;m(p)||r.output.push(p)}r.index=i}return!0}},"chars"),Se=c((e,t)=>{if(Ae(e))return G(e.source,t);{const n=e.source,r=e.flags.replace(/y|$/,"y"),o=new RegExp(n,r);return Pe(e)&&z(t)&&!ke(t)?Be(o,t):Ce(o,t)}},"regex"),Be=c((e,t)=>n=>{const r=n.index,o=n.input;e.lastIndex=r;const a=e.exec(o);if(a){const i=e.lastIndex;if(!n.options.silent){const u=t(...a,o,`${r}`);m(u)||n.output.push(u)}return n.index=i,!0}else return!1},"regexCapturing"),Ce=c((e,t)=>n=>{const r=n.index,o=n.input;if(e.lastIndex=r,e.test(o)){const a=e.lastIndex;if(!m(t)&&!n.options.silent){const i=z(t)?t(o.slice(r,a),o,`${r}`):t;m(i)||n.output.push(i)}return n.index=a,!0}else return!1},"regexNonCapturing"),G=c((e,t)=>n=>{const r=n.index,o=n.input;if(o.startsWith(e,r)){if(!m(t)&&!n.options.silent){const a=z(t)?t(e,o,`${r}`):t;m(a)||n.output.push(a)}return n.index+=e.length,!0}else return!1},"string"),E=c((e,t,n,r)=>{const o=g(e),a=t>1;return F(R(N(i=>{let u=0;for(;u<n;){const p=i.index;if(!o(i)||(u+=1,i.index===p))break}return u>=t},a),r))},"repeat"),C=c((e,t)=>E(e,0,1,t),"optional"),O=c((e,t)=>E(e,0,1/0,t),"star"),H=c((e,t)=>E(e,1,1/0,t),"plus"),v=c((e,t)=>{const n=e.map(g);return F(R(N(r=>{for(let o=0,a=n.length;o<a;o++)if(!n[o](r))return!1;return!0}),t))},"and"),$=c((e,t)=>{const n=e.map(g);return F(R(r=>{for(let o=0,a=n.length;o<a;o++)if(n[o](r))return!0;return!1},t))},"or"),Ne=c((e,t)=>{const n={};for(const r in e){if(r.length!==1&&r!=="default")throw new Error(`Invalid jump character: "${r}"`);n[r]=g(e[r])}return R(r=>{const o=r.input[r.index],a=n[o]||n.default;return a?a(r):!1},t)},"jump"),J=c((e,t)=>{const n=g(e);return N(r=>n(r)===t,!0,!0)},"lookahead"),Fe=c(e=>J(e,!1),"negative"),Ze=c(e=>J(e,!0),"positive"),N=c((e,t=!0,n=!1)=>{const r=g(e);return t?o=>{const a=o.index,i=o.output.length,u=r(o);return!u&&!n&&(o.indexBacktrackMax=Math.max(o.indexBacktrackMax,o.index)),(!u||n)&&(o.index=a,o.output.length!==i&&(o.output.length=i)),u}:r},"backtrackable"),R=c((e,t)=>{const n=g(e);return t?r=>{if(r.options.silent)return n(r);const o=r.output.length;if(n(r)){const a=r.output.splice(o,1/0),i=t(a);return m(i)||r.output.push(i),!0}else return!1}:n},"handleable"),F=(()=>{let e=0;return t=>{const n=g(t),r=e+=1;return o=>{var a;if(o.options.memoization===!1)return n(o);const i=o.index,u=(a=o.cache)[r]||(a[r]={indexMax:-1,queue:[]}),p=u.queue;if(i<=u.indexMax){const k=u.store||(u.store=new Map);if(p.length){for(let y=0,ie=p.length;y<ie;y+=2){const se=p[y*2],ue=p[y*2+1];k.set(se,ue)}p.length=0}const d=k.get(i);if(d===!1)return!1;if(Me(d))return o.index=d,!0;if(d)return o.index=d.index,d.output?.length&&o.output.push(...d.output),!0}const w=o.output.length,ae=n(o);if(u.indexMax=Math.max(u.indexMax,i),ae){const k=o.index,d=o.output.length;if(d>w){const y=o.output.slice(w,d);p.push(i,{index:k,output:y})}else p.push(i,k);return!0}else return p.push(i,!1),!1}}})();c(e=>e({match:s,repeat:E,optional:C,star:O,plus:H,and:v,or:$,jump:Ne,negative:Fe,positive:Ze,lazy:Z}),"grammar");const Z=c(e=>{let t;return n=>(t||(t=g(e())),t(n))},"lazy"),g=Ee(e=>{if(z(e))return we(e)?Z(e):e;if(Y(e)||Oe(e))return s(e);if(X(e))return v(e);if(ze(e))return $(Object.values(e));throw new Error("Invalid rule")});var qe=Object.defineProperty,I=f((e,t)=>qe(e,"name",{value:t,configurable:!0}),"a$3");const b=I(e=>e,"identity"),_e=I(e=>typeof e=="string","isString"),We=I(e=>{const t=new WeakMap,n=new WeakMap;return(r,o)=>{const a=o?.partial?n:t,i=a.get(r);if(i!==void 0)return i;const u=e(r,o);return a.set(r,u),u}},"memoizeByObject"),Le=I(e=>{const t={},n={};return(r,o)=>{const a=o?.partial?n:t;return a[r]??(a[r]=e(r,o))}},"memoizeByPrimitive"),Ue=s(/\\./,b),Te=s(/./,b),Xe=s(/\*\*\*+/,"*"),Ye=s(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),De=s(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Ge=O($([Ue,Xe,Ye,De,Te]));var He=Object.defineProperty,Je=f((e,t)=>He(e,"name",{value:t,configurable:!0}),"o$3");const Ke=Je(e=>D(e,Ge,{memoization:!1}).join(""),"normalize");var Qe=Object.defineProperty,P=f((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"a$1");const K="abcdefghijklmnopqrstuvwxyz",Ve=P(e=>{let t="";for(;e>0;){const n=(e-1)%26;t=K[n]+t,e=Math.floor((e-1)/26)}return t},"int2alpha"),W=P(e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+K.indexOf(e[n])+1;return t},"alpha2int"),q=P((e,t)=>{if(t<e)return q(t,e);const n=[];for(;e<=t;)n.push(e++);return n},"makeRangeInt"),et=P((e,t,n)=>q(e,t).map(r=>String(r).padStart(n,"0")),"makeRangePaddedInt"),Q=P((e,t)=>q(W(e),W(t)).map(Ve),"makeRangeAlpha");var tt=Object.defineProperty,S=f((e,t)=>tt(e,"name",{value:t,configurable:!0}),"l");const l=S(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"regex"),A=S(e=>({children:e}),"alternation"),j=(()=>{const e=S((t,n,r)=>{if(r.has(t))return;r.add(t);const{children:o}=t;if(!o.length)o.push(n);else for(let a=0,i=o.length;a<i;a++)e(o[a],n,r)},"pushToLeaves");return t=>{if(!t.length)return A([]);for(let n=t.length-1;n>=1;n--){const r=new Set,o=t[n-1],a=t[n];e(o,a,r)}return t[0]}})(),x=S(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"slash"),nt=s(/\\./,l),rt=s(/[$.*+?^(){}[\]\|]/,e=>l(`\\${e}`)),ot=s(/[\\\/]/,x),at=s(/[^$.*+?^(){}[\]\|\\\/]+/,l),it=s(/^(?:!!)*!(.*)$/,(e,t)=>l(`(?!^${_.compile(t).source}$).*?`)),st=s(/^(!!)+/),ut=$([it,st]),ct=s(/\/(\*\*\/)+/,()=>A([j([x(),l(".+?"),x()]),x()])),lt=s(/^(\*\*\/)+/,()=>A([l("^"),j([l(".*?"),x()])])),pt=s(/\/(\*\*)$/,()=>A([j([x(),l(".*?")]),l("$")])),ft=s(/\*\*/,()=>l(".*?")),V=$([ct,lt,pt,ft]),$t=s(/\*\/(?!\*\*\/|\*$)/,()=>j([l("[^\\\\/]*?"),x()])),gt=s(/\*/,()=>l("[^\\\\/]*")),ee=$([$t,gt]),te=s("?",()=>l("[^\\\\/]")),dt=s("[",b),ht=s("]",b),xt=s(/[!^]/,"^\\\\/"),mt=s(/[a-z]-[a-z]|[0-9]-[0-9]/i,b),vt=s(/\\./,b),bt=s(/[$.*+?^(){}[\|]/,e=>`\\${e}`),yt=s(/[\\\/]/,"\\\\/"),jt=s(/[^$.*+?^(){}[\]\|\\\/]+/,b),wt=$([vt,bt,yt,mt,jt]),ne=v([dt,C(xt),O(wt),ht],e=>l(e.join(""))),kt=s("{","(?:"),Mt=s("}",")"),zt=s(/(\d+)\.\.(\d+)/,(e,t,n)=>et(+t,+n,Math.min(t.length,n.length)).join("|")),Ot=s(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>Q(t,n).join("|")),Pt=s(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>Q(t.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),At=$([zt,Ot,Pt]),re=v([kt,At,Mt],e=>l(e.join(""))),Et=s("{"),Rt=s("}"),It=s(","),St=s(/\\./,l),Bt=s(/[$.*+?^(){[\]\|]/,e=>l(`\\${e}`)),Ct=s(/[\\\/]/,x),Nt=s(/[^$.*+?^(){}[\]\|\\\/,]+/,l),Ft=Z(()=>oe),Zt=s("",()=>l("(?:)")),qt=H($([V,ee,te,ne,re,Ft,St,Bt,Ct,Nt]),j),L=$([qt,Zt]),oe=v([Et,C(v([L,O(v([It,L]))])),Rt],A),_t=O($([ut,V,ee,te,ne,re,oe,nt,rt,ot,at]),j);var Wt=Object.defineProperty,Lt=f((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"m");const Ut=Lt(e=>D(e,_t,{memoization:!1})[0],"_parse");var Tt=Object.defineProperty,Xt=f((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"i");const _=Xt((e,t,n)=>_.compile(e,n).test(t),"zeptomatch");_.compile=(()=>{const e=Le((n,r)=>me(Ut(Ke(n)),r)),t=We((n,r)=>ye(n.map(o=>e(o,r))));return(n,r)=>_e(n)?e(n,r):t(n,r)})();export{_ as o};
@@ -0,0 +1,2 @@
1
+ var z=Object.defineProperty;var a=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as Q}from"node:module";import{m as tt,o as O,M as p}from"../packem_chunks/config.js";import{aZ as lt,a4 as dt,a_ as W}from"../packem_chunks/bin.js";const U=Q(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=a(t=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[e,o]=k.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return k.getBuiltinModule(t)}return U(t)},"__cjs_getBuiltinModule"),{Socket:et}=y("node:net"),{randomBytes:ot}=y("node:crypto"),{readdir:st,writeFile:rt,rename:it,rm:T,open:A,readFile:at,stat:nt,unlink:j}=y("node:fs/promises"),{createRequire:ct}=y("node:module"),{spawn:ht}=y("node:child_process");var ut=Object.defineProperty,ft=a((t,e)=>ut(t,"name",{value:e,configurable:!0}),"i$1"),pt=Object.defineProperty,N=ft((t,e)=>pt(t,"name",{value:e,configurable:!0}),"s");const wt=ct(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=N(t=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,o]=m.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return m.getBuiltinModule(t)}return wt(t)},"__cjs_getBuiltinModule"),{lstat:x,mkdir:mt}=kt("node:fs/promises");var gt=Object.defineProperty,vt=N((t,e)=>gt(t,"name",{value:e,configurable:!0}),"o");const yt=vt(async t=>{tt(t);try{const e=await x(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(O(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await mt(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await x(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(O(o))}'`,{cause:e})}},"ensureDir");var _t=Object.defineProperty,u=a((t,e)=>_t(t,"name",{value:e,configurable:!0}),"s");const bt=3e4,B=100;class $t extends Error{static{a(this,"ServiceReadinessError")}constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs;static{u(this,"ServiceReadinessError")}}const Ht=u(async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??bt,r=Date.now();for(;Date.now()-r<s;){if(await Et(e,o))return;await St(B)}throw new $t(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},"waitForTcp"),Et=u((t,e)=>new Promise(o=>{const s=new et,r=u(i=>{s.removeAllListeners(),s.destroy(),o(i)},"onDone");s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(B,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),"tryConnect"),St=u(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),Pt=u(async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Ht({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},"runReadiness");var Tt=Object.defineProperty,d=a((t,e)=>Tt(t,"name",{value:e,configurable:!0}),"o");const M=384,C=5e3,Mt=50,Rt=3e4,w=d(async t=>{const e=p(lt(t),"services");try{await yt(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},"getRegistryDir"),R=d(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),D=d((t,e)=>p(t,`${R(e)}.json`),"entryPath"),Dt=d((t,e)=>p(t,`${R(e)}.lock`),"lockPath"),b=d(async(t,e)=>{const o=await w(t),s=D(o,e);if(await dt(s))try{return await W(s)}catch{return}},"readEntry"),Ot=d(async t=>{const e=await w(t);let o;try{o=await st(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await W(p(e,r));s.push(i)}catch{}return s},"readAllEntries"),jt=d(async(t,e)=>{const o=await w(t),s=D(o,e.id),r=p(o,`.${ot(8).toString("hex")}.tmp`);await rt(r,`${JSON.stringify(e,void 0,2)}
2
+ `,{mode:M});try{await it(r,s)}catch(i){throw await T(r,{force:!0}).catch(()=>{}),i}},"writeEntry"),g=d(async(t,e,o)=>{const s=await w(t),r=o??await b(t,e);await T(D(s,e),{force:!0}),r&&await T(r.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),f=d(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),Ut=d(async t=>{const e=await Ot(t),o=[],s=[];for(const r of e){if(f(r.pid)){s.push(r);continue}const i=await b(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await g(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},"pruneDead"),xt=d(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),Ct=d(async t=>{try{const e=await A(t,"wx",M);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},"tryClaimLock"),Ft=d(async t=>{let e;try{const o=await at(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!f(e))return!0;try{const o=await nt(t);return Date.now()-o.mtimeMs>Rt}catch{return!0}},"isLockStale"),G=d(async(t,e,o)=>{const s=await w(t),r=Dt(s,e),i=Date.now();for(;!await Ct(r);){if(await Ft(r)){await j(r).catch(()=>{});continue}if(Date.now()-i>=C)throw new Error(`Could not acquire service lock for ${e} within ${String(C)}ms — another \`vis service\` invocation appears to be holding it.`);await xt(Mt)}try{return await o()}finally{await j(r).catch(()=>{})}},"withServiceLock");var It=Object.defineProperty,n=a((t,e)=>It(t,"name",{value:e,configurable:!0}),"r");function v(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?v(r,e,i):typeof r=="function"&&(e[i]=r)}return e}a(v,"c");n(v,"flatHooks");function Lt(...t){const e={};for(const o of t){const s=v(o);for(const r in s)e[r]?e[r].push(s[r]):e[r]=[s[r]]}for(const o in e)if(e[o].length>1){const s=e[o];e[o]=(...r)=>V(s,i=>i(...r))}else e[o]=e[o][0];return e}a(Lt,"v");n(Lt,"mergeHooks");function V(t,e){return t.reduce((o,s)=>o.then(()=>e(s)),Promise.resolve())}a(V,"d$2");n(V,"serial");const q=(()=>{if(console.createTask)return console.createTask;const t={run:n(e=>e(),"run")};return()=>t})();function $(t,e,o,s){for(let r=o;r<t.length;r+=1)try{const i=s?s.run(()=>t[r](...e)):t[r](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>$(t,e,r+1,s))}catch(i){return Promise.reject(i)}}a($,"k");n($,"callHooks");function X(t,e,o){if(t.length>0)return $(t,e,0,q(o))}a(X,"y");n(X,"serialTaskCaller");function J(t,e,o){if(t.length>0){const s=q(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}a(J,"m");n(J,"parallelTaskCaller");function At(t,e){return t.reduce((o,s)=>o.then(()=>s(...e||[])),Promise.resolve())}a(At,"x");n(At,"serialCaller");function Wt(t,e){return Promise.all(t.map(o=>o(...e||[])))}a(Wt,"P");n(Wt,"parallelCaller");function _(t,e){for(const o of[...t])o(e)}a(_,"a");n(_,"callEachWith");var Nt=class{static{a(this,"p")}static{n(this,"Hookable")}_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:n(()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb","get"),configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=n((...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r)),"_function");return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=v(t),o=Object.keys(e).map(s=>this.hook(s,e[s]));return()=>{for(const s of o)s();o.length=0}}removeHooks(t){const e=v(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(X,t,e)}callHookParallel(t,...e){return this.callHookWith(J,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&_(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&_(this._after,s)}):(this._after&&s&&_(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function K(){return new Nt}a(K,"w$2");n(K,"createHooks");(class{static{n(this,"HookableCore")}_hooks;constructor(){this._hooks={}}hook(t,e){return!t||typeof e!="function"?()=>{}:(this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)})}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}callHook(t,...e){const o=this._hooks[t];if(!(!o||o.length===0))return $(o,e,0)}});const F=typeof window<"u";function Bt(t,e={}){const o={inspect:F,group:F,filter:n(()=>!0,"filter"),...e},s=o.filter,r=typeof s=="string"?c=>c.startsWith(s):s,i=o.tag?`[${o.tag}] `:"",l=n(c=>i+c.name+"".padEnd(c._id,"\0"),"logPrefix"),h={},S=t.beforeEach(c=>{r!==void 0&&!r(c.name)||(h[c.name]=h[c.name]||0,c._id=h[c.name]++,console.time(l(c)))}),P=t.afterEach(c=>{r!==void 0&&!r(c.name)||(o.group&&console.groupCollapsed(c.name),o.inspect?console.timeLog(l(c),c.args):console.timeEnd(l(c)),o.group&&console.groupEnd(),h[c.name]--)});return{close:n(()=>{S(),P()},"close")}}a(Bt,"W");n(Bt,"createDebugger");var Gt=Object.defineProperty,H=a((t,e)=>Gt(t,"name",{value:e,configurable:!0}),"t$1");const te=H(()=>K(),"createVisHooks"),ee=H(async(t,e)=>{if(!(!e||e.length===0))for(const o of e){if(o.hooks)for(const[s,r]of Object.entries(o.hooks)){const i=Array.isArray(r)?r:[r];for(const l of i)t.hook(s,l)}o.setup&&await o.setup(t)}},"registerPlugins");class oe{static{a(this,"HookableLifeCycle")}static{H(this,"HookableLifeCycle")}#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Vt(o.status)&&this.#t("task:cacheHit",o.task,o)}printCacheMiss(e,o){this.#t("task:cacheMiss",e,o)}onTaskStdout(e,o){this.#t("task:stdout",e,o)}onTaskStderr(e,o){this.#t("task:stderr",e,o)}#t(e,...o){Promise.resolve(this.#o.callHook(e,...o)).catch(s=>{if(this.#e)try{this.#e(e,s)}catch{}})}}const Vt=H(t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache","isCacheStatus");var qt=Object.defineProperty,Xt=a((t,e)=>qt(t,"name",{value:e,configurable:!0}),"i");const I=process.platform==="win32",Jt=Xt(async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=await A(r,"a",M);let l;try{l=ht(I?"cmd":"/bin/sh",I?["/d","/s","/c",e]:["-c",e],{cwd:o,detached:!0,env:{...process.env,...s},stdio:["ignore",i.fd,i.fd],windowsHide:!0})}finally{await i.close().catch(()=>{})}if(l.pid===void 0&&await new Promise((h,S)=>{l.once("spawn",()=>{h()}),l.once("error",P=>{S(P)})}),l.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return l.unref(),{pid:l.pid}},"spawnDetached");var Kt=Object.defineProperty,E=a((t,e)=>Kt(t,"name",{value:e,configurable:!0}),"t");const Y=5e3,se=E(async t=>G(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(e&&f(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await g(t.workspaceRoot,t.id,e);const o=await w(t.workspaceRoot),s=R(t.id),r=p(o,`${s}.log`),{pid:i}=await Jt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),l={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await jt(t.workspaceRoot,l),t.skipReadiness!==!0)try{await Pt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(h){throw await Z(i,t.config.killGracePeriodMs??Y).catch(()=>{}),await g(t.workspaceRoot,t.id,l).catch(()=>{}),h}return{entry:l}}),"startService"),re=E(async t=>G(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!f(e.pid))return await g(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??Y;return await Z(e.pid,o),await g(t.workspaceRoot,t.id,e),{stopped:!0}}),"stopService"),Z=E(async(t,e)=>{L(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!f(t))return;await new Promise(s=>{setTimeout(s,100)})}f(t)&&L(t,"SIGKILL")},"stopServiceByPid"),L=E((t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}},"sendSignalToServiceGroup");export{oe as H,$t as S,b as a,re as b,te as c,Ot as d,Pt as e,g as f,f as i,Ut as p,ee as r,se as s};
@@ -0,0 +1 @@
1
+ var T=Object.defineProperty;var j=(n,e)=>T(n,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{v as R,w as C}from"../packem_chunks/bin.js";const B=A(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=j(n=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[e,t]=h.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return h.getBuiltinModule(n)}return B(n)},"__cjs_getBuiltinModule"),{createRequire:N}=q("node:module");var U=Object.defineProperty,z=j((n,e)=>U(n,"name",{value:e,configurable:!0}),"L"),I=Object.defineProperty,F=z((n,e)=>I(n,"name",{value:e,configurable:!0}),"F");const J=N(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=F(n=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,t]=y.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return y.getBuiltinModule(n)}return J(n)},"__cjs_getBuiltinModule"),{readFileSync:Y}=S("node:fs"),{readFile:Z}=S("node:fs/promises");var K=Object.defineProperty,l=F((n,e)=>K(n,"name",{value:e,configurable:!0}),"g");const G={sha256:"sha256",sha384:"sha384",sha512:"sha512"},H=1024,Q=/^[A-Z0-9+/]+={0,2}$/i,V=/.*node_modules\/((?:@[^/]+\/)?[^/]+)$/,k=/^['"]/,v=/['"]$/,X=/^[a-z][a-zA-Z0-9]*:\s*$/m,ee=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,ne=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^"'\n]+["']?:?[\t\v\f\r \u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n((?:[\t ][^\n]*\n?)+)/gm,te=/^\s+version:?\s+"?([^"\n]+)"?/m,se=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,x=l(n=>{if(n.length>H)return;const e=n.indexOf("-");if(e<=0)return;const t=G[n.slice(0,e).toLowerCase()];if(!t)return;const s=n.slice(e+1);if(Q.test(s))try{const i=Buffer.from(s,"base64");return i.length===0?void 0:{algorithm:t,hex:i.toString("hex")}}catch{return}},"decodeSriIntegrity"),w=l((n,e,t)=>{const s=`${t.name}@${t.version}`;e.has(s)||(e.add(s),n.push(t))},"pushUniqueEntry"),m=l((n,e,t)=>{t&&Object.keys(t).length>0&&(n[e]={...t})},"copyDepMap"),g=l(n=>{if(!n)return;const e={};for(const[t,s]of Object.entries(n))e[t]=[s];return Object.keys(e).length>0?e:void 0},"liftDepMap"),re=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n)}catch{return e}if(!s.packages)return e;for(const[i,r]of Object.entries(s.packages)){if(!i||!r.version)continue;const p=V.exec(i);if(!p?.[1])continue;const c=r.name??p[1];if(c.startsWith("."))continue;const o={name:c,version:r.version};if(r.integrity){const a=x(r.integrity);a&&(o.integrity=a)}m(o,"dependencies",g(r.dependencies)),m(o,"peerDependencies",g(r.peerDependencies)),m(o,"optionalDependencies",g(r.optionalDependencies)),w(e,t,o)}return e},"parseNpmLockFile"),_=l(n=>{let e=n.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(k,"").replace(v,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const s=e.lastIndexOf("@");if(s<=0)return;const i=e.slice(0,s),r=e.slice(s+1);if(!(!i||!r||r.startsWith("link:")||r.startsWith("workspace:")||r.startsWith("file:")))return{name:i,version:r}},"splitPnpmPackageKey"),W=l((n,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(n);if(!t)return;const s=t.index+t[0].length,i=X.exec(n.slice(s));return n.slice(s,i?s+i.index:n.length)},"sliceTopLevelSection"),oe=l(n=>{const e=new Map,t=W(n,"snapshots");if(!t)return e;const s=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let i;for(;(i=s.exec(t)??void 0)!==void 0;){const r=_(i[1]);if(!r)continue;const p=`${r.name}@${r.version}`,c=i[2],o=e.get(p)??{};for(const a of["dependencies","peerDependencies","optionalDependencies"]){const u=b(c,a);if(!u)continue;const d=o[a]??{};for(const[f,P]of Object.entries(u)){const D=d[f]??[];for(const $ of P)D.includes($)||D.push($);d[f]=D}o[a]=d}e.set(p,o)}return e},"parsePnpmSnapshotEdges"),ie=l(n=>{const e=[],t=new Set,s=W(n,"packages");if(!s)return e;const i=oe(n),r=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let p;for(;(p=r.exec(s)??void 0)!==void 0;){const c=_(p[1]);if(!c)continue;const o=p[2],a=ee.exec(o),u={name:c.name,version:c.version};if(a?.[1]){const f=x(a[1]);f&&(u.integrity=f)}const d=i.get(`${c.name}@${c.version}`);m(u,"dependencies",d?.dependencies??b(o,"dependencies")),m(u,"peerDependencies",d?.peerDependencies??b(o,"peerDependencies")),m(u,"optionalDependencies",d?.optionalDependencies??b(o,"optionalDependencies")),w(e,t,u)}return e},"parsePnpmLockFile"),b=l((n,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,"");let c=r[2].trim();c=c.replace(k,"").replace(v,"");const o=c.indexOf("(");if(o>0&&(c=c.slice(0,o).trim()),!p||!c)continue;const a=s[p]??[];a.includes(c)||a.push(c),s[p]=a}return Object.keys(s).length>0?s:void 0},"extractPnpmDependencyMap"),ce=l(n=>{const e=[],t=new Set,s=ne;s.lastIndex=0;let i;for(;(i=s.exec(n)??void 0)!==void 0;){const r=i[1].replace(k,"").replace(v,"");if(!r)continue;const p=i[2],c=te.exec(p);if(!c?.[1])continue;const o={name:r,version:c[1].trim()},a=se.exec(p);if(a?.[1]){const u=x(a[1]);u&&(o.integrity=u)}m(o,"dependencies",O(p,"dependencies")),m(o,"peerDependencies",O(p,"peerDependencies")),m(o,"optionalDependencies",O(p,"optionalDependencies")),w(e,t,o)}return e},"parseYarnLockFile"),O=l((n,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,""),c=r[2];if(p&&c){const o=s[p]??[];o.includes(c)||o.push(c),s[p]=o}}return Object.keys(s).length>0?s:void 0},"extractYarnDependencyMap"),pe=/,(?=\s*[}\]])/g,ae=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n.replaceAll(pe,""))}catch{return e}if(!s.packages)return e;for(const i of Object.values(s.packages)){const r=i[0];if(typeof r!="string")continue;const p=r.indexOf("@",1);if(p<=0)continue;const c=r.slice(0,p),o=r.slice(p+1);if(!c||!o||o.startsWith("workspace:")||o.startsWith("link:")||o.startsWith("file:"))continue;const a={name:c,version:o},u=i[3];if(typeof u=="string"&&u.length>0){const f=x(u);f&&(a.integrity=f)}const d=i[2];if(d&&typeof d=="object"&&!Array.isArray(d)){const f=d;m(a,"dependencies",g(f.dependencies)),m(a,"peerDependencies",g(f.peerDependencies)),m(a,"optionalDependencies",g(f.optionalDependencies))}w(e,t,a)}return e},"parseBunLockFile"),E=l(n=>{if(n.endsWith("pnpm-lock.yaml"))return"pnpm";if(n.endsWith("package-lock.json"))return"npm";if(n.endsWith("yarn.lock"))return"yarn";if(n.endsWith("bun.lock"))return"bun"},"inferLockFileType"),L=l((n,e)=>{switch(e){case"bun":return ae(n);case"npm":return re(n);case"pnpm":return ie(n);case"yarn":return ce(n);default:return[]}},"parseLockFileContent"),M=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"];l(async n=>{const e=await R(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=E(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);const s=await Z(e,"utf8");return{entries:L(s,t),path:e,type:t}},"parseLockFile");l(n=>{const e=C(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=E(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);return{entries:L(Y(e,"utf8"),t),path:e,type:t}},"parseLockFileSync");export{L as F};
@@ -0,0 +1 @@
1
+ var j=Object.defineProperty;var g=(s,e)=>j(s,"name",{value:e,configurable:!0});import{createRequire as S}from"node:module";import{M as d,i as y,n as q}from"../packem_chunks/config.js";const $=S(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=g(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,n]=f.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return f.getBuiltinModule(s)}return $(s)},"__cjs_getBuiltinModule"),{readdirSync:b,lstatSync:P}=A("node:fs");var w=Object.defineProperty,v=g((s,e)=>w(s,"name",{value:e,configurable:!0}),"u");const D=/^([^<(]+?)?(?:<([^>]+)>)?\s*(?:\(([^)]+)\))?\s*$/u,N=v(s=>{const e=s.match(D);if(!e)return;const n=e[1]?.trim(),t=e[2]?.trim(),r=e[3]?.trim();if(!(!n&&!t&&!r))return{email:t||void 0,name:n||void 0,url:r||void 0}},"parsePersonString"),R=v(s=>{if(!Array.isArray(s)||s.length===0)return;const e=[];for(const n of s)if(typeof n=="string"){const t=N(n);t&&e.push(t)}else if(n&&typeof n=="object"){const t=n,r=typeof t.name=="string"?t.name:void 0,o=typeof t.email=="string"?t.email:void 0,u=typeof t.url=="string"?t.url:void 0;(r||o||u)&&e.push({email:o,name:r,url:u})}return e.length>0?e:void 0},"normalizeMaintainers"),B=v(s=>{const e=d(s,"node_modules");if(!y(e))return new Map;const n=new Map,t=new Set,r=v((o,u="")=>{if(t.has(o))return;t.add(o);let h;try{h=b(o)}catch{return}for(const a of h){const c=d(o,a);let m;try{m=P(c)}catch{continue}if(m.isSymbolicLink())continue;if(a.startsWith("@")){m.isDirectory()&&r(c,`${a}/`);continue}if(a===".pnpm"&&u===""){let i;try{i=b(c)}catch{continue}for(const p of i){const l=d(c,p,"node_modules");y(l)&&r(l)}continue}if(a.startsWith(".")||!m.isDirectory())continue;const _=u+a,M=d(c,"package.json");try{if(!y(M))continue;const i=q(M);if(typeof i.version!="string")continue;const p=`${_}@${i.version}`;n.has(p)||n.set(p,{directory:c,license:i.license,licenses:Array.isArray(i.licenses)?i.licenses:void 0,maintainers:R(i.maintainers),name:_,scripts:i.scripts&&typeof i.scripts=="object"?i.scripts:void 0,version:i.version});const l=d(c,"node_modules");y(l)&&r(l)}catch{}}},"scanDir");return r(e),n},"readNodeModulesManifests");export{R as n,B as r};
@@ -0,0 +1,34 @@
1
+ var E=Object.defineProperty;var R=(u,p)=>E(u,"name",{value:p,configurable:!0});import{M as d,i as o,$,B as h}from"../packem_chunks/config.js";import{K as x}from"../packem_chunks/bin.js";var S=Object.defineProperty,b=R((u,p)=>S(u,"name",{value:p,configurable:!0}),"k");const P=b((u,p,A,m=[])=>{const i=[];if(A===void 0)return i.push("minimumReleaseAge not set in vis.config; skipping native sync."),i;const r=Number.isFinite(A)?Math.max(0,Math.round(A)):0;switch(u){case"bun":{const n=d(p,"bunfig.toml");let e=o(n)?$(n):"";const a=r*60,t=`minimumReleaseAge = ${String(a)}`,s=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,g=/^\[install\][ \t]*\n/m.exec(e);if(g?.index===void 0){const c=s?`${t}
2
+ ${s}`:t;e=`${e.trimEnd()?`${e.trimEnd()}
3
+
4
+ `:""}[install]
5
+ ${c}
6
+ `}else{const c=g.index+g[0].length,f=e.slice(c),y=/^\[/m.exec(f),k=y?.index===void 0?e.length:c+y.index;let l=e.slice(c,k);l=/^[ \t]*minimumReleaseAge[ \t]*=/m.test(l)?l.replace(/^[ \t]*minimumReleaseAge[ \t]*=.*$/m,t):`${t}
7
+ ${l}`,s&&(l=/^[ \t]*minimumReleaseAgeExcludes[ \t]*=/m.test(l)?l.replace(/^[ \t]*minimumReleaseAgeExcludes[ \t]*=.*$/m,s):`${s}
8
+ ${l}`),e=`${e.slice(0,c)}${l}${e.slice(k)}`}h(n,e.endsWith(`
9
+ `)?e:`${e}
10
+ `),i.push(`Updated bunfig.toml [install] minimumReleaseAge = ${String(a)} (${String(r)} minutes)`),s&&i.push(`Updated bunfig.toml [install] minimumReleaseAgeExcludes (${String(m.length)} entries)`);break}case"npm":{const n=d(p,".npmrc");let e=o(n)?$(n):"";const a=r===0?0:Math.max(1,Math.ceil(r/1440)),t=`min-release-age=${String(a)}`;e=/^\s*min-release-age\s*=/m.test(e)?e.replace(/^\s*min-release-age\s*=.*$/m,t):`${e.trimEnd()}
11
+ ${t}
12
+ `,h(n,e.endsWith(`
13
+ `)?e:`${e}
14
+ `),i.push(`Updated .npmrc min-release-age=${String(a)} (rounded up from ${String(r)} minutes; npm's unit is days)`),m.length>0&&i.push("npm has no native per-package exclude list; skipped excludes sync.");break}case"pnpm":{const n=d(p,"pnpm-workspace.yaml");if(!o(n)){i.push("pnpm-workspace.yaml not found. Cannot sync minimumReleaseAge.");break}let e=$(n);e.endsWith(`
15
+ `)||(e+=`
16
+ `);const a=`minimumReleaseAge: ${String(r)}
17
+ `;if(e=/^minimumReleaseAge[ \t]*:.*$/m.test(e)?e.replace(/^minimumReleaseAge[ \t]*:.*$/m,a.trimEnd()):`${e.trimEnd()}
18
+
19
+ ${a}`,m.length>0){const t=`minimumReleaseAgeExclude:
20
+ ${m.map(g=>` - ${x(g)}`).join(`
21
+ `)}
22
+ `,s=/^minimumReleaseAgeExclude:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;e=s.test(e)?e.replace(s,t):`${e.trimEnd()}
23
+
24
+ ${t}`}h(n,e),i.push(`Updated pnpm-workspace.yaml minimumReleaseAge: ${String(r)} minutes`),m.length>0&&i.push(`Updated pnpm-workspace.yaml minimumReleaseAgeExclude (${String(m.length)} entries)`);break}case"yarn":{const n=d(p,".yarnrc.yml");if(!o(n)){i.push("yarn classic lacks npmMinimalAgeGate; .yarnrc.yml not found, skipping.");break}let e=$(n);const a=`npmMinimalAgeGate: ${String(r)}`;if(e.endsWith(`
25
+ `)||(e+=`
26
+ `),e=/^npmMinimalAgeGate[ \t]*:.*$/m.test(e)?e.replace(/^npmMinimalAgeGate[ \t]*:.*$/m,a):`${e.trimEnd()}
27
+
28
+ ${a}
29
+ `,m.length>0){const t=`npmPreapprovedPackages:
30
+ ${m.map(g=>` - ${x(g)}`).join(`
31
+ `)}
32
+ `,s=/^npmPreapprovedPackages:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;e=s.test(e)?e.replace(s,t):`${e.trimEnd()}
33
+
34
+ ${t}`}h(n,e),i.push(`Updated .yarnrc.yml npmMinimalAgeGate: ${String(r)} (minutes; bare integer dodges yarn duration-string bug)`),m.length>0&&i.push(`Updated .yarnrc.yml npmPreapprovedPackages (${String(m.length)} entries)`);break}}return i},"syncMinimumReleaseAgeToNativeConfig");export{P as E};
@@ -0,0 +1,21 @@
1
+ var v=Object.defineProperty;var E=(o,l)=>v(o,"name",{value:l,configurable:!0});import{M as c,$ as S,B as i,i as g,n as O}from"../packem_chunks/config.js";import{t as N,u as U}from"../packem_chunks/bin.js";var x=Object.defineProperty,D=E((o,l)=>x(o,"name",{value:l,configurable:!0}),"f");const P=D((o,l,d)=>{const s=[],b=Object.entries(d).filter(([,n])=>n).map(([n])=>n);switch(o){case"bun":{const n=c(l,"package.json");if(g(n))try{const e=O(n);e.trustedDependencies=b,i(n,`${JSON.stringify(e,null,2)}
2
+ `),s.push(`Updated package.json trustedDependencies with ${b.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(l,".npmrc");let e=g(n)?S(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
3
+ ignore-scripts=true
4
+ `,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(l,"pnpm-workspace.yaml");if(!g(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},u=[];try{const t=U(n);e=t?.allowBuilds??{},u=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const h={...e,...d},A=Object.keys(d).filter(t=>e[t]!==d[t]).length,m=b.toSorted((t,p)=>t.localeCompare(p)),k=[...new Set([...u,...m])].toSorted((t,p)=>t.localeCompare(p)),w=m.filter(t=>!u.includes(t)).length;if(A===0&&w===0)s.push(`All ${String(Object.keys(d).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(h).sort(),p=D(a=>a.startsWith("@")||a.includes("/")||/[:#\s]/.test(a),"needsQuote"),$=D(a=>p(a)?`'${a.replaceAll("'","''")}'`:a,"renderKey"),y=`allowBuilds:
5
+ ${t.map(a=>` ${$(a)}: ${String(h[a])}`).join(`
6
+ `)}
7
+ `;let r=S(n);r.endsWith(`
8
+ `)||(r+=`
9
+ `);const f=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;if(r=f.test(r)?r.replace(f,y):`${r.trimEnd()}
10
+
11
+ ${y}`,k.length>0){const a=`onlyBuiltDependencies:
12
+ ${k.map(j=>` - ${p(j)?`'${j.replaceAll("'","''")}'`:j}`).join(`
13
+ `)}
14
+ `,C=/^onlyBuiltDependencies:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;r=C.test(r)?r.replace(C,a):`${r.trimEnd()}
15
+
16
+ ${a}`}i(n,r),s.push(`Updated pnpm-workspace.yaml allowBuilds (${String(A)} new, ${String(t.length)} total)`),w>0&&s.push(`Updated pnpm-workspace.yaml onlyBuiltDependencies (${String(w)} new, ${String(k.length)} total)`)}const B=c(l,"package.json");if(g(B)&&m.length>0)try{const t=O(B),p=Array.isArray(t.pnpm?.onlyBuiltDependencies)?t.pnpm.onlyBuiltDependencies:[],$=[...new Set([...p,...m])].toSorted((r,f)=>r.localeCompare(f)),y=m.filter(r=>!p.includes(r)).length;y>0&&(t.pnpm={...t.pnpm,onlyBuiltDependencies:$},i(B,`${JSON.stringify(t,null,2)}
17
+ `),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(y)} new, ${String($.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(N(l)){const n=c(l,".yarnrc.yml");let e=S(n);const u=/^\s*enableScripts\s*:/m.test(e),h=/^\s*enableScripts\s*:\s*false\s*$/m.test(e);u?h?s.push(".yarnrc.yml already has enableScripts: false"):(e=e.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),i(n,e),s.push("Changed enableScripts to false in .yarnrc.yml")):(e=`${e.trimEnd()}
18
+ enableScripts: false
19
+ `,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(l,".npmrc");let e=g(n)?S(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
20
+ ignore-scripts=true
21
+ `,i(n,e),s.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return s},"syncAllowBuildsToNativeConfig");export{P as N};
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var c=(a,n)=>l(a,"name",{value:n,configurable:!0});import{definePlugin as f}from"./definePlugin-CWm4Dv_t.js";var o;(function(a){a[a.UNSET=0]="UNSET",a[a.OK=1]="OK",a[a.ERROR=2]="ERROR"})(o||(o={}));var k=Object.defineProperty,u=c((a,n)=>k(a,"name",{value:n,configurable:!0}),"i");const p=u(a=>{const{renameSpan:n,tracer:d}=a;let r;const i=new Map;return f({hooks:{"run:after":u(e=>{if(!r)return;const t=[...e.values()].filter(s=>s.status==="failure").length;r.setAttribute("vis.run.tasks_total",e.size),r.setAttribute("vis.run.tasks_failed",t),t>0?r.setStatus({code:o.ERROR,message:`${String(t)} task(s) failed`}):r.setStatus({code:o.OK}),r.end(),r=void 0;for(const s of i.values())s.end();i.clear()},"run:after"),"run:before":u(e=>{r&&(r.setStatus({code:o.ERROR,message:"run:before fired while previous run was still active"}),r.end());for(const t of i.values())t.end();i.clear(),r=d.startSpan("vis.run",{attributes:{"vis.run.task_count":e.tasks.length,"vis.workspace_root":e.workspaceRoot}})},"run:before"),"task:after":u((e,t)=>{const s=i.get(e.id);s&&(s.setAttribute("vis.task.exit_code",t.code??0),s.setAttribute("vis.task.cache_status",t.status),s.end(),i.delete(e.id))},"task:after"),"task:before":u(e=>{const t=i.get(e.id);t&&(t.setStatus({code:o.ERROR,message:"retried — superseded by new attempt"}),t.end());const s=d.startSpan(n?n(e):e.id,{attributes:{"vis.task.id":e.id,"vis.task.project":e.target.project,"vis.task.target":e.target.target}});i.set(e.id,s)},"task:before"),"task:failure":u((e,t)=>{const s=i.get(e.id);s&&s.setStatus({code:o.ERROR,message:`Task failed with exit code ${String(t.code??-1)}`})},"task:failure")},name:"otel"})},"otelPlugin");export{p as otelPlugin};
@@ -0,0 +1 @@
1
+ var v=Object.defineProperty;var a=(e,r)=>v(e,"name",{value:r,configurable:!0});import{createRequire as _}from"node:module";import{M as h,i as m,n as j,b as R}from"../packem_chunks/config.js";import{n as K}from"../packem_chunks/bin.js";const k=_(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=a(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[r,t]=n.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return n.getBuiltinModule(e)}return k(e)},"__cjs_getBuiltinModule"),{rmSync:d,writeFileSync:C}=b("node:fs");var M=Object.defineProperty,o=a((e,r)=>M(e,"name",{value:r,configurable:!0}),"r");const w=1440*60*1e3,A=15e3,S="https://registry.npmjs.org/-/npm/v1/keys",p=o(()=>h(K(),"registry-keys"),"getRegistryKeysCacheDir"),c=o(()=>h(p(),"npmjs.json"),"cacheFilePath"),T=o(()=>{const e=c();if(m(e))try{const r=j(e),t=Date.now()-r.createdAt>r.ttlMs;return{entry:r,expired:t}}catch{d(e,{force:!0});return}},"readCachedKeys"),D=o((e,r)=>{R(p());const t={createdAt:Date.now(),keys:e,ttlMs:r};C(c(),JSON.stringify(t),"utf8")},"writeCachedKeys"),x=o(async(e={})=>{const r=e.ttlMs??w,t=e.keysUrl??process.env.VIS_NPM_KEYS_URL??S,s=T();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const i=new AbortController,g=setTimeout(()=>{i.abort()},A),y=o(()=>{i.abort()},"abortListener");e.signal?.addEventListener("abort",y,{once:!0});try{const u=await fetch(t,{headers:{Accept:"application/json"},signal:i.signal});if(!u.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const f=await u.json(),l=Array.isArray(f.keys)?f.keys:[];return D(l,r),{fromCache:!1,keys:l}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(g),e.signal?.removeEventListener("abort",y)}},"fetchRegistryKeys"),N=o(()=>{const e=c();return m(e)?(d(e,{force:!0}),!0):!1},"clearRegistryKeysCache");export{N as c,x as f};
@@ -0,0 +1,5 @@
1
+ var f=Object.defineProperty;var w=(e,a)=>f(e,"name",{value:a,configurable:!0});import{createRequire as k}from"node:module";import{s as N,p as h,ax as M}from"../packem_chunks/bin.js";import{k as R,m as D,g as S,M as E,D as P,a as A,b as C,c as _,d as x,e as L,f as j,h as F,i as V}from"./signatures-5ZdjJ2Pu.js";import{d as B}from"./utils-DrNg0XTR.js";const b=k(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=w(e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[a,n]=g.versions.node.split(".").map(Number);if(a>22||a===22&&n>=3||a===20&&n>=16)return g.getBuiltinModule(e)}return b(e)},"__cjs_getBuiltinModule"),{createInterface:T}=$("node:readline");var I=Object.defineProperty,p=w((e,a)=>I(e,"name",{value:a,configurable:!0}),"s");const O=15,W=p(e=>{if(e===void 0)return!1;const a=e.trim().toLowerCase();return a!==""&&a!=="0"&&a!=="false"&&a!=="no"},"isTruthyEnv"),U=p(e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},"shouldAnimateCountdown"),Y=p(async e=>{const a=T({input:process.stdin,output:process.stdout});try{return await new Promise(n=>{a.question(e,r=>{n(r.trim().toLowerCase())})})}finally{a.close()}},"defaultReadline"),v=p(async(e,a)=>{const n=await a(e);return n==="y"||n==="yes"},"promptYesNo"),q=p(async(e,a,n,r)=>new Promise(c=>{if(r?.aborted){c(!1);return}const o=U(n)&&a.isTTY!==!1;let s=e;const i=p(()=>{o?a.write(`\rContinuing in ${String(s)}s... press Ctrl-C to abort. `):s===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
2
+ `)},"render");i();const u=setInterval(()=>{if(s-=1,s<=0){clearInterval(u),r?.removeEventListener("abort",l),o&&a.write(`\rContinuing now.
3
+ `),c(!0);return}i()},1e3),l=p(()=>{clearInterval(u),o&&a.write(`\rAborted.
4
+ `),c(!1)},"onAbort");r?.addEventListener("abort",l,{once:!0})}),"runCountdown"),H=p(async(e,a={})=>{if(e.length===0)return{proceed:!0};const n=a.env??process.env,r=a.isTty??!!process.stdin.isTTY,c=a.isCi??N,o=a.strict??!1,s=a.readline??Y,i=a.output??{isTTY:!!process.stdout.isTTY,write:p(m=>process.stdout.write(m),"write")},u=W(n.VIS_DISABLE_AUTO_CONTINUE),l=Number.parseInt(n.VIS_AUTO_CONTINUE_SECONDS??"",10),t=a.countdownSeconds??(Number.isFinite(l)&&l>0?l:O);return e.some(m=>m.severity==="error")?o?{proceed:!1,reason:"errors-present"}:c?{proceed:!1,reason:"errors-present"}:r?await v("Proceed despite errors? [y/N] ",s)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!1,reason:"non-tty"}:o?{proceed:!1,reason:"ci-strict"}:r?u?await v("Proceed despite warnings? [y/N] ",s)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:await q(t,i,n,a.signal)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!0}},"presentMarshallDecision"),me=p(async(e,a={})=>{if(e.isEmpty())return!0;const n=e.all(),r=a.output??{isTTY:!!process.stdout.isTTY,write:p(c=>process.stdout.write(c),"write")};for(const c of R(n))r.write(`${c}
5
+ `);return(await H(n,{countdownSeconds:a.countdownSeconds,isCi:a.isCi,isTty:a.isTty,output:r,readline:a.readline,signal:a.signal,strict:a.strict})).proceed},"presentMarshallFindings");var G=Object.defineProperty,d=w((e,a)=>G(e,"name",{value:a,configurable:!0}),"o");const z=d(e=>({marshall:"author",message:e.message,packageName:e.packageName,severity:e.severity}),"formatAuthorFinding"),J=d(e=>({marshall:"provenance",message:`Prior version ${e.priorVersionWithProvenance} had provenance but ${e.version} does not.`,packageName:e.packageName,severity:"error",suggestedAction:`Investigate why ${e.version} dropped sigstore attestations.`}),"formatProvenanceFinding"),K=d(e=>{const a=e.newBins.map(n=>n.command).join(", ");return{marshall:"newBin",message:`${e.toVersion} adds new bin script${e.newBins.length===1?"":"s"}: ${a} (prior: ${e.fromVersion}).`,packageName:e.packageName,severity:"warning"}},"formatNewBinFinding"),Q=d(e=>({marshall:"metadata",message:`Missing/invalid metadata: ${e.issues.join(", ")}.`,packageName:e.packageName,severity:"warning"}),"formatMetadataFinding"),X=d(e=>e.kind==="no-data"?{marshall:"downloads",message:"npm stats API returned no monthly download data.",packageName:e.packageName,severity:e.severity}:{marshall:"downloads",message:`Only ${String(e.downloadsLastMonth??0)} downloads in the past month.`,packageName:e.packageName,severity:e.severity},"formatDownloadsFinding"),Z=d(e=>({marshall:"expiredDomains",message:e.kind==="expired"?`Maintainer email domain ${e.domain} (${e.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${e.domain} (${e.maintainer}).`,packageName:e.packageName,severity:e.severity}),"formatExpiredDomainsFinding"),ee=d(e=>({marshall:"signatures",message:e.message,packageName:e.packageName,severity:e.severity}),"formatSignatureFinding"),ae=d(e=>({marshall:"archivedRepo",message:e.kind==="archived"?`Source repo ${e.owner}/${e.repo} is archived${e.archivedAt===void 0?"":` (since ${e.archivedAt})`}.`:`Source repo ${e.owner}/${e.repo} returned 404 from GitHub.`,packageName:e.packageName,severity:"warning"}),"formatArchivedRepoFinding"),re=["author","provenance","newBin","metadata","expiredDomains","signatures","archivedRepo"],se=d(e=>re.some(a=>a==="signatures"?e.signatures?.enabled===!0:e[a]?.enabled!==!1),"anyPackumentReaderEnabled"),ne=d(async(e,a,n,r)=>{const c=[...new Set(e.map(o=>o.name))];await D(c,a,async o=>{try{await S(o,{signal:r,workspaceRoot:n})}catch{}})},"prefetchPackuments"),we=d(async(e,a={})=>{const n=new E;if(e.length===0)return n;const r=a.config??{},c=e.map(t=>t.name),o=a.signal,s=a.concurrency??P;se(r)&&await ne(e,s,a.workspaceRoot,o);const i=[],u=[],l=d(t=>{const m=i.length;i.push([]),u.push((async()=>{i[m]=await t()})())},"schedule");r.author?.enabled!==!1&&l(async()=>(await A(e,{allowlist:r.author?.allowlist,concurrency:s,signal:o,thresholds:{dormantErrorDays:r.author?.dormantErrorDays,dormantWarnDays:r.author?.dormantWarnDays,newPublisherWindowDays:r.author?.newPublisherWindowDays,recentVersionErrorDays:r.author?.recentVersionErrorDays,recentVersionWarnDays:r.author?.recentVersionWarnDays},workspaceRoot:a.workspaceRoot})).map(t=>z(t))),r.provenance?.enabled!==!1&&l(async()=>(await C(e,{allowlist:r.provenance?.allowlist,concurrency:s,workspaceRoot:a.workspaceRoot})).map(t=>J(t))),r.newBin?.enabled!==!1&&l(async()=>(await _(e,{allowlist:r.newBin?.allowlist,concurrency:s,workspaceRoot:a.workspaceRoot})).map(t=>K(t))),r.metadata?.enabled!==!1&&l(async()=>(await x(e,{allowlist:r.metadata?.allowlist,checks:r.metadata?.checks,concurrency:s,workspaceRoot:a.workspaceRoot})).map(t=>Q(t))),r.downloads?.enabled!==!1&&l(async()=>(await L(c,{allowlist:r.downloads?.allowlist,concurrency:s,errorThreshold:r.downloads?.errorThreshold,signal:o,warnThreshold:r.downloads?.warnThreshold})).map(t=>X(t))),r.expiredDomains?.enabled!==!1&&l(async()=>(await j(e,{allowDomains:r.expiredDomains?.allowDomains,allowlist:r.expiredDomains?.allowlist,concurrency:s,dnsServers:r.expiredDomains?.dnsServers,perDomainTimeoutMs:r.expiredDomains?.timeoutMs,signal:o,workspaceRoot:a.workspaceRoot})).map(t=>Z(t))),r.signatures?.enabled===!0&&l(async()=>(await F(e,{allowlist:r.signatures?.allowlist,concurrency:s,keysUrl:r.signatures?.keysUrl,signal:o,treatExpiredAs:r.signatures?.treatExpiredAs,workspaceRoot:a.workspaceRoot})).map(t=>ee(t))),r.archivedRepo?.enabled!==!1&&l(async()=>(await V(e,{allowlist:r.archivedRepo?.allowlist,concurrency:s,githubToken:r.archivedRepo?.githubToken,signal:o,workspaceRoot:a.workspaceRoot})).map(t=>ae(t))),await Promise.all(u);for(const t of i)n.addMany(t);return n},"runMarshallPipeline");var oe=Object.defineProperty,y=w((e,a)=>oe(e,"name",{value:a,configurable:!0}),"l");const te=1e4,ie=y(async(e,a=te)=>{const n=new Map;if(e.length===0)return n;const r=new AbortController,c=setTimeout(()=>{r.abort()},a);try{await Promise.all(e.map(async o=>{try{const s=await fetch(`https://registry.npmjs.org/${o}/latest`,{headers:{Accept:"application/json"},signal:r.signal});if(s.ok){const i=await s.json();i.version?n.set(o,i.version):h.debug(`resolveLatestVersions: ${o} returned 200 but no version field; dropping.`)}else h.debug(`resolveLatestVersions: ${o} returned ${String(s.status)}; dropping.`)}catch(s){h.debug(`resolveLatestVersions: ${o} fetch failed (${s instanceof Error?s.message:String(s)}); dropping.`)}}))}finally{clearTimeout(c)}return n},"resolveLatestVersions"),ge=y(async e=>{const a=e.map(s=>B(s)),n=new Map;for(const s of a)if(s.versionSpec){const i=M.coerce(s.versionSpec);i&&n.set(s.name,i.version)}const r=a.filter(s=>!n.has(s.name)).map(s=>s.name),c=await ie(r),o=[];for(const s of a){const i=n.get(s.name)??c.get(s.name);i?o.push({name:s.name,version:i}):h.debug(`resolveExplicitPackages: dropping ${s.name}${s.versionSpec?`@${s.versionSpec}`:""} — neither semver-coerce nor /latest resolved a version.`)}return o},"resolveExplicitPackages");export{ie as a,we as b,me as p,ge as r};
@@ -0,0 +1 @@
1
+ var j=Object.defineProperty;var u=(e,s)=>j(e,"name",{value:s,configurable:!0});import{createRequire as M}from"node:module";import{M as f}from"../packem_chunks/config.js";import{o as p}from"../packem_chunks/bin.js";const _=M(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=u(e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[s,t]=m.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return m.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{readdir:l,stat:h,readFile:y}=g("node:fs/promises");var v=Object.defineProperty,c=u((e,s)=>v(e,"name",{value:s,configurable:!0}),"m");const w=c((e,s)=>e.tasks.find(t=>t.taskId===s),"findTaskInSummary"),d=c((e,s)=>{const t=e??{},n=s??{},i=[],r=[],o=[];for(const a of Object.keys(t))a in n?t[a]!==n[a]&&o.push(a):i.push(a);for(const a of Object.keys(n))a in t||r.push(a);return i.sort(),r.sort(),o.sort(),{added:i,changed:o,removed:r}},"diffHashBuckets"),B=c((e,s)=>({commandChanged:(e?.command??"")!==(s?.command??""),implicitDeps:d(e?.implicitDeps,s?.implicitDeps),nodes:d(e?.nodes,s?.nodes),runtime:d(e?.runtime,s?.runtime)}),"diffHashDetails"),D=c(async(e,s)=>{const t=f(p(e),`${s}.json`);try{const n=await y(t,"utf8");return JSON.parse(n)}catch{return}},"readRunSummaryById"),I=c(async(e,s)=>{const t=p(e);let n;try{n=await l(t)}catch{return}const i=[];for(const r of n){if(!r.endsWith(".json")||s!==void 0&&r===`${s}.json`)continue;const o=f(t,r);try{const a=await h(o);a.isFile()&&i.push({mtimeMs:a.mtimeMs,path:o})}catch{}}if(i.length!==0){i.sort((r,o)=>o.mtimeMs-r.mtimeMs);try{const r=await y(i[0].path,"utf8");return JSON.parse(r)}catch{return}}},"readPreviousRunSummary"),O=c(async e=>{const s=p(e);let t;try{t=await l(s)}catch{return[]}const n=[];for(const i of t){if(!i.endsWith(".json"))continue;const r=f(s,i);try{const o=await h(r);o.isFile()&&n.push({id:i.slice(0,-5),mtimeMs:o.mtimeMs,path:r})}catch{}}return n.sort((i,r)=>r.mtimeMs-i.mtimeMs),n},"listRunSummaries");export{I as a,B as d,w as f,O as l,D as r};
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty;var f=(t,s)=>d(t,"name",{value:s,configurable:!0});import{M as m,i as h,$ as k,n as v}from"../packem_chunks/config.js";var $=Object.defineProperty,g=f((t,s)=>$(t,"name",{value:s,configurable:!0}),"p");const M=g(t=>{for(const s of[".nvmrc",".node-version"]){const i=m(t,s);if(h(i))try{return k(i).trim().replace(/^v/,"")}catch{}}},"readNodeVersionFile"),l=g((t,s)=>{const i=t.split(/[.\-+]/).map(r=>Number.parseInt(r,10)||0),c=s.split(/[.\-+]/).map(r=>Number.parseInt(r,10)||0),e=Math.max(i.length,c.length);for(let r=0;r<e;r++){const n=i[r]??0,a=c[r]??0;if(n!==a)return n-a}return 0},"compareVersions"),b=g((t,s)=>{const i=s.trim();if(i===""||i==="*")return!0;const c=i.split(/\s+/).filter(Boolean);for(const e of c)if(e.startsWith(">=")){if(l(t,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(t,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(t,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(t,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const r=t.split("."),n=e.split(".");for(const[a,o]of n.entries())if(o!==r[a])return!1}return!0},"satisfiesRange"),x=g(t=>{const s=[],i=m(t,"package.json");let c;try{c=v(i)}catch{return s}const e=process.versions.node;if(c.engines?.node){const n=c.engines.node;b(e,n)||s.push({actual:e,expected:n,kind:"node",message:`package.json engines.node requires ${n}, but the current Node.js is ${e}.`,severity:"error"})}const r=M(t);if(r){const[n,a]=r.split("."),[o,p]=e.split(".");(n!==o||a!==void 0&&a!==p)&&s.push({actual:e,expected:r,kind:"node",message:`.nvmrc pins Node ${r} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(c.packageManager){const[n,a]=c.packageManager.split("@"),o=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=o.split("/");p&&n&&p!==n?s.push({actual:p,expected:n,kind:"packageManager",message:`package.json packageManager pins ${c.packageManager} but the current invocation is ${o}. Install the correct package manager.`,severity:"error"}):u&&a&&u!==a&&s.push({actual:u,expected:a,kind:"packageManager",message:`package.json packageManager pins ${n}@${a} but the current invocation uses ${n}@${u}.`,severity:"warning"})}return s},"checkRuntimeVersions");export{x as c};
@@ -0,0 +1,2 @@
1
+ var x=Object.defineProperty;var g=(t,e)=>x(t,"name",{value:e,configurable:!0});import{e as C,ag as d,E as b,I as $,a as E,s as P}from"../packem_chunks/bin.js";import{render as j}from"@visulima/tui";import S from"react";import{jsx as n,jsxs as y}from"react/jsx-runtime";import{Box as m}from"@visulima/tui/components/box";import{Spinner as O}from"@visulima/tui/components/spinner";import{Text as l}from"@visulima/tui/components/text";import{D as v,W as R,T as A,C as D}from"./symbols-CQmER5MT.js";var I=Object.defineProperty,Y=g((t,e)=>I(t,"name",{value:e,configurable:!0}),"l");const T=Y(({rows:t})=>n(m,{flexDirection:"column",children:t.map(e=>{let s;switch(e.status){case"error":{s=n(l,{color:"red",children:D});break}case"ok":{s=n(l,{color:"green",children:A});break}case"running":{s=n(l,{color:"white",children:n(O,{type:"dots"})});break}case"warn":{s=n(l,{color:"yellow",children:R});break}default:{s=n(l,{dimColor:!0,children:v});break}}return y(m,{children:[n(m,{width:3,children:s}),n(m,{flexGrow:1,children:n(l,{children:e.label})}),e.summary?n(m,{children:y(l,{dimColor:!0,children:[v," ",e.summary]})}):null]},e.id)})}),"ScanProgressApp");var B=Object.defineProperty,i=g((t,e)=>B(t,"name",{value:e,configurable:!0}),"e");const G={error:E(d.failure),ok:$(d.success),pending:b(d.dash),skip:b(d.dash),warn:C(d.warning)},M=i((t,e,s)=>{const p=s?`${t} ${b(`— ${s}`)}`:t;return` ${G[e]} ${p}
2
+ `},"formatStaticRow"),Q=i((t,e={})=>{const s=e.stream??process.stderr,p=typeof s.isTTY=="boolean"&&s.isTTY&&!P,k=e.live??p,o=new Map;for(const r of t)o.set(r.id,{id:r.id,label:r.label,status:"pending"});if(!k||t.length===0)return{finish:i((r,a,f)=>{const c=o.get(r);c&&(o.set(r,{...c,status:a,summary:f}),s.write(M(c.label,a,f)))},"finish"),start:i(r=>{const a=o.get(r);a&&o.set(r,{...a,status:"running"})},"start"),stop:i(()=>{},"stop")};const w=i(()=>t.map(r=>o.get(r.id)),"buildRows");let u=j(S.createElement(T,{rows:w()}),{interactive:!0,patchConsole:!1});const h=i(()=>{u?.rerender(S.createElement(T,{rows:w()}))},"rerender");return{finish:i((r,a,f)=>{const c=o.get(r);c&&(o.set(r,{...c,status:a,summary:f}),h())},"finish"),start:i(r=>{const a=o.get(r);a&&(o.set(r,{...a,status:"running"}),h())},"start"),stop:i(()=>{u&&(h(),u.unmount(),u=void 0)},"stop")}},"startScanProgress");export{Q as s};
@@ -0,0 +1,3 @@
1
+ var w=Object.defineProperty;var m=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as v}from"node:module";import{z as b}from"../packem_chunks/config.js";const k=v(import.meta.url),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=m(e=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[t,r]=j.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return j.getBuiltinModule(e)}return k(e)},"__cjs_getBuiltinModule"),{createInterface:$}=_("node:readline");var T=Object.defineProperty,f=m((e,t)=>T(e,"name",{value:t,configurable:!0}),"g");const q=/^#([\w\-/]+):(.+)$/,x=/^([@\w\-/]+):(.+)$/,P=f(e=>{if(e==="")return;if(e.startsWith(":"))return{kind:"all",target:e.slice(1)};if(e.startsWith("~:"))return{kind:"closest",target:e.slice(2)};const t=q.exec(e);if(t?.[1]&&t[2])return{kind:"tag",tag:t[1],target:t[2]};const r=x.exec(e);return r?.[1]&&r[2]&&(r[1].startsWith("@")||r[1].includes("/")||r[1].includes("-"))?{kind:"project",projects:[r[1]],target:r[2]}:{kind:"all",target:e}},"parseTargetSelector"),N=f(async(e,t,r,a)=>{const s=P(e);if(!s)throw new Error(`Invalid target selector: "${e}"`);const c=Object.keys(t.projects);if(s.kind==="all")return{projects:c,target:s.target};if(s.kind==="project")return{projects:s.projects??[],target:s.target};if(s.kind==="tag"){const o=s.tag;return{projects:c.filter(i=>t.projects[i]?.tags?.includes(o)??!1),target:s.target}}const n=b(a,r)||".";let p,l=-1;for(const[o,i]of Object.entries(t.projects)){const u=i.root;u&&(n===u||n.startsWith(`${u}/`))&&u.length>l&&(l=u.length,p=o)}if(!p){if(process.stdout.isTTY){const o=$({input:process.stdin,output:process.stderr}),i=Object.keys(t.projects).sort();process.stderr.write(`No project found at ${n}. Pick one:
2
+ `);for(const[d,h]of i.entries())process.stderr.write(` ${String(d+1)}) ${h}
3
+ `);const u=await new Promise(d=>{o.question("> ",d)});o.close();const g=Number.parseInt(u,10)-1;if(g>=0&&g<i.length)return{projects:[i[g]],target:s.target}}throw new Error(`No project found at or above ${n} for selector "${e}".`)}return{projects:[p],target:s.target}},"resolveSelector"),E=/^(\w+)\s*(!?=)\s*(.+)$/,Q=f(e=>{const t=e.trim();if(t==="")return;const r=t.split("&&").map(o=>o.trim()),a=t.split("||").map(o=>o.trim()),s=r.length>1,c=a.length>1;if(s&&c)throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");const n=c?a:r,p=c?"||":"&&",l=[];for(const o of n){const i=E.exec(o);if(!i)throw new Error(`Invalid query clause: "${o}". Expected <field>=<value> or <field>!=<value>.`);const[,u,g,d]=i;l.push({field:u,op:g==="!="?"!=":"=",value:d.trim().replaceAll(/^["']|["']$/g,"")})}return{clauses:l,op:p}},"parseQuery"),y=f((e,t,r)=>{const{field:a,op:s,value:c}=e,n=f(l=>{const o=l===c;return s==="="?o:!o},"test"),p=f(l=>{const o=(l??[]).includes(c);return s==="="?o:!o},"testList");switch(a){case"id":case"project":return n(t);case"language":return n(r.language);case"layer":return n(r.layer);case"projectType":case"type":return n(r.projectType);case"stack":return n(r.stack);case"tag":case"tags":return p(r.tags);default:return!1}},"matchClause"),O=f((e,t,r)=>{if(!r||r.trim()==="")return e;const a=Q(r);return a?e.filter(s=>{const c=t.projects[s];return c?a.op==="&&"?a.clauses.every(n=>y(n,s,c)):a.clauses.some(n=>y(n,s,c)):!1}):e},"filterProjectsByQuery");export{O as f,P as p,N as r};
@@ -0,0 +1,2 @@
1
+ var ue=Object.defineProperty;var h=(r,e)=>ue(r,"name",{value:e,configurable:!0});import{createRequire as fe}from"node:module";import{a as re,e as U,n as _,ax as p,i as A}from"../packem_chunks/bin.js";import{M as w,i as P,n as W,b as V}from"../packem_chunks/config.js";import{f as ye}from"./registry-keys-CewRFW0e.js";const ve=fe(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,H=h(r=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[e,t]=x.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return x.getBuiltinModule(r)}return ve(r)},"__cjs_getBuiltinModule"),{rmSync:y,writeFileSync:L,readdirSync:B}=H("node:fs"),{createHash:ge,createPublicKey:he,createVerify:me}=H("node:crypto"),{Resolver:pe}=H("node:dns/promises");var we=Object.defineProperty,z=h((r,e)=>we(r,"name",{value:e,configurable:!0}),"t$2");class Cr{static{h(this,"MarshallFindings")}static{z(this,"MarshallFindings")}entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const Ur=z(r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(re(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${re("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${U("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(U(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${U("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${U("→")} ${s.suggestedAction}`)}return e},"formatMarshallFindingsAsTable"),Fr=z(r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),"formatMarshallFindingsAsJson");var ke=Object.defineProperty,te=h((r,e)=>ke(r,"name",{value:e,configurable:!0}),"o$3");const N=8,j=te(async(r,e,t)=>{if(r.length===0)return[];const n=Math.max(1,Math.min(e,r.length)),s=Array.from({length:r.length});let o=0;const c=te(async()=>{for(;o<r.length;){const a=o;o+=1;const i=r[a];s[a]=await t(i,a)}},"worker");return await Promise.all(Array.from({length:n},()=>c())),s},"mapWithConcurrency");var $e=Object.defineProperty,$=h((r,e)=>$e(r,"name",{value:e,configurable:!0}),"o$2");const be=1800*1e3,Me=15e3,J=$(()=>w(_(),"packuments"),"getPackumentCacheDir"),ie=$(r=>w(J(),`${encodeURIComponent(r)}.json`),"cacheFilePath"),De=$(r=>{const e=ie(r);if(P(e))try{const t=W(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t.packument}catch{y(e,{force:!0});return}},"readCached"),Re=$((r,e,t)=>{V(J());const n={createdAt:Date.now(),packument:e,ttlMs:t};L(ie(r),JSON.stringify(n),"utf8")},"writeCached"),Ae=$(r=>{const e={},t=r.versions??{};for(const[s,o]of Object.entries(t)){const c=o.dist,a={version:s};if(o._npmUser!==void 0&&(a._npmUser=o._npmUser),o.maintainers!==void 0&&(a.maintainers=o.maintainers),o.bin!==void 0&&(a.bin=o.bin),c!==void 0){const i={};c.signatures!==void 0&&(i.signatures=c.signatures),c.attestations!==void 0&&(i.attestations=c.attestations),typeof c.integrity=="string"&&(i.integrity=c.integrity),typeof c.tarball=="string"&&(i.tarball=c.tarball),a.dist=i}o.repository!==void 0&&(a.repository=o.repository),o.license!==void 0&&(a.license=o.license),typeof o.readme=="string"&&(a.readme=o.readme),typeof o.readmeFilename=="string"&&(a.readmeFilename=o.readmeFilename),typeof o.private=="boolean"&&(a.private=o.private),typeof o.deprecated=="string"&&(a.deprecated=o.deprecated),e[s]=a}const n={name:typeof r.name=="string"?r.name:"",versions:e};return r["dist-tags"]!==void 0&&(n["dist-tags"]=r["dist-tags"]),r.time!==void 0&&(n.time=r.time),typeof r.readme=="string"&&(n.readme=r.readme),n},"stripPackument"),Pe=$(r=>{const e={Accept:"application/json"};return r!==void 0&&r!==""&&(e.Authorization=`Bearer ${r}`),e},"buildHeaders"),Ne=$(async(r,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:t,loadNpmrc:n}=await import("../packem_chunks/bin.js").then(a=>a.bF),s=n(e.workspaceRoot),{token:o,url:c}=t(r,s);return{authToken:e.authToken??o,url:c}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},"resolveRegistry"),E=$(async(r,e={})=>{const t=e.cacheTtlMs??be,n=De(r);if(n!==void 0)return n;const s=await Ne(r,e),o=`${s.url.endsWith("/")?s.url.slice(0,-1):s.url}/${r.replace("/","%2f")}`,c=new AbortController,a=setTimeout(()=>{c.abort()},Me),i=$(()=>{c.abort()},"abortListener");e.signal?.addEventListener("abort",i,{once:!0});try{const d=await fetch(o,{headers:Pe(s.authToken),signal:c.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${r}`);const l=await d.json(),u=Ae(l);return Re(r,u,t),u}finally{clearTimeout(a),e.signal?.removeEventListener("abort",i)}},"getPackument"),_r=$((r,e)=>{const t=Object.keys(r.versions);if(t.length===0)return;if(e===void 0||e===""||e==="latest")return r["dist-tags"]?.latest??t.at(-1);const n=r["dist-tags"]?.[e];return n!==void 0?n:Object.hasOwn(r.versions,e)?e:p.maxSatisfying(t,e)??void 0},"resolveVersionRange");$(()=>{const r=J();if(!P(r))return 0;let e=0;for(const t of B(r))t.endsWith(".json")&&(y(w(r,t),{force:!0}),e+=1);return e},"clearPackumentCache");var je=Object.defineProperty,b=h((r,e)=>je(r,"name",{value:e,configurable:!0}),"o$1");const Ee=1440*60*1e3,Oe=15e3,Te="https://api.github.com/repos",K=b(()=>w(_(),"archived-repo"),"getArchivedRepoCacheDir"),ae=b((r,e)=>w(K(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),"cacheFilePath"),Se=b((r,e)=>{const t=ae(r,e);if(P(t))try{const n=W(t);if(Date.now()-n.createdAt>n.ttlMs){y(t,{force:!0});return}return n}catch{y(t,{force:!0});return}},"readCachedRepo"),ne=b((r,e,t,n)=>{V(K());const s={createdAt:Date.now(),ttlMs:n,...t};L(ae(r,e),JSON.stringify(s),"utf8")},"writeCachedRepo"),xe=b(r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},"parseGitHubUrl"),Ce=b(async(r,e,t,n)=>{const s=`${Te}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,o=new AbortController,c=setTimeout(()=>{o.abort()},Oe),a=b(()=>{o.abort()},"abortListener");n?.addEventListener("abort",a,{once:!0});const i={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(i.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:i,signal:o.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,f=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(c),n?.removeEventListener("abort",a)}},"fetchGitHubRepo"),Ue=b((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),Lr=b(async(r,e={})=>{if(A("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??Ee,s=e.githubToken??process.env.GITHUB_TOKEN,o=e.concurrency??N,c=new Map,a=b(async(i,d)=>{const l=`${i}/${d}`;let u=c.get(l);return u===void 0&&(u=(async()=>{const f=Se(i,d);if(f!==void 0)return f.missing===!0?{archived:!1,kind:"missing"}:{archived:f.archived,archivedAt:f.archivedAt,kind:"ok"};const v=await Ce(i,d,s,e.signal);return v.kind==="missing"?ne(i,d,{archived:!1,missing:!0},n):v.kind==="ok"&&ne(i,d,{archived:v.archived===!0,archivedAt:v.archivedAt},n),v})(),c.set(l,u)),u},"fetchRepoOnce");return(await j(r,o,async({name:i,version:d})=>{if(t.has(i))return;const l=await E(i,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[Ue(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const f=xe(u.repository?.url);if(f===void 0)return;const v=await a(f.owner,f.repo);if(v.kind!=="transient-error"){if(v.kind==="missing")return{kind:"missing-repo",owner:f.owner,packageName:i,repo:f.repo};if(v.archived===!0)return{...v.archivedAt===void 0?{}:{archivedAt:v.archivedAt},kind:"archived",owner:f.owner,packageName:i,repo:f.repo}}})).filter(i=>i!==void 0)},"runArchivedRepoMarshall");b(()=>{const r=K();if(!P(r))return 0;let e=0;for(const t of B(r))t.endsWith(".json")&&(y(w(r,t),{force:!0}),e+=1);return e},"clearArchivedRepoCache");var Fe=Object.defineProperty,S=h((r,e)=>Fe(r,"name",{value:e,configurable:!0}),"h$2");const _e={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},Le=1440*60*1e3,G=S((r,e)=>(r-e)/Le,"daysBetween"),F=S(r=>{if(r!==void 0)return r.email??r.name},"userIdentity"),Be=S((r,e,t,n,s)=>{const o=r.time?.[t];if(o===void 0)return;const c=new Date(o).getTime();if(!Number.isFinite(c))return;const a=G(n,c);if(a<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${a.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(a<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${a.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkRecentVersion"),We=S((r,e,t,n,s)=>{const o=r.versions[t],c=F(o?._npmUser);if(c===void 0)return;const a=Object.keys(r.versions).filter(u=>p.valid(u)!==null).filter(u=>p.lt(u,t));if(a.length===0||a.some(u=>F(r.versions[u]?._npmUser)===c))return;const i=r.time?.[a[0]??""];if(i===void 0)return;const d=new Date(i).getTime();if(!Number.isFinite(d))return;const l=G(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${c} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},"checkNewPublisher"),Ve=S((r,e,t,n,s)=>{const o=r.versions[t],c=F(o?._npmUser);if(c===void 0)return;const a=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||F(u._npmUser)!==c)continue;const f=r.time?.[l];if(f===void 0)continue;const v=new Date(f).getTime();Number.isFinite(v)&&a.push(v)}if(a.length===0)return;const i=Math.max(...a),d=G(n,i);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${c} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${c} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkDormantMaintainer"),Br=S(async(r,e={})=>{if(A("author"))return[];const t=new Set(e.allowlist),n={..._e,...e.thresholds},s=e.now??(()=>Date.now()),o=e.concurrency??N;return(await j(r,o,async({name:c,version:a})=>{if(t.has(c))return[];const i=await E(c,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(i===void 0)return[];const d=s(),l=[],u=Be(i,c,a,d,n);u!==void 0&&l.push(u);const f=We(i,c,a,d,n);f!==void 0&&l.push(f);const v=Ve(i,c,a,d,n);return v!==void 0&&l.push(v),l})).flat()},"runAuthorMarshall");var Ie=Object.defineProperty,R=h((r,e)=>Ie(r,"name",{value:e,configurable:!0}),"t$1");const He=1440*60*1e3,ze=15e3,Je=20,Ke=1e4,Ge="https://api.npmjs.org/downloads/point/last-month",q=R(()=>w(_(),"downloads"),"getDownloadsCacheDir"),oe=R(r=>w(q(),`${encodeURIComponent(r)}.json`),"cacheFilePath"),qe=R(r=>{const e=oe(r);if(P(e))try{const t=W(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t.downloads}catch{y(e,{force:!0});return}},"readCachedDownloads"),Ye=R((r,e,t)=>{V(q());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};L(oe(r),JSON.stringify(n),"utf8")},"writeCachedDownloads"),Xe=R(async(r,e)=>{const t=`${Ge}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},ze),o=R(()=>{n.abort()},"abortListener");e?.addEventListener("abort",o,{once:!0});try{const c=await fetch(t,{signal:n.signal});if(c.status===404)return{kind:"no-data"};if(!c.ok)return{kind:"error"};const a=await c.json();return typeof a.downloads=="number"?{downloads:a.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",o)}},"fetchDownloads"),Wr=R(async(r,e={})=>{if(A("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??Je,s=e.warnThreshold??Ke,o=e.cacheTtlMs??He,c=e.concurrency??N;return(await j(r,c,async a=>{if(t.has(a))return;let i=qe(a);if(i===void 0){const d=await Xe(a,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:a,severity:"warning"};i=d.downloads??0,Ye(a,i,o)}if(i<n)return{downloadsLastMonth:i,kind:"below-error",packageName:a,severity:"error"};if(i<s)return{downloadsLastMonth:i,kind:"below-warning",packageName:a,severity:"warning"}})).filter(a=>a!==void 0)},"runDownloadsMarshall");R(()=>{const r=q();if(!P(r))return 0;let e=0;for(const t of B(r))t.endsWith(".json")&&(y(w(r,t),{force:!0}),e+=1);return e},"clearDownloadsCache");var Qe=Object.defineProperty,m=h((r,e)=>Qe(r,"name",{value:e,configurable:!0}),"t");const Ze=1440*60*1e3,er=4e3,rr=["1.1.1.1","8.8.8.8"],Y=m(()=>w(_(),"expired-domains"),"getExpiredDomainsCacheDir"),ce=m(r=>{const e=ge("sha256").update(r).digest("hex").slice(0,12);return w(Y(),`${e}.json`)},"cacheFilePath"),tr=m(r=>{const e=ce(r);if(P(e))try{const t=W(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t}catch{y(e,{force:!0});return}},"readCachedDomain"),nr=m((r,e,t)=>{V(Y());const n={createdAt:Date.now(),outcome:e,ttlMs:t};L(ce(r),JSON.stringify(n),"utf8")},"writeCachedDomain"),sr=m(r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},"extractDomain"),ir=m((r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},"collectMaintainers"),ar=m(async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},"withTimeout"),or=m(r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},"isExpiredError"),cr=m(async(r,e,t)=>{try{const n=await ar(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return or(n)?{kind:"expired"}:{kind:"transient-error"}}},"resolveDomain"),dr=m((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),Vr=m(async(r,e={})=>{if(A("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??Ze,o=e.perDomainTimeoutMs??er,c=e.dnsServers??rr,a=e.concurrency??N,i=e.createResolver===void 0?new pe:e.createResolver();typeof i.setServers=="function"&&i.setServers(c);const d=new Map,l=m(async u=>{let f=d.get(u);return f===void 0&&(f=(async()=>{const v=tr(u);if(v!==void 0)return{kind:v.outcome==="ok"?"ok":"expired"};const g=await cr(i,u,o);return g.kind!=="transient-error"&&nr(u,g.kind,s),g})(),d.set(u,f)),f},"resolveDomainOnce");return(await j(r,a,async({name:u,version:f})=>{if(t.has(u))return[];const v=await E(u,{workspaceRoot:e.workspaceRoot});if(v===void 0)return[];const g=v.versions[f]??v.versions[dr(Object.keys(v.versions),v["dist-tags"]?.latest)??""];if(g===void 0)return[];const M=ir(g.maintainers,g._npmUser),k=new Set,D=[];for(const C of M){const T=sr(C.email);if(T===void 0||n.has(T))continue;const Z=`${T}:${C.email??""}`;if(k.has(Z))continue;k.add(Z);const ee=await l(T);ee.kind==="expired"?D.push({domain:T,kind:"expired",maintainer:C.email??"",packageName:u,severity:"error"}):ee.kind==="transient-error"&&D.push({domain:T,kind:"unresolved",maintainer:C.email??"",packageName:u,severity:"warning"})}return D})).flat()},"runExpiredDomainsMarshall");m(()=>{const r=Y();if(!P(r))return 0;let e=0;for(const t of B(r))t.endsWith(".json")&&(y(w(r,t),{force:!0}),e+=1);return e},"clearExpiredDomainsCache");var lr=Object.defineProperty,O=h((r,e)=>lr(r,"name",{value:e,configurable:!0}),"s");const ur=["readme","license","repo"],fr=["ERROR: No README data found!","# Security holding package"],vr=O(r=>{const e=r.trim();return e===""?!0:fr.some(t=>e.startsWith(t))},"isPlaceholderReadme"),gr=O((r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},"getReadme"),hr=O((r,e)=>{const t=gr(r,e);if(t===void 0)return"missing-readme";if(vr(t))return"placeholder-readme"},"checkReadme"),mr=O(r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},"checkLicense"),pr=O(r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},"checkRepository"),yr=O(r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},"resolveLatestVersion"),Ir=O(async(r,e={})=>{if(A("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??ur),s=e.concurrency??N;return(await j(r,s,async({name:o,version:c})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const i=a.versions[c]??a.versions[yr(a)??""];if(i===void 0||i.private===!0)return;const d=[];if(n.has("readme")){const l=hr(a,i);l!==void 0&&d.push(l)}if(n.has("license")){const l=mr(i);l!==void 0&&d.push(l)}if(n.has("repo")){const l=pr(i);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:o,version:c}})).filter(o=>o!==void 0)},"runMetadataMarshall");var wr=Object.defineProperty,X=h((r,e)=>wr(r,"name",{value:e,configurable:!0}),"o");const se=X((r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},"normalizeBin"),kr=X((r,e)=>p.valid(e)?Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.lt(t,e)).sort((t,n)=>p.lt(t,n)?1:-1)[0]:void 0,"findImmediatelyPriorVersion"),Hr=X(async(r,e={})=>{if(A("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??N;return(await j(r,s,async({name:o,version:c})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const i=a.versions[c];if(i===void 0)return;const d=kr(a,c);if(d===void 0)return;const l=a.versions[d];if(l===void 0)return;const u=se(i.bin,o),f=se(l.bin,o),v=Object.entries(u).filter(([g])=>!(g in f)).filter(([g])=>!n.has(g)).map(([g,M])=>({command:M,name:g}));if(v.length!==0)return{fromVersion:d,newBins:v,packageName:o,toVersion:c}})).filter(o=>o!==void 0)},"runNewBinMarshall");var $r=Object.defineProperty,Q=h((r,e)=>$r(r,"name",{value:e,configurable:!0}),"i");const de=Q((r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,"hasProvenance"),br=Q((r,e)=>p.valid(e)?Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.lt(t,e)).filter(t=>p.satisfies(t,"*",{includePrerelease:!1})).filter(t=>de(r,t)).sort((t,n)=>p.lt(t,n)?1:-1)[0]:void 0,"findNewestPriorWithAttestations"),zr=Q(async(r,e={})=>{if(A("provenance"))return[];const t=new Set(e.allowlist),n=e.concurrency??N;return(await j(r,n,async({name:s,version:o})=>{if(t.has(s))return;const c=await E(s,{workspaceRoot:e.workspaceRoot});if(c===void 0||de(c,o))return;const a=br(c,o);if(a!==void 0)return{packageName:s,priorVersionWithProvenance:a,version:o}})).filter(s=>s!==void 0)},"runProvenanceMarshall");var Mr=Object.defineProperty,le=h((r,e)=>Mr(r,"name",{value:e,configurable:!0}),"n");const Dr=le(r=>{const e=["-----BEGIN PUBLIC KEY-----"],t=r.replaceAll(/\s+/g,"");for(let n=0;n<t.length;n+=64)e.push(t.slice(n,n+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
2
+ `)},"wrapSpkiPem"),Rr=le(({keyBase64:r,message:e,signatureBase64:t})=>{try{const n=he({format:"pem",key:Dr(r)}),s=me("SHA256");return s.update(e),s.end(),s.verify(n,Buffer.from(t,"base64"))}catch{return!1}},"verifyEcdsaSignature");var Ar=Object.defineProperty,I=h((r,e)=>Ar(r,"name",{value:e,configurable:!0}),"g");const Pr=I((r,e)=>{if(r.expires===void 0||r.expires==="")return!1;const t=Date.parse(r.expires);return Number.isNaN(t)?!1:t<=e},"isKeyExpired"),Nr=I((r,e,t)=>`${r}@${e}:${t}`,"buildSignedMessage"),jr=I((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),Jr=I(async(r,e={})=>{if(A("signatures"))return[];const t=new Set(e.allowlist),n=e.treatExpiredAs??"warning",s=e.concurrency??N,o=await ye({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(o===void 0)return r.filter(({name:i})=>!t.has(i)).map(({name:i,version:d})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:i,severity:"warning",version:d}));const c=new Map;for(const i of o.keys)c.set(i.keyid,i);const a=Date.now();return(await j(r,s,async({name:i,version:d})=>{if(t.has(i))return[];const l=await E(i,{workspaceRoot:e.workspaceRoot});if(l===void 0)return[];const u=l.versions[d]??l.versions[jr(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return[];const f=u.dist?.signatures,v=u.dist?.integrity;if(f===void 0||f.length===0)return[{code:"missing-signature",message:`Package ${i}@${d} has no dist.signatures from the registry.`,packageName:i,severity:"warning",version:d}];if(typeof v!="string"||v==="")return[{code:"missing-signature",message:`Package ${i}@${d} has signatures but no dist.integrity to verify against.`,packageName:i,severity:"warning",version:d}];const g=Nr(i,d,v),M=[];for(const k of f){const D=c.get(k.keyid);if(D===void 0){M.push({code:"unknown-keyid",keyid:k.keyid,message:`Package ${i}@${d} was signed with an unrecognized keyid (${k.keyid}).`,packageName:i,severity:"error",version:d});continue}if(Pr(D,a)){M.push({code:"expired-key",keyid:k.keyid,message:`Package ${i}@${d} was signed with an expired key (${k.keyid}, expired ${D.expires??"unknown"}).`,packageName:i,severity:n,version:d});continue}Rr({keyBase64:D.key,message:g,signatureBase64:k.sig})||M.push({code:"invalid-signature",keyid:k.keyid,message:`Package ${i}@${d} signature did not verify against ${k.keyid}.`,packageName:i,severity:"error",version:d})}return M})).flat()},"runSignatureMarshall");export{N as D,Cr as M,Br as a,zr as b,Hr as c,Ir as d,Wr as e,Vr as f,E as g,Jr as h,Lr as i,Fr as j,Ur as k,j as m,_r as r};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var r=(s,o)=>n(s,"name",{value:o,configurable:!0});var c=Object.defineProperty,a=r((s,o)=>c(s,"name",{value:o,configurable:!0}),"n");const p=a(()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux","isUnicodeSupported"),e=p(),S=e?"✓":"√",v=e?"✖":"×",R=e?"…":"...",i=e?"—":"-",E=e?"⚠":"!";export{v as C,i as D,R as E,S as T,E as W};
@@ -0,0 +1,5 @@
1
+ var N=Object.defineProperty;var x=(o,e)=>N(o,"name",{value:e,configurable:!0});import{createRequire as I}from"node:module";import{M as g,i as d,$ as k,n as O,d as J,f as R}from"../packem_chunks/config.js";const B=I(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=x(o=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,n]=M.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return M.getBuiltinModule(o)}return B(o)},"__cjs_getBuiltinModule"),{execFileSync:w}=j("node:child_process"),{randomBytes:D}=j("node:crypto"),{writeFileSync:U,renameSync:q,unlinkSync:H}=j("node:fs");var z=Object.defineProperty,f=x((o,e)=>z(o,"name",{value:e,configurable:!0}),"f");const V=["proto","mise","fnm","volta","asdf","nvm","corepack"],Z={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},X=["proto","mise","fnm","volta","asdf","nvm","corepack"],W={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},b=new Map,y=f(o=>{const e=b.get(o);if(e!==void 0||b.has(o))return e;const n=process.env.PATH;if(!n){b.set(o,void 0);return}const t=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const r of n.split(J)){const i=r.replaceAll(/^["']|["']$/g,"").trim();if(i!=="")for(const l of t){const s=`${i}${R}${o}${l}`;if(d(s))return b.set(o,s),s}}b.set(o,void 0)},"isOnPath"),_=f((o,e=["--version"])=>{try{const n=w(o,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),t=/\d+\.\d+(?:\.\d+)?/.exec(n);return t?t[0]:n.trim()||void 0}catch{return}},"queryManagerVersion"),A=f((o,e)=>{const n=g(o,"package.json");if(!d(n))return[];try{const t=O(n)[e];if(e==="volta"&&typeof t=="object"&&t!==null&&Object.keys(t).length>0)return["package.json"];if(e==="packageManager"&&typeof t=="string"&&t.length>0)return["package.json"]}catch{}return[]},"pkgFieldConfigFiles"),G=f((o,e)=>o==="volta"?A(e,"volta"):o==="corepack"?A(e,"packageManager"):W[o].filter(n=>d(g(e,n))),"configFilesFor"),P=new Map,K=f(()=>{P.clear(),b.clear()},"clearToolchainCache"),S=f((o,e)=>{if(!e?.refresh){const i=P.get(o);if(i)return i}const n=[],t=!!y("pnpm")||!!y("yarn");for(const i of X){const l=i==="nvm"?void 0:y(i),s=i==="nvm"&&!!process.env.NVM_DIR,c=G(i,o),a=!!l||s;i==="corepack"&&!a&&(!(c.length>0)||t)||!a&&c.length===0||n.push({binPath:l,configFiles:c,installed:a,name:i,version:l?_(l):void 0})}const r=Object.freeze(n);return P.set(o,r),r},"findInstalledManagers"),ye=f((o,e,n)=>{const t=n??S(o);return e?.preferredManager&&e.preferredManager!=="none"?t.find(r=>r.name===e.preferredManager)??{configFiles:[],installed:!1,name:e.preferredManager}:t.find(r=>r.installed&&r.configFiles.length>0)??t.find(r=>r.installed)??t.find(r=>r.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},"pickPrimaryManager"),L=f((o,e)=>{for(const n of e){const t=g(o,n);if(d(t))try{const r=k(t).trim();if(r!=="")return{name:n,value:r.replace(/^v/,"")}}catch{}}},"readVersionFile"),Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,Y=f(o=>{const e=g(o,".prototools");if(!d(e))return[];const n=k(e),t=[];let r=!1;for(const i of n.split(/\r?\n/)){const l=i.trim();if(l===""||l.startsWith("#"))continue;if(l.startsWith("[")){r=!0;continue}if(r)continue;const s=Q.exec(l);if(!s)continue;const[,c,a]=s,u=h(c);u&&t.push({source:".prototools",tool:u,version:a.trim()})}return t},"parsePrototools"),ee=/^\[tools\]\s*$/i,oe=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,ne=f(o=>{for(const e of W.mise){const n=g(o,e);if(!d(n))continue;const t=[],r=k(n);let i=!1;for(const l of r.split(/\r?\n/)){const s=l.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=ee.test(s);continue}if(!i)continue;const c=oe.exec(s);if(!c)continue;const[,a,u]=c,m=h(a);m&&t.push({source:".mise.toml",tool:m,version:u.trim()})}if(t.length>0)return t}return[]},"parseMiseToml"),te=f(o=>{const e=g(o,".tool-versions");if(!d(e))return[];const n=k(e),t=[];for(const r of n.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const l=i.split(/\s+/);if(l.length<2)continue;const[s,...c]=l,a=h(s);a&&c[0]&&t.push({source:".tool-versions",tool:a,version:c[0]})}return t},"parseToolVersions"),h=f(o=>{switch(o.toLowerCase()){case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},"normalizeToolName"),re=f(o=>{const[e]=o.split("+",1),n=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(e??"");if(!n)return;const t=h(n[1]);if(t)return{source:"packageManager",tool:t,version:n[2]}},"parsePackageManagerField"),se=f((o,e)=>{const n=new Map,t=f(s=>{n.set(s.tool,s)},"add"),r=g(o,"package.json");let i={};try{d(r)&&(i=O(r))}catch{}if(i.engines)for(const[s,c]of Object.entries(i.engines)){const a=h(s);a&&typeof c=="string"&&t({source:"engines",tool:a,version:c})}if(i.packageManager){const s=re(i.packageManager);s&&t(s)}if(i.volta)for(const[s,c]of Object.entries(i.volta)){const a=h(s);a&&typeof c=="string"&&t({source:"volta",tool:a,version:c})}const l=L(o,[".nvmrc",".node-version"]);l&&t({source:l.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:l.value});for(const s of te(o))t(s);for(const s of ne(o))t(s);for(const s of Y(o))t(s);if(e?.tools)for(const[s,c]of Object.entries(e.tools)){const a=h(s);a&&typeof c=="string"&&t({source:"vis.config.ts",tool:a,version:c})}return[...n.values()]},"parseExpectedTools"),F={bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},ie=f(o=>{const e=F[o];for(const n of e.binaries){const t=y(n);if(t)return _(t,e.args)}if(o==="node")return process.versions.node},"queryToolVersion"),ae=f((o,e)=>{const n=e.trim();if(n===""||n==="*"||n==="latest")return!0;if(/^\d[\d.]*$/.test(n))return o===n||o.startsWith(`${n}.`);const t=f(s=>s.split(/[.\-+]/).map(c=>Number.parseInt(c,10)||0),"parse"),r=f((s,c)=>{const a=t(s),u=t(c),m=Math.max(a.length,u.length);for(let p=0;p<m;p++){const $=a[p]??0,v=u[p]??0;if($!==v)return $-v}return 0},"compare"),i=f(s=>{for(const c of s)if(c.startsWith(">=")){if(r(o,c.slice(2).trim())<0)return!1}else if(c.startsWith("<=")){if(r(o,c.slice(2).trim())>0)return!1}else if(c.startsWith(">")){if(r(o,c.slice(1).trim())<=0)return!1}else if(c.startsWith("<")){if(r(o,c.slice(1).trim())>=0)return!1}else if(c.startsWith("^")||c.startsWith("~")){const a=c.slice(1).trim(),[u,m]=t(a),[p,$]=t(o);if(p!==u||c.startsWith("~")&&$!==m||r(o,a)<0)return!1}return!0},"matchesAll"),l=n.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return l.length===0?!0:l.some(s=>i(s))},"satisfies"),ce=f((o,e)=>{switch(o){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return e==="pnpm"||e==="yarn"?["self-activate","volta","proto","mise","corepack"]:e==="npm"?["volta","proto","mise","asdf","corepack"]:e==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},"preferenceFor"),le=f((o,e,n)=>{if(n?.preferredManager&&n.preferredManager!=="none"&&T(n.preferredManager,o.tool)){const r=e.find(i=>i.name===n.preferredManager);return r?{installed:r.installed,name:r.name}:{installed:!1,name:n.preferredManager,note:`${n.preferredManager} is the preferred manager but isn't on PATH`}}const t=ce(o.source,o.tool);for(const r of t){if(r==="self-activate"){if((o.tool==="pnpm"||o.tool==="yarn")&&y(o.tool))return{installed:!0,name:"self-activate",note:`${o.tool} will activate ${o.version} from the packageManager field on next invocation`};continue}if(T(r,o.tool)&&e.find(i=>i.name===r)?.installed)return{installed:!0,name:r}}for(const r of t)if(!(r==="self-activate"||!T(r,o.tool)))return{installed:!1,name:r,note:`${r} can install ${o.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},"resolveManagerFor"),T=f((o,e)=>o==="none"?!1:o==="self-activate"?e==="pnpm"||e==="yarn":Z[o].includes(e),"canHandle"),fe=f((o,e)=>{const n=S(o),t=se(o,e).map(r=>{const i=ie(r.tool),l=i!==void 0&&ae(i,r.version),s=le(r,n,e);return{actual:i,expected:r,manager:s,matches:l}});return{detected:n,tools:t}},"getToolchainStatus"),pe=f((o,e)=>{switch(o){case"asdf":return e?{args:["install",e.tool,e.version],bin:"asdf"}:void 0;case"corepack":return e?{args:["prepare",`${e.tool}@${e.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return e?.tool!=="node"?void 0:{args:["install",e.version],bin:"fnm"};case"mise":return e?{args:["install",`${e.tool}@${e.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return e?{args:["install",e.tool,e.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:e?.tool??"pnpm",hint:`${e?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return e?{args:["install",`${e.tool}@${e.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},"buildInstallInvocation"),$e=f((o,e)=>{switch(o){case"asdf":return{args:["local",e.tool,e.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${e.tool} ${e.version}`}};case"corepack":return e.tool!=="npm"&&e.tool!=="pnpm"&&e.tool!=="yarn"?void 0:{args:["use",`${e.tool}@${e.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${e.tool}@${e.version}"`}};case"fnm":return e.tool==="node"?{args:["use",e.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${e.tool}@${e.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${e.tool} ${e.version}`}};case"none":return;case"nvm":return e.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",e.tool,e.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${e.tool} ${e.version}`}};case"self-activate":return{args:[],bin:e.tool,configChange:{file:"package.json",hint:`Set packageManager: "${e.tool}@${e.version}" — ${e.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${e.tool}@${e.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${e.tool}`}};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},"buildUseInvocation"),be=f(o=>{for(const e of F[o].binaries){const n=y(e);if(n)return n}},"findOnPathByAlias"),ke=f((o,e)=>{const n=F[e].binaries;if(o.installed&&o.binPath&&(o.name==="proto"||o.name==="mise"||o.name==="asdf"||o.name==="volta"||o.name==="fnm"))for(const t of n)try{const r=w(o.binPath,["which",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(r)return r}catch{}for(const t of n){const r=y(t);if(r)return r}},"resolveToolBinary"),E=f((o,e)=>{const n=`${o}.${process.pid}.${D(6).toString("hex")}.tmp`;U(n,e);try{q(n,o)}catch(t){try{H(n)}catch{}throw t}},"atomicWrite"),ue=f((o,e)=>{if("packageManager"in o)return o.packageManager=e,o;const n={};let t=!1;for(const[r,i]of Object.entries(o))!t&&(r==="dependencies"||r==="devDependencies"||r==="peerDependencies"||r==="optionalDependencies")&&(n.packageManager=e,t=!0),n[r]=i;return t||(n.packageManager=e),n},"insertPackageManagerKey"),Me=f((o,e)=>{if(e.tool!=="pnpm"&&e.tool!=="yarn"&&e.tool!=="npm"&&e.tool!=="bun")return;const n=g(o,"package.json");if(!d(n))throw new Error(`Cannot pin ${e.tool}: ${n} does not exist.`);const t=k(n),r=/\n([ \t]+)/.exec(t)?.[1]??" ";let i;try{i=JSON.parse(t)}catch(a){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}const l=`${e.tool}@${e.version}`,s=ue(i,l),c=t.endsWith(`
2
+ `)?`
3
+ `:"";return E(n,`${JSON.stringify(s,void 0,r)}${c}`),l},"writePackageManagerField"),we=f((o,e)=>{const n=g(o,"package.json");if(!d(n))return;const t=k(n);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${s.message}`,{cause:s})}if(r.engines?.[e.tool]===void 0||r.engines[e.tool]===e.version)return;r.engines[e.tool]=e.version;const i=/\n([ \t]+)/.exec(t)?.[1]??" ",l=t.endsWith(`
4
+ `)?`
5
+ `:"";return E(n,`${JSON.stringify(r,void 0,i)}${l}`),e.version},"updateEnginesField"),xe=f(o=>{const e=/^([a-z][\w-]*)@(.+)$/i.exec(o.trim());if(!e)return;const n=h(e[1]);if(n)return{source:"vis.config.ts",tool:n,version:e[2]}},"parseUseArgument"),de=f(async(o,e,n)=>{const t=fe(o,e),r=t.tools.filter(a=>!a.matches);if(r.length===0)return{attempted:[],failed:[],upToDate:!0};const i=t.detected.some(a=>a.installed);if(!(e?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const l=[],s=[],c=new Map;for(const a of r){const u=c.get(a.manager.name);u?u.push(a):c.set(a.manager.name,[a])}for(const[a,u]of c){if(a==="self-activate"){for(const{expected:p}of u)n.info(`toolchain: ${p.tool} ${p.version} will self-activate on next ${p.tool} invocation`),l.push(p);continue}if(a==="none"){for(const{expected:p}of u)s.push({error:`no manager can install ${p.tool} — install one of ${V.join(", ")}`,spec:p});continue}if(!t.detected.find(p=>p.name===a)?.installed){for(const{expected:p}of u)s.push({error:`${a} is not on PATH`,spec:p});continue}const m=u.map(p=>({invocation:pe(a,p.expected),tool:p})).filter(p=>p.invocation!==void 0);for(const{invocation:p,tool:$}of m){const{expected:v}=$;if(p.bin==="nvm"&&p.args.length===0){n.warn(`toolchain: nvm requires a shell-side activation for ${v.tool} ${v.version}. Run \`nvm install\` / \`nvm use\` manually.`),s.push({error:"nvm requires shell-side activation",spec:v});continue}n.info(`toolchain: $ ${p.bin} ${p.args.join(" ")}`);try{w(p.bin,p.args,{cwd:o,stdio:"inherit"}),l.push(v),a==="fnm"&&ge(p.bin,n)}catch(C){s.push({error:C.message,spec:v});break}}}return K(),{attempted:l,failed:s,upToDate:!1}},"ensureToolchain"),Te=f(async(o,e,n,t=!1)=>{if(t)return;const r=await de(o,e,n);for(const i of r.failed)n.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},"runToolchainPreflight"),ge=f((o,e)=>{const n=process.platform==="win32"?"powershell":"bash";try{const t=w(o,["env","--shell",n],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const r of t.split(/\r?\n/)){const i=r.trim();if(i==="")continue;const l=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(l){const[,a,u]=l;process.env[a]=u.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,a,u]=s;process.env[a]=u;continue}const c=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(c){const[,a,u]=c;process.env[a]=u.replaceAll(/^["']|["']$/g,"")}}}catch(t){e.warn(`toolchain: could not activate fnm env (${t.message}). Subsequent tasks may use the previous Node version.`)}},"activateFnmEnv");export{V as S,le as a,pe as b,$e as c,ke as d,be as e,S as f,fe as g,ye as h,xe as p,Te as r,we as u,Me as w};
@@ -0,0 +1 @@
1
+ var $=Object.defineProperty;var m=(e,s)=>$(e,"name",{value:s,configurable:!0});import{createRequire as z}from"node:module";import{aQ as C,i as f,p as i,a as b,e as k}from"../packem_chunks/bin.js";import{M as D,i as A,n as O}from"../packem_chunks/config.js";const _=z(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=m(e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[s,r]=l.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return l.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{createInterface:M}=T("node:readline");var F=["aj","aju","av","avj","ejv","jav","jv"],N=["angula","angular-node","angularjs"],P=["auto-prefixer"],B=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],R=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],S=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],W=["bcryptjs-node","dcryptjs"],L=["bunan","bunya","bunyan-node","buynan"],E=["cai","cha","chaijs","chal","chi","chia","hai"],U=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],V=["cheero","cherio"],I=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],J=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Q=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],Y=["cor","corss","cos","cosr","cros","crs","ors"],G=["days"],H=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],K=["dot-env","dotenv-node","dotenvjs","dotevn"],X=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],Z=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],ee=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],oe=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],se=["astify"],re=["firebasejs"],ae=["form1dable"],te=["glb","glo","glob-js","globjs","gob","golb","lob"],ne=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ce=["helmetjs","helnet"],ie=["homo","hon","hoo","hoon","ohno","ono"],de=["inquire","inquirer-js","nquirer"],le=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],pe=["imp","jim","jip","jmp"],ue=["ji","jio","jo","joii","jol","oi","oji"],ve=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],he=["jsonwebtoken-js","jsonwebtoken-node"],je=["ka","kao","ko","koaa","koajs","koe","oa","oka"],be=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],ke=["luca","luci","lucie"],ge=["luon","luxo","luxon-js"],fe=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],ye=["minimath"],xe=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],we=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],qe=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],$e=["moran","organ"],ze=["muler","multer-js","muter"],_e=["mysql"],Te=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Me=["node-mailer","nodemailer-js"],Ce=["nodemo","nodemonjs","nodmeon"],De=["oar","or","ora-node","ore","ra","roa"],Ae=["arcel","parce","parceljs"],Oe=["passport-js"],Fe=["phase","phaser-node"],Ne=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Pe=["playright","playwright-js"],Be=["postcss-js","postcss-node","potscss"],Re=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Se=["prima","prism","prisma-js","prismajs","prizma"],We=["pupeteer"],Le=["rada","rama","ramd","randa"],Ee=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Ue=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ve=["resen","rsend"],Ie=["ollup","rollup-js","rollup-node"],Je=["ass","asss","sas","sass-node","sess","ssas","sss"],Qe=["emver","seemver","semver-node","semvre","senver","sever"],Ye=["sequelize-js","sequelize-node"],Ge=["harp","shap","shar","sharp-js","sharpjs"],He=["stipe","strip","stripe-node","tripe"],Ke=["supabase-js"],Xe=["suelte","svelt3","svelte-js","sveltejs","velte"],Ze=["tailwindcss-js"],eo=["auri","taui"],oo=["hree","htree","thee","there","three-js","three-node","tree"],so=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],ro=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ao=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],to=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],no=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],co=["itest","uitest","vitestjs","vitezt","vittest","vtest"],io=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],lo=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],po=["up","uyp","yp","yu","yupjs","yupp"],uo=["od","zd","zdo","zo","zob","zod-js","zodjs"];const vo={ajv:F,angular:N,autoprefixer:P,"aws-sdk":["awssdk","ews-sdk"],axios:B,babel:R,bcrypt:S,bcryptjs:W,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:L,chai:E,chalk:U,cheerio:V,color:I,colors:J,commander:Q,"cookie-parser":["cookie-parse","cookieparser"],cors:Y,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:G,debug:H,dotenv:K,electron:X,esbuild:Z,eslint:ee,express:oe,fastify:se,firebase:re,formidable:ae,glob:te,got:ne,helmet:ce,hono:ie,inquirer:de,ioredis:le,jest:me,jimp:pe,joi:ue,jsdom:ve,jsonwebtoken:he,koa:je,lodash:be,lucia:ke,luxon:ge,micromatch:fe,minimatch:ye,mocha:xe,moment:we,mongoose:qe,morgan:$e,multer:ze,mysql2:_e,next:Te,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Me,nodemon:Ce,ora:De,parcel:Ae,passport:Oe,phaser:Fe,pino:Ne,playwright:Pe,postcss:Be,prettier:Re,prisma:Se,puppeteer:We,ramda:Le,react:Ee,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Ue,resend:Ve,rollup:Ie,sass:Je,semver:Qe,sequelize:Ye,sharp:Ge,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:He,supabase:Ke,svelte:Xe,tailwindcss:Ze,tauri:eo,three:oo,"ts-node":["tts-node"],tsx:so,typescript:ro,underscore:ao,uuid:to,vite:no,vitest:co,vue:io,webpack:lo,winston:mo,yup:po,zod:uo};var v,g;function ho(){return g||(g=1,v={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),v}m(ho,"requireTyposquatsManual");var jo=ho();const bo=C(jo);var ko=Object.defineProperty,n=m((e,s)=>ko(e,"name",{value:s,configurable:!0}),"c");const go={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},fo=["app","cli","core","kit","lib","pkg","sdk"],yo=n(e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const u=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!u){const d=[...e];[d[o],d[o+1]]=[d[o+1],d[o]],s.add(d.join(""))}}const c=e[o].toLowerCase(),j=go[c];if(j)for(const u of j)s.add(e.slice(0,o)+u+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const c of["","-",".","_"])s.add(`${a}${c}${t}`),s.add(`${t}${c}${a}`);for(const c of fo)s.add(`${a}-${c}`),s.add(`${t}-${a}-${c}`),s.add(`${c}-${a}-${t}`)}}return s.delete(e),s},"generateVariants");let h,p;const y=n(()=>{if(!h){const e={};for(const s of[vo,bo])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}h=e}return h},"loadBlocklist"),xo=n(()=>{if(!p){p=new Map;for(const[e,s]of Object.entries(y()))for(const r of s)p.set(r,e)}return p},"getReverseLookup"),wo=n(e=>e.startsWith("@")?e.split("/")[1]??e:e,"bareName"),qo=n(e=>{const s=wo(e),r=xo().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};for(const o of Object.keys(y()))if(yo(o).has(s))return{input:e,legitimate:o,method:"heuristic"}},"checkTyposquat"),x=n((e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=qo(a);t&&o.push(t)}return o},"checkTyposquats"),w=n((e,s)=>{i.warn(""),i.warn(b(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";i.warn(` ${k("⚠")} ${b(r.input)} — did you mean ${k(r.legitimate)}? (${o})`)}i.warn("")},"printTyposquatWarnings"),q=n(async e=>{if(!process.stdin.isTTY){i.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=M({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},"askConfirmation"),Ao=n(async(e,s)=>{if(f("typosquats"))return{ok:!0,packages:e};const r=x(e,s);if(r.length===0)return{ok:!0,packages:e};w(r,"detected");const o=await q(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},"runTyposquatCheck"),$o=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,zo=n(e=>$o.exec(e)?.[1],"parseAliasTarget"),_o=n(e=>{if(!A(e))return[];const s=O(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const c=zo(t);c&&o.add(c)}return[...o]},"readDepsFromPackageJson"),Oo=n(async(e,s)=>{if(f("typosquats"))return!0;const r=D(e,"package.json"),o=_o(r);if(o.length===0)return!0;const a=x(o,s);if(a.length===0)return!0;w(a,"in package.json dependencies"),i.warn("Fix the package name in package.json before proceeding.");const t=await q("Continue anyway? [y/N] ");return t==="y"||t==="yes"},"scanDepsForTyposquats");export{Ao as r,Oo as s};
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var n=(e,r)=>o(e,"name",{value:r,configurable:!0});import{measureElement as i}from"@visulima/tui";import{useRef as f,useState as m,useLayoutEffect as c}from"react";var g=Object.defineProperty,h=n((e,r)=>g(e,"name",{value:r,configurable:!0}),"i");const v=h((e,r)=>{const u=f(null),[s,a]=m(e);return c(()=>{if(!u.current)return;const{height:t}=i(u.current);t>0&&t!==s&&(a(t),r?.(t))}),{measuredHeight:s,ref:u}},"useMeasuredHeight");export{v as u};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var o=(e,r)=>c(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,t=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"s");const p=t(e=>e?Array.isArray(e)?e:[e]:[],"toStringArray"),g=t(e=>e instanceof Error?e.message:typeof e=="string"?e:String(e),"errorMessage"),v=/^(.+?)(?:@(.+))?$/,m=t(e=>{if(e.startsWith("@")){const i=e.indexOf("/");if(i===-1)return{name:e,versionSpec:void 0};const a=e.slice(i+1),s=a.indexOf("@");return s===-1?{name:e,versionSpec:void 0}:{name:e.slice(0,i+1+s),versionSpec:a.slice(s+1)}}const r=v.exec(e);return r?{name:r[1]??e,versionSpec:r[2]}:{name:e,versionSpec:void 0}},"parsePackageArgument");export{m as d,g as f,p as o};