@visulima/vis 6.1.3 → 6.1.4

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 (193) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE.md +0 -29
  3. package/dashboard/dist/index.html +10 -10
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +1 -1
  6. package/dist/config/index.d.ts +16 -10
  7. package/dist/generate/index.d.ts +25 -0
  8. package/dist/packem_chunks/CONFIG_FILES.js +6 -7
  9. package/dist/packem_chunks/bloom-status.js +1 -1
  10. package/dist/packem_chunks/bloom-sync.js +1 -1
  11. package/dist/packem_chunks/catalog2.js +7 -7
  12. package/dist/packem_chunks/cli-exec.js +1 -1
  13. package/dist/packem_chunks/cli-main.js +129 -129
  14. package/dist/packem_chunks/dispatch.js +1 -1
  15. package/dist/packem_chunks/fix.js +1 -1
  16. package/dist/packem_chunks/handler.js +1 -1
  17. package/dist/packem_chunks/handler10.js +5 -5
  18. package/dist/packem_chunks/handler11.js +1 -1
  19. package/dist/packem_chunks/handler12.js +1 -1
  20. package/dist/packem_chunks/handler13.js +1 -1
  21. package/dist/packem_chunks/handler14.js +1 -1
  22. package/dist/packem_chunks/handler15.js +1 -1
  23. package/dist/packem_chunks/handler16.js +1 -1
  24. package/dist/packem_chunks/handler17.js +1 -1
  25. package/dist/packem_chunks/handler18.js +1 -1
  26. package/dist/packem_chunks/handler19.js +1 -1
  27. package/dist/packem_chunks/handler2.js +1 -1
  28. package/dist/packem_chunks/handler20.js +1 -1
  29. package/dist/packem_chunks/handler21.js +1 -1
  30. package/dist/packem_chunks/handler22.js +1 -1
  31. package/dist/packem_chunks/handler23.js +1 -1
  32. package/dist/packem_chunks/handler24.js +1 -1
  33. package/dist/packem_chunks/handler25.js +1 -1
  34. package/dist/packem_chunks/handler26.js +1 -1
  35. package/dist/packem_chunks/handler27.js +1 -1
  36. package/dist/packem_chunks/handler28.js +1 -1
  37. package/dist/packem_chunks/handler29.js +1 -1
  38. package/dist/packem_chunks/handler3.js +2 -2
  39. package/dist/packem_chunks/handler30.js +1 -1
  40. package/dist/packem_chunks/handler4.js +1 -1
  41. package/dist/packem_chunks/handler40.js +1 -1
  42. package/dist/packem_chunks/handler5.js +1 -1
  43. package/dist/packem_chunks/handler50.js +2 -2
  44. package/dist/packem_chunks/handler51.js +1 -1
  45. package/dist/packem_chunks/handler52.js +1 -1
  46. package/dist/packem_chunks/handler53.js +1 -1
  47. package/dist/packem_chunks/handler54.js +2 -2
  48. package/dist/packem_chunks/handler55.js +1 -1
  49. package/dist/packem_chunks/handler56.js +1 -1
  50. package/dist/packem_chunks/handler58.js +1 -1
  51. package/dist/packem_chunks/handler59.js +1 -1
  52. package/dist/packem_chunks/handler6.js +1 -1
  53. package/dist/packem_chunks/handler60.js +4 -4
  54. package/dist/packem_chunks/handler61.js +2 -2
  55. package/dist/packem_chunks/handler62.js +1 -1
  56. package/dist/packem_chunks/handler63.js +2 -61
  57. package/dist/packem_chunks/handler64.js +61 -6
  58. package/dist/packem_chunks/handler65.js +6 -8
  59. package/dist/packem_chunks/handler66.js +8 -2
  60. package/dist/packem_chunks/handler67.js +2 -28
  61. package/dist/packem_chunks/handler68.js +28 -12
  62. package/dist/packem_chunks/handler69.js +12 -25
  63. package/dist/packem_chunks/handler7.js +1 -1
  64. package/dist/packem_chunks/handler70.js +25 -22
  65. package/dist/packem_chunks/handler71.js +22 -10
  66. package/dist/packem_chunks/handler72.js +10 -133
  67. package/dist/packem_chunks/handler73.js +133 -23
  68. package/dist/packem_chunks/handler74.js +23 -323
  69. package/dist/packem_chunks/handler75.js +274 -659
  70. package/dist/packem_chunks/handler76.js +13 -13
  71. package/dist/packem_chunks/handler77.js +12 -12
  72. package/dist/packem_chunks/handler78.js +1 -1
  73. package/dist/packem_chunks/handler79.js +69 -67
  74. package/dist/packem_chunks/handler8.js +1 -1
  75. package/dist/packem_chunks/handler9.js +1 -1
  76. package/dist/packem_chunks/heal-accept.js +1 -1
  77. package/dist/packem_chunks/heal.js +1 -1
  78. package/dist/packem_chunks/help-command.js +1 -1
  79. package/dist/packem_chunks/html.js +707 -0
  80. package/dist/packem_chunks/index4.js +1 -1
  81. package/dist/packem_chunks/index6.js +57 -51
  82. package/dist/packem_chunks/index7.js +2 -2
  83. package/dist/packem_chunks/keys-refresh.js +1 -1
  84. package/dist/packem_chunks/lean.js +1 -1
  85. package/dist/packem_chunks/list.js +1 -1
  86. package/dist/packem_chunks/loader.js +1 -1
  87. package/dist/packem_chunks/prune.js +1 -1
  88. package/dist/packem_chunks/run.js +1 -1
  89. package/dist/packem_chunks/status.js +1 -1
  90. package/dist/packem_chunks/sync.js +1 -1
  91. package/dist/packem_chunks/sync2.js +1 -1
  92. package/dist/packem_chunks/tripwire.js +1 -1
  93. package/dist/packem_chunks/ts-loader.js +1 -1
  94. package/dist/packem_chunks/verify-lockfile.js +1 -1
  95. package/dist/packem_shared/advisories-DHGJ6XhP.js +1 -0
  96. package/dist/packem_shared/affected-selection-DCT4CLex.js +1 -0
  97. package/dist/packem_shared/{affected-shas-B_kfSKss.js → affected-shas-CycHU3nr.js} +1 -1
  98. package/dist/packem_shared/{ai-analysis-qdksWsn1.js → ai-analysis-CO4rT3Nd.js} +1 -1
  99. package/dist/packem_shared/ai-cache-Dkb6me20.js +1 -0
  100. package/dist/packem_shared/{ai-fix-DEwd0QKC.js → ai-fix-C0OBhGDq.js} +1 -1
  101. package/dist/packem_shared/{augment-B9kSZuvW.js → augment-BSeqaai8.js} +1 -1
  102. package/dist/packem_shared/{bin-BND-N6AL.js → bin-DwACrJUJ.js} +1 -1
  103. package/dist/packem_shared/build-scripts-BeMIA-_q.js +1 -0
  104. package/dist/packem_shared/{command-runtime-HSsYGCQd.js → command-runtime-DG49t2MT.js} +1 -1
  105. package/dist/packem_shared/{dependency-scan-B1CU6P9M.js → dependency-scan-D8e370_h.js} +1 -1
  106. package/dist/packem_shared/detect-C-9o_BPB.js +1 -0
  107. package/dist/packem_shared/{docker-DXqV-07f.js → docker-vRDm2lHX.js} +1 -1
  108. package/dist/packem_shared/{ecosystem-gate-InIAzSPA.js → ecosystem-gate-DpO43yAS.js} +1 -1
  109. package/dist/packem_shared/env-BymuoTL8.js +4 -0
  110. package/dist/packem_shared/env-consistency-BDfAa56d.js +1 -0
  111. package/dist/packem_shared/{failure-log-DIsKBKaI.js → failure-log-BslhfaEO.js} +1 -1
  112. package/dist/packem_shared/glob-Cyk1H9ZL-6yDyaJwk.js +1 -0
  113. package/dist/packem_shared/{index-BzhrR_iC.js → index-0dnGN3GP.js} +1 -1
  114. package/dist/packem_shared/index-CIdjkZgt.js +1 -0
  115. package/dist/packem_shared/{index-BtVOr8mn.js → index-Cwxbl_pY.js} +1 -1
  116. package/dist/packem_shared/index-Doab17tq.js +1 -0
  117. package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-C-_5cgwu.js → isAccessibleSync-DYKTrrvc-CBsMZhj-.js} +1 -1
  118. package/dist/packem_shared/{lifecycle-CQjeMPY0.js → lifecycle-Gy7mqMGg.js} +2 -2
  119. package/dist/packem_shared/{lockfile-CiUtEbnt.js → lockfile-DEWjBrlY.js} +1 -1
  120. package/dist/packem_shared/manifests-kE5OweNT.js +1 -0
  121. package/dist/packem_shared/{min-release-age-JViyQuBM.js → min-release-age-yvuPbJ8G.js} +1 -1
  122. package/dist/packem_shared/missing-package-json-CEEPXqYi.js +1 -0
  123. package/dist/packem_shared/{multi-eco-lockfiles-h_HBOpPX.js → multi-eco-lockfiles-D5tM7pkg.js} +1 -1
  124. package/dist/packem_shared/{native-config-sync-TdTWjVgI.js → native-config-sync-DDGt3vvd.js} +1 -1
  125. package/dist/packem_shared/{npmrc-CHsOyMvA.js → npmrc-CIvOb61L.js} +1 -1
  126. package/dist/packem_shared/{osv-BLj4LauP.js → osv-4kFhXIoW.js} +1 -1
  127. package/dist/packem_shared/osv-bloom-DU6avR2k.js +2 -0
  128. package/dist/packem_shared/package-version-x7sPg2TM.js +4 -0
  129. package/dist/packem_shared/packument-Dg8cIDYR.js +1 -0
  130. package/dist/packem_shared/{pm-runner-RM72mDZg.js → pm-runner-Dboj-wZG.js} +1 -1
  131. package/dist/packem_shared/{project-name-filter-C6ObyhZ4.js → project-name-filter-B3tKt-Pf.js} +1 -1
  132. package/dist/packem_shared/{provenance-SX1MxPUZ.js → provenance-BG5mu0H_.js} +1 -1
  133. package/dist/packem_shared/registry-CndByNx9.js +85 -0
  134. package/dist/packem_shared/registry-keys-CE-RZlp_.js +1 -0
  135. package/dist/packem_shared/{removeSync-g1D5kONg-LbjATA8v.js → removeSync-g1D5kONg-jOsRSIIv.js} +1 -1
  136. package/dist/packem_shared/{renderToString-DR0zDUjh-5WQEQBtg.js → renderToString-DR0zDUjh-DeiCwydO.js} +1 -1
  137. package/dist/packem_shared/{resolve-explicit-D9kdTNvl.js → resolve-explicit-Cge6eKPt.js} +1 -1
  138. package/dist/packem_shared/{resolve-runtime-DNukUjIr.js → resolve-runtime-D8rxuo3J.js} +1 -1
  139. package/dist/packem_shared/run-CKL4VGzQ.js +10 -0
  140. package/dist/packem_shared/{run-file-UBukWaha.js → run-file-D1mlOnd8.js} +1 -1
  141. package/dist/packem_shared/{run-summary-utils-CMeURYtS.js → run-summary-utils-DbyeUM6f.js} +1 -1
  142. package/dist/packem_shared/runtime-check-Dw0q3X67.js +1 -0
  143. package/dist/packem_shared/s1ngularity-BOl0c716.js +1 -0
  144. package/dist/packem_shared/{scaffold-files-02tUvEKC.js → scaffold-files-B8zMyMvq.js} +1 -1
  145. package/dist/packem_shared/{scan-progress-D_POj2sy.js → scan-progress-CY3XIDOY.js} +1 -1
  146. package/dist/packem_shared/selectors-BB0yaWyK.js +3 -0
  147. package/dist/packem_shared/{signatures-CeL0bOEo.js → signatures-r1SeDHLL.js} +1 -1
  148. package/dist/packem_shared/spinner-B_rRdoro.js +1 -0
  149. package/dist/packem_shared/{table-bf3rvDd-.js → table-bu4cV-it.js} +1 -1
  150. package/dist/packem_shared/{tabs-CvrVM8BU.js → tabs-A2EUpTHt.js} +1 -1
  151. package/dist/packem_shared/target-merge-ya19LiWB.js +1 -0
  152. package/dist/packem_shared/{target-options-DsHFmRZH.js → target-options-rIthWS4M.js} +1 -1
  153. package/dist/packem_shared/{task-env-C2lmxvzA.js → task-env-Cl4jNMCR.js} +1 -1
  154. package/dist/packem_shared/toolchain-Bt93i37e.js +5 -0
  155. package/dist/packem_shared/typosquats-BbebOgKM.js +1 -0
  156. package/dist/packem_shared/{use-measured-height-CQ-qYCmz.js → use-measured-height-CwhybDI9.js} +1 -1
  157. package/dist/packem_shared/{verify-B_MblU_Q.js → verify-3WE9U_Bv.js} +1 -1
  158. package/dist/packem_shared/{vis-update-app-a93HLRLX.js → vis-update-app-PjJWvxqF.js} +1 -1
  159. package/dist/packem_shared/{vis-user-error-Cpb0P6VA.js → vis-user-error-BivZDkQD.js} +2 -2
  160. package/dist/packem_shared/{watch-CcTketln.js → watch-C-9-PD2m.js} +1 -1
  161. package/dist/packem_shared/{watch-loop-CGPe21AK.js → watch-loop-dWYGUQwi.js} +1 -1
  162. package/dist/release/plugin-sdk.d.ts +32 -0
  163. package/dist/release/presets.d.ts +38 -0
  164. package/dist/runtime/preload.js +1 -1
  165. package/index.js +26 -26
  166. package/package.json +19 -15
  167. package/schemas/vis-config.schema.json +12 -0
  168. package/dist/packem_shared/advisories-BKsh48bi.js +0 -1
  169. package/dist/packem_shared/affected-selection-C7rvg_xC.js +0 -1
  170. package/dist/packem_shared/ai-cache-iSIyY3So.js +0 -1
  171. package/dist/packem_shared/build-scripts-CEDx_nJp.js +0 -1
  172. package/dist/packem_shared/detect-CbMRSXkM.js +0 -1
  173. package/dist/packem_shared/env-BSXG3QKH.js +0 -4
  174. package/dist/packem_shared/env-consistency-B4rU4MQb.js +0 -1
  175. package/dist/packem_shared/glob-Cyk1H9ZL-DlsGNNhY.js +0 -1
  176. package/dist/packem_shared/index-BS3mFsh-.js +0 -1
  177. package/dist/packem_shared/manifests-Du4yKlf_.js +0 -1
  178. package/dist/packem_shared/missing-package-json-DDVQ_scH.js +0 -1
  179. package/dist/packem_shared/osv-bloom-BCAX5ARR.js +0 -2
  180. package/dist/packem_shared/package-version-D0b8b41D.js +0 -4
  181. package/dist/packem_shared/packument-CbTmbHU4.js +0 -1
  182. package/dist/packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js +0 -1
  183. package/dist/packem_shared/registry-B6LWRK9T.js +0 -81
  184. package/dist/packem_shared/registry-keys-z038Ecb4.js +0 -1
  185. package/dist/packem_shared/run-DLvd3RIZ.js +0 -10
  186. package/dist/packem_shared/runtime-check-D3cRDuoi.js +0 -1
  187. package/dist/packem_shared/s1ngularity-BuU9Cxpy.js +0 -1
  188. package/dist/packem_shared/selectors-edwcgNl3.js +0 -3
  189. package/dist/packem_shared/spinner-8fJUI_wl.js +0 -1
  190. package/dist/packem_shared/target-merge-DVJl-7Qz.js +0 -4
  191. package/dist/packem_shared/toolchain-CP79HNVy.js +0 -5
  192. package/dist/packem_shared/typosquats-BFKus_aM.js +0 -1
  193. package/dist/packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js +0 -1
@@ -0,0 +1 @@
1
+ import{createRequire as W}from"node:module";import{e as h}from"./index-0dnGN3GP.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as O}from"./package-version-x7sPg2TM.js";let S;const B=e=>(S??=W(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,n]=_.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return _.getBuiltinModule(e)}return B(e)},{readdirSync:y,statSync:M}=w("node:fs"),P=["preinstall","install","postinstall","prepare"],$=e=>{const s=h(e,"node_modules");if(!g(s))return[];const n=new Map,o=(p,f="")=>{let l;try{l=y(p)}catch{return}for(const r of l){const i=h(p,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&f===""){let u;try{u=y(i)}catch{continue}for(const a of u){const c=h(i,a,"node_modules");g(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=f+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!g(t))continue;const u=O(t),a=u.scripts??{},c=P.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&g(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof u.version=="string"?u.version:void 0});const d=h(i,"node_modules");g(d)&&o(d)}catch{}}};return o(s),[...n.values()]},b=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},k=(e,s,n)=>{for(const[o,p]of Object.entries(s)){if(!p)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:f,version:l}=b(o);if(f===e.name&&(!n||l===void 0||e.version===l))return!0}return!1},q=(e,s,n={})=>{const o=n.pinVersions===!0,p=$(e),f=[],l=[],r=new Map(p.map(t=>[t.name,t]));for(const t of p)k(t,s,o)?l.push(t):f.push(t);const i=[],m=[];for(const[t,u]of Object.entries(s)){if(!u)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(j=>j.startsWith(v))||i.push(t);continue}const{name:a,version:c}=b(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:l,unapproved:f,versionDrift:m}},T=(e,s)=>q(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{q as a,T as s};
@@ -1 +1 @@
1
- import{r}from"./resolve-runtime-DNukUjIr.js";const t=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const n=e.runtime;if(typeof n=="string")return n}},u=(e,n)=>r(n,{config:e.visConfig?.runtime,flag:t(e.options)}),m=e=>e.runtime==="bun"?"bun":void 0;export{m as a,u as r};
1
+ import{r}from"./resolve-runtime-D8rxuo3J.js";const t=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const n=e.runtime;if(typeof n=="string")return n}},u=(e,n)=>r(n,{config:e.visConfig?.runtime,flag:t(e.options)}),m=e=>e.runtime==="bun"?"bun":void 0;export{m as a,u as r};
@@ -1 +1 @@
1
- import{e as l,z as d}from"./index-BzhrR_iC.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{h as g,i as D}from"./registry-B6LWRK9T.js";import{y as S}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const k={vite:"Separate vite copies each load their own plugin and config state. Pin one version with a package manager override.",vitest:"Separate vitest copies each keep their own expect, mocks and runner state. Pin one version with a package manager override."},P={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},b=t=>{const o=P[t];return o?[...o.aliases??[],o.file].map(n=>({file:n,type:o.type})):[]},h=(t,o)=>{const n=b(o);if(n.length!==0)return n.find(r=>S(l(t,r.file)))??n[n.length-1]},v=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],n=v(l(t,"package.json"));n&&o.push(n);const r=g(t);let c;if(r?c=r:n?.workspaces&&(Array.isArray(n.workspaces)?c=n.workspaces:n.workspaces.packages&&(c=n.workspaces.packages)),!c)return o;const i=D(t,c);for(const s of i){const e=v(l(t,s,"package.json"));e&&o.push(e)}return o},w=(t,o)=>{const n=new Set,r=[],c=new Map;for(const s of o){const e=c.get(s.name);e?e.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const e of Object.keys(s))n.has(e)||(n.add(e),r.push(e))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),e=c.get(s);if(e){for(const a of e)for(const f of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(f)for(const p of Object.keys(f))n.has(p)||(n.add(p),r.push(p))}}return n},L=(t,o,n={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const e=n.includeDev??!0?void 0:w(t,i),a=new Set,f=[];for(const p of i){if(e&&!e.has(p.name))continue;const u=`${p.name}@${p.version}`;a.has(u)||(a.add(u),f.push({isDev:!1,name:p.name,version:p.version}))}return f},O=(t,o)=>{const n=h(t,o);if(!n)return[];let r;try{r=d(l(t,n.file))}catch{return[]}const c=m(r,n.type);if(c.length===0)return[];const i=new Map;for(const e of c)i.has(e.name)||i.set(e.name,new Set),i.get(e.name).add(e.version);const s=[];for(const[e,a]of i){if(a.size<=1)continue;const f={name:e,versions:[...a]};k[e]&&(f.hint=k[e]),s.push(f)}return s.sort((e,a)=>e.name.localeCompare(a.name))},M=(t,o)=>{const n=h(t,o);if(!n)return;let r;try{r=d(l(t,n.file))}catch{return}const c=m(r,n.type);if(c.length===0)return;const i=[],s=new Set;for(const e of y(t))for(const a of[e.dependencies,e.devDependencies,e.peerDependencies,e.optionalDependencies])if(a)for(const[f,p]of Object.entries(a)){const u=`${f}@${p}`;s.has(u)||(s.add(u),i.push({name:f,version:p}))}return{entries:c,roots:i}};export{P as L,M as a,O as f,L as l,h as r};
1
+ import{e as l,z as d}from"./index-0dnGN3GP.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{h as g,i as D}from"./registry-CndByNx9.js";import{y as S}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";const k={vite:"Separate vite copies each load their own plugin and config state. Pin one version with a package manager override.",vitest:"Separate vitest copies each keep their own expect, mocks and runner state. Pin one version with a package manager override."},P={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},b=t=>{const o=P[t];return o?[...o.aliases??[],o.file].map(n=>({file:n,type:o.type})):[]},h=(t,o)=>{const n=b(o);if(n.length!==0)return n.find(r=>S(l(t,r.file)))??n[n.length-1]},v=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],n=v(l(t,"package.json"));n&&o.push(n);const r=g(t);let c;if(r?c=r:n?.workspaces&&(Array.isArray(n.workspaces)?c=n.workspaces:n.workspaces.packages&&(c=n.workspaces.packages)),!c)return o;const i=D(t,c);for(const s of i){const e=v(l(t,s,"package.json"));e&&o.push(e)}return o},w=(t,o)=>{const n=new Set,r=[],c=new Map;for(const s of o){const e=c.get(s.name);e?e.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const e of Object.keys(s))n.has(e)||(n.add(e),r.push(e))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),e=c.get(s);if(e){for(const a of e)for(const f of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(f)for(const p of Object.keys(f))n.has(p)||(n.add(p),r.push(p))}}return n},L=(t,o,n={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const e=n.includeDev??!0?void 0:w(t,i),a=new Set,f=[];for(const p of i){if(e&&!e.has(p.name))continue;const u=`${p.name}@${p.version}`;a.has(u)||(a.add(u),f.push({isDev:!1,name:p.name,version:p.version}))}return f},O=(t,o)=>{const n=h(t,o);if(!n)return[];let r;try{r=d(l(t,n.file))}catch{return[]}const c=m(r,n.type);if(c.length===0)return[];const i=new Map;for(const e of c)i.has(e.name)||i.set(e.name,new Set),i.get(e.name).add(e.version);const s=[];for(const[e,a]of i){if(a.size<=1)continue;const f={name:e,versions:[...a]};k[e]&&(f.hint=k[e]),s.push(f)}return s.sort((e,a)=>e.name.localeCompare(a.name))},M=(t,o)=>{const n=h(t,o);if(!n)return;let r;try{r=d(l(t,n.file))}catch{return}const c=m(r,n.type);if(c.length===0)return;const i=[],s=new Set;for(const e of y(t))for(const a of[e.dependencies,e.devDependencies,e.peerDependencies,e.optionalDependencies])if(a)for(const[f,p]of Object.entries(a)){const u=`${f}@${p}`;s.has(u)||(s.add(u),i.push({name:f,version:p}))}return{entries:c,roots:i}};export{P as L,M as a,O as f,L as l,h as r};
@@ -0,0 +1 @@
1
+ import{e as c}from"./index-0dnGN3GP.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as i}from"./package-version-x7sPg2TM.js";const g=(n,e)=>{for(const o of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const t=n[o];if(t&&typeof t[e]=="string")return t[e]}},k=(n,e)=>{for(const o of e){const t=c(n,o);if(a(t))return t}},d=n=>{const e=c(n,"package.json");if(!a(e))return{};try{return i(e)}catch{return{}}},l=(n,e)=>{const o=d(n),t=new Map;for(const r of e){const s=r.detect(n,o);s&&t.set(r.id,s)}return t};export{l as a,g as d,k as f,d as r};
@@ -1,4 +1,4 @@
1
- import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-BzhrR_iC.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ns}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{U as ut,h as lo}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let Zs;const eo=a=>(Zs??=Xs(import.meta.url))(a),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=a=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[g,C]=zr.versions.node.split(".").map(Number);if(g>22||g===22&&C>=3||g===20&&C>=16)return zr.getBuiltinModule(a)}return eo(a)},{rmSync:ki,existsSync:es,readFileSync:at,cpSync:rs,lstatSync:no,readdirSync:io}=ro("node:fs");class Ze extends Error{constructor(g){super(g),this.name="LockfilePruneError"}}const is=a=>{let g=a.startsWith("/")?a.slice(1):a;const C=g.indexOf("(");return C!==-1&&(g=g.slice(0,C)),g},co=(a,g)=>{if(!(g.startsWith("link:")||g.startsWith("file:")||g.startsWith("workspace:")))return`${a}@${g}`},ao=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))h?.version&&g.push({name:s,version:h.version});return g},pt=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,version:h});return g},ht=a=>{const g=new Map;if(!a)return g;for(const C of Object.keys(a)){const s=is(C),h=g.get(s);h?h.push(C):g.set(s,[C])}return g},ts=a=>{const g=a.displayName??"pnpm-lock.yaml",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=so(C)}catch(V){throw new Ze(`${g}: parse failed — ${V.message}`)}const h=V=>V.packages?Object.keys(V.packages).length:0;let e;for(const V of s){const[ne]=V.errors;if(ne)throw new Ze(`${g}: parse failed — ${ne.message}`);const M=V.toJS();if(!M||typeof M!="object")continue;const le=M;(e===void 0||h(le)>h(e))&&(e=le)}if(e===void 0)throw new Ze(`${g}: top-level value is not an object`);const d=e.importers??{},w=ht(e.packages),m=ht(e.snapshots),A=new Set(["."]);for(const V of a.closure)A.add(V.relativeRoot===""?".":V.relativeRoot);const x={};for(const[V,ne]of Object.entries(d))A.has(V)&&(x[V]=ne);const Y=new Set,y=new Set,v=[];for(const V of Object.values(x))for(const ne of ao(V))v.push(ne);for(;v.length>0;){const{name:V,version:ne}=v.shift(),M=co(V,ne);if(!M)continue;const le=is(M),we=m.get(le)??m.get(M)??[];for(const ve of we){if(y.has(ve))continue;y.add(ve);const Se=e.snapshots?.[ve];if(Se)for(const xe of pt(Se))v.push(xe)}const ge=w.get(le)??w.get(M)??[];for(const ve of ge){if(Y.has(ve))continue;Y.add(ve);const Se=e.packages?.[ve];if(Se&&!e.snapshots)for(const xe of pt(Se))v.push(xe)}}const $={lockfileVersion:e.lockfileVersion};for(const V of["settings","overrides","patchedDependencies","catalogs"])e[V]!==void 0&&($[V]=e[V]);if($.importers=x,e.packages){const V={};for(const ne of Object.keys(e.packages))Y.has(ne)&&(V[ne]=e.packages[ne]);$.packages=V}if(e.snapshots){const V={};for(const ne of Object.keys(e.snapshots))y.has(ne)&&(V[ne]=e.snapshots[ne]);$.snapshots=V}const P=Object.keys(e.packages??{}).length,ie=Object.keys($.packages??{}).length,oe=P-ie,R=Object.keys(d).length-Object.keys(x).length;return{content:oo($,{lineWidth:0}),message:`${g}: kept ${ie}/${P} packages and ${Object.keys(x).length} importers (dropped ${oe} packages, ${R} importers)`,status:"pruned"}},uo=a=>ts({...a,displayName:a.displayName??"aube-lock.yaml"}),po=a=>{let g="",C=!1,s=!1,h=!1;for(let e=0;e<a.length;e+=1){const d=a[e],w=a[e+1];if(s){d===`
1
+ import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-0dnGN3GP.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ns}from"./package-version-x7sPg2TM.js";import{U as ut,h as lo}from"./env-BymuoTL8.js";let Zs;const eo=a=>(Zs??=Xs(import.meta.url))(a),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=a=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[g,C]=zr.versions.node.split(".").map(Number);if(g>22||g===22&&C>=3||g===20&&C>=16)return zr.getBuiltinModule(a)}return eo(a)},{rmSync:ki,existsSync:es,readFileSync:at,cpSync:rs,lstatSync:no,readdirSync:io}=ro("node:fs");class Ze extends Error{constructor(g){super(g),this.name="LockfilePruneError"}}const is=a=>{let g=a.startsWith("/")?a.slice(1):a;const C=g.indexOf("(");return C!==-1&&(g=g.slice(0,C)),g},co=(a,g)=>{if(!(g.startsWith("link:")||g.startsWith("file:")||g.startsWith("workspace:")))return`${a}@${g}`},ao=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))h?.version&&g.push({name:s,version:h.version});return g},pt=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,version:h});return g},ht=a=>{const g=new Map;if(!a)return g;for(const C of Object.keys(a)){const s=is(C),h=g.get(s);h?h.push(C):g.set(s,[C])}return g},ts=a=>{const g=a.displayName??"pnpm-lock.yaml",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=so(C)}catch(V){throw new Ze(`${g}: parse failed — ${V.message}`)}const h=V=>V.packages?Object.keys(V.packages).length:0;let e;for(const V of s){const[ne]=V.errors;if(ne)throw new Ze(`${g}: parse failed — ${ne.message}`);const M=V.toJS();if(!M||typeof M!="object")continue;const le=M;(e===void 0||h(le)>h(e))&&(e=le)}if(e===void 0)throw new Ze(`${g}: top-level value is not an object`);const d=e.importers??{},w=ht(e.packages),m=ht(e.snapshots),A=new Set(["."]);for(const V of a.closure)A.add(V.relativeRoot===""?".":V.relativeRoot);const x={};for(const[V,ne]of Object.entries(d))A.has(V)&&(x[V]=ne);const Y=new Set,y=new Set,v=[];for(const V of Object.values(x))for(const ne of ao(V))v.push(ne);for(;v.length>0;){const{name:V,version:ne}=v.shift(),M=co(V,ne);if(!M)continue;const le=is(M),we=m.get(le)??m.get(M)??[];for(const ve of we){if(y.has(ve))continue;y.add(ve);const Se=e.snapshots?.[ve];if(Se)for(const xe of pt(Se))v.push(xe)}const ge=w.get(le)??w.get(M)??[];for(const ve of ge){if(Y.has(ve))continue;Y.add(ve);const Se=e.packages?.[ve];if(Se&&!e.snapshots)for(const xe of pt(Se))v.push(xe)}}const $={lockfileVersion:e.lockfileVersion};for(const V of["settings","overrides","patchedDependencies","catalogs"])e[V]!==void 0&&($[V]=e[V]);if($.importers=x,e.packages){const V={};for(const ne of Object.keys(e.packages))Y.has(ne)&&(V[ne]=e.packages[ne]);$.packages=V}if(e.snapshots){const V={};for(const ne of Object.keys(e.snapshots))y.has(ne)&&(V[ne]=e.snapshots[ne]);$.snapshots=V}const P=Object.keys(e.packages??{}).length,ie=Object.keys($.packages??{}).length,oe=P-ie,R=Object.keys(d).length-Object.keys(x).length;return{content:oo($,{lineWidth:0}),message:`${g}: kept ${ie}/${P} packages and ${Object.keys(x).length} importers (dropped ${oe} packages, ${R} importers)`,status:"pruned"}},uo=a=>ts({...a,displayName:a.displayName??"aube-lock.yaml"}),po=a=>{let g="",C=!1,s=!1,h=!1;for(let e=0;e<a.length;e+=1){const d=a[e],w=a[e+1];if(s){d===`
2
2
  `&&(s=!1,g+=d);continue}if(h){d==="*"&&w==="/"&&(h=!1,e+=1);continue}if(C){if(d==="\\"){g+=d,w!==void 0&&(g+=w,e+=1);continue}d==='"'&&(C=!1),g+=d;continue}if(d==='"'){C=!0,g+=d;continue}if(d==="/"&&w==="/"){s=!0,e+=1;continue}if(d==="/"&&w==="*"){h=!0,e+=1;continue}g+=d}return g},ho=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},go=a=>{for(const g of a)if(typeof g=="object"&&!Array.isArray(g))return g},mo=a=>{if(!a)return[];const g=[];for(const C of["dependencies","optionalDependencies","peerDependencies"]){const s=a[C];s!==null&&typeof s=="object"&&!Array.isArray(s)&&g.push(...Object.keys(s))}return g},yo=a=>{if(Buffer.isBuffer(a.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const g=po(a.lockfileContent);let C;try{C=JSON.parse(g)}catch(P){throw new Ze(`bun.lock: parse failed — ${P.message}`)}if(!C||typeof C!="object")throw new Ze("bun.lock: top-level value is not an object");const s=C.workspaces??{},h=C.packages??{},e=new Set([""]);for(const P of a.closure)e.add(P.relativeRoot===""?"":P.relativeRoot);const d={},w=[];for(const[P,ie]of Object.entries(s))e.has(P)&&(d[P]=ie,w.push(...ho(ie)));const m=new Set;for(const{name:P}of w)m.add(P);const A=[...m];for(;A.length>0;){const P=A.shift();for(const ie of Object.keys(h)){if(ie.split("/")[0]!==P&&ie!==P)continue;const R=go(h[ie]);for(const V of mo(R))m.has(V)||(m.add(V),A.push(V))}}const x={};for(const[P,ie]of Object.entries(h)){const oe=P.split("/")[0];(m.has(oe)||m.has(P))&&(x[P]=ie)}const Y={...C,packages:x,workspaces:d},y=Object.keys(h).length,v=Object.keys(x).length,$=y-v;return{content:`${JSON.stringify(Y,null,2)}
3
3
  `,message:`bun.lock: kept ${v}/${y} packages (dropped ${$})`,status:"pruned"}},Jn="node_modules/",$o=(a,g,C)=>{let s=g;for(;;){const h=s===""?`${Jn}${C}`:`${s}/${Jn}${C}`;if(a[h]!==void 0)return h;if(s==="")return;const e=s.lastIndexOf(`/${Jn.slice(0,-1)}/`);s=e===-1?"":s.slice(0,e)}},vo=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const s of Object.keys(C))g.push(s);return g},Ao=a=>{const g=a.displayName??"package-lock.json",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=JSON.parse(C)}catch($){throw new Ze(`${g}: parse failed — ${$.message}`)}if(!s||typeof s!="object")throw new Ze(`${g}: top-level value is not an object`);const h=s.packages??{},e=new Set([""]);for(const $ of a.closure)$.relativeRoot!==""&&e.add($.relativeRoot);const d=new Set,w=[];for(const $ of Object.keys(h))e.has($)&&(d.add($),w.push($));for(const[$,P]of Object.entries(h))P.link===!0&&typeof P.resolved=="string"&&e.has(P.resolved)&&d.add($);for(;w.length>0;){const $=w.shift(),P=h[$];if(P)for(const ie of vo(P)){const oe=$o(h,$,ie);if(!oe||d.has(oe))continue;d.add(oe);const R=h[oe];R.link===!0&&typeof R.resolved=="string"&&h[R.resolved]!==void 0&&!d.has(R.resolved)?(d.add(R.resolved),w.push(R.resolved)):w.push(oe)}}const m={};for(const $ of Object.keys(h))d.has($)&&(m[$]=h[$]);const A=m[""];A&&Array.isArray(A.workspaces)&&(A.workspaces=A.workspaces.filter($=>{if(typeof $!="string")return!1;const P=$.replace(/\/?\*+$/,"").replace(/\/$/,"");if(P===""||P==="*")return!0;for(const ie of e)if(ie===$||ie===P||ie.startsWith(`${P}/`))return!0;return!1}));const x={...s,packages:m};delete x.dependencies;const Y=Object.keys(h).length,y=Object.keys(m).length,v=Y-y;return{content:`${JSON.stringify(x,null,2)}
4
4
  `,message:`${g}: kept ${y}/${Y} entries (dropped ${v})`,status:"pruned"}};var Qn={},Fe={},zn,gt;function wo(){if(gt)return zn;gt=1;function a(s,h){function e(){this.constructor=s}e.prototype=h.prototype,s.prototype=new e}function g(s,h,e,d){this.message=s,this.expected=h,this.found=e,this.location=d,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,g)}a(g,Error),g.buildMessage=function(s,h){var e={literal:function(y){return'"'+w(y.text)+'"'},class:function(y){var v="",$;for($=0;$<y.parts.length;$++)v+=y.parts[$]instanceof Array?m(y.parts[$][0])+"-"+m(y.parts[$][1]):m(y.parts[$]);return"["+(y.inverted?"^":"")+v+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function d(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function A(y){return e[y.type](y)}function x(y){var v=new Array(y.length),$,P;for($=0;$<y.length;$++)v[$]=A(y[$]);if(v.sort(),v.length>0){for($=1,P=1;$<v.length;$++)v[$-1]!==v[$]&&(v[P]=v[$],P++);v.length=P}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function Y(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+x(s)+" but "+Y(h)+" found."};function C(s,h){h=h!==void 0?h:{};var e={},d={Start:Vi},w=Vi,m=function(r){return r||[]},A=function(r,t,o){return[{command:r,type:t}].concat(o||[])},x=function(r,t){return[{command:r,type:t||";"}]},Y=function(r){return r},y=";",v=ce(";",!1),$="&",P=ce("&",!1),ie=function(r,t){return t?{chain:r,then:t}:{chain:r}},oe=function(r,t){return{type:r,line:t}},R="&&",V=ce("&&",!1),ne="||",M=ce("||",!1),le=function(r,t){return t?{...r,then:t}:r},we=function(r,t){return{type:r,chain:t}},ge="|&",ve=ce("|&",!1),Se="|",xe=ce("|",!1),je="=",Be=ce("=",!1),$e=function(r,t){return{name:r,args:[t]}},Ne=function(r){return{name:r,args:[]}},Qe="(",Ee=ce("(",!1),re=")",Ie=ce(")",!1),De=function(r,t){return{type:"subshell",subshell:r,args:t}},Oe="{",Pe=ce("{",!1),_e="}",B=ce("}",!1),G=function(r,t){return{type:"group",group:r,args:t}},X=function(r,t){return{type:"command",args:t,envs:r}},me=function(r){return{type:"envs",envs:r}},qe=function(r){return r},ze=function(r){return r},Me=/^[0-9]/,Ye=We([["0","9"]],!1,!1),er=function(r,t,o){return{type:"redirection",subtype:t,fd:r!==null?parseInt(r):null,args:[o]}},or=">>",hr=ce(">>",!1),fr=">&",lr=ce(">&",!1),Cr=">",gr=ce(">",!1),Ke="<<<",rr=ce("<<<",!1),Ge="<&",dr=ce("<&",!1),mr="<",yr=ce("<",!1),Ue=function(r){return{type:"argument",segments:[].concat(...r)}},n=function(r){return r},k="$'",j=ce("$'",!1),J="'",l=ce("'",!1),b=function(r){return[{type:"text",text:r}]},E='""',T=ce('""',!1),O=function(){return{type:"text",text:""}},q='"',U=ce('"',!1),N=function(r){return r},Z=function(r){return{type:"arithmetic",arithmetic:r,quoted:!0}},Q=function(r){return{type:"shell",shell:r,quoted:!0}},ae=function(r){return{type:"variable",...r,quoted:!0}},de=function(r){return{type:"text",text:r}},se=function(r){return{type:"arithmetic",arithmetic:r,quoted:!1}},En=function(r){return{type:"shell",shell:r,quoted:!1}},kn=function(r){return{type:"variable",...r,quoted:!1}},tn=function(r){return{type:"glob",pattern:r}},jr=/^[^']/,Fr=We(["'"],!0,!1),$r=function(r){return r.join("")},sn=/^[^$"]/,on=We(["$",'"'],!0,!1),Kr=`\\
@@ -1,4 +1,4 @@
1
- import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-h_HBOpPX.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-Cpb0P6VA.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
1
+ import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-0dnGN3GP.js";import{r as qe}from"./docker-vRDm2lHX.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-D5tM7pkg.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./package-version-x7sPg2TM.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-BivZDkQD.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
2
2
  `:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
3
3
  ${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
4
4
  `)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
@@ -0,0 +1,4 @@
1
+ import{createRequire as oe}from"node:module";import{n as q,C as ue,o as le,m as de,e as f}from"./index-0dnGN3GP.js";import{y as B}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ye}from"./package-version-x7sPg2TM.js";let ce;const ae=e=>(ce??=oe(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return ae(e)},{createRequire:N}=x("node:module"),{existsSync:fe,readdirSync:G,statSync:pe,rmSync:Y,writeFileSync:he}=x("node:fs"),{spawn:O}=x("node:child_process"),{createHash:we}=x("node:crypto"),{homedir:me,platform:ge}=x("node:os");let Se=class extends Error{constructor(n){super(`EEXIST: ${n}`)}get code(){return"EEXIST"}set code(n){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(n){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const L=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let $e;const Ee=e=>($e??=N(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[n,t]=$.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return $.getBuiltinModule(e)}return Ee(e)},{lstatSync:P,mkdirSync:xe}=be("node:fs"),ve=e=>{q(e);try{const n=P(e);if(!n.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(n))}'`);return}catch(n){if(n.code!=="ENOENT")throw n}try{xe(e,{recursive:!0})}catch(n){if(n.code!=="EEXIST")throw n;const t=P(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(t))}'`,{cause:n})}},ke=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Te;const Ie=e=>(Te??=N(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[n,t]=E.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return E.getBuiltinModule(e)}return Ie(e)},{randomBytes:Be}=Re("node:crypto"),We=e=>`${e}.${process.pid.toString(36)}.${Be(6).toString("hex")}.tmp`,Ae=new TextEncoder,Me=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ae.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let _e;const Ce=e=>(_e??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,t]=b.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return b.getBuiltinModule(e)}return Ce(e)},{mkdirSync:Fe,readFileSync:je,writeFileSync:De,statSync:Oe,renameSync:V,chownSync:Le,chmodSync:Pe,unlinkSync:Ve}=Ne("node:fs"),jt=(e,n,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},q(e),ke(n),e=ue(e);const i=B(e,le),c=t.flag??"w",a=c.includes("a"),s=c.includes("x");if(i&&(!t.overwrite||s))throw new Se(`file already exists, open '${e}'`);const r=We(e);try{!i&&t.recursive&&Fe(de(e),{recursive:!0});let o,u=typeof n=="string"?Buffer.from(n,t.encoding??"utf8"):Me(n);if(a&&i&&(u=Buffer.concat([je(e),u])),De(r,u,{flag:"wx"}),i&&t.backup&&(o=Oe(e),t.chown??={gid:o.gid,uid:o.uid},V(e,`${e}.bak`)),t.chown)try{Le(r,t.chown.uid,t.chown.gid)}catch{}const d=o&&t.mode===void 0?o.mode:t.mode;d!==void 0&&Pe(r,d),V(r,e)}catch(o){throw new Error(`Failed to write file at: ${e} - ${o.message}`,{cause:o})}finally{B(r)&&Ve(r)}},ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ue=12288,He=65510,Ke=[12288,12288,65281,65376,65504,65510],qe=8361,Ge=65518,Ye=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Xe=32,Je=10630,Ze=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Qe=4352,et=262141,X=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],v=(e,n)=>{let t=0,i=Math.floor(e.length/2)-1;for(;t<=i;){const c=Math.floor((t+i)/2),a=c*2;if(n<e[a])i=c-1;else if(n>e[a+1])t=c+1;else return!0}return!1},z=19968,[tt,nt]=st(X);function st(e){let n=e[0],t=e[1];for(let i=0;i<e.length;i+=2){const c=e[i],a=e[i+1];if(z>=c&&z<=a)return[c,a];a-c>t-n&&(n=c,t=a)}return[n,t]}const it=e=>e<161||e>1114109?!1:v(ze,e),rt=e=>e<Ue||e>He?!1:v(Ke,e),ot=e=>e<qe||e>Ge?!1:v(Ye,e),ct=e=>e<Xe||e>Je?!1:v(Ze,e),at=e=>e>=tt&&e<=nt?!0:e<Qe||e>et?!1:v(X,e);function ut(e){return it(e)?"ambiguous":rt(e)?"fullwidth":ot(e)?"halfwidth":ct(e)?"narrow":at(e)?"wide":"neutral"}function lt(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function J(e){return lt(e),ut(e)}const Z=String.raw,U=Z`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dt=()=>new RegExp(Z`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${U}(?:\u200D${U})*`,"gu"),Dt=new Set(["\x1B","›"]),Ot="\x07",Lt="]8;;",Pt=/[\u200B\uFEFF\u2060-\u2064]/g,Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,Vt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,zt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,T=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ee=dt(),Ut=/[-_./\s]+/g,Ht=/(\u001B\[[0-9;]*[a-z])/i,Kt=new RegExp("\\p{Script=Arabic}","u"),qt=new RegExp("\\p{Script=Bengali}","u"),Gt=new RegExp("\\p{Script=Cyrillic}","u"),Yt=new RegExp("\\p{Script=Devanagari}","u"),Xt=new RegExp("\\p{Script=Ethiopic}","u"),Jt=new RegExp("\\p{Script=Greek}","u"),Zt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Qt=new RegExp("\\p{Script=Gujarati}","u"),en=new RegExp("\\p{Script=Gurmukhi}","u"),tn=new RegExp("\\p{Script=Hangul}","u"),nn=new RegExp("\\p{Script=Hebrew}","u"),sn=new RegExp("\\p{Script=Hiragana}","u"),rn=new RegExp("\\p{Script=Han}","u"),on=new RegExp("\\p{Script=Kannada}","u"),cn=new RegExp("\\p{Script=Katakana}","u"),an=new RegExp("\\p{Script=Khmer}","u"),un=new RegExp("\\p{Script=Lao}","u"),ln=new RegExp("\\p{Script=Latin}","u"),dn=new RegExp("\\p{Script=Malayalam}","u"),fn=new RegExp("\\p{Script=Myanmar}","u"),pn=new RegExp("\\p{Script=Oriya}","u"),hn=new RegExp("\\p{Script=Sinhala}","u"),wn=new RegExp("\\p{Script=Tamil}","u"),mn=new RegExp("\\p{Script=Telugu}","u"),gn=new RegExp("\\p{Script=Thai}","u"),yn=new RegExp("\\p{Script=Tibetan}","u"),Sn=/[\u02BB\u02BC\u0027]/u,$n=e=>e.replace(ee,""),H=new Map,ft=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),pt=e=>{const n=ft(e.width);let t=H.get(n);return t||(t=new Map,H.set(n,t)),t},I=new RegExp(Q.source,"y"),_=new RegExp(ee.source,"uy"),R=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,te=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",ht=(e,n)=>{const t=pt(n),i=Math.floor(e/65536),c=e%65536;let a=t.get(i);if(a||(a=new Map,t.set(i,a)),a.has(c))return a.get(c);let s;switch(te(e)){case"control":{s=n.width.control;break}case"latin":{s=n.width.regular;break}case"wide":{s=n.width.wide;break}case"zero":{s=0;break}default:switch(J(e)){case"ambiguous":{s=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{s=n.width.fullWidth;break}case"wide":{s=n.width.wide;break}default:s=n.width.regular}}return a.set(c,s),s},wt=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,C=(e,n={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const t={truncation:{countAnsiEscapeCodes:n.countAnsiEscapeCodes??!1,ellipsis:n.ellipsis??"",ellipsisWidth:n.ellipsisWidth??(n.ellipsis?C(n.ellipsis,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:n.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:n.ambiguousIsNarrow??!1,ansi:n.ansiWidth??0,control:n.controlWidth??0,emoji:n.emojiWidth??2,fullWidth:n.fullWidth??2,halfWidth:n.halfWidth??1,regular:n.regularWidth??1,tab:n.tabWidth??8,wide:n.wideWidth??2}},i=Math.max(0,t.truncation.limit-t.truncation.ellipsisWidth),{length:c}=e,a=c>1e4;let s=0,r=0,o=c,u=!1;const d=e.includes("\x1B")||e.includes("›");for(;s<c;){if(d&&(e[s]==="\x1B"||e[s]==="›")){if(e.startsWith("\x1B]8;;",s)){const h="\x1B]8;;\x07",w=h.length,W=e.indexOf("\x07",s+5);if(W!==-1){const A=e.indexOf(h,W+1);if(A!==-1){const ie=A+w,re=e.slice(W+1,A).replace(Q,""),D=C(re,{ambiguousIsNarrow:t.width.ambiguousIsNarrow,ansiWidth:t.width.ansi,controlWidth:t.width.control,countAnsiEscapeCodes:!1,ellipsis:t.truncation.ellipsis,ellipsisWidth:t.truncation.ellipsisWidth,emojiWidth:t.width.emoji,fullWidth:t.width.fullWidth,halfWidth:t.width.halfWidth,limit:Math.max(0,i-r),regularWidth:t.width.regular,tabWidth:t.width.tab,wideWidth:t.width.wide}),M=D.width;if(D.truncated)u=!0,o=Math.min(o,s);else if(r+M>i&&(o=Math.min(o,s),u=!0,r+M>t.truncation.limit))break;if(r+=M,s=ie,u&&r>=t.truncation.limit)break;continue}}}if(I.lastIndex=s,I.test(e)){const h=I.lastIndex-s,w=t.truncation.countAnsiEscapeCodes?h:t.width.ansi;if(r+w>i&&(o=Math.min(o,s),r+w>t.truncation.limit)){u=!0;break}r+=w,s=I.lastIndex;continue}}const l=e.codePointAt(s);if(l===8203||l===65279||l>=8288&&l<=8292){s+=1;continue}if(l===9){if(r+t.width.tab>i&&(o=Math.min(o,s),r+t.width.tab>t.truncation.limit)){u=!0;break}r+=t.width.tab,s+=1;continue}if(R.lastIndex=s,R.test(e)){const h=(R.lastIndex-s)*t.width.regular;if(r+h>i){const w=t.width.regular>0?Math.floor((i-r)/t.width.regular):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=R.lastIndex;continue}if((l<=31||l>=127&&l<=159)&&(T.lastIndex=s,T.test(e))){const h=(T.lastIndex-s)*t.width.control;if(r+h>i){const w=t.width.control>0?Math.floor((i-r)/t.width.control):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=T.lastIndex;continue}if(_.lastIndex=s,_.test(e)){if(r+t.width.emoji>i&&(o=Math.min(o,s),r+t.width.emoji>t.truncation.limit)){u=!0;break}r+=t.width.emoji,s=_.lastIndex;continue}const g=e.codePointAt(s)??0;if(wt(g)){s+=g>65535?2:1;continue}let p;if(a)p=ht(g,t);else switch(te(g)){case"control":{p=t.width.control;break}case"latin":{p=t.width.regular;break}case"wide":{p=t.width.wide;break}case"zero":{p=0;break}default:switch(J(g)){case"ambiguous":{p=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{p=t.width.fullWidth;break}case"wide":{p=t.width.wide;break}default:p=t.width.regular}}if(r+p>i&&(o=Math.min(o,s),r+p>t.truncation.limit)){u=!0;break}r+=p,s+=g>65535?2:1}let m=r,y=!1;return u&&t.truncation.limit>=t.truncation.ellipsisWidth&&(m=t.truncation.limit,y=!0),{ellipsed:y,index:u?o:c,truncated:u,width:m}},En=(e,n={})=>C(e,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,F=()=>f(me(),".vis"),mt=()=>f(F(),"cache"),bn=()=>f(F(),"state"),gt=e=>we("sha256").update(e).digest("hex").slice(0,12),xn=e=>f(F(),"workspaces",gt(e)),yt=".vis",j=e=>f(e,yt),vn="node_modules/.cache/vis",kn=e=>f(j(e),"runs"),Tn=e=>f(j(e),"last-summary.json"),In=e=>f(j(e),"last-failures"),Rn=e=>{const n=ge()==="win32";for(const t of[".task-runner",".task-runner-cache"]){const i=f(e,t);if(fe(i))try{const c=n?O("cmd.exe",["/c","rmdir","/s","/q",i],{detached:!0,stdio:"ignore"}):O("rm",["-rf",i],{detached:!0,stdio:"ignore"});c.on("error",()=>{}),c.unref()}catch{}}},St="https://api.socket.dev/v0/purl?alerts=true",k=()=>f(mt(),"socket-security"),$t=3600*1e3,ne=.4,K=100,Et=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm",bt=()=>{ve(k())},se=(e,n)=>`${encodeURIComponent(e)}@${encodeURIComponent(n)}`,xt=(e,n)=>{const t=se(e,n),i=f(k(),`${t}.json`);try{const c=ye(i);if(Date.now()-c.createdAt>c.ttlMs){Y(i,{force:!0});return}return c.report}catch{return}},vt=(e,n,t,i)=>{const c=se(e,n),a={createdAt:Date.now(),report:t,ttlMs:i};he(f(k(),`${c}.json`),JSON.stringify(a),"utf8")},kt=e=>{const n=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((n.reduce((t,i)=>t+i,0)/n.length).toFixed(2))},Tt=async(e,n={})=>{const{apiToken:t,cacheTtlMs:i=$t,timeoutMs:c=15e3}=n,a=new Map;if(e.length===0||!t)return a;const s=[];for(const u of e){const d=xt(u.name,u.version);d?a.set(`${u.name}@${u.version}`,d):s.push(u)}if(s.length===0)return a;const r=`Basic ${Buffer.from(`${t}:`).toString("base64")}`;bt();const o=[];for(let u=0;u<s.length;u+=K)o.push(s.slice(u,u+K));for(const u of o){const d=u.map(l=>({purl:`pkg:npm/${l.name}@${l.version}`})),m=new AbortController,y=setTimeout(()=>{m.abort()},c);try{const l=await fetch(St,{body:JSON.stringify({components:d}),headers:{Authorization:r,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:m.signal});if(!l.ok)continue;const g=await l.text();It(g,u,a,i)}catch{}finally{clearTimeout(y)}}return a},It=(e,n,t,i)=>{const c=new Map;for(const s of n)c.set(`${s.name}@${s.version}`,s);const a=e.split(`}
2
+ `);for(const s of a){const r=s.trim();if(r)try{const o=JSON.parse(r.endsWith("}")?r:`${r}}`),d=`${o.namespace?`${o.namespace}/`:""}${o.name}`,m=`${d}@${o.version}`;if(!c.has(m))continue;const y=o.score.overall??kt(o.score),l={alerts:o.alerts,author:o.author,id:o.id,license:o.license,name:o.name,score:{...o.score,overall:y},size:o.size,type:"npm",version:o.version};o.namespace&&(l.namespace=o.namespace),Et(l)&&(t.set(m,l),vt(d,o.version,l,i))}catch{}}},Rt=e=>e.namespace?`${e.namespace}/${e.name}`:e.name,Bn=e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical",Wn=e=>e>=.6?"green":e>=.4?"yellow":"red",An=e=>{const n=Rt(e),t=`score: ${String(Math.round(e.score.overall*100))}%`,i=e.alerts.length,c=i>0?`${String(i)} alert${i===1?"":"s"}`:"no alerts";return`${n}@${e.version} (${t}, ${c})`},Mn=(e,n=ne)=>{if(e.size===0)return"";let t=0,i=0,c=0,a=0,s=0,r=0;for(const u of e.values()){for(const d of u.alerts)switch(t++,d.severity){case"critical":{i++;break}case"high":{c++;break}case"medium":{a++;break}default:s++}u.score.overall<n&&r++}const o=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(t>0){const u=[];i>0&&u.push(`${String(i)} critical`),c>0&&u.push(`${String(c)} high`),a>0&&u.push(`${String(a)} medium`),s>0&&u.push(`${String(s)} low`),o.push(` Alerts: ${String(t)} total (${u.join(", ")})`)}else o.push(" No security alerts found.");if(r>0){const u=Math.round(n*100);o.push(` ${String(r)} package${r===1?"":"s"} with low security score (<${String(u)}%)`)}return o.join(`
3
+ `)},Bt=()=>{const e=k();if(!B(e))return 0;const n=G(e).filter(t=>t.endsWith(".json"));for(const t of n)Y(f(e,t),{force:!0});return n.length},Wt=()=>{const e=k();if(!B(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const n=G(e).filter(a=>a.endsWith(".json"));let t=0,i,c;for(const a of n){const s=pe(f(e,a));t+=s.size;const{mtimeMs:r}=s;(i===void 0||r<i)&&(i=r),(c===void 0||r>c)&&(c=r)}return{entries:n.length,newestEntry:c,oldestEntry:i,totalSizeBytes:t}},At=(e,n)=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:n??ne,timeoutMs:e.timeoutMs}:void 0,_n=(e,n,t,i)=>{if(!t)return;const c=Date.now(),a=r=>{if(r.expiresAt){const o=Date.parse(r.expiresAt);if(!Number.isNaN(o)&&o<c)return!1}return!(i&&r.policies&&!r.policies.includes(i))},s=`${e}@${n}`;if(t[s]&&a(t[s]))return t[s];if(t[e]&&a(t[e]))return t[e];for(const[r,o]of Object.entries(t))if(r.endsWith("*")&&e.startsWith(r.slice(0,-1))&&a(o))return o},Cn=(e,n,t,i)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${i}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(t)},`,' policies: ["score"],'," },"].join(`
4
+ `),Nn=(e,n={})=>{const t=At(e,n.minimumScore);if(t)return{clearCache:Bt,displayName:"Socket.dev",fetchReports:i=>Tt(i,t),getCacheStats:Wt,id:"socket"}},Fn=e=>{if(e===void 0)return!1;const n=e.trim().toLowerCase();return n!==""&&n!=="0"&&n!=="false"&&n!=="no"};export{fn as $,nn as A,Gt as B,Kt as C,vn as D,qt as E,tn as F,en as G,Yt as H,wn as I,mn as J,Zt as K,Ut as L,Qt as M,hn as N,Jt as O,on as P,gn as Q,ee as R,un as S,Ht as T,jt as U,yn as V,cn as W,Xt as X,dn as Y,Sn as Z,an as _,kn as a,pn as a0,Rn as a1,Vt as a2,zt as a3,Q as a4,C as a5,rt as a6,at as a7,Pt as a8,Dt as a9,Lt as aa,Ot as ab,Nn as ac,Mn as ad,Tn as ae,In as b,F as c,j as d,ne as e,Rt as f,mt as g,ve as h,_n as i,An as j,Bn as k,Cn as l,Fn as m,bn as n,kt as o,Tt as p,En as q,Bt as r,Wn as s,Wt as t,L as u,xn as v,$n as w,ln as x,rn as y,sn as z};
@@ -0,0 +1 @@
1
+ import{e as d,z as u}from"./index-0dnGN3GP.js";import{s as l}from"./index-B4AjSxHU.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"./package-version-x7sPg2TM.js";const v={sha1:40,sha224:56,sha256:64,sha384:96,sha512:128},p=o=>{const n=o.indexOf("+");if(n===-1)return;const t=o.slice(n+1),e=/^([a-z0-9]+)\.([0-9a-f]+)$/.exec(t),s=e?v[e[1]]:void 0;if(!(e&&s!==void 0&&e[2].length===s))return`packageManager "${o}" has a malformed integrity suffix. Expected "+<algo>.<hex>" with algo sha1, sha224, sha256, sha384 or sha512 and lowercase hex of the matching length (sha512 = 128 characters).`},k=[".nvmrc",".node-version"],y=o=>{const n=d(o,"package.json");if(!f(n))return{};try{return m(n)??{}}catch{return{}}},c=(o,n)=>{const t=[];for(const{name:e,version:s}of n){const a=typeof s=="string"&&s.trim()!==""?s.trim():"*";l.validRange(a)!==null&&t.push({name:e,range:a})}if(t.length!==0)return{entries:t,label:o,value:n.map(e=>typeof e.version=="string"&&e.version!==""?`${e.name}@${e.version}`:e.name).join(" | ")}},h=(o,n)=>{const t=Array.isArray(o)?o:[o],e=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{name:a,onFail:r,version:i}=s;typeof a!="string"||n!==void 0&&a!==n||e.push({name:a,onFail:typeof r=="string"?r:void 0,version:i})}return e},E=(o,n)=>{const t=d(o,n);if(f(t))try{const e=u(t).trim();return e===""?void 0:e}catch{return}},x=(o,n)=>{const t=[];for(const r of k){const i=E(o,r);i!==void 0&&t.push(c(r,[{name:"node",version:i}]))}const e=n.engines;e&&typeof e.node=="string"&&t.push(c("engines.node",[{name:"node",version:e.node}]));const s=n.devEngines;s?.runtime!==void 0&&t.push(c("devEngines.runtime",h(s.runtime,"node")));const a=n.volta;return a&&typeof a.node=="string"&&t.push(c("volta.node",[{name:"node",version:a.node}])),t.filter(r=>r!==void 0)},$=o=>{const n=[],t=[];if(typeof o.packageManager=="string"){const s=o.packageManager,a=p(s);a&&t.push(a);const[r]=s.split("+",1),i=/^([^@]+)@(.+)$/.exec(r??"");i&&n.push(c("packageManager",[{name:i[1],version:i[2]}]))}const e=o.devEngines;if(e?.packageManager!==void 0){const s=h(e.packageManager);n.push(c("devEngines.packageManager",s))}return{declarations:n.filter(s=>s!==void 0),integrityIssues:t}},M=(o,n)=>o.entries.some(t=>n.entries.some(e=>t.name===e.name&&l.intersects(t.range,e.range))),g=(o,n)=>{const t=[];for(let e=0;e<n.length;e++)for(let s=e+1;s<n.length;s++){const a=n[e],r=n[s];M(a,r)||t.push(`Conflicting ${o} declarations: ${a.label} (${a.value}) and ${r.label} (${r.value}) have no version in common. vis does not pick one; align them.`)}return t},P=o=>{const n=y(o),t=x(o,n),{declarations:e,integrityIssues:s}=$(n),a=t.length+e.length;if(a===0&&s.length===0)return[{id:"env-declarations",message:"No Node.js or package-manager declarations to cross-check.",status:"skip"}];const r=[...g("Node.js",t),...g("package-manager",e)].map(i=>({id:"env-conflict",message:i,status:"warn"}));for(const i of s)r.push({id:"env-integrity",message:i,status:"warn"});return r.length===0?[{id:"env-declarations",message:`Node.js and package-manager declarations agree (${a} checked).`,status:"ok"}]:r};export{P as c,h as d};
@@ -1,2 +1,2 @@
1
- import{createRequire as p}from"node:module";import{e as j}from"./index-BzhrR_iC.js";import{b as F}from"./env-BSXG3QKH.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
1
+ import{createRequire as p}from"node:module";import{e as j}from"./index-0dnGN3GP.js";import{b as F}from"./env-BymuoTL8.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
2
2
  `,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},b=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,b as l};
@@ -0,0 +1 @@
1
+ import{I as t}from"./registry-CndByNx9.js";const s=async(a,o)=>await t(a,o);export{s as l};
@@ -19,4 +19,4 @@ ${this.codeFrame}
19
19
  `+f+"}"}}return n.pop(),i=f,v}function p(o){if(o.length===0)return B(o);const f=String.fromCodePoint(o.codePointAt(0));if(!b.isIdStartChar(f))return B(o);for(let s=f.length;s<o.length;s++)if(!b.isIdContinueChar(String.fromCodePoint(o.codePointAt(s))))return B(o);return o}function l(o){if(n.indexOf(o)>=0)throw TypeError("Converting circular structure to JSON5");n.push(o);let f=i;i=i+d;let s=[];for(let v=0;v<o.length;v++){const y=A(String(v),o);s.push(y!==void 0?y:"null")}let w;if(s.length===0)w="[]";else if(d==="")w="["+s.join(",")+"]";else{let v=`,
20
20
  `+i,y=s.join(v);w=`[
21
21
  `+i+y+`,
22
- `+f+"]"}return n.pop(),i=f,w}};const j0={parse:x0,stringify:P0};var K0=j0;export{Tu as $,K as C,_u as G,R0 as L,U0 as T,H as U,_0 as _,V0 as a,Lu as b,H0 as c,t0 as d,L0 as e,K0 as f,D0 as g,I0 as h,J0 as k,T0 as l,mu as m,Gu as n,z0 as o,G0 as q,Z0 as r,M0 as t,M as v,W0 as z};
22
+ `+f+"]"}return n.pop(),i=f,w}};const j0={parse:x0,stringify:P0};var K0=j0;export{Tu as $,K as C,_u as G,R0 as L,U0 as T,H as U,_0 as _,V0 as a,Lu as b,K0 as c,t0 as d,L0 as e,H0 as f,D0 as g,I0 as h,J0 as k,T0 as l,mu as m,Gu as n,z0 as o,G0 as q,Z0 as r,M0 as t,M as v,W0 as z};
@@ -0,0 +1 @@
1
+ import{createRequire as ie}from"node:module";let ce;const le=e=>(ce??=ie(import.meta.url))(e),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[t,s]=y.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return y.getBuiltinModule(e)}return le(e)},{createRequire:ae}=pe("node:module");let fe;const ue=e=>(fe??=ae(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,V=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[t,s]=b.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return b.getBuiltinModule(e)}return ue(e)},{homedir:me,tmpdir:L}=V("node:os"),{env:A,cwd:de,platform:Z}=b,{createRequire:g}=V("node:module"),ge=0,ee=2,he=Symbol("findUpStop"),be=/^[A-Z]:\//i,x=(e="")=>e&&e.replaceAll("\\","/").replace(be,t=>t.toUpperCase()),ve=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,te=/^[A-Z]:$/i,xe=/[^/](\.[^./]+)$/,ye=/^[/\\]|^[a-z]:[/\\]/i,we=/\/$/,ke=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return x(e)}catch{}return"/"},Te=(e,t)=>{let s="",o=0,n=-1,r=0,c;for(let i=0;i<=e.length;++i){if(i<e.length)c=e[i];else{if(c==="/")break;c="/"}if(c==="/"){if(!(n===i-1||r===1))if(r===2){if(s.length<2||o!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const m=s.lastIndexOf("/");m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),n=i,r=0;continue}else if(s.length>0){s="",o=0,n=i,r=0;continue}}t&&(s+=s.length>0?"/..":"..",o=2)}else s.length>0?s+=`/${e.slice(n+1,i)}`:s=e.slice(n+1,i),o=i-n-1;n=i,r=0}else c==="."&&r!==-1?++r:r=-1}return s},O=e=>ve.test(e),R=function(...e){e=e.map(o=>x(o));let t="",s=!1;for(let o=e.length-1;o>=-1&&!s;o--){const n=o>=0?e[o]:ke();!n||n.length===0||(t=`${n}/${t}`,s=O(n))}return t=Te(t,!s),te.test(t)?`${t}/`:s&&!O(t)?`/${t}`:t.length>0?t:"."},ze=function(e){return xe.exec(x(e))?.[1]??""},se=e=>{const t=x(e).replace(we,""),s=t.lastIndexOf("/");if(s===-1)return O(e)?"/":".";const o=t.slice(0,s);return te.test(o)?`${o}/`:o||(O(e)?"/":".")},je=(e,t)=>{const s=x(e);return s.slice(s.lastIndexOf("/")+1)},Se=function(e){const t=ye.exec(e)?.[0]?.replaceAll("\\","/")??"",s=je(e),o=ze(s);return{base:s,dir:se(e),ext:o,name:s.slice(0,s.length-o.length),root:t}};let _e;const Ee=e=>(_e??=g(import.meta.url))(e),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$e=e=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[t,s]=w.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return w.getBuiltinModule(e)}return Ee(e)},{fileURLToPath:Ce}=$e("node:url");function Ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var H,W;function Ae(){return W||(W=1,H=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),H}var Oe=Ae();const Ie=Ne(Oe);new Set(Ie);const M=e=>x(e instanceof URL?Ce(e):e),oe=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},G=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let Me;const De=e=>(Me??=g(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Le=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[t,s]=k.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return k.getBuiltinModule(e)}return De(e)},{lstat:It,mkdir:Mt}=Le("node:fs/promises");let Re;const Be=e=>(Re??=g(import.meta.url))(e),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,s]=T.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return T.getBuiltinModule(e)}return Be(e)},{lstatSync:X,mkdirSync:Ue}=Fe("node:fs"),z=e=>{oe(e);try{const t=X(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(G(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Ue(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=X(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(G(s))}'`,{cause:t})}};let Pe;const qe=e=>(Pe??=g(import.meta.url))(e),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ze=e=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[t,s]=j.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return j.getBuiltinModule(e)}return qe(e)},{stat:Dt,lstat:Lt}=Ze("node:fs/promises");let He;const We=e=>(He??=g(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ge=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[t,s]=S.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return S.getBuiltinModule(e)}return We(e)},{statSync:Xe,lstatSync:Ye}=Ge("node:fs"),Je=(e,t={})=>{const s=t.cwd?M(t.cwd):process.cwd();let o=R(s);const{root:n}=Se(o),r=M(t.stopAt??n),c=R(o,r),i=t.type??"file",m=function(l){return[e]};t.allowSymlinks??=!0;const f=t.allowSymlinks?Xe:Ye;for(;o;){for(let l of m()){if(l===he)return;if(l===void 0)continue;Buffer.isBuffer(l)?l=l.toString():l instanceof URL&&(l=M(l));const p=O(l)?l:R(o,l);try{const a=f(p);if(i==="file"&&a.isFile()||i==="directory"&&a.isDirectory())return p}catch{}}if(o===c||o===n)break;o=se(o)}};let Ke;const Qe=e=>(Ke??=g(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ve=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,s]=_.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return _.getBuiltinModule(e)}return Qe(e)},{access:Rt}=Ve("node:fs/promises");let et;const tt=e=>(et??=g(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[t,s]=E.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return E.getBuiltinModule(e)}return tt(e)},{accessSync:ot}=st("node:fs");function D(e,t=ge){oe(e),e=M(e);try{return ot(e,t),!0}catch{return!1}}class rt extends Error{constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}}let nt;const it=e=>(nt??=g(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,U=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[t,s]=$.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return $.getBuiltinModule(e)}return it(e)},ct=U("fs"),lt=U("os"),pt=U("path");var B={},Y;function at(){if(Y)return B;Y=1;var e=Object.defineProperty,t=(l,p)=>e(l,"name",{value:p,configurable:!0}),s=ct,o=lt,n=pt;const r=t(l=>{let p="";for(let a=0;a<l.length;a+=1){const u=l[a],h=u.toUpperCase();p+=u===h?u.toLowerCase():h}return p},"invertCase"),c=new Map,i=t((l,p)=>{const a=n.join(l,`.is-fs-case-sensitive-test-${process.pid}`);try{return p.writeFileSync(a,""),!p.existsSync(r(a))}finally{try{p.unlinkSync(a)}catch{}}},"checkDirectoryCaseWithWrite"),m=t((l,p,a)=>{try{return i(l,a)}catch(u){if(p===void 0)return i(o.tmpdir(),a);throw u}},"checkDirectoryCaseWithFallback"),f=t((l,p=s,a=!0)=>{const u=l??process.cwd();if(a&&c.has(u))return c.get(u);let h;const q=r(u);return q!==u&&p.existsSync(u)?h=!p.existsSync(q):h=m(u,l,p),a&&c.set(u,h),h},"isFsCaseSensitive");return B.isFsCaseSensitive=f,B}var ft=at();ft.isFsCaseSensitive;const ut=/^[A-Z]:\//i,I=(e="")=>e&&e.replaceAll("\\","/").replace(ut,t=>t.toUpperCase()),mt=/^[/\\]{2}/,dt=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,P=/^[A-Z]:$/i,gt=/\/$/,ht=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return I(e)}catch{}return"/"},F="/",re=(e,t)=>{let s="",o=0,n=-1,r=0,c;for(let i=0;i<=e.length;++i){if(i<e.length)c=e[i];else{if(c==="/")break;c="/"}if(c==="/"){if(!(n===i-1||r===1))if(r===2){if(s.length<2||o!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const m=s.lastIndexOf("/");m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),n=i,r=0;continue}else if(s.length>0){s="",o=0,n=i,r=0;continue}}t&&(s+=s.length>0?"/..":"..",o=2)}else s.length>0?s+=`/${e.slice(n+1,i)}`:s=e.slice(n+1,i),o=i-n-1;n=i,r=0}else c==="."&&r!==-1?++r:r=-1}return s},v=e=>dt.test(e),bt=function(e){if(e.length===0)return".";e=I(e);const t=mt.exec(e),s=v(e),o=e.at(-1)==="/";return e=re(e,!s),e.length===0?s?"/":o?"./":".":(o&&(e+="/"),P.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!v(e)?`/${e}`:e)},d=(...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const o=t.at(-1)==="/",n=s[0]==="/";o&&n?t+=s.slice(1):t+=o||n?s:`/${s}`}else t+=s;return bt(t)},vt=function(...e){e=e.map(o=>I(o));let t="",s=!1;for(let o=e.length-1;o>=-1&&!s;o--){const n=o>=0?e[o]:ht();!n||n.length===0||(t=`${n}/${t}`,s=v(n))}return t=re(t,!s),P.test(t)?`${t}/`:s&&!v(t)?`/${t}`:t.length>0?t:"."},xt=e=>{const t=I(e).replace(gt,""),s=t.lastIndexOf("/");if(s===-1)return v(e)?"/":".";const o=t.slice(0,s);return P.test(o)?`${o}/`:o||(v(e)?"/":".")};let yt;const wt=e=>(yt??=g(import.meta.url))(e),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,s]=C.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return C.getBuiltinModule(e)}return wt(e)},{fileURLToPath:Tt}=kt("node:url");function zt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K;function jt(){return K||(K=1,J=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),J}var St=jt();const _t=zt(St);new Set(_t);const ne=e=>I(e instanceof URL?Tt(e):e),Q=e=>{const t=me();if(Z==="win32"){const r=A.LOCALAPPDATA,c=t?d(t,"AppData","Local"):L(),i=r&&r.length>0?r:c;return d(i,e,"Cache")}if(Z==="darwin"){const r=t?d(t,"Library","Caches"):L();return d(r,e)}const s=A.XDG_CACHE_HOME,o=t?d(t,".cache"):L(),n=s&&s.length>0?s:o;return d(n,e)},Et=e=>{if(e.length===0)return;const t=e.map(r=>vt(ne(r)).split(F));let s=Number.POSITIVE_INFINITY;for(const r of t)r.length<s&&(s=r.length);const o=[];for(let r=0;r<s;r+=1){const c=t[0][r];if(t.every(i=>i[r]===c))o.push(c);else break}const n=o.join(F);return n===""?F:n},N=(e,t)=>{if(e!==void 0)return t?(...s)=>d(e,...s):e},$t=e=>{if(e?.files&&e.files.length>0){const t=Et(e.files);if(t!==void 0)return t}return e?.cwd??de()},Ct=e=>new rt(`No package.json found searching upwards from '${ne(e)}'.`),Nt=e=>!D(e,ee)&&D(e),At=(e,t)=>{if(A.CACHE_DIR&&!["0","1","false","true"].includes(A.CACHE_DIR)){const f=d(A.CACHE_DIR,e);return t?.create&&z(f),N(f,t?.thunk)}const s=$t(t),o=Je("package.json",{cwd:s,type:"file"});if(!o){if(t?.useGlobalCacheFallback){const f=Q(e);return t.create&&z(f),N(f,t.thunk)}if(t?.throwError)throw Ct(s);return}const n=xt(o),r=d(n,"node_modules"),c=d(r,".cache"),i=d(c,e);if(D(i,ee))return t?.create&&z(i),N(i,t?.thunk);const m=[i,c,r];if(D(r)||m.push(n),m.some(f=>Nt(f))){if(t?.useGlobalCacheFallback){const f=Q(e);return t.create&&z(f),N(f,t.thunk)}return}return t?.create&&z(i),N(i,t?.thunk)},Bt=At;export{Bt as L};
@@ -1 +1 @@
1
- import{b as e}from"./vis-user-error-Cpb0P6VA.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
1
+ import{b as e}from"./vis-user-error-BivZDkQD.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
@@ -0,0 +1 @@
1
+ import{m as k,D as S,f as L}from"./provenance-BG5mu0H_.js";import{g as $}from"./packument-Dg8cIDYR.js";import{i as f}from"./env-BymuoTL8.js";import{a as E}from"./build-scripts-BeMIA-_q.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-0dnGN3GP.js";import{S as O}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-D8e370_h.js";import{a as M}from"./advisories-DHGJ6XhP.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},le=(e,s)=>{const n=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||e.packageName.localeCompare(s.packageName)||e.packageVersion.localeCompare(s.packageVersion)},D=(e,s)=>{const n=y[s.toUpperCase()]??C;return(y[e.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,W=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},U=async(e,s)=>{const n=s.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],c=s.security?.acceptedRisks,a=t*w,o=Date.now();return(await k(e.packages,S,async l=>{if(W(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:e.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=a)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,c,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},_=(e,s)=>{const n=s.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const c=E(e.workspaceRoot,t,{pinVersions:s.security?.pinVersions===!0});if(c.unapproved.length===0)return[];const a=s.security?.acceptedRisks,o=r?"block":"warn";return c.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",a,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},I=new Set(["AND","OR"]),F=e=>{const s=e.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of s){const c=r.toUpperCase();if(t){t=!1;continue}if(c==="WITH"){t=!0;continue}if(I.has(c))continue;const a=r.endsWith("+"),o=a?r.slice(0,-1):r,i=h(o)??o;n.push(i),a&&n.push(`${i}-or-later`)}return n},T=e=>{if(typeof e.license=="string"){const s=e.license.trim();return s.length>0?s:void 0}if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string"){const s=e.license.type.trim();if(s.length>0)return s}if(Array.isArray(e.licenses)&&e.licenses.length>0){const s=e.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(s.length>0)return s.length===1?s[0]:`(${s.join(" OR ")})`}},V=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(n.has(t.toLowerCase()))return t},K=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(!n.has(t.toLowerCase()))return t},j=(e,s)=>{const n=s.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const c=s.security?.acceptedRisks,a=[];for(const o of e.packages){const i=e.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=F(l),u=V(p,r);if(u){a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=K(p,t);d&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return a},z=6e4,B=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},Y=async(e,s)=>{const n=s.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*z:void 0,c=s.security?.acceptedRisks,a=Date.now();return(await k(e.packages,S,async i=>{if(B(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&a-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,c,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},H=e=>{for(const s of Object.values(b))for(const n of[s.file,...s.aliases??[]])if(e===n||e.endsWith(`/${n}`)||e.endsWith(`.${n}`))return s.type},q=(e,s,n)=>{const t=A(s)?s:P(e,s);let r;try{r=x(t)}catch{return}const c=H(t)??b[n]?.type;if(!c)return;const a=O(r,c);if(a.length===0)return;const o=new Set;for(const i of a)o.add(`${i.name}@${i.version}`);return o},G=(e,s)=>{for(const n of s)if(n===e||n.endsWith("*")&&e.startsWith(n.slice(0,-1)))return!0;return!1},X=(e,s)=>{const n=s.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const c=r?q(e.workspaceRoot,r,e.packageManager):void 0,a=s.security?.acceptedRisks,o=[];for(const i of e.packages){const l=t.length===0||G(i.name,t),p=c?c.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&c&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,a,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},J=(e,s)=>{if(!e.osvFindings||e.osvFindings.size===0)return[];const t=s.security?.policies?.vulnerability?.failOn,r=s.security?.acceptedRisks,c=[];for(const a of e.packages){const o=e.osvFindings.get(M(a.name,a.version))??e.osvFindings.get(a.name);if(!(!o||o.length===0))for(const i of o){const l=t?D(i.severity,t)?"block":"warn":"info";c.push({acceptedRisk:f(a.name,a.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:a.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${a.name}@${a.version}: ${i.summary}`,severity:l,version:a.version})}}return c},N=[{evaluate:J,isConfigured:e=>e.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:e=>{const s=e.security?.policies?.license;return!!(s&&(s.allow&&s.allow.length>0||s.deny&&s.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:_,isConfigured:e=>{const s=e.security?.policies?.installScripts;return!!(s&&(s.allow&&Object.keys(s.allow).length>0||s.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:X,isConfigured:e=>{const s=e.security?.policies?.unexpectedDeps;return!!(s&&(s.allow&&s.allow.length>0||typeof s.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:e=>{const s=e.security?.policies?.firstSeen?.minutes;return typeof s=="number"&&s>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:e=>e.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],Q=(e,s,n)=>N.filter(t=>t.surfaces.includes(e)?n!==void 0?n.has(t.name):t.isConfigured(s):!1),ue=async(e,s,n)=>{const t=Q(s,n.visConfig,n.enabledPolicies),r=[];for(const c of t){if(e.offline&&!c.offlineSupported){r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const a=await c.evaluate(e,n.visConfig);r.push(...a)}catch(a){const o=a instanceof Error?a.message:String(a);r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Z=(()=>{const e=new Map;for(const s of R)e.set(s.toLowerCase(),s);return e})(),de=()=>N.map(e=>e.name),pe=(e,s)=>{if(e===void 0)return;const n=e.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of e.split(",").map(c=>c.trim()).filter(c=>c.length>0)){const c=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),a=Z.get(c.toLowerCase());a===void 0?s?.(r):t.add(a)}return t};export{le as c,ue as e,de as g,pe as p,D as s};
@@ -1 +1 @@
1
- import{createRequire as n}from"node:module";import{o as p,n as a,C as f}from"./index-BzhrR_iC.js";let i;const c=e=>(i??=n(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,s]=r.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return r.getBuiltinModule(e)}return c(e)},{createRequire:l}=u("node:module");let d;const _=e=>(d??=l(import.meta.url))(e),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[o,s]=t.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return t.getBuiltinModule(e)}return _(e)},{accessSync:g}=m("node:fs");function h(e,o=p){a(e),e=f(e);try{return g(e,o),!0}catch{return!1}}export{h as y};
1
+ import{createRequire as n}from"node:module";import{o as p,n as a,C as f}from"./index-0dnGN3GP.js";let i;const c=e=>(i??=n(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,s]=r.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return r.getBuiltinModule(e)}return c(e)},{createRequire:l}=u("node:module");let d;const _=e=>(d??=l(import.meta.url))(e),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[o,s]=t.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return t.getBuiltinModule(e)}return _(e)},{accessSync:g}=m("node:fs");function h(e,o=p){a(e),e=f(e);try{return g(e,o),!0}catch{return!1}}export{h as y};
@@ -1,2 +1,2 @@
1
- import{createRequire as K}from"node:module";import{n as E,o as z,C as S,d as X,e as h}from"./index-BzhrR_iC.js";import{r as rt}from"./env-BSXG3QKH.js";import{N as it}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{r as D}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{withEnhancedPath as lt}from"@visulima/task-runner";let V;const U=t=>(V??=K(import.meta.url))(t),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,o]=f.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return f.getBuiltinModule(t)}return U(t)},{Socket:Y}=l("node:net"),{randomBytes:J}=l("node:crypto"),{readdir:Q,rm:b,unlink:$,open:Z,readFile:tt,stat:et,writeFile:ot,rename:st}=l("node:fs/promises"),{createRequire:M}=l("node:module"),{spawn:nt}=l("node:child_process"),{openSync:ct,closeSync:at}=l("node:fs");let ht;const dt=t=>(ht??=M(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,o]=u.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return u.getBuiltinModule(t)}return dt(t)},{lstat:A,mkdir:ut}=ft("node:fs/promises"),pt=async t=>{E(t);try{const e=await A(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await ut(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await A(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(o))}'`,{cause:e})}};let wt;const yt=t=>(wt??=M(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,o]=p.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return p.getBuiltinModule(t)}return yt(t)},{access:mt}=kt("node:fs/promises");async function _t(t,e=z){E(t),t=S(t);try{return await mt(t,e),!0}catch{return!1}}let gt;const vt=t=>(gt??=M(import.meta.url))(t),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,o]=w.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return w.getBuiltinModule(t)}return vt(t)},{readFile:bt}=x("node:fs/promises"),{unzip:Tt,brotliDecompress:Et}=x("node:zlib"),St={brotli:Et,gzip:Tt,none:(t,e)=>{e(null,t)}},Mt=async(t,e)=>{E(t),t=S(t);const{buffer:o,compression:s,encoding:r,flag:i}=e??{};let n;try{n=await bt(t,i?{flag:i}:{})}catch(c){throw X(c,t)}return await new Promise((c,g)=>{St[s??"none"](n,(k,m)=>{k?g(k):c(o?m:m.toString(r??"utf8"))})})};async function C(t,e,o){const s=await Mt(t,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(s);const{beforeParse:i,color:n}={};return typeof i=="function"&&(r=i(r)),it(r,e,S(t),{color:n})}const H=384,L=5e3,Ht=50,Rt=3e4,d=async t=>{const e=h(rt(t),"services");try{await pt(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},R=t=>t.replaceAll("/","_").replaceAll(":","__"),P=(t,e)=>h(t,`${R(e)}.json`),Pt=(t,e)=>h(t,`${R(e)}.lock`),_=async(t,e)=>{const o=await d(t),s=P(o,e);if(await _t(s))try{return await C(s)}catch{return}},$t=async t=>{const e=await d(t);let o;try{o=await Q(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await C(h(e,r));s.push(i)}catch{}return s},Dt=async(t,e)=>{const o=await d(t),s=P(o,e.id),r=h(o,`.${J(8).toString("hex")}.tmp`);await ot(r,`${JSON.stringify(e,void 0,2)}
2
- `,{mode:H});try{await It(r,s)}catch(i){throw await b(r,{force:!0}).catch(()=>{}),i}},At=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Ot=20,It=async(t,e)=>{let o=0;for(;;)try{await st(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&At.has(r))||o>=Lt)throw s;const n=Ot*2**o;await new Promise(c=>{setTimeout(c,n)}),o+=1}},y=async(t,e,o)=>{const s=await d(t),r=o??await _(t,e);await b(P(s,e),{force:!0}),r&&await b(r.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},se=async t=>{const e=await $t(t),o=[],s=[];for(const r of e){if(a(r.pid)){s.push(r);continue}const i=await _(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await y(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},xt=t=>new Promise(e=>{setTimeout(e,t)}),Ct=async t=>{try{const e=await Z(t,"wx",H);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},Nt=async t=>{let e;try{const o=await tt(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!a(e))return!0;try{const o=await et(t);return Date.now()-o.mtimeMs>Rt}catch{return!0}},N=async(t,e,o)=>{const s=await d(t),r=Pt(s,e),i=Date.now();for(;!await Ct(r);){if(await Nt(r)){await $(r).catch(()=>{});continue}if(Date.now()-i>=L)throw new Error(`Could not acquire service lock for ${e} within ${String(L)}ms — another \`vis service\` invocation appears to be holding it.`);await xt(Ht)}try{return await o()}finally{await $(r).catch(()=>{})}};function T(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?T(r,e,i):typeof r=="function"&&(e[i]=r)}return e}const F=(()=>{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function j(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(()=>j(t,e,r+1,s))}catch(i){return Promise.reject(i)}}function Ft(t,e,o){if(t.length>0)return j(t,e,0,F(o))}function jt(t,e,o){if(t.length>0){const s=F(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}function v(t,e){for(const o of[...t])o(e)}var Wt=class{_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:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",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=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r));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=T(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=T(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(Ft,t,e)}callHookParallel(t,...e){return this.callHookWith(jt,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&v(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&v(this._after,s)}):(this._after&&s&&v(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 Bt(){return new Wt}const re=()=>Bt(),ie=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 n of i)t.hook(s,n)}o.setup&&await o.setup(t)}};class ne{#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):Gt(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 Gt=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",qt=3e4,W=100;class Kt extends Error{constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs}const Vt=async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??qt,r=Date.now();for(;Date.now()-r<s;){if(await Ut(e,o))return;await zt(W)}throw new Kt(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},Ut=(t,e)=>new Promise(o=>{const s=new Y,r=i=>{s.removeAllListeners(),s.destroy(),o(i)};s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(W,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),zt=t=>new Promise(e=>{setTimeout(e,t)}),Xt=async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Vt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},O=process.platform==="win32",Yt=async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ct(r,"a",H);let n;const c=O?"cmd":"/bin/sh",g=O?["/d","/s","/c",e]:["-c",e];try{n=nt(c,g,{cwd:o,detached:!0,env:lt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{at(i)}if(n.pid===void 0&&await new Promise((k,m)=>{n.once("spawn",()=>{k()}),n.once("error",q=>{m(q)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return n.unref(),{pid:n.pid}},B=5e3,ce=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(e&&a(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await y(t.workspaceRoot,t.id,e);const o=await d(t.workspaceRoot),s=R(t.id),r=h(o,`${s}.log`),{pid:i}=await Yt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),n={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 Dt(t.workspaceRoot,n),t.skipReadiness!==!0)try{await Xt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(c){throw await G(i,t.config.killGracePeriodMs??B).catch(()=>{}),await y(t.workspaceRoot,t.id,n).catch(()=>{}),c}return{entry:n}}),ae=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!a(e.pid))return await y(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??B;return await G(e.pid,o),await y(t.workspaceRoot,t.id,e),{stopped:!0}}),G=async(t,e)=>{I(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&I(t,"SIGKILL")},I=(t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}};export{ne as H,Kt as S,ce as a,Xt as b,$t as c,re as d,ie as e,y as f,_t as g,a as i,se as p,_ as r,ae as s};
1
+ import{createRequire as K}from"node:module";import{n as E,o as z,C as S,d as X,e as h}from"./index-0dnGN3GP.js";import{u as D,v as rt}from"./env-BymuoTL8.js";import{N as it}from"./package-version-x7sPg2TM.js";import{withEnhancedPath as lt}from"@visulima/task-runner";let V;const U=t=>(V??=K(import.meta.url))(t),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,o]=f.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return f.getBuiltinModule(t)}return U(t)},{Socket:Y}=l("node:net"),{randomBytes:J}=l("node:crypto"),{readdir:Q,rm:b,unlink:$,open:Z,readFile:tt,stat:et,writeFile:ot,rename:st}=l("node:fs/promises"),{createRequire:M}=l("node:module"),{spawn:nt}=l("node:child_process"),{openSync:ct,closeSync:at}=l("node:fs");let ht;const dt=t=>(ht??=M(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,o]=u.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return u.getBuiltinModule(t)}return dt(t)},{lstat:A,mkdir:ut}=ft("node:fs/promises"),pt=async t=>{E(t);try{const e=await A(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await ut(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await A(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(o))}'`,{cause:e})}};let wt;const yt=t=>(wt??=M(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,o]=p.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return p.getBuiltinModule(t)}return yt(t)},{access:mt}=kt("node:fs/promises");async function _t(t,e=z){E(t),t=S(t);try{return await mt(t,e),!0}catch{return!1}}let gt;const vt=t=>(gt??=M(import.meta.url))(t),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,o]=w.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return w.getBuiltinModule(t)}return vt(t)},{readFile:bt}=x("node:fs/promises"),{unzip:Tt,brotliDecompress:Et}=x("node:zlib"),St={brotli:Et,gzip:Tt,none:(t,e)=>{e(null,t)}},Mt=async(t,e)=>{E(t),t=S(t);const{buffer:o,compression:s,encoding:r,flag:i}=e??{};let n;try{n=await bt(t,i?{flag:i}:{})}catch(c){throw X(c,t)}return await new Promise((c,g)=>{St[s??"none"](n,(k,m)=>{k?g(k):c(o?m:m.toString(r??"utf8"))})})};async function C(t,e,o){const s=await Mt(t,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(s);const{beforeParse:i,color:n}={};return typeof i=="function"&&(r=i(r)),it(r,e,S(t),{color:n})}const H=384,L=5e3,Ht=50,Rt=3e4,d=async t=>{const e=h(rt(t),"services");try{await pt(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},R=t=>t.replaceAll("/","_").replaceAll(":","__"),P=(t,e)=>h(t,`${R(e)}.json`),Pt=(t,e)=>h(t,`${R(e)}.lock`),_=async(t,e)=>{const o=await d(t),s=P(o,e);if(await _t(s))try{return await C(s)}catch{return}},$t=async t=>{const e=await d(t);let o;try{o=await Q(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await C(h(e,r));s.push(i)}catch{}return s},Dt=async(t,e)=>{const o=await d(t),s=P(o,e.id),r=h(o,`.${J(8).toString("hex")}.tmp`);await ot(r,`${JSON.stringify(e,void 0,2)}
2
+ `,{mode:H});try{await It(r,s)}catch(i){throw await b(r,{force:!0}).catch(()=>{}),i}},At=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Ot=20,It=async(t,e)=>{let o=0;for(;;)try{await st(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&At.has(r))||o>=Lt)throw s;const n=Ot*2**o;await new Promise(c=>{setTimeout(c,n)}),o+=1}},y=async(t,e,o)=>{const s=await d(t),r=o??await _(t,e);await b(P(s,e),{force:!0}),r&&await b(r.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},oe=async t=>{const e=await $t(t),o=[],s=[];for(const r of e){if(a(r.pid)){s.push(r);continue}const i=await _(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await y(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},xt=t=>new Promise(e=>{setTimeout(e,t)}),Ct=async t=>{try{const e=await Z(t,"wx",H);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},Nt=async t=>{let e;try{const o=await tt(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!a(e))return!0;try{const o=await et(t);return Date.now()-o.mtimeMs>Rt}catch{return!0}},N=async(t,e,o)=>{const s=await d(t),r=Pt(s,e),i=Date.now();for(;!await Ct(r);){if(await Nt(r)){await $(r).catch(()=>{});continue}if(Date.now()-i>=L)throw new Error(`Could not acquire service lock for ${e} within ${String(L)}ms — another \`vis service\` invocation appears to be holding it.`);await xt(Ht)}try{return await o()}finally{await $(r).catch(()=>{})}};function T(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?T(r,e,i):typeof r=="function"&&(e[i]=r)}return e}const F=(()=>{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function j(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(()=>j(t,e,r+1,s))}catch(i){return Promise.reject(i)}}function Ft(t,e,o){if(t.length>0)return j(t,e,0,F(o))}function jt(t,e,o){if(t.length>0){const s=F(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}function v(t,e){for(const o of[...t])o(e)}var Wt=class{_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:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",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=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r));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=T(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=T(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(Ft,t,e)}callHookParallel(t,...e){return this.callHookWith(jt,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&v(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&v(this._after,s)}):(this._after&&s&&v(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 Bt(){return new Wt}const se=()=>Bt(),re=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 n of i)t.hook(s,n)}o.setup&&await o.setup(t)}};class ie{#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):Gt(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 Gt=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",qt=3e4,W=100;class Kt extends Error{constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs}const Vt=async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??qt,r=Date.now();for(;Date.now()-r<s;){if(await Ut(e,o))return;await zt(W)}throw new Kt(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},Ut=(t,e)=>new Promise(o=>{const s=new Y,r=i=>{s.removeAllListeners(),s.destroy(),o(i)};s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(W,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),zt=t=>new Promise(e=>{setTimeout(e,t)}),Xt=async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Vt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},O=process.platform==="win32",Yt=async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ct(r,"a",H);let n;const c=O?"cmd":"/bin/sh",g=O?["/d","/s","/c",e]:["-c",e];try{n=nt(c,g,{cwd:o,detached:!0,env:lt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{at(i)}if(n.pid===void 0&&await new Promise((k,m)=>{n.once("spawn",()=>{k()}),n.once("error",q=>{m(q)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return n.unref(),{pid:n.pid}},B=5e3,ne=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(e&&a(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await y(t.workspaceRoot,t.id,e);const o=await d(t.workspaceRoot),s=R(t.id),r=h(o,`${s}.log`),{pid:i}=await Yt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),n={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 Dt(t.workspaceRoot,n),t.skipReadiness!==!0)try{await Xt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(c){throw await G(i,t.config.killGracePeriodMs??B).catch(()=>{}),await y(t.workspaceRoot,t.id,n).catch(()=>{}),c}return{entry:n}}),ce=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!a(e.pid))return await y(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??B;return await G(e.pid,o),await y(t.workspaceRoot,t.id,e),{stopped:!0}}),G=async(t,e)=>{I(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&I(t,"SIGKILL")},I=(t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}};export{ie as H,Kt as S,ne as a,Xt as b,$t as c,se as d,re as e,y as f,_t as g,a as i,oe as p,_ as r,ce as s};
@@ -1 +1 @@
1
- import{createRequire as p}from"node:module";import{e as a}from"./index-BzhrR_iC.js";let k;const _=e=>(k??=p(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[o,t]=i.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return i.getBuiltinModule(e)}return _(e)},{statSync:u,existsSync:m,readFileSync:f}=y("node:fs"),h={aube:["aube-lock.yaml"],bun:["bun.lock","bun.lockb"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]},b={aube:["node_modules/.aube-state","node_modules/.modules.yaml"],bun:["node_modules/.bun-tag"],npm:["node_modules/.package-lock.json"],pnpm:["node_modules/.modules.yaml","node_modules/.pnpm/lock.yaml"],yarn:["node_modules/.yarn-integrity","node_modules/.yarn-state.yml",".yarn/install-state.gz"]},g={pnpm:"node_modules/.pnpm/lock.yaml"},M={ci:{aube:"aube ci",bun:"bun install --frozen-lockfile",npm:"npm ci",pnpm:"pnpm install --frozen-lockfile",yarn:"yarn install --immutable"},tty:{aube:"aube install",bun:"bun install",npm:"npm install",pnpm:"pnpm install",yarn:"yarn install"}},L=1e3,S=e=>{for(const[o,t]of Object.entries(h))for(const s of t)if(m(a(e,s)))return{lockfileFile:s,manager:o}},j=(e,o,t)=>{const s=g[t];if(!s)return;const n=a(e,s);if(!m(n))return;const r=a(e,o);try{return u(r).size!==u(n).size?!1:f(r).equals(f(n))}catch{return}},v=(e,o)=>{let t;for(const s of b[o]){const n=a(e,s);if(!m(n))continue;const{mtimeMs:r}=u(n);(!t||r>t.mtimeMs)&&(t={mtimeMs:r,path:s})}return t},C=(e,o={})=>{const t=S(e);if(!t)return{checked:!1};const{lockfileFile:s,manager:n}=t,r=u(a(e,s)).mtimeMs,l=v(e,n),d=M[o.inCi?"ci":"tty"][n],c={comparedBy:"mtime",installMarkerMtimeMs:l?.mtimeMs,lockfileMtimeMs:r,lockfilePath:s,marker:l?.path,packageManager:n};return l?j(e,s,n)===!0?{checked:!0,detail:{...c,comparedBy:"content"}}:r>l.mtimeMs+L?{checked:!0,detail:c,failure:"stale-install",message:`${s} is newer than node_modules (${l.path}) — run \`${d}\` to sync.`}:{checked:!0,detail:c}:{checked:!0,detail:c,failure:"missing-install",message:`lockfile detected but node_modules looks uninitialised — run \`${d}\` before \`vis run\`.`}},E=(e,o,t,s={})=>{if(s.skip)return{checked:!1,shouldContinue:!0};const n=C(e,{inCi:o});if(!n.failure)return{...n,shouldContinue:!0};const r=`preflight: ${n.message??"lockfile drift detected"}`;return o&&!s.ciAsWarning?{...n,formattedMessage:r,shouldContinue:!1}:(t.warn(r),{...n,formattedMessage:r,shouldContinue:!0})};export{S as d,E as r};
1
+ import{createRequire as p}from"node:module";import{e as a}from"./index-0dnGN3GP.js";let k;const _=e=>(k??=p(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[o,t]=i.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return i.getBuiltinModule(e)}return _(e)},{statSync:u,existsSync:m,readFileSync:f}=y("node:fs"),h={aube:["aube-lock.yaml"],bun:["bun.lock","bun.lockb"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]},b={aube:["node_modules/.aube-state","node_modules/.modules.yaml"],bun:["node_modules/.bun-tag"],npm:["node_modules/.package-lock.json"],pnpm:["node_modules/.modules.yaml","node_modules/.pnpm/lock.yaml"],yarn:["node_modules/.yarn-integrity","node_modules/.yarn-state.yml",".yarn/install-state.gz"]},g={pnpm:"node_modules/.pnpm/lock.yaml"},M={ci:{aube:"aube ci",bun:"bun install --frozen-lockfile",npm:"npm ci",pnpm:"pnpm install --frozen-lockfile",yarn:"yarn install --immutable"},tty:{aube:"aube install",bun:"bun install",npm:"npm install",pnpm:"pnpm install",yarn:"yarn install"}},L=1e3,S=e=>{for(const[o,t]of Object.entries(h))for(const s of t)if(m(a(e,s)))return{lockfileFile:s,manager:o}},j=(e,o,t)=>{const s=g[t];if(!s)return;const n=a(e,s);if(!m(n))return;const r=a(e,o);try{return u(r).size!==u(n).size?!1:f(r).equals(f(n))}catch{return}},v=(e,o)=>{let t;for(const s of b[o]){const n=a(e,s);if(!m(n))continue;const{mtimeMs:r}=u(n);(!t||r>t.mtimeMs)&&(t={mtimeMs:r,path:s})}return t},C=(e,o={})=>{const t=S(e);if(!t)return{checked:!1};const{lockfileFile:s,manager:n}=t,r=u(a(e,s)).mtimeMs,l=v(e,n),d=M[o.inCi?"ci":"tty"][n],c={comparedBy:"mtime",installMarkerMtimeMs:l?.mtimeMs,lockfileMtimeMs:r,lockfilePath:s,marker:l?.path,packageManager:n};return l?j(e,s,n)===!0?{checked:!0,detail:{...c,comparedBy:"content"}}:r>l.mtimeMs+L?{checked:!0,detail:c,failure:"stale-install",message:`${s} is newer than node_modules (${l.path}) — run \`${d}\` to sync.`}:{checked:!0,detail:c}:{checked:!0,detail:c,failure:"missing-install",message:`lockfile detected but node_modules looks uninitialised — run \`${d}\` before \`vis run\`.`}},E=(e,o,t,s={})=>{if(s.skip)return{checked:!1,shouldContinue:!0};const n=C(e,{inCi:o});if(!n.failure)return{...n,shouldContinue:!0};const r=`preflight: ${n.message??"lockfile drift detected"}`;return o&&!s.ciAsWarning?{...n,formattedMessage:r,shouldContinue:!1}:(t.warn(r),{...n,formattedMessage:r,shouldContinue:!0})};export{S as d,E as r};
@@ -0,0 +1 @@
1
+ import{createRequire as j}from"node:module";import{e as d}from"./index-0dnGN3GP.js";import{y}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as P}from"./package-version-x7sPg2TM.js";let M;const b=o=>(M??=j(import.meta.url))(o),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=o=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(o)}return b(o)},{readdirSync:g,lstatSync:S}=N("node:fs"),R=/^([^<(]+?)?(?:<([^>]+)>)?\s*(?:\(([^)]+)\))?\s*$/u,T=o=>{const e=o.match(R);if(!e)return;const t=e[1]?.trim(),n=e[2]?.trim(),r=e[3]?.trim();if(!(!t&&!n&&!r))return{email:n||void 0,name:t||void 0,url:r||void 0}},k=o=>{if(!Array.isArray(o)||o.length===0)return;const e=[];for(const t of o)if(typeof t=="string"){const n=T(t);n&&e.push(n)}else if(t&&typeof t=="object"){const n=t,r=typeof n.name=="string"?n.name:void 0,i=typeof n.email=="string"?n.email:void 0,u=typeof n.url=="string"?n.url:void 0;(r||i||u)&&e.push({email:i,name:r,url:u})}return e.length>0?e:void 0},D=o=>{const e=d(o,"node_modules");if(!y(e))return new Map;const t=new Map,n=new Set,r=(i,u="")=>{if(n.has(i))return;n.add(i);let h;try{h=g(i)}catch{return}for(const a of h){const c=d(i,a);let m;try{m=S(c)}catch{continue}if(m.isSymbolicLink())continue;if(a.startsWith("@")){m.isDirectory()&&r(c,`${a}/`);continue}if(a===".pnpm"&&u===""){let s;try{s=g(c)}catch{continue}for(const p of s){const f=d(c,p,"node_modules");y(f)&&r(f)}continue}if(a.startsWith(".")||!m.isDirectory())continue;const v=u+a,_=d(c,"package.json");try{if(!y(_))continue;const s=P(_);if(typeof s.version!="string")continue;const p=`${v}@${s.version}`;t.has(p)||t.set(p,{directory:c,license:s.license,licenses:Array.isArray(s.licenses)?s.licenses:void 0,maintainers:k(s.maintainers),name:v,scripts:s.scripts&&typeof s.scripts=="object"?s.scripts:void 0,version:s.version});const f=d(c,"node_modules");y(f)&&r(f)}catch{}}};return r(e),t};export{k as n,D as r};
@@ -1,4 +1,4 @@
1
- import{e as g,z as d}from"./index-BzhrR_iC.js";import{r as A}from"../packem_chunks/cli-main.js";import{y as $}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as u}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";const x=(k,p,h,m=[])=>{const t=[];if(h===void 0)return t.push("minimumReleaseAge not set in vis.config; skipping native sync."),t;const r=Number.isFinite(h)?Math.max(0,Math.round(h)):0;switch(k){case"bun":{const n=g(p,"bunfig.toml");let e=$(n)?d(n):"";const s=r*60,i=`minimumReleaseAge = ${String(s)}`,a=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,o=/^\[install\][ \t]*\n/m.exec(e);if(o?.index===void 0){const c=a?`${i}
1
+ import{e as g,z as d}from"./index-0dnGN3GP.js";import{d as A}from"../packem_chunks/cli-main.js";import{y as $}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as u}from"./env-BymuoTL8.js";const x=(k,p,h,m=[])=>{const t=[];if(h===void 0)return t.push("minimumReleaseAge not set in vis.config; skipping native sync."),t;const r=Number.isFinite(h)?Math.max(0,Math.round(h)):0;switch(k){case"bun":{const n=g(p,"bunfig.toml");let e=$(n)?d(n):"";const s=r*60,i=`minimumReleaseAge = ${String(s)}`,a=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,o=/^\[install\][ \t]*\n/m.exec(e);if(o?.index===void 0){const c=a?`${i}
2
2
  ${a}`:i;e=`${e.trimEnd()?`${e.trimEnd()}
3
3
 
4
4
  `:""}[install]
@@ -0,0 +1 @@
1
+ import{e as h,U as p}from"./index-0dnGN3GP.js";import{h as d,l as D,m as y,L as o,s as P}from"./registry-CndByNx9.js";import{y as c}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";const _=/\/+$/,l=/node_modules/,f=/\.git/,E=/\/\*\*$|\/\*\/\*$/,S=s=>{for(const r of o(s,{includeDirs:!1,includeSymlinks:!1,skip:[l,f]}))if(r.name==="package.json")return!0;return!1},m=(s,r,n)=>{for(const e of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[l,f]})){if(e.path===s||e.name.startsWith(".")||c(h(e.path,"package.json")))continue;const a=`${r}/${e.name}`;S(e.path)?m(e.path,a,n):n.push(a)}},g=(s,r)=>{const n=r.replace(_,"");if(n.startsWith("!"))return[];const e=[];if(n.endsWith("/*")&&!n.endsWith("/*/*")){const i=n.slice(0,-2),t=p(s,i);if(!c(t))return[];for(const u of o(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[l,f]}))u.path===t||u.name.startsWith(".")||e.push(h(i,u.name));return e}if(n.endsWith("/**")||n.endsWith("/*/*")){const i=n.replace(E,""),t=p(s,i);return c(t)&&m(t,i,e),e}if(!n.includes("/")&&n.includes("*")){const i=P(n);for(const t of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[l,f]}))t.path!==s&&i.test(t.name)&&e.push(t.name);return e}const a=p(s,n);return c(a)&&e.push(n),e},b=s=>{const n=d(s)??D(s)??[],e=new Set,a=[];for(const i of n)for(const t of g(s,i))t==="."||e.has(t)||(e.add(t),y(h(s,t))||a.push({packageDir:t}));return a};export{b as l};
@@ -1 +1 @@
1
- import{createRequire as J}from"node:module";import{e as K}from"./index-BzhrR_iC.js";import{u as X}from"./registry-B6LWRK9T.js";import{e as L,i as Z,s as Q}from"./maven-pom-B0KG9kJQ.js";import{c as ee}from"./composer-DR3D-Psb.js";let Y;const B=e=>(Y??=J(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return B(e)},{existsSync:E,readFileSync:_}=G("node:fs"),{resolve:w,dirname:M,join:x}=G("node:path"),oe=8,ne=8,te="vis:maven:version-unresolved",N=(e,n,t)=>`pkg:maven/${encodeURIComponent(e)}/${encodeURIComponent(n)}${t===void 0?"":`@${encodeURIComponent(t)}`}`,A=e=>{if(E(e))try{return{path:e,scan:Q(_(e,"utf8"))}}catch{return}},D=e=>{const n=e.scan.parent;if(!n)return;const t=n.relativePath||"../pom.xml",o=t.endsWith(".xml")?w(M(e.path),t):w(M(e.path),t,"pom.xml"),s=A(o);return s&&s.scan.artifactId?.value===n.artifactId?.value&&L(s.scan)===n.groupId?.value?s:void 0},se=e=>{const n=[e];let t=D(e);for(;t&&n.length<oe;)n.push(t),t=D(t);return n},P=(e,n,t=0)=>{if(e===""||t>ne)return;let o=!1;const s=e.replaceAll(/\$\{([^}]+)\}/g,(c,r)=>{const i=n(r),a=i===void 0?void 0:P(i,n,t+1);return a===void 0?(o=!0,""):a});return o||s.includes("${")?void 0:s},C=(e,n)=>{if(e===void 0)return{unresolved:""};const t=P(e,n);return t===void 0||!Z(t)?{unresolved:e}:{version:t}},re=e=>{const n=[],t=new Set,o=s=>{const c=w(s),r=A(c);if(!(!r||t.has(c))){t.add(c),n.push(se(r));for(const i of r.scan.modules)o(i.endsWith(".xml")?w(M(c),i):w(M(c),i,"pom.xml"))}};return o(e),n},T=e=>{const n=[];for(const t of re(w(e,"pom.xml"))){const o=t[0].scan,s=new Map;for(const m of t)for(const[y,b]of m.scan.properties)s.has(y)||s.set(y,b.value);const c=L(o),r=o.artifactId?.value,i=o.version?.value??o.parent?.version?.value,a=o.parent?.version?.value,u=m=>{switch(m){case"artifactId":case"pom.artifactId":case"project.artifactId":return r;case"groupId":case"pom.groupId":case"project.groupId":return c;case"pom.version":case"project.version":case"version":return i;case"project.parent.version":return a;default:return s.get(m)}},l=c===void 0?void 0:P(c,u),g=r===void 0?void 0:P(r,u),h=C(i,u),v=new Map;for(const m of t)for(const y of m.scan.dependencies){const b=y.groupId?.value??"",d=y.artifactId?.value??"",p=`${b}:${d}`;if(v.has(p))continue;const f=P(b,u),k=P(d,u),j=f===void 0||k===void 0?{unresolved:y.version?.value??""}:C(y.version?.value,u);v.set(p,{artifact:k,group:f,scope:y.scope?.value??"compile",unresolved:f===void 0||k===void 0?p:j.unresolved,version:j.version})}n.push({artifact:g,dependencies:[...v.values()],group:l,path:t[0].path,unresolved:h.unresolved,version:h.version})}return n},O=e=>e==="test"||e==="provided",ce=(e,n)=>{const t=new Set(n),o=new Map;for(const r of e)r.group!==void 0&&r.artifact!==void 0&&o.set(`${r.group}:${r.artifact}`,r);const s=new Set(e.filter(r=>r.artifact!==void 0&&t.has(r.artifact))),c=[...s];for(;c.length>0;){const r=c.shift();for(const i of r.dependencies){const a=o.get(`${i.group}:${i.artifact}`);a!==void 0&&!s.has(a)&&(s.add(a),c.push(a))}}return e.filter(r=>s.has(r))},De=(e,n={})=>{const t=n.includeDev??!1,o=new Map,s=new Map,c=(a,u,l,g,h)=>{const v=N(a,u,l);if(!o.has(v)){const m={"bom-ref":v,group:a,name:u,purl:v,type:"library"};l!==void 0&&(m.version=l),g!==void 0&&(m.properties=[{name:te,value:g}]),h!==void 0&&(m.scope=h),o.set(v,m)}return v},r=T(e);for(const a of n.focusNames===void 0?r:ce(r,n.focusNames)){const u=a.group!==void 0&&a.artifact!==void 0?c(a.group,a.artifact,a.version,a.unresolved):void 0;for(const l of a.dependencies){if(O(l.scope)&&!t||l.group===void 0||l.artifact===void 0)continue;const g=c(l.group,l.artifact,l.version,l.unresolved,O(l.scope)?"optional":"required");u!==void 0&&s.set(u,(s.get(u)??new Set).add(g))}}const i=[...o.values()].sort((a,u)=>(a["bom-ref"]??"").localeCompare(u["bom-ref"]??""));return{components:i,dependencies:i.map(a=>{const u=a["bom-ref"]??"",l=[...s.get(u)??[]].sort();return l.length>0?{dependsOn:l,ref:u}:{ref:u}})}},ie=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=t.trim();if(o.length===0||o.startsWith("#"))continue;const s=o.indexOf("="),c=(s===-1?o:o.slice(0,s)).split(":");if(c.length<3||!c[0]||!c[1]||!c[2])continue;const r=s===-1?[]:o.slice(s+1).split(",").map(i=>i.trim()).filter(i=>i.length>0);n.push({artifact:c[1],configurations:r,group:c[0],version:c[2]})}return n},ae=e=>["",...X(e,[])].map(t=>x(e,t,"gradle.lockfile")).filter(t=>E(t)),U=e=>{const n=[];for(const t of ae(e))try{n.push(...ie(_(t,"utf8")))}catch{}return n},de=e=>e.configurations.length>0&&e.configurations.every(n=>/test/i.test(n)),Ce=(e,n={})=>{const t=n.includeDev??!1,o=new Map;for(const r of U(e)){const i=N(r.group,r.artifact,r.version),a=o.get(i),u=de(r);o.set(i,{dev:(a?.dev??!0)&&u,entry:r})}const s=[...o.keys()].filter(r=>t||!o.get(r).dev).sort();return{components:s.map(r=>{const{dev:i,entry:a}=o.get(r);return{"bom-ref":r,group:a.group,name:a.artifact,purl:r,scope:i?"optional":"required",type:"library",version:a.version}}),dependencies:s.map(r=>({ref:r}))}},V=(e,n)=>{const{focusNames:t,includeDev:o=!1,normalize:s,purl:c}=n,r=new Map;for(const d of e){const p=`${s(d.name)}@${d.version}`;r.set(p,(r.get(p)??0)+1)}const i=d=>{const p=(r.get(`${s(d.name)}@${d.version}`)??0)>1,f=c(d.name,d.version);return p&&d.source!==void 0?`${f}?source=${encodeURIComponent(d.source)}`:f},a=new Map;for(const d of e){const p=s(d.name);a.set(p,[...a.get(p)??[],d])}const u=d=>{const p=(a.get(s(d.name))??[]).filter(f=>(d.version===void 0||f.version===d.version)&&(d.source===void 0||f.source===d.source));return p.length===1?p[0]:void 0},l=t===void 0?void 0:new Set(t.map(d=>s(d))),g=e.filter(d=>d.member&&(l===void 0||l.has(s(d.name)))),h=new Set(g),v=[...g];for(;v.length>0;){const d=v.shift();for(const p of d.deps){if(p.kind==="dev"&&!o)continue;const f=u(p);f!==void 0&&!h.has(f)&&(h.add(f),v.push(f))}}const m=[...h],y=m.map(d=>{const p=i(d);return{"bom-ref":p,name:d.name,purl:p,type:"library",version:d.version}}).sort((d,p)=>(d["bom-ref"]??"").localeCompare(p["bom-ref"]??"")),b=m.map(d=>{const p=[...new Set(d.deps.filter(k=>o||k.kind!=="dev").map(k=>u(k)).filter(k=>k!==void 0&&h.has(k)).map(k=>i(k)))].sort(),f=i(d);return p.length>0?{dependsOn:p,ref:f}:{ref:f}}).sort((d,p)=>d.ref.localeCompare(p.ref));return{components:y,dependencies:b}},ue=(e,n)=>`pkg:hex/${encodeURIComponent(e)}@${encodeURIComponent(n)}`,le=/^\s*"[^"]+":\s*\{:hex,\s*:([a-z_]\w*),\s*"([^"]+)"/,q=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=le.exec(t);if(o?.[1]===void 0||o[2]===void 0)continue;const s=[];for(const c of t.matchAll(/\{:([a-z_]\w*),\s*"/g))s.push({kind:"main",name:c[1]});n.push({deps:s,member:!0,name:o[1],version:o[2]})}return n},Oe=(e,n={})=>{let t;try{t=_(x(e,"mix.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return V(q(t),{includeDev:n.includeDev,normalize:o=>o,purl:ue})},pe=(e,n)=>`pkg:nuget/${encodeURIComponent(e)}@${encodeURIComponent(n)}`,$=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),I=e=>e.toLowerCase(),z=e=>{let n;try{n=JSON.parse(e)}catch{return[]}if(!$(n)||!$(n.dependencies))return[];const t=[];for(const i of Object.values(n.dependencies)){if(!$(i))continue;const a=new Map;for(const[u,l]of Object.entries(i))$(l)&&a.set(u,{depIds:$(l.dependencies)?Object.keys(l.dependencies):[],resolved:typeof l.resolved=="string"?l.resolved:void 0,type:typeof l.type=="string"?l.type:""});t.push(a)}const o=new Set;let s=!1;for(const i of t)for(const a of i.values())if(a.type==="Direct"&&(s=!0),a.type==="Project")for(const u of a.depIds)o.add(I(u));const c=new Map;for(const i of t)for(const[a,u]of i){if(u.type==="Project"||u.resolved===void 0)continue;const l=`${I(a)}\0${u.resolved}`,g=c.get(l)??{deps:[],member:!1,name:a,version:u.resolved};c.set(l,g),u.type==="Direct"&&(g.member=!0);for(const h of u.depIds){const v=i.get(h)?.resolved;v!==void 0&&g.deps.push({kind:"main",name:h,version:v})}}const r=!s&&o.size===0;return[...c.values()].map(i=>({...i,member:r||i.member||o.has(I(i.name))}))},Ge=e=>{let n;try{n=_(x(e,"packages.lock.json"),"utf8")}catch{return{components:[],dependencies:[]}}return V(z(n),{normalize:I,purl:pe})},F={"crates.io":["Cargo.lock"],Go:["go.sum"],Hex:["mix.lock"],Maven:["gradle.lockfile","pom.xml"],NuGet:["packages.lock.json"],Packagist:["composer.lock"],Pub:["pubspec.lock"],PyPI:["uv.lock","poetry.lock","Pipfile.lock"],RubyGems:["Gemfile.lock"],SwiftURL:["Package.resolved"]},fe={cargo:"crates.io",composer:"Packagist","crates.io":"crates.io",dart:"Pub",go:"Go",gradle:"Maven",hex:"Hex",maven:"Maven",npm:"npm",nuget:"NuGet",packagist:"Packagist",pub:"Pub",pypi:"PyPI",rubygems:"RubyGems",swift:"SwiftURL",swifturl:"SwiftURL"},R=e=>fe[e.toLowerCase()]??e,Le=e=>F[R(e)]??[],ve=(e,n)=>{const t=R(n),o=F[t]??[];for(const s of o){const c=K(e,s);if(E(c))return c}},H=e=>{const n=new Set,t=[];for(const o of e){const s=`${o.name}@${o.version}`;n.has(s)||(n.add(s),t.push(o))}return t},me=/\[\[package\]\]([\s\S]*?)(?=\[\[|$)/g,ge=/^\s*name\s*=\s*"([^"]+)"\s*$/m,he=/^\s*version\s*=\s*"([^"]+)"\s*$/m,ke=e=>{const n=[];for(const t of e.matchAll(me)){const o=t[1]??"",s=ge.exec(o)?.[1],c=he.exec(o)?.[1];s&&c&&n.push({isDev:!1,name:s,version:c})}return n},ye=e=>{let n;try{n=JSON.parse(e)}catch{return[]}if(typeof n!="object"||n===null)return[];const t=[];for(const o of["default","develop"]){const s=n[o];if(!(typeof s!="object"||s===null))for(const[c,r]of Object.entries(s)){if(typeof r!="object"||r===null)continue;const i=r.version;if(typeof i!="string")continue;const a=i.replace(/^==/,"").trim();a.length>0&&t.push({isDev:!1,name:c,version:a})}}return t},be=e=>{const n=[];let t;try{t=JSON.parse(e)}catch{return n}for(const[o,s]of[["packages",!1],["packages-dev",!0]]){const c=t[o];if(Array.isArray(c))for(const r of c)typeof r.name=="string"&&typeof r.version=="string"&&n.push({isDev:s,name:r.name,version:ee(r.version)})}return n},Pe=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=t.trim();if(o.length===0)continue;const s=o.split(/\s+/);if(s.length<3)continue;const[c,r]=s;if(!c||!r?.endsWith("/go.mod"))continue;const i=r.slice(0,-7);i.length!==0&&n.push({isDev:!1,name:c,version:i})}return n},we=/^ {4}([^ ()]+) \(([^()]+)\)\s*$/,Se=e=>{const n=[];let t=!1,o=!1;for(const s of e.split(/\r?\n/)){if(s.startsWith("GEM")){t=!0,o=!1;continue}if(t&&/^[A-Z]/.test(s)){t=!1,o=!1;continue}if(t&&s.trim()==="specs:"){o=!0;continue}if(o){const c=we.exec(s);if(c){const[,r,i]=c,a=i?.split("-")[0];r&&a&&n.push({isDev:!1,name:r,version:a})}}}return n},$e=e=>{const n=[];let t=!1;for(const o of e.split(/\r?\n/)){if(/^\S/.test(o)){t=o.trimEnd()==="packages:";continue}const s=n.at(-1),c=/^ {2}(\S+):\s*$/.exec(o);if(t&&c?.[1]!==void 0){n.push({name:c[1]});continue}const[,r,i]=/^ {4}(dependency|source|version): "?([^"]*)"?\s*$/.exec(o)??[];t&&s!==void 0&&r!==void 0&&i!==void 0&&(r==="source"?s.source=i:r==="version"?s.version=i:s.dependency=i)}return n.filter(o=>o.source==="hosted"&&o.version!==void 0&&o.version.length>0).map(o=>({isDev:o.dependency==="direct dev",name:o.name,version:o.version}))},_e=e=>e.trim().replace(/^[a-z+]+:\/\//i,"").replace(/^[^@/]+@([^:/]+):/,"$1/").replace(/\.git$/,"").replace(/\/+$/,""),Ie=e=>{let n;try{n=JSON.parse(e)}catch{return[]}const t=typeof n=="object"&&n!==null?n.pins:void 0;if(!Array.isArray(t))return[];const o=[];for(const s of t)typeof s.location=="string"&&typeof s.state?.version=="string"&&s.state.version.length>0&&o.push({isDev:!1,name:_e(s.location),version:s.state.version});return o},W=e=>{const n=[],t=[];for(const o of T(e))for(const s of o.dependencies){if(s.group===void 0||s.artifact===void 0||s.version===void 0){t.push(s.group!==void 0&&s.artifact!==void 0?`${s.group}:${s.artifact}`:s.unresolved??"");continue}n.push({isDev:!1,name:`${s.group}:${s.artifact}`,version:s.version})}for(const o of U(e))n.push({isDev:!1,name:`${o.group}:${o.artifact}`,version:o.version});return{packages:H(n),unresolved:[...new Set(t)]}},Ne=e=>W(e).unresolved,Ae=(e,n)=>{if(R(n)==="Maven")return W(e).packages;const t=ve(e,n);if(!t)return[];let o;try{o=_(t,"utf8")}catch{return[]}const s=t.split(/[/\\]/).pop()??"";let c;switch(s){case"Cargo.lock":case"poetry.lock":case"uv.lock":{c=ke(o);break}case"composer.lock":{c=be(o);break}case"Gemfile.lock":{c=Se(o);break}case"go.sum":{c=Pe(o);break}case"mix.lock":{c=q(o).map(r=>({isDev:!1,name:r.name,version:r.version}));break}case"Package.resolved":{c=Ie(o);break}case"packages.lock.json":{c=z(o).map(r=>({isDev:!1,name:r.name,version:r.version}));break}case"Pipfile.lock":{c=ye(o);break}case"pubspec.lock":{c=$e(o);break}default:return[]}return H(c)};export{Oe as a,V as b,R as c,De as d,Ce as e,Ge as f,ae as g,ve as h,Le as i,Ae as l,Ne as m};
1
+ import{createRequire as J}from"node:module";import{e as K}from"./index-0dnGN3GP.js";import{x as X}from"./registry-CndByNx9.js";import{e as L,i as Z,s as Q}from"./maven-pom-B0KG9kJQ.js";import{c as ee}from"./composer-DR3D-Psb.js";let Y;const B=e=>(Y??=J(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return B(e)},{existsSync:E,readFileSync:_}=G("node:fs"),{resolve:w,dirname:M,join:x}=G("node:path"),oe=8,ne=8,te="vis:maven:version-unresolved",N=(e,n,t)=>`pkg:maven/${encodeURIComponent(e)}/${encodeURIComponent(n)}${t===void 0?"":`@${encodeURIComponent(t)}`}`,A=e=>{if(E(e))try{return{path:e,scan:Q(_(e,"utf8"))}}catch{return}},D=e=>{const n=e.scan.parent;if(!n)return;const t=n.relativePath||"../pom.xml",o=t.endsWith(".xml")?w(M(e.path),t):w(M(e.path),t,"pom.xml"),s=A(o);return s&&s.scan.artifactId?.value===n.artifactId?.value&&L(s.scan)===n.groupId?.value?s:void 0},se=e=>{const n=[e];let t=D(e);for(;t&&n.length<oe;)n.push(t),t=D(t);return n},P=(e,n,t=0)=>{if(e===""||t>ne)return;let o=!1;const s=e.replaceAll(/\$\{([^}]+)\}/g,(c,r)=>{const i=n(r),a=i===void 0?void 0:P(i,n,t+1);return a===void 0?(o=!0,""):a});return o||s.includes("${")?void 0:s},C=(e,n)=>{if(e===void 0)return{unresolved:""};const t=P(e,n);return t===void 0||!Z(t)?{unresolved:e}:{version:t}},re=e=>{const n=[],t=new Set,o=s=>{const c=w(s),r=A(c);if(!(!r||t.has(c))){t.add(c),n.push(se(r));for(const i of r.scan.modules)o(i.endsWith(".xml")?w(M(c),i):w(M(c),i,"pom.xml"))}};return o(e),n},T=e=>{const n=[];for(const t of re(w(e,"pom.xml"))){const o=t[0].scan,s=new Map;for(const m of t)for(const[y,b]of m.scan.properties)s.has(y)||s.set(y,b.value);const c=L(o),r=o.artifactId?.value,i=o.version?.value??o.parent?.version?.value,a=o.parent?.version?.value,l=m=>{switch(m){case"artifactId":case"pom.artifactId":case"project.artifactId":return r;case"groupId":case"pom.groupId":case"project.groupId":return c;case"pom.version":case"project.version":case"version":return i;case"project.parent.version":return a;default:return s.get(m)}},u=c===void 0?void 0:P(c,l),g=r===void 0?void 0:P(r,l),h=C(i,l),v=new Map;for(const m of t)for(const y of m.scan.dependencies){const b=y.groupId?.value??"",d=y.artifactId?.value??"",p=`${b}:${d}`;if(v.has(p))continue;const f=P(b,l),k=P(d,l),j=f===void 0||k===void 0?{unresolved:y.version?.value??""}:C(y.version?.value,l);v.set(p,{artifact:k,group:f,scope:y.scope?.value??"compile",unresolved:f===void 0||k===void 0?p:j.unresolved,version:j.version})}n.push({artifact:g,dependencies:[...v.values()],group:u,path:t[0].path,unresolved:h.unresolved,version:h.version})}return n},O=e=>e==="test"||e==="provided",ce=(e,n)=>{const t=new Set(n),o=new Map;for(const r of e)r.group!==void 0&&r.artifact!==void 0&&o.set(`${r.group}:${r.artifact}`,r);const s=new Set(e.filter(r=>r.artifact!==void 0&&t.has(r.artifact))),c=[...s];for(;c.length>0;){const r=c.shift();for(const i of r.dependencies){const a=o.get(`${i.group}:${i.artifact}`);a!==void 0&&!s.has(a)&&(s.add(a),c.push(a))}}return e.filter(r=>s.has(r))},De=(e,n={})=>{const t=n.includeDev??!1,o=new Map,s=new Map,c=(a,l,u,g,h)=>{const v=N(a,l,u);if(!o.has(v)){const m={"bom-ref":v,group:a,name:l,purl:v,type:"library"};u!==void 0&&(m.version=u),g!==void 0&&(m.properties=[{name:te,value:g}]),h!==void 0&&(m.scope=h),o.set(v,m)}return v},r=T(e);for(const a of n.focusNames===void 0?r:ce(r,n.focusNames)){const l=a.group!==void 0&&a.artifact!==void 0?c(a.group,a.artifact,a.version,a.unresolved):void 0;for(const u of a.dependencies){if(O(u.scope)&&!t||u.group===void 0||u.artifact===void 0)continue;const g=c(u.group,u.artifact,u.version,u.unresolved,O(u.scope)?"optional":"required");l!==void 0&&s.set(l,(s.get(l)??new Set).add(g))}}const i=[...o.values()].sort((a,l)=>(a["bom-ref"]??"").localeCompare(l["bom-ref"]??""));return{components:i,dependencies:i.map(a=>{const l=a["bom-ref"]??"",u=[...s.get(l)??[]].sort();return u.length>0?{dependsOn:u,ref:l}:{ref:l}})}},ie=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=t.trim();if(o.length===0||o.startsWith("#"))continue;const s=o.indexOf("="),c=(s===-1?o:o.slice(0,s)).split(":");if(c.length<3||!c[0]||!c[1]||!c[2])continue;const r=s===-1?[]:o.slice(s+1).split(",").map(i=>i.trim()).filter(i=>i.length>0);n.push({artifact:c[1],configurations:r,group:c[0],version:c[2]})}return n},ae=e=>["",...X(e,[])].map(t=>x(e,t,"gradle.lockfile")).filter(t=>E(t)),U=e=>{const n=[];for(const t of ae(e))try{n.push(...ie(_(t,"utf8")))}catch{}return n},de=e=>e.configurations.length>0&&e.configurations.every(n=>/test/i.test(n)),Ce=(e,n={})=>{const t=n.includeDev??!1,o=new Map;for(const r of U(e)){const i=N(r.group,r.artifact,r.version),a=o.get(i),l=de(r);o.set(i,{dev:(a?.dev??!0)&&l,entry:r})}const s=[...o.keys()].filter(r=>t||!o.get(r).dev).sort();return{components:s.map(r=>{const{dev:i,entry:a}=o.get(r);return{"bom-ref":r,group:a.group,name:a.artifact,purl:r,scope:i?"optional":"required",type:"library",version:a.version}}),dependencies:s.map(r=>({ref:r}))}},V=(e,n)=>{const{focusNames:t,includeDev:o=!1,normalize:s,purl:c}=n,r=new Map;for(const d of e){const p=`${s(d.name)}@${d.version}`;r.set(p,(r.get(p)??0)+1)}const i=d=>{const p=(r.get(`${s(d.name)}@${d.version}`)??0)>1,f=c(d.name,d.version);return p&&d.source!==void 0?`${f}?source=${encodeURIComponent(d.source)}`:f},a=new Map;for(const d of e){const p=s(d.name);a.set(p,[...a.get(p)??[],d])}const l=d=>{const p=(a.get(s(d.name))??[]).filter(f=>(d.version===void 0||f.version===d.version)&&(d.source===void 0||f.source===d.source));return p.length===1?p[0]:void 0},u=t===void 0?void 0:new Set(t.map(d=>s(d))),g=e.filter(d=>d.member&&(u===void 0||u.has(s(d.name)))),h=new Set(g),v=[...g];for(;v.length>0;){const d=v.shift();for(const p of d.deps){if(p.kind==="dev"&&!o)continue;const f=l(p);f!==void 0&&!h.has(f)&&(h.add(f),v.push(f))}}const m=[...h],y=m.map(d=>{const p=i(d);return{"bom-ref":p,name:d.name,purl:p,type:"library",version:d.version}}).sort((d,p)=>(d["bom-ref"]??"").localeCompare(p["bom-ref"]??"")),b=m.map(d=>{const p=[...new Set(d.deps.filter(k=>o||k.kind!=="dev").map(k=>l(k)).filter(k=>k!==void 0&&h.has(k)).map(k=>i(k)))].sort(),f=i(d);return p.length>0?{dependsOn:p,ref:f}:{ref:f}}).sort((d,p)=>d.ref.localeCompare(p.ref));return{components:y,dependencies:b}},le=(e,n)=>`pkg:hex/${encodeURIComponent(e)}@${encodeURIComponent(n)}`,ue=/^\s*"[^"]+":\s*\{:hex,\s*:([a-z_]\w*),\s*"([^"]+)"/,q=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=ue.exec(t);if(o?.[1]===void 0||o[2]===void 0)continue;const s=[];for(const c of t.matchAll(/\{:([a-z_]\w*),\s*"/g))s.push({kind:"main",name:c[1]});n.push({deps:s,member:!0,name:o[1],version:o[2]})}return n},Oe=(e,n={})=>{let t;try{t=_(x(e,"mix.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return V(q(t),{includeDev:n.includeDev,normalize:o=>o,purl:le})},pe=(e,n)=>`pkg:nuget/${encodeURIComponent(e)}@${encodeURIComponent(n)}`,$=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),I=e=>e.toLowerCase(),z=e=>{let n;try{n=JSON.parse(e)}catch{return[]}if(!$(n)||!$(n.dependencies))return[];const t=[];for(const i of Object.values(n.dependencies)){if(!$(i))continue;const a=new Map;for(const[l,u]of Object.entries(i))$(u)&&a.set(l,{depIds:$(u.dependencies)?Object.keys(u.dependencies):[],resolved:typeof u.resolved=="string"?u.resolved:void 0,type:typeof u.type=="string"?u.type:""});t.push(a)}const o=new Set;let s=!1;for(const i of t)for(const a of i.values())if(a.type==="Direct"&&(s=!0),a.type==="Project")for(const l of a.depIds)o.add(I(l));const c=new Map;for(const i of t)for(const[a,l]of i){if(l.type==="Project"||l.resolved===void 0)continue;const u=`${I(a)}\0${l.resolved}`,g=c.get(u)??{deps:[],member:!1,name:a,version:l.resolved};c.set(u,g),l.type==="Direct"&&(g.member=!0);for(const h of l.depIds){const v=i.get(h)?.resolved;v!==void 0&&g.deps.push({kind:"main",name:h,version:v})}}const r=!s&&o.size===0;return[...c.values()].map(i=>({...i,member:r||i.member||o.has(I(i.name))}))},Ge=e=>{let n;try{n=_(x(e,"packages.lock.json"),"utf8")}catch{return{components:[],dependencies:[]}}return V(z(n),{normalize:I,purl:pe})},F={"crates.io":["Cargo.lock"],Go:["go.sum"],Hex:["mix.lock"],Maven:["gradle.lockfile","pom.xml"],NuGet:["packages.lock.json"],Packagist:["composer.lock"],Pub:["pubspec.lock"],PyPI:["uv.lock","poetry.lock","Pipfile.lock"],RubyGems:["Gemfile.lock"],SwiftURL:["Package.resolved"]},fe={cargo:"crates.io",composer:"Packagist","crates.io":"crates.io",dart:"Pub",go:"Go",gradle:"Maven",hex:"Hex",maven:"Maven",npm:"npm",nuget:"NuGet",packagist:"Packagist",pub:"Pub",pypi:"PyPI",rubygems:"RubyGems",swift:"SwiftURL",swifturl:"SwiftURL"},R=e=>fe[e.toLowerCase()]??e,Le=e=>F[R(e)]??[],ve=(e,n)=>{const t=R(n),o=F[t]??[];for(const s of o){const c=K(e,s);if(E(c))return c}},H=e=>{const n=new Set,t=[];for(const o of e){const s=`${o.name}@${o.version}`;n.has(s)||(n.add(s),t.push(o))}return t},me=/\[\[package\]\]([\s\S]*?)(?=\[\[|$)/g,ge=/^\s*name\s*=\s*"([^"]+)"\s*$/m,he=/^\s*version\s*=\s*"([^"]+)"\s*$/m,ke=e=>{const n=[];for(const t of e.matchAll(me)){const o=t[1]??"",s=ge.exec(o)?.[1],c=he.exec(o)?.[1];s&&c&&n.push({isDev:!1,name:s,version:c})}return n},ye=e=>{let n;try{n=JSON.parse(e)}catch{return[]}if(typeof n!="object"||n===null)return[];const t=[];for(const o of["default","develop"]){const s=n[o];if(!(typeof s!="object"||s===null))for(const[c,r]of Object.entries(s)){if(typeof r!="object"||r===null)continue;const i=r.version;if(typeof i!="string")continue;const a=i.replace(/^==/,"").trim();a.length>0&&t.push({isDev:!1,name:c,version:a})}}return t},be=e=>{const n=[];let t;try{t=JSON.parse(e)}catch{return n}for(const[o,s]of[["packages",!1],["packages-dev",!0]]){const c=t[o];if(Array.isArray(c))for(const r of c)typeof r.name=="string"&&typeof r.version=="string"&&n.push({isDev:s,name:r.name,version:ee(r.version)})}return n},Pe=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=t.trim();if(o.length===0)continue;const s=o.split(/\s+/);if(s.length<3)continue;const[c,r]=s;if(!c||!r?.endsWith("/go.mod"))continue;const i=r.slice(0,-7);i.length!==0&&n.push({isDev:!1,name:c,version:i})}return n},we=/^ {4}([^ ()]+) \(([^()]+)\)\s*$/,Se=e=>{const n=[];let t=!1,o=!1;for(const s of e.split(/\r?\n/)){if(s.startsWith("GEM")){t=!0,o=!1;continue}if(t&&/^[A-Z]/.test(s)){t=!1,o=!1;continue}if(t&&s.trim()==="specs:"){o=!0;continue}if(o){const c=we.exec(s);if(c){const[,r,i]=c,a=i?.split("-")[0];r&&a&&n.push({isDev:!1,name:r,version:a})}}}return n},$e=e=>{const n=[];let t=!1;for(const o of e.split(/\r?\n/)){if(/^\S/.test(o)){t=o.trimEnd()==="packages:";continue}const s=n.at(-1),c=/^ {2}(\S+):\s*$/.exec(o);if(t&&c?.[1]!==void 0){n.push({name:c[1]});continue}const[,r,i]=/^ {4}(dependency|source|version): "?([^"]*)"?\s*$/.exec(o)??[];t&&s!==void 0&&r!==void 0&&i!==void 0&&(r==="source"?s.source=i:r==="version"?s.version=i:s.dependency=i)}return n.filter(o=>o.source==="hosted"&&o.version!==void 0&&o.version.length>0).map(o=>({isDev:o.dependency==="direct dev",name:o.name,version:o.version}))},_e=e=>e.trim().replace(/^[a-z+]+:\/\//i,"").replace(/^[^@/]+@([^:/]+):/,"$1/").replace(/\.git$/,"").replace(/\/+$/,""),Ie=e=>{let n;try{n=JSON.parse(e)}catch{return[]}const t=typeof n=="object"&&n!==null?n.pins:void 0;if(!Array.isArray(t))return[];const o=[];for(const s of t)typeof s.location=="string"&&typeof s.state?.version=="string"&&s.state.version.length>0&&o.push({isDev:!1,name:_e(s.location),version:s.state.version});return o},W=e=>{const n=[],t=[];for(const o of T(e))for(const s of o.dependencies){if(s.group===void 0||s.artifact===void 0||s.version===void 0){t.push(s.group!==void 0&&s.artifact!==void 0?`${s.group}:${s.artifact}`:s.unresolved??"");continue}n.push({isDev:!1,name:`${s.group}:${s.artifact}`,version:s.version})}for(const o of U(e))n.push({isDev:!1,name:`${o.group}:${o.artifact}`,version:o.version});return{packages:H(n),unresolved:[...new Set(t)]}},Ne=e=>W(e).unresolved,Ae=(e,n)=>{if(R(n)==="Maven")return W(e).packages;const t=ve(e,n);if(!t)return[];let o;try{o=_(t,"utf8")}catch{return[]}const s=t.split(/[/\\]/).pop()??"";let c;switch(s){case"Cargo.lock":case"poetry.lock":case"uv.lock":{c=ke(o);break}case"composer.lock":{c=be(o);break}case"Gemfile.lock":{c=Se(o);break}case"go.sum":{c=Pe(o);break}case"mix.lock":{c=q(o).map(r=>({isDev:!1,name:r.name,version:r.version}));break}case"Package.resolved":{c=Ie(o);break}case"packages.lock.json":{c=z(o).map(r=>({isDev:!1,name:r.name,version:r.version}));break}case"Pipfile.lock":{c=ye(o);break}case"pubspec.lock":{c=$e(o);break}default:return[]}return H(c)};export{Oe as a,V as b,R as c,De as d,Ce as e,Ge as f,ae as g,ve as h,Le as i,Ae as l,Ne as m};
@@ -1,4 +1,4 @@
1
- import{e as o,z as f}from"./index-BzhrR_iC.js";import{l as E}from"../packem_chunks/ts-loader.js";import{i as O}from"../packem_chunks/cli-main.js";import{U as c}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{y as u}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as C}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";const J=(x,a,d)=>{const s=[],$=Object.entries(d).filter(([,n])=>n).map(([n])=>n);switch(x){case"bun":{const n=o(a,"package.json");if(u(n))try{const e=C(n);e.trustedDependencies=$,c(n,`${JSON.stringify(e,null,2)}
1
+ import{e as o,z as f}from"./index-0dnGN3GP.js";import{l as E}from"../packem_chunks/ts-loader.js";import{i as O}from"../packem_chunks/cli-main.js";import{U as c}from"./env-BymuoTL8.js";import{y as u}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as C}from"./package-version-x7sPg2TM.js";const J=(x,a,d)=>{const s=[],$=Object.entries(d).filter(([,n])=>n).map(([n])=>n);switch(x){case"bun":{const n=o(a,"package.json");if(u(n))try{const e=C(n);e.trustedDependencies=$,c(n,`${JSON.stringify(e,null,2)}
2
2
  `),s.push(`Updated package.json trustedDependencies with ${$.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=o(a,".npmrc");let e=u(n)?f(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
3
3
  ignore-scripts=true
4
4
  `,c(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=o(a,"pnpm-workspace.yaml");if(!u(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=E(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const y={...e,...d},j=Object.keys(d).filter(t=>e[t]!==d[t]).length,g=$.toSorted((t,l)=>t.localeCompare(l)),S=[...new Set([...m,...g])].toSorted((t,l)=>t.localeCompare(l)),b=g.filter(t=>!m.includes(t)).length;if(j===0&&b===0)s.push(`All ${String(Object.keys(d).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(y).sort(),l=i=>i.startsWith("@")||i.includes("/")||/[:#\s]/.test(i),h=i=>l(i)?`'${i.replaceAll("'","''")}'`:i,p=`allowBuilds:
@@ -1,2 +1,2 @@
1
- import{e as u,z as f}from"./index-BzhrR_iC.js";import{y as m}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const d=/^(@[^:]+):registry$/,h=/^\/\/(.+)\/:_authToken$/,y=/^https?:\/\//,E=/\/$/,T=/\$\{([^}]+)\}/g,_=s=>{let e=!1;const r=s.replaceAll(T,(o,n)=>{const t=n.indexOf(":-"),c=(t===-1?n:n.slice(0,t)).trim(),i=t===-1?void 0:n.slice(t+2),a=process.env[c];return a!==void 0?a:i!==void 0?i:(e=!0,"")});return{hasUnresolved:e,value:r}},R=s=>{const e=new Map,r=new Map;let o="https://registry.npmjs.org";for(const n of s.split(`
1
+ import{e as u,z as f}from"./index-0dnGN3GP.js";import{y as m}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";const d=/^(@[^:]+):registry$/,h=/^\/\/(.+)\/:_authToken$/,y=/^https?:\/\//,E=/\/$/,T=/\$\{([^}]+)\}/g,_=s=>{let e=!1;const r=s.replaceAll(T,(o,n)=>{const t=n.indexOf(":-"),c=(t===-1?n:n.slice(0,t)).trim(),i=t===-1?void 0:n.slice(t+2),a=process.env[c];return a!==void 0?a:i!==void 0?i:(e=!0,"")});return{hasUnresolved:e,value:r}},R=s=>{const e=new Map,r=new Map;let o="https://registry.npmjs.org";for(const n of s.split(`
2
2
  `)){const t=n.trim();if(!t||t.startsWith("#")||t.startsWith(";"))continue;const c=t.indexOf("=");if(c===-1)continue;const i=t.slice(0,c).trim(),{hasUnresolved:a,value:l}=_(t.slice(c+1).trim()),p=d.exec(i);if(p?.[1]){e.set(p[1],l);continue}if(i==="registry"){o=l;continue}const g=h.exec(i);g?.[1]&&!a&&r.set(g[1],l)}return{authTokens:r,defaultRegistry:o,registries:e}},k=(s,e)=>({authTokens:new Map([...s.authTokens,...e.authTokens]),defaultRegistry:e.defaultRegistry==="https://registry.npmjs.org"?s.defaultRegistry:e.defaultRegistry,registries:new Map([...s.registries,...e.registries])}),O=s=>{const e={authTokens:new Map,defaultRegistry:"https://registry.npmjs.org",registries:new Map},r=process.env.HOME??process.env.USERPROFILE??"",o=u(r,".npmrc");let n=r&&m(o)?R(f(o)):e;const t=u(s,".npmrc");return m(t)&&(n=k(n,R(f(t)))),n},G=(s,e)=>{let r=e.defaultRegistry;if(s.startsWith("@")){const t=s.split("/")[0];if(t&&e.registries.has(t)){const c=e.registries.get(t);c&&(r=c)}}const o=r.replace(y,"").replace(E,"");return{token:e.authTokens.get(o),url:r}};export{E as T,G as g,O as l,R as p};
@@ -1 +1 @@
1
- import{a as u}from"./advisories-BKsh48bi.js";const d=e=>{const s=e.database_specific?.severity?.toUpperCase();if(s==="CRITICAL"||s==="HIGH"||s==="MODERATE"||s==="LOW")return s;const r=e.severity?.find(t=>t.type==="CVSS_V3")?.score;if(r){const t=Number.parseFloat(r);return t>=9?"CRITICAL":t>=7?"HIGH":t>=4?"MODERATE":"LOW"}return"UNKNOWN"},v=e=>{const s=e.severity?.find(r=>r.type==="CVSS_V3")?.score;return s?Number.parseFloat(s):void 0},y=e=>{const s=[];for(const r of e.affected??[])for(const t of r.ranges??[])for(const o of t.events??[])o.fixed&&s.push(o.fixed);return s},l=e=>({aliases:e.aliases?.length?e.aliases:void 0,cvssScore:v(e),fixedVersions:y(e),id:e.id,severity:d(e),summary:e.summary??""}),O=async(e,s=1e4)=>{if(e.length===0)return new Map;const r=e.map(n=>({package:{ecosystem:"npm",name:n.name},version:n.version})),t=new AbortController,o=setTimeout(()=>{t.abort()},s);try{const n=await fetch("https://api.osv.dev/v1/querybatch",{body:JSON.stringify({queries:r}),headers:{"Content-Type":"application/json"},method:"POST",signal:t.signal});if(!n.ok)return new Map;const f=await n.json(),i=new Map;for(const[p,c]of e.entries()){const a=f.results[p]?.vulns;a&&a.length>0&&i.set(u(c.name,c.version),a.map(m=>l(m)))}return i}catch{return new Map}finally{clearTimeout(o)}};export{O as f};
1
+ import{a as u}from"./advisories-DHGJ6XhP.js";const d=e=>{const s=e.database_specific?.severity?.toUpperCase();if(s==="CRITICAL"||s==="HIGH"||s==="MODERATE"||s==="LOW")return s;const r=e.severity?.find(t=>t.type==="CVSS_V3")?.score;if(r){const t=Number.parseFloat(r);return t>=9?"CRITICAL":t>=7?"HIGH":t>=4?"MODERATE":"LOW"}return"UNKNOWN"},v=e=>{const s=e.severity?.find(r=>r.type==="CVSS_V3")?.score;return s?Number.parseFloat(s):void 0},y=e=>{const s=[];for(const r of e.affected??[])for(const t of r.ranges??[])for(const o of t.events??[])o.fixed&&s.push(o.fixed);return s},l=e=>({aliases:e.aliases?.length?e.aliases:void 0,cvssScore:v(e),fixedVersions:y(e),id:e.id,severity:d(e),summary:e.summary??""}),O=async(e,s=1e4)=>{if(e.length===0)return new Map;const r=e.map(n=>({package:{ecosystem:"npm",name:n.name},version:n.version})),t=new AbortController,o=setTimeout(()=>{t.abort()},s);try{const n=await fetch("https://api.osv.dev/v1/querybatch",{body:JSON.stringify({queries:r}),headers:{"Content-Type":"application/json"},method:"POST",signal:t.signal});if(!n.ok)return new Map;const f=await n.json(),i=new Map;for(const[p,c]of e.entries()){const a=f.results[p]?.vulns;a&&a.length>0&&i.set(u(c.name,c.version),a.map(m=>l(m)))}return i}catch{return new Map}finally{clearTimeout(o)}};export{O as f};
@@ -0,0 +1,2 @@
1
+ import{createRequire as j}from"node:module";import{L as J}from"./index-CIdjkZgt.js";import{osvBloomDecode as z,osvBloomProbeBatch as K,NATIVE_BINDING_VERSION as D}from"#native";let k;const V=e=>(k??=j(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,t]=h.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return h.getBuiltinModule(e)}return V(e)},{createHash:H,randomUUID:P}=v("node:crypto"),{existsSync:g}=v("node:fs"),{readFile:O,mkdir:T,stat:B,writeFile:F,rename:q,unlink:G}=v("node:fs/promises"),{join:d,dirname:W}=v("node:path"),I=6;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const nt="https://endevco.github.io/osv-bloom",X=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(s){super(`osv-bloom source host '${s}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class b extends Error{cause="OSV_BLOOM_NETWORK";constructor(s,t){super(`osv-bloom fetch failed for ${s}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class Y extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(s,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${s}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(s){super(`osv-bloom manifest invalid: ${s}`),this.name="OsvBloomManifestError"}}class Q extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(s){super(`No osv-bloom cache at ${s}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const p=e=>{const t=J("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(t,"osv-bloom")},l=e=>d(e,"filter.bin"),L=e=>d(e,"manifest.json"),$=e=>d(e,"state.json"),Z=(e,s)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...X,...s??[]]).has(t.host))throw new w(t.host);return t},at=async e=>{const s=Date.now(),t=e.cacheDir??p(e.workspaceRoot);await T(t,{recursive:!0});const r=Z(e.source,e.allowedHosts),n=new URL("manifest.json",M(r.toString())),o=new URL("filter.bin",M(r.toString())),a=await A(n,{method:"GET"});if(!a.ok)throw new b(n.toString(),a.status);const _=await a.text(),i=R(_),u=await x(t);if(!e.force&&u?.setDigestSha256===i.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-s,manifest:i,upToDate:!0};const E={};!e.force&&u?.filterEtag&&(E.headers={"if-none-match":u.filterEtag});const f=await A(o,{...E,method:"GET"});if(f.status===304&&u&&g(l(t)))return await N(t,_,{fetchedAtIso:new Date().toISOString(),filterEtag:u.filterEtag,setDigestSha256:i.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-s,manifest:i,upToDate:!0};if(!f.ok||!f.body)throw new b(o.toString(),f.status);const c=Buffer.from(await f.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const y=tt(c);if(y!==i.filterSha256)throw new Y(i.filterSha256,y);if(c.length!==i.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${i.bloomByteLen}`);const U=f.headers.get("etag")??void 0;return await S(l(t),c),await N(t,_,{fetchedAtIso:new Date().toISOString(),filterEtag:U,setDigestSha256:i.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-s,manifest:i,upToDate:!1}},it=async(e,s)=>{const t=s?.cacheDir??p(e),r=l(t);if(!g(r)){if(s?.softFail)return null;throw new Q(t)}const n=await O(r);return z(n)},ct=(e,s)=>K(e,s),lt=async(e,s)=>{const t=s??p(e);if(!g(l(t)))return{cacheDir:t,present:!1};let n,o;try{n=R(await O(L(t),"utf8"))}catch{}try{o=await x(t)}catch{}return{cacheDir:t,fetchedAtIso:o?.fetchedAtIso,manifest:n,present:!0}},R=e=>{let s;try{s=JSON.parse(e)}catch(o){throw new m(o instanceof Error?o.message:String(o))}const t=o=>{const a=s[o];if(typeof a!="number"||Number.isNaN(a))throw new m(`field '${o}' missing or non-numeric`);return a},r=o=>{const a=s[o];if(typeof a!="string"||a.length===0)throw new m(`field '${o}' missing or empty`);return a},n=t("format_version");if(n!==1)throw new m(`unsupported format_version ${n} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:r("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:r("filter_sha256"),formatVersion:n,setDigestSha256:r("set_digest_sha256"),sourceUrl:r("source_url"),targetFpr:t("target_fpr")}},x=async e=>{try{const s=await O($(e),"utf8"),t=JSON.parse(s);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},N=async(e,s,t)=>{await S(L(e),Buffer.from(s,"utf8")),await S($(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
2
+ `,"utf8"))},S=async(e,s)=>{await T(W(e),{recursive:!0});const t=`${e}.${process.pid}.${P()}.tmp`;try{await F(t,s),await q(t,e)}catch(r){throw await G(t).catch(()=>{}),r}},tt=e=>H("sha256").update(e).digest("hex"),M=e=>e.endsWith("/")?e:`${e}/`,et=3e4,A=async(e,s)=>{try{return await fetch(e,{...s,signal:AbortSignal.timeout(et)})}catch(t){throw new b(e.toString(),t instanceof Error?t.message:String(t))}};export{nt as D,Q as O,lt as g,it as l,ct as p,at as s};