@visulima/vis 1.0.0-alpha.32 → 1.0.0-alpha.34

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 (77) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/binx.js +1 -1
  4. package/dist/config/index.d.ts +31 -6
  5. package/dist/packem_chunks/bin.js +274 -274
  6. package/dist/packem_chunks/bloom-sync.js +1 -1
  7. package/dist/packem_chunks/fix.js +1 -1
  8. package/dist/packem_chunks/handler11.js +1 -1
  9. package/dist/packem_chunks/handler13.js +1 -1
  10. package/dist/packem_chunks/handler14.js +1 -1
  11. package/dist/packem_chunks/handler16.js +1 -1
  12. package/dist/packem_chunks/handler20.js +1 -1
  13. package/dist/packem_chunks/handler21.js +1 -1
  14. package/dist/packem_chunks/handler22.js +2 -2
  15. package/dist/packem_chunks/handler23.js +1 -1
  16. package/dist/packem_chunks/handler27.js +1 -1
  17. package/dist/packem_chunks/handler29.js +1 -1
  18. package/dist/packem_chunks/handler3.js +1 -1
  19. package/dist/packem_chunks/handler30.js +1 -1
  20. package/dist/packem_chunks/handler33.js +1 -1
  21. package/dist/packem_chunks/handler34.js +4 -4
  22. package/dist/packem_chunks/handler35.js +1 -1
  23. package/dist/packem_chunks/handler36.js +3 -3
  24. package/dist/packem_chunks/handler37.js +1 -1
  25. package/dist/packem_chunks/handler38.js +4 -4
  26. package/dist/packem_chunks/handler39.js +2 -2
  27. package/dist/packem_chunks/handler4.js +1 -1
  28. package/dist/packem_chunks/handler40.js +1 -1
  29. package/dist/packem_chunks/handler41.js +7 -7
  30. package/dist/packem_chunks/handler42.js +25 -153
  31. package/dist/packem_chunks/handler43.js +153 -25
  32. package/dist/packem_chunks/handler44.js +5 -5
  33. package/dist/packem_chunks/handler45.js +1 -1
  34. package/dist/packem_chunks/handler47.js +1 -1
  35. package/dist/packem_chunks/handler48.js +1 -1
  36. package/dist/packem_chunks/handler49.js +1 -1
  37. package/dist/packem_chunks/handler5.js +1 -1
  38. package/dist/packem_chunks/handler50.js +10 -10
  39. package/dist/packem_chunks/handler51.js +53 -53
  40. package/dist/packem_chunks/handler7.js +1 -1
  41. package/dist/packem_chunks/heal.js +1 -1
  42. package/dist/packem_chunks/help-command.js +1 -1
  43. package/dist/packem_chunks/index.js +1 -1
  44. package/dist/packem_chunks/keys-refresh.js +1 -1
  45. package/dist/packem_chunks/list.js +1 -1
  46. package/dist/packem_chunks/run.js +1 -1
  47. package/dist/packem_chunks/sync.js +1 -1
  48. package/dist/packem_chunks/sync2.js +1 -1
  49. package/dist/packem_chunks/verify-lockfile.js +1 -1
  50. package/dist/packem_shared/{ai-analysis-KP8b5lc0.js → ai-analysis-3QD_RS6F.js} +1 -1
  51. package/dist/packem_shared/{ai-fix-BkPUHA0z.js → ai-fix-TsjDQz_0.js} +3 -3
  52. package/dist/packem_shared/{cyclonedx-BilSFCNY.js → cyclonedx-zf9R2jCs.js} +1 -1
  53. package/dist/packem_shared/{dependency-scan-BUbOcMwX.js → dependency-scan-B70azq4x.js} +1 -1
  54. package/dist/packem_shared/{failure-log-34Wl3npC.js → failure-log-Dxafk3t4.js} +2 -2
  55. package/dist/packem_shared/index-BpbjpCNL.js +1 -0
  56. package/dist/packem_shared/{index-K8aQuMvx.js → index-di3jpyZS.js} +1 -1
  57. package/dist/packem_shared/{lifecycle-Buigdp7P.js → lifecycle-DvVTL8nx.js} +2 -2
  58. package/dist/packem_shared/{lockfile-CrT86D6d.js → lockfile-CedmXr44.js} +1 -1
  59. package/dist/packem_shared/{min-release-age-BPVXwPUg.js → min-release-age-DKMW2N_v.js} +1 -1
  60. package/dist/packem_shared/missing-package-json-DKAwoiWK.js +1 -0
  61. package/dist/packem_shared/{native-config-sync-BRZZetn3.js → native-config-sync-DBkJ-hsF.js} +1 -1
  62. package/dist/packem_shared/{provenance-D8vU1u2L.js → provenance-Cu6VR1Hy.js} +1 -1
  63. package/dist/packem_shared/{registry-keys-E3cZn4FI.js → registry-keys-CuBAVdsk.js} +1 -1
  64. package/dist/packem_shared/{resolve-explicit-cPzwdiEE.js → resolve-explicit-Xue0oq8V.js} +1 -1
  65. package/dist/packem_shared/{s1ngularity-DBcjspCC.js → s1ngularity-adnHbyTd.js} +1 -1
  66. package/dist/packem_shared/{scan-progress-CTVVf9WW.js → scan-progress-lZdk5KJ-.js} +1 -1
  67. package/dist/packem_shared/{signatures-ChTfrQvT.js → signatures-FGbYV5QE.js} +1 -1
  68. package/dist/packem_shared/{spinner-C8xs6QZv.js → spinner-0acw5pd_.js} +1 -1
  69. package/dist/packem_shared/{tabs-xZkm6Y_J.js → tabs-zUSdR1HI.js} +1 -1
  70. package/dist/packem_shared/{use-measured-height-Lea6TCVD.js → use-measured-height-DyCBfLtu.js} +1 -1
  71. package/dist/packem_shared/{verify-cLcZwKqe.js → verify-BYzxSKWD.js} +1 -1
  72. package/dist/packem_shared/{vis-update-app-BCKzlqj8.js → vis-update-app-D0QyGneK.js} +1 -1
  73. package/dist/packem_shared/{watch-loop-BpA_pxU9.js → watch-loop-jmQQl2Qe.js} +2 -2
  74. package/index.js +52 -52
  75. package/package.json +10 -10
  76. package/schemas/vis-config.schema.json +34 -7
  77. package/dist/packem_shared/index-BnANMQ7k.js +0 -1
@@ -1,2 +1,2 @@
1
- var z=Object.defineProperty;var n=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as Q}from"node:module";import{n as tt,M as w}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{f as j}from"../packem_chunks/config.js";import{aT as ht,U as dt,aU as L}from"../packem_chunks/bin.js";import{withEnhancedPath as wt}from"@visulima/task-runner";const Z=Q(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=n(t=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,o]=m.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return m.getBuiltinModule(t)}return Z(t)},"__cjs_getBuiltinModule"),{Socket:et}=p("node:net"),{randomBytes:ot}=p("node:crypto"),{readdir:st,writeFile:rt,rm:T,rename:it,open:nt,readFile:at,stat:ct,unlink:O}=p("node:fs/promises"),{createRequire:lt}=p("node:module"),{spawn:ft}=p("node:child_process"),{openSync:ut,closeSync:pt}=p("node:fs");var kt=Object.defineProperty,W=n((t,e)=>kt(t,"name",{value:e,configurable:!0}),"s$2");const mt=lt(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yt=W(t=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,o]=y.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return y.getBuiltinModule(t)}return mt(t)},"a"),{lstat:x,mkdir:vt}=yt("node:fs/promises"),gt=W(async t=>{tt(t);try{const e=await x(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await vt(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await x(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(o))}'`,{cause:e})}},"m");var _t=Object.defineProperty,f=n((t,e)=>_t(t,"name",{value:e,configurable:!0}),"s$1");const bt=3e4,N=100;class Et extends Error{static{n(this,"ServiceReadinessError")}constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs;static{f(this,"ServiceReadinessError")}}const $t=f(async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??bt,r=Date.now();for(;Date.now()-r<s;){if(await St(e,o))return;await Ht(N)}throw new Et(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},"waitForTcp"),St=f((t,e)=>new Promise(o=>{const s=new et,r=f(i=>{s.removeAllListeners(),s.destroy(),o(i)},"onDone");s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(N,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),"tryConnect"),Ht=f(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),Pt=f(async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await $t({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},"runReadiness");var Tt=Object.defineProperty,h=n((t,e)=>Tt(t,"name",{value:e,configurable:!0}),"o");const R=384,C=5e3,Rt=50,Mt=3e4,k=h(async t=>{const e=w(ht(t),"services");try{await gt(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},"getRegistryDir"),M=h(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),D=h((t,e)=>w(t,`${M(e)}.json`),"entryPath"),Dt=h((t,e)=>w(t,`${M(e)}.lock`),"lockPath"),b=h(async(t,e)=>{const o=await k(t),s=D(o,e);if(await dt(s))try{return await L(s)}catch{return}},"readEntry"),Ot=h(async t=>{const e=await k(t);let o;try{o=await st(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await L(w(e,r));s.push(i)}catch{}return s},"readAllEntries"),jt=h(async(t,e)=>{const o=await k(t),s=D(o,e.id),r=w(o,`.${ot(8).toString("hex")}.tmp`);await rt(r,`${JSON.stringify(e,void 0,2)}
2
- `,{mode:R});try{await It(r,s)}catch(i){throw await T(r,{force:!0}).catch(()=>{}),i}},"writeEntry"),xt=new Set(["EACCES","EBUSY","EPERM"]),Ct=8,At=20,It=h(async(t,e)=>{let o=0;for(;;)try{await it(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&xt.has(r))||o>=Ct)throw s;const i=At*2**o;await new Promise(c=>{setTimeout(c,i)}),o+=1}},"renameWithRetry"),v=h(async(t,e,o)=>{const s=await k(t),r=o??await b(t,e);await T(D(s,e),{force:!0}),r&&await T(r.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),u=h(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),ie=h(async t=>{const e=await Ot(t),o=[],s=[];for(const r of e){if(u(r.pid)){s.push(r);continue}const i=await b(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await v(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},"pruneDead"),Ft=h(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),Lt=h(async t=>{try{const e=await nt(t,"wx",R);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},"tryClaimLock"),Wt=h(async t=>{let e;try{const o=await at(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!u(e))return!0;try{const o=await ct(t);return Date.now()-o.mtimeMs>Mt}catch{return!0}},"isLockStale"),B=h(async(t,e,o)=>{const s=await k(t),r=Dt(s,e),i=Date.now();for(;!await Lt(r);){if(await Wt(r)){await O(r).catch(()=>{});continue}if(Date.now()-i>=C)throw new Error(`Could not acquire service lock for ${e} within ${String(C)}ms — another \`vis service\` invocation appears to be holding it.`);await Ft(Rt)}try{return await o()}finally{await O(r).catch(()=>{})}},"withServiceLock");var Nt=Object.defineProperty,l=n((t,e)=>Nt(t,"name",{value:e,configurable:!0}),"r");function g(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?g(r,e,i):typeof r=="function"&&(e[i]=r)}return e}n(g,"c");l(g,"flatHooks");function Bt(...t){const e={};for(const o of t){const s=g(o);for(const r in s)e[r]?e[r].push(s[r]):e[r]=[s[r]]}for(const o in e)if(e[o].length>1){const s=e[o];e[o]=(...r)=>G(s,i=>i(...r))}else e[o]=e[o][0];return e}n(Bt,"v");l(Bt,"mergeHooks");function G(t,e){return t.reduce((o,s)=>o.then(()=>e(s)),Promise.resolve())}n(G,"d$1");l(G,"serial");const V=(()=>{if(console.createTask)return console.createTask;const t={run:l(e=>e(),"run")};return()=>t})();function E(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(()=>E(t,e,r+1,s))}catch(i){return Promise.reject(i)}}n(E,"k");l(E,"callHooks");function q(t,e,o){if(t.length>0)return E(t,e,0,V(o))}n(q,"y");l(q,"serialTaskCaller");function U(t,e,o){if(t.length>0){const s=V(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}n(U,"m");l(U,"parallelTaskCaller");function Gt(t,e){return t.reduce((o,s)=>o.then(()=>s(...e||[])),Promise.resolve())}n(Gt,"x");l(Gt,"serialCaller");function Vt(t,e){return Promise.all(t.map(o=>o(...e||[])))}n(Vt,"P");l(Vt,"parallelCaller");function _(t,e){for(const o of[...t])o(e)}n(_,"a");l(_,"callEachWith");var qt=class{static{n(this,"p")}static{l(this,"Hookable")}_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:l(()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb","get"),configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=l((...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r)),"_function");return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=g(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=g(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(q,t,e)}callHookParallel(t,...e){return this.callHookWith(U,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&_(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&_(this._after,s)}):(this._after&&s&&_(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function X(){return new qt}n(X,"w$1");l(X,"createHooks");(class{static{l(this,"HookableCore")}_hooks;constructor(){this._hooks={}}hook(t,e){return!t||typeof e!="function"?()=>{}:(this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)})}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}callHook(t,...e){const o=this._hooks[t];if(!(!o||o.length===0))return E(o,e,0)}});const A=typeof window<"u";function Ut(t,e={}){const o={inspect:A,group:A,filter:l(()=>!0,"filter"),...e},s=o.filter,r=typeof s=="string"?a=>a.startsWith(s):s,i=o.tag?`[${o.tag}] `:"",c=l(a=>i+a.name+"".padEnd(a._id,"\0"),"logPrefix"),d={},H=t.beforeEach(a=>{r!==void 0&&!r(a.name)||(d[a.name]=d[a.name]||0,a._id=d[a.name]++,console.time(c(a)))}),P=t.afterEach(a=>{r!==void 0&&!r(a.name)||(o.group&&console.groupCollapsed(a.name),o.inspect?console.timeLog(c(a),a.args):console.timeEnd(c(a)),o.group&&console.groupEnd(),d[a.name]--)});return{close:l(()=>{H(),P()},"close")}}n(Ut,"W");l(Ut,"createDebugger");var Xt=Object.defineProperty,$=n((t,e)=>Xt(t,"name",{value:e,configurable:!0}),"t$1");const ne=$(()=>X(),"createVisHooks"),ae=$(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 c of i)t.hook(s,c)}o.setup&&await o.setup(t)}},"registerPlugins");class ce{static{n(this,"HookableLifeCycle")}static{$(this,"HookableLifeCycle")}#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Yt(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 Yt=$(t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache","isCacheStatus");var Jt=Object.defineProperty,Kt=n((t,e)=>Jt(t,"name",{value:e,configurable:!0}),"i");const I=process.platform==="win32",zt=Kt(async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ut(r,"a",R);let c;const d=I?"cmd":"/bin/sh",H=I?["/d","/s","/c",e]:["-c",e];try{c=ft(d,H,{cwd:o,detached:!0,env:wt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{pt(i)}if(c.pid===void 0&&await new Promise((P,a)=>{c.once("spawn",()=>{P()}),c.once("error",K=>{a(K)})}),c.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return c.unref(),{pid:c.pid}},"spawnDetached");var Qt=Object.defineProperty,S=n((t,e)=>Qt(t,"name",{value:e,configurable:!0}),"t");const Y=5e3,le=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(e&&u(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await v(t.workspaceRoot,t.id,e);const o=await k(t.workspaceRoot),s=M(t.id),r=w(o,`${s}.log`),{pid:i}=await zt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),c={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await jt(t.workspaceRoot,c),t.skipReadiness!==!0)try{await Pt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(d){throw await J(i,t.config.killGracePeriodMs??Y).catch(()=>{}),await v(t.workspaceRoot,t.id,c).catch(()=>{}),d}return{entry:c}}),"startService"),he=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!u(e.pid))return await v(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??Y;return await J(e.pid,o),await v(t.workspaceRoot,t.id,e),{stopped:!0}}),"stopService"),J=S(async(t,e)=>{F(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!u(t))return;await new Promise(s=>{setTimeout(s,100)})}u(t)&&F(t,"SIGKILL")},"stopServiceByPid"),F=S((t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}},"sendSignalToServiceGroup");export{ce as H,Et as S,b as a,he as b,ne as c,Ot as d,Pt as e,v as f,u as i,ie as p,ae as r,le as s};
1
+ var z=Object.defineProperty;var n=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as Q}from"node:module";import{n as tt,M as w}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{f as j}from"../packem_chunks/config.js";import{aT as ht,Y as dt,aU as L}from"../packem_chunks/bin.js";import{withEnhancedPath as wt}from"@visulima/task-runner";const Z=Q(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=n(t=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,o]=m.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return m.getBuiltinModule(t)}return Z(t)},"__cjs_getBuiltinModule"),{Socket:et}=p("node:net"),{randomBytes:ot}=p("node:crypto"),{readdir:st,writeFile:rt,rm:T,rename:it,open:nt,readFile:at,stat:ct,unlink:O}=p("node:fs/promises"),{createRequire:lt}=p("node:module"),{spawn:ft}=p("node:child_process"),{openSync:ut,closeSync:pt}=p("node:fs");var kt=Object.defineProperty,W=n((t,e)=>kt(t,"name",{value:e,configurable:!0}),"s$2");const mt=lt(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yt=W(t=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,o]=y.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return y.getBuiltinModule(t)}return mt(t)},"a"),{lstat:x,mkdir:vt}=yt("node:fs/promises"),gt=W(async t=>{tt(t);try{const e=await x(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await vt(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await x(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(o))}'`,{cause:e})}},"m");var _t=Object.defineProperty,f=n((t,e)=>_t(t,"name",{value:e,configurable:!0}),"s$1");const bt=3e4,N=100;class Et extends Error{static{n(this,"ServiceReadinessError")}constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs;static{f(this,"ServiceReadinessError")}}const $t=f(async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??bt,r=Date.now();for(;Date.now()-r<s;){if(await St(e,o))return;await Ht(N)}throw new Et(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},"waitForTcp"),St=f((t,e)=>new Promise(o=>{const s=new et,r=f(i=>{s.removeAllListeners(),s.destroy(),o(i)},"onDone");s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(N,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),"tryConnect"),Ht=f(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),Pt=f(async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await $t({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},"runReadiness");var Tt=Object.defineProperty,h=n((t,e)=>Tt(t,"name",{value:e,configurable:!0}),"o");const R=384,C=5e3,Rt=50,Mt=3e4,k=h(async t=>{const e=w(ht(t),"services");try{await gt(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},"getRegistryDir"),M=h(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),D=h((t,e)=>w(t,`${M(e)}.json`),"entryPath"),Dt=h((t,e)=>w(t,`${M(e)}.lock`),"lockPath"),b=h(async(t,e)=>{const o=await k(t),s=D(o,e);if(await dt(s))try{return await L(s)}catch{return}},"readEntry"),Ot=h(async t=>{const e=await k(t);let o;try{o=await st(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await L(w(e,r));s.push(i)}catch{}return s},"readAllEntries"),jt=h(async(t,e)=>{const o=await k(t),s=D(o,e.id),r=w(o,`.${ot(8).toString("hex")}.tmp`);await rt(r,`${JSON.stringify(e,void 0,2)}
2
+ `,{mode:R});try{await It(r,s)}catch(i){throw await T(r,{force:!0}).catch(()=>{}),i}},"writeEntry"),xt=new Set(["EACCES","EBUSY","EPERM"]),Ct=8,At=20,It=h(async(t,e)=>{let o=0;for(;;)try{await it(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&xt.has(r))||o>=Ct)throw s;const i=At*2**o;await new Promise(c=>{setTimeout(c,i)}),o+=1}},"renameWithRetry"),v=h(async(t,e,o)=>{const s=await k(t),r=o??await b(t,e);await T(D(s,e),{force:!0}),r&&await T(r.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),u=h(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),ie=h(async t=>{const e=await Ot(t),o=[],s=[];for(const r of e){if(u(r.pid)){s.push(r);continue}const i=await b(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await v(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},"pruneDead"),Ft=h(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),Lt=h(async t=>{try{const e=await nt(t,"wx",R);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},"tryClaimLock"),Wt=h(async t=>{let e;try{const o=await at(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!u(e))return!0;try{const o=await ct(t);return Date.now()-o.mtimeMs>Mt}catch{return!0}},"isLockStale"),B=h(async(t,e,o)=>{const s=await k(t),r=Dt(s,e),i=Date.now();for(;!await Lt(r);){if(await Wt(r)){await O(r).catch(()=>{});continue}if(Date.now()-i>=C)throw new Error(`Could not acquire service lock for ${e} within ${String(C)}ms — another \`vis service\` invocation appears to be holding it.`);await Ft(Rt)}try{return await o()}finally{await O(r).catch(()=>{})}},"withServiceLock");var Nt=Object.defineProperty,l=n((t,e)=>Nt(t,"name",{value:e,configurable:!0}),"r");function g(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?g(r,e,i):typeof r=="function"&&(e[i]=r)}return e}n(g,"c");l(g,"flatHooks");function Bt(...t){const e={};for(const o of t){const s=g(o);for(const r in s)e[r]?e[r].push(s[r]):e[r]=[s[r]]}for(const o in e)if(e[o].length>1){const s=e[o];e[o]=(...r)=>G(s,i=>i(...r))}else e[o]=e[o][0];return e}n(Bt,"v");l(Bt,"mergeHooks");function G(t,e){return t.reduce((o,s)=>o.then(()=>e(s)),Promise.resolve())}n(G,"d$1");l(G,"serial");const V=(()=>{if(console.createTask)return console.createTask;const t={run:l(e=>e(),"run")};return()=>t})();function E(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(()=>E(t,e,r+1,s))}catch(i){return Promise.reject(i)}}n(E,"k");l(E,"callHooks");function q(t,e,o){if(t.length>0)return E(t,e,0,V(o))}n(q,"y");l(q,"serialTaskCaller");function Y(t,e,o){if(t.length>0){const s=V(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}n(Y,"m");l(Y,"parallelTaskCaller");function Gt(t,e){return t.reduce((o,s)=>o.then(()=>s(...e||[])),Promise.resolve())}n(Gt,"x");l(Gt,"serialCaller");function Vt(t,e){return Promise.all(t.map(o=>o(...e||[])))}n(Vt,"P");l(Vt,"parallelCaller");function _(t,e){for(const o of[...t])o(e)}n(_,"a");l(_,"callEachWith");var qt=class{static{n(this,"p")}static{l(this,"Hookable")}_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:l(()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb","get"),configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=l((...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r)),"_function");return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=g(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=g(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(q,t,e)}callHookParallel(t,...e){return this.callHookWith(Y,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&_(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&_(this._after,s)}):(this._after&&s&&_(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function U(){return new qt}n(U,"w$1");l(U,"createHooks");(class{static{l(this,"HookableCore")}_hooks;constructor(){this._hooks={}}hook(t,e){return!t||typeof e!="function"?()=>{}:(this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)})}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}callHook(t,...e){const o=this._hooks[t];if(!(!o||o.length===0))return E(o,e,0)}});const A=typeof window<"u";function Yt(t,e={}){const o={inspect:A,group:A,filter:l(()=>!0,"filter"),...e},s=o.filter,r=typeof s=="string"?a=>a.startsWith(s):s,i=o.tag?`[${o.tag}] `:"",c=l(a=>i+a.name+"".padEnd(a._id,"\0"),"logPrefix"),d={},H=t.beforeEach(a=>{r!==void 0&&!r(a.name)||(d[a.name]=d[a.name]||0,a._id=d[a.name]++,console.time(c(a)))}),P=t.afterEach(a=>{r!==void 0&&!r(a.name)||(o.group&&console.groupCollapsed(a.name),o.inspect?console.timeLog(c(a),a.args):console.timeEnd(c(a)),o.group&&console.groupEnd(),d[a.name]--)});return{close:l(()=>{H(),P()},"close")}}n(Yt,"W");l(Yt,"createDebugger");var Ut=Object.defineProperty,$=n((t,e)=>Ut(t,"name",{value:e,configurable:!0}),"t$1");const ne=$(()=>U(),"createVisHooks"),ae=$(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 c of i)t.hook(s,c)}o.setup&&await o.setup(t)}},"registerPlugins");class ce{static{n(this,"HookableLifeCycle")}static{$(this,"HookableLifeCycle")}#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Xt(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 Xt=$(t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache","isCacheStatus");var Jt=Object.defineProperty,Kt=n((t,e)=>Jt(t,"name",{value:e,configurable:!0}),"i");const I=process.platform==="win32",zt=Kt(async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ut(r,"a",R);let c;const d=I?"cmd":"/bin/sh",H=I?["/d","/s","/c",e]:["-c",e];try{c=ft(d,H,{cwd:o,detached:!0,env:wt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{pt(i)}if(c.pid===void 0&&await new Promise((P,a)=>{c.once("spawn",()=>{P()}),c.once("error",K=>{a(K)})}),c.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return c.unref(),{pid:c.pid}},"spawnDetached");var Qt=Object.defineProperty,S=n((t,e)=>Qt(t,"name",{value:e,configurable:!0}),"t");const X=5e3,le=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(e&&u(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await v(t.workspaceRoot,t.id,e);const o=await k(t.workspaceRoot),s=M(t.id),r=w(o,`${s}.log`),{pid:i}=await zt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),c={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await jt(t.workspaceRoot,c),t.skipReadiness!==!0)try{await Pt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(d){throw await J(i,t.config.killGracePeriodMs??X).catch(()=>{}),await v(t.workspaceRoot,t.id,c).catch(()=>{}),d}return{entry:c}}),"startService"),he=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!u(e.pid))return await v(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??X;return await J(e.pid,o),await v(t.workspaceRoot,t.id,e),{stopped:!0}}),"stopService"),J=S(async(t,e)=>{F(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!u(t))return;await new Promise(s=>{setTimeout(s,100)})}u(t)&&F(t,"SIGKILL")},"stopServiceByPid"),F=S((t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}},"sendSignalToServiceGroup");export{ce as H,Et as S,b as a,he as b,ne as c,Ot as d,Pt as e,v as f,u as i,ie as p,ae as r,le as s};
@@ -1 +1 @@
1
- var T=Object.defineProperty;var j=(n,e)=>T(n,"name",{value:e,configurable:!0});import{createRequire as B}from"node:module";import{D as R,u as C}from"../packem_chunks/bin.js";const q=B(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=j(n=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[e,t]=h.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return h.getBuiltinModule(n)}return q(n)},"__cjs_getBuiltinModule"),{createRequire:N}=A("node:module");var U=Object.defineProperty,z=j((n,e)=>U(n,"name",{value:e,configurable:!0}),"L"),I=Object.defineProperty,_=z((n,e)=>I(n,"name",{value:e,configurable:!0}),"b");const J=N(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=_(n=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,t]=y.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return y.getBuiltinModule(n)}return J(n)},"__cjs_getBuiltinModule"),{readFileSync:Y}=S("node:fs"),{readFile:Z}=S("node:fs/promises");var K=Object.defineProperty,l=_((n,e)=>K(n,"name",{value:e,configurable:!0}),"g");const G={sha256:"sha256",sha384:"sha384",sha512:"sha512"},H=1024,Q=/^[A-Z0-9+/]+={0,2}$/i,V=/.*node_modules\/((?:@[^/]+\/)?[^/]+)$/,k=/^['"]/,v=/['"]$/,X=/^[a-z][a-zA-Z0-9]*:\s*$/m,ee=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,ne=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^\n]+\n((?:[\t ][^\n]*(?:\n|$))+)/gm,te=/^\s+version:?\s+"?([^"\n]+)"?/m,se=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,x=l(n=>{if(n.length>H)return;const e=n.indexOf("-");if(e<=0)return;const t=G[n.slice(0,e).toLowerCase()];if(!t)return;const s=n.slice(e+1);if(Q.test(s))try{const i=Buffer.from(s,"base64");return i.length===0?void 0:{algorithm:t,hex:i.toString("hex")}}catch{return}},"decodeSriIntegrity"),w=l((n,e,t)=>{const s=`${t.name}@${t.version}`;e.has(s)||(e.add(s),n.push(t))},"pushUniqueEntry"),m=l((n,e,t)=>{t&&Object.keys(t).length>0&&(n[e]={...t})},"copyDepMap"),g=l(n=>{if(!n)return;const e={};for(const[t,s]of Object.entries(n))e[t]=[s];return Object.keys(e).length>0?e:void 0},"liftDepMap"),re=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n)}catch{return e}if(!s.packages)return e;for(const[i,r]of Object.entries(s.packages)){if(!i||!r.version)continue;const p=V.exec(i);if(!p?.[1])continue;const c=r.name??p[1];if(c.startsWith("."))continue;const o={name:c,version:r.version};if(r.integrity){const a=x(r.integrity);a&&(o.integrity=a)}m(o,"dependencies",g(r.dependencies)),m(o,"peerDependencies",g(r.peerDependencies)),m(o,"optionalDependencies",g(r.optionalDependencies)),w(e,t,o)}return e},"parseNpmLockFile"),W=l(n=>{let e=n.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(k,"").replace(v,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const s=e.lastIndexOf("@");if(s<=0)return;const i=e.slice(0,s),r=e.slice(s+1);if(!(!i||!r||r.startsWith("link:")||r.startsWith("workspace:")||r.startsWith("file:")))return{name:i,version:r}},"splitPnpmPackageKey"),F=l((n,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(n);if(!t)return;const s=t.index+t[0].length,i=X.exec(n.slice(s));return n.slice(s,i?s+i.index:n.length)},"sliceTopLevelSection"),oe=l(n=>{const e=new Map,t=F(n,"snapshots");if(!t)return e;const s=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let i;for(;(i=s.exec(t)??void 0)!==void 0;){const r=W(i[1]);if(!r)continue;const p=`${r.name}@${r.version}`,c=i[2],o=e.get(p)??{};for(const a of["dependencies","peerDependencies","optionalDependencies"]){const u=b(c,a);if(!u)continue;const d=o[a]??{};for(const[f,P]of Object.entries(u)){const D=d[f]??[];for(const $ of P)D.includes($)||D.push($);d[f]=D}o[a]=d}e.set(p,o)}return e},"parsePnpmSnapshotEdges"),ie=l(n=>{const e=[],t=new Set,s=F(n,"packages");if(!s)return e;const i=oe(n),r=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let p;for(;(p=r.exec(s)??void 0)!==void 0;){const c=W(p[1]);if(!c)continue;const o=p[2],a=ee.exec(o),u={name:c.name,version:c.version};if(a?.[1]){const f=x(a[1]);f&&(u.integrity=f)}const d=i.get(`${c.name}@${c.version}`);m(u,"dependencies",d?.dependencies??b(o,"dependencies")),m(u,"peerDependencies",d?.peerDependencies??b(o,"peerDependencies")),m(u,"optionalDependencies",d?.optionalDependencies??b(o,"optionalDependencies")),w(e,t,u)}return e},"parsePnpmLockFile"),b=l((n,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,"");let c=r[2].trim();c=c.replace(k,"").replace(v,"");const o=c.indexOf("(");if(o>0&&(c=c.slice(0,o).trim()),!p||!c)continue;const a=s[p]??[];a.includes(c)||a.push(c),s[p]=a}return Object.keys(s).length>0?s:void 0},"extractPnpmDependencyMap"),ce=l(n=>{const e=[],t=new Set,s=ne;s.lastIndex=0;let i;for(;(i=s.exec(n)??void 0)!==void 0;){const r=i[1].replace(k,"").replace(v,"");if(!r)continue;const p=i[2],c=te.exec(p);if(!c?.[1])continue;const o={name:r,version:c[1].trim()},a=se.exec(p);if(a?.[1]){const u=x(a[1]);u&&(o.integrity=u)}m(o,"dependencies",O(p,"dependencies")),m(o,"peerDependencies",O(p,"peerDependencies")),m(o,"optionalDependencies",O(p,"optionalDependencies")),w(e,t,o)}return e},"parseYarnLockFile"),O=l((n,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,""),c=r[2];if(p&&c){const o=s[p]??[];o.includes(c)||o.push(c),s[p]=o}}return Object.keys(s).length>0?s:void 0},"extractYarnDependencyMap"),pe=/,(?=\s*[}\]])/g,ae=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n.replaceAll(pe,""))}catch{return e}if(!s.packages)return e;for(const i of Object.values(s.packages)){const r=i[0];if(typeof r!="string")continue;const p=r.indexOf("@",1);if(p<=0)continue;const c=r.slice(0,p),o=r.slice(p+1);if(!c||!o||o.startsWith("workspace:")||o.startsWith("link:")||o.startsWith("file:"))continue;const a={name:c,version:o},u=i[3];if(typeof u=="string"&&u.length>0){const f=x(u);f&&(a.integrity=f)}const d=i[2];if(d&&typeof d=="object"&&!Array.isArray(d)){const f=d;m(a,"dependencies",g(f.dependencies)),m(a,"peerDependencies",g(f.peerDependencies)),m(a,"optionalDependencies",g(f.optionalDependencies))}w(e,t,a)}return e},"parseBunLockFile"),L=l(n=>{if(n.endsWith("pnpm-lock.yaml"))return"pnpm";if(n.endsWith("package-lock.json"))return"npm";if(n.endsWith("yarn.lock"))return"yarn";if(n.endsWith("bun.lock"))return"bun"},"inferLockFileType"),E=l((n,e)=>{switch(e){case"bun":return ae(n);case"npm":return re(n);case"pnpm":return ie(n);case"yarn":return ce(n);default:return[]}},"parseLockFileContent"),M=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"];l(async n=>{const e=await R(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=L(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);const s=await Z(e,"utf8");return{entries:E(s,t),path:e,type:t}},"parseLockFile");l(n=>{const e=C(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=L(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);return{entries:E(Y(e,"utf8"),t),path:e,type:t}},"parseLockFileSync");export{E as S};
1
+ var T=Object.defineProperty;var j=(n,e)=>T(n,"name",{value:e,configurable:!0});import{createRequire as B}from"node:module";import{D as R,w as C}from"../packem_chunks/bin.js";const q=B(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=j(n=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[e,t]=h.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return h.getBuiltinModule(n)}return q(n)},"__cjs_getBuiltinModule"),{createRequire:N}=A("node:module");var U=Object.defineProperty,z=j((n,e)=>U(n,"name",{value:e,configurable:!0}),"L"),I=Object.defineProperty,_=z((n,e)=>I(n,"name",{value:e,configurable:!0}),"b");const J=N(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=_(n=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,t]=y.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return y.getBuiltinModule(n)}return J(n)},"__cjs_getBuiltinModule"),{readFileSync:Y}=S("node:fs"),{readFile:Z}=S("node:fs/promises");var K=Object.defineProperty,l=_((n,e)=>K(n,"name",{value:e,configurable:!0}),"g");const G={sha256:"sha256",sha384:"sha384",sha512:"sha512"},H=1024,Q=/^[A-Z0-9+/]+={0,2}$/i,V=/.*node_modules\/((?:@[^/]+\/)?[^/]+)$/,k=/^['"]/,v=/['"]$/,X=/^[a-z][a-zA-Z0-9]*:\s*$/m,ee=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,ne=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^\n]+\n((?:[\t ][^\n]*(?:\n|$))+)/gm,te=/^\s+version:?\s+"?([^"\n]+)"?/m,se=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,x=l(n=>{if(n.length>H)return;const e=n.indexOf("-");if(e<=0)return;const t=G[n.slice(0,e).toLowerCase()];if(!t)return;const s=n.slice(e+1);if(Q.test(s))try{const i=Buffer.from(s,"base64");return i.length===0?void 0:{algorithm:t,hex:i.toString("hex")}}catch{return}},"decodeSriIntegrity"),w=l((n,e,t)=>{const s=`${t.name}@${t.version}`;e.has(s)||(e.add(s),n.push(t))},"pushUniqueEntry"),m=l((n,e,t)=>{t&&Object.keys(t).length>0&&(n[e]={...t})},"copyDepMap"),g=l(n=>{if(!n)return;const e={};for(const[t,s]of Object.entries(n))e[t]=[s];return Object.keys(e).length>0?e:void 0},"liftDepMap"),re=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n)}catch{return e}if(!s.packages)return e;for(const[i,r]of Object.entries(s.packages)){if(!i||!r.version)continue;const p=V.exec(i);if(!p?.[1])continue;const c=r.name??p[1];if(c.startsWith("."))continue;const o={name:c,version:r.version};if(r.integrity){const a=x(r.integrity);a&&(o.integrity=a)}m(o,"dependencies",g(r.dependencies)),m(o,"peerDependencies",g(r.peerDependencies)),m(o,"optionalDependencies",g(r.optionalDependencies)),w(e,t,o)}return e},"parseNpmLockFile"),W=l(n=>{let e=n.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(k,"").replace(v,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const s=e.lastIndexOf("@");if(s<=0)return;const i=e.slice(0,s),r=e.slice(s+1);if(!(!i||!r||r.startsWith("link:")||r.startsWith("workspace:")||r.startsWith("file:")))return{name:i,version:r}},"splitPnpmPackageKey"),F=l((n,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(n);if(!t)return;const s=t.index+t[0].length,i=X.exec(n.slice(s));return n.slice(s,i?s+i.index:n.length)},"sliceTopLevelSection"),oe=l(n=>{const e=new Map,t=F(n,"snapshots");if(!t)return e;const s=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let i;for(;(i=s.exec(t)??void 0)!==void 0;){const r=W(i[1]);if(!r)continue;const p=`${r.name}@${r.version}`,c=i[2],o=e.get(p)??{};for(const a of["dependencies","peerDependencies","optionalDependencies"]){const u=b(c,a);if(!u)continue;const d=o[a]??{};for(const[f,P]of Object.entries(u)){const D=d[f]??[];for(const $ of P)D.includes($)||D.push($);d[f]=D}o[a]=d}e.set(p,o)}return e},"parsePnpmSnapshotEdges"),ie=l(n=>{const e=[],t=new Set,s=F(n,"packages");if(!s)return e;const i=oe(n),r=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let p;for(;(p=r.exec(s)??void 0)!==void 0;){const c=W(p[1]);if(!c)continue;const o=p[2],a=ee.exec(o),u={name:c.name,version:c.version};if(a?.[1]){const f=x(a[1]);f&&(u.integrity=f)}const d=i.get(`${c.name}@${c.version}`);m(u,"dependencies",d?.dependencies??b(o,"dependencies")),m(u,"peerDependencies",d?.peerDependencies??b(o,"peerDependencies")),m(u,"optionalDependencies",d?.optionalDependencies??b(o,"optionalDependencies")),w(e,t,u)}return e},"parsePnpmLockFile"),b=l((n,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,"");let c=r[2].trim();c=c.replace(k,"").replace(v,"");const o=c.indexOf("(");if(o>0&&(c=c.slice(0,o).trim()),!p||!c)continue;const a=s[p]??[];a.includes(c)||a.push(c),s[p]=a}return Object.keys(s).length>0?s:void 0},"extractPnpmDependencyMap"),ce=l(n=>{const e=[],t=new Set,s=ne;s.lastIndex=0;let i;for(;(i=s.exec(n)??void 0)!==void 0;){const r=i[1].replace(k,"").replace(v,"");if(!r)continue;const p=i[2],c=te.exec(p);if(!c?.[1])continue;const o={name:r,version:c[1].trim()},a=se.exec(p);if(a?.[1]){const u=x(a[1]);u&&(o.integrity=u)}m(o,"dependencies",O(p,"dependencies")),m(o,"peerDependencies",O(p,"peerDependencies")),m(o,"optionalDependencies",O(p,"optionalDependencies")),w(e,t,o)}return e},"parseYarnLockFile"),O=l((n,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},i=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let r;for(;(r=i.exec(t[1])??void 0)!==void 0;){const p=r[1].replace(k,"").replace(v,""),c=r[2];if(p&&c){const o=s[p]??[];o.includes(c)||o.push(c),s[p]=o}}return Object.keys(s).length>0?s:void 0},"extractYarnDependencyMap"),pe=/,(?=\s*[}\]])/g,ae=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n.replaceAll(pe,""))}catch{return e}if(!s.packages)return e;for(const i of Object.values(s.packages)){const r=i[0];if(typeof r!="string")continue;const p=r.indexOf("@",1);if(p<=0)continue;const c=r.slice(0,p),o=r.slice(p+1);if(!c||!o||o.startsWith("workspace:")||o.startsWith("link:")||o.startsWith("file:"))continue;const a={name:c,version:o},u=i[3];if(typeof u=="string"&&u.length>0){const f=x(u);f&&(a.integrity=f)}const d=i[2];if(d&&typeof d=="object"&&!Array.isArray(d)){const f=d;m(a,"dependencies",g(f.dependencies)),m(a,"peerDependencies",g(f.peerDependencies)),m(a,"optionalDependencies",g(f.optionalDependencies))}w(e,t,a)}return e},"parseBunLockFile"),L=l(n=>{if(n.endsWith("pnpm-lock.yaml"))return"pnpm";if(n.endsWith("package-lock.json"))return"npm";if(n.endsWith("yarn.lock"))return"yarn";if(n.endsWith("bun.lock"))return"bun"},"inferLockFileType"),E=l((n,e)=>{switch(e){case"bun":return ae(n);case"npm":return re(n);case"pnpm":return ie(n);case"yarn":return ce(n);default:return[]}},"parseLockFileContent"),M=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"];l(async n=>{const e=await R(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=L(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);const s=await Z(e,"utf8");return{entries:E(s,t),path:e,type:t}},"parseLockFile");l(n=>{const e=C(M,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=L(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);return{entries:E(Y(e,"utf8"),t),path:e,type:t}},"parseLockFileSync");export{E as S};
@@ -1,4 +1,4 @@
1
- var f=Object.defineProperty;var R=(u,p)=>f(u,"name",{value:p,configurable:!0});import{M as d,l as o,B as $}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{E as h}from"../packem_chunks/config.js";import{z as x}from"../packem_chunks/bin.js";var S=Object.defineProperty,b=R((u,p)=>S(u,"name",{value:p,configurable:!0}),"k");const U=b((u,p,A,m=[])=>{const i=[];if(A===void 0)return i.push("minimumReleaseAge not set in vis.config; skipping native sync."),i;const r=Number.isFinite(A)?Math.max(0,Math.round(A)):0;switch(u){case"bun":{const n=d(p,"bunfig.toml");let e=o(n)?$(n):"";const a=r*60,t=`minimumReleaseAge = ${String(a)}`,s=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,g=/^\[install\][ \t]*\n/m.exec(e);if(g?.index===void 0){const c=s?`${t}
1
+ var f=Object.defineProperty;var R=(u,p)=>f(u,"name",{value:p,configurable:!0});import{M as d,l as o,B as $}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{E as h}from"../packem_chunks/config.js";import{A as x}from"../packem_chunks/bin.js";var S=Object.defineProperty,b=R((u,p)=>S(u,"name",{value:p,configurable:!0}),"k");const U=b((u,p,A,m=[])=>{const i=[];if(A===void 0)return i.push("minimumReleaseAge not set in vis.config; skipping native sync."),i;const r=Number.isFinite(A)?Math.max(0,Math.round(A)):0;switch(u){case"bun":{const n=d(p,"bunfig.toml");let e=o(n)?$(n):"";const a=r*60,t=`minimumReleaseAge = ${String(a)}`,s=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,g=/^\[install\][ \t]*\n/m.exec(e);if(g?.index===void 0){const c=s?`${t}
2
2
  ${s}`:t;e=`${e.trimEnd()?`${e.trimEnd()}
3
3
 
4
4
  `:""}[install]
@@ -0,0 +1 @@
1
+ var k=Object.defineProperty;var h=(e,r)=>k(e,"name",{value:r,configurable:!0});import{m as c,V as $,P}from"../packem_chunks/bin.js";import{C as f,l,M as d}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";var S=Object.defineProperty,m=h((e,r)=>S(e,"name",{value:r,configurable:!0}),"o");const y=/\/+$/,p=/node_modules/,u=/\.git/,M=/[$()+.?[\\\]^{|}]/g,W=/\/\*\*$|\/\*\/\*$/,x=m((e,r)=>{const n=r.replace(y,"");if(n.startsWith("!"))return[];const s=[];if(n.endsWith("/*")){const t=n.slice(0,-2),i=f(e,t);if(!l(i))return[];for(const a of c(i,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))a.path===i||a.name.startsWith(".")||s.push(d(t,a.name));return s}if(n.endsWith("/**")||n.endsWith("/*/*")){const t=n.replace(W,""),i=f(e,t);if(!l(i))return[];for(const a of c(i,{includeFiles:!1,includeSymlinks:!1,skip:[p,u]})){if(a.path===i)continue;const g=a.path.slice(i.length+1);s.push(`${t}/${g}`)}return s}if(!n.includes("/")&&n.includes("*")){const t=n.replaceAll(M,String.raw`\$&`).replaceAll("*",".*"),i=new RegExp(`^${t}$`);for(const a of c(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))a.path!==e&&i.test(a.name)&&s.push(a.name);return s}const o=f(e,n);return l(o)&&s.push(n),s},"collectPatternMatches"),F=m(e=>{const r=$(e)??P(e)??[],n=new Set,s=[];for(const o of r)for(const t of x(e,o))t==="."||n.has(t)||(n.add(t),l(d(e,t,"package.json"))||s.push({packageDir:t}));return s},"lintMissingPackageJson");export{F as l};
@@ -1,4 +1,4 @@
1
- var v=Object.defineProperty;var C=(o,l)=>v(o,"name",{value:l,configurable:!0});import{M as c,B as S,l as g}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{E as i,s as O}from"../packem_chunks/config.js";import{q as N,r as U}from"../packem_chunks/bin.js";var x=Object.defineProperty,D=C((o,l)=>x(o,"name",{value:l,configurable:!0}),"f");const W=D((o,l,d)=>{const s=[],b=Object.entries(d).filter(([,n])=>n).map(([n])=>n);switch(o){case"bun":{const n=c(l,"package.json");if(g(n))try{const e=O(n);e.trustedDependencies=b,i(n,`${JSON.stringify(e,null,2)}
1
+ var v=Object.defineProperty;var C=(o,l)=>v(o,"name",{value:l,configurable:!0});import{M as c,B as S,l as g}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{E as i,s as O}from"../packem_chunks/config.js";import{r as N,t as U}from"../packem_chunks/bin.js";var x=Object.defineProperty,D=C((o,l)=>x(o,"name",{value:l,configurable:!0}),"f");const W=D((o,l,d)=>{const s=[],b=Object.entries(d).filter(([,n])=>n).map(([n])=>n);switch(o){case"bun":{const n=c(l,"package.json");if(g(n))try{const e=O(n);e.trustedDependencies=b,i(n,`${JSON.stringify(e,null,2)}
2
2
  `),s.push(`Updated package.json trustedDependencies with ${b.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(l,".npmrc");let e=g(n)?S(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
3
3
  ignore-scripts=true
4
4
  `,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(l,"pnpm-workspace.yaml");if(!g(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=U(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const h={...e,...d},A=Object.keys(d).filter(t=>e[t]!==d[t]).length,u=b.toSorted((t,p)=>t.localeCompare(p)),k=[...new Set([...m,...u])].toSorted((t,p)=>t.localeCompare(p)),w=u.filter(t=>!m.includes(t)).length;if(A===0&&w===0)s.push(`All ${String(Object.keys(d).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(h).sort(),p=D(a=>a.startsWith("@")||a.includes("/")||/[:#\s]/.test(a),"needsQuote"),f=D(a=>p(a)?`'${a.replaceAll("'","''")}'`:a,"renderKey"),y=`allowBuilds:
@@ -1 +1 @@
1
- var R=Object.defineProperty;var d=(e,t)=>R(e,"name",{value:t,configurable:!0});import{createRequire as M}from"node:module";import{s as u}from"./pm-runner-DmKT2FqF.js";import{s as $,b as S}from"../packem_chunks/config.js";import{M as v,l as k}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{m as U,i as D}from"../packem_chunks/bin.js";const T=M(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=d(e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,r]=f.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return f.getBuiltinModule(e)}return T(e)},"__cjs_getBuiltinModule"),{rmSync:p,writeFileSync:C,readdirSync:O}=A("node:fs");var N=Object.defineProperty,b=d((e,t)=>N(e,"name",{value:t,configurable:!0}),"o$1");const F=8,V=b(async(e,t,r)=>{if(e.length===0)return[];const o=Math.max(1,Math.min(t,e.length)),a=Array.from({length:e.length});let n=0;const i=b(async()=>{for(;n<e.length;){const s=n;n+=1;const l=e[s];a[s]=await r(l,s)}},"worker");return await Promise.all(Array.from({length:o},()=>i())),a},"mapWithConcurrency");var W=Object.defineProperty,c=d((e,t)=>W(e,"name",{value:t,configurable:!0}),"o");const w=2,E=1800*1e3,L=15e3,g=c(()=>v(U(),"packuments"),"getPackumentCacheDir"),P=c(e=>v(g(),`${encodeURIComponent(e)}.json`),"cacheFilePath"),x=c(e=>{const t=P(e);if(k(t))try{const r=$(t);if(r.cacheVersion!==w){p(t,{force:!0});return}if(Date.now()-r.createdAt>r.ttlMs){p(t,{force:!0});return}return r.packument}catch{p(t,{force:!0});return}},"readCached"),q=c((e,t,r)=>{S(g());const o={cacheVersion:w,createdAt:Date.now(),packument:t,ttlMs:r};C(P(e),JSON.stringify(o),"utf8")},"writeCached"),B=c(e=>{const t={},r=e.versions??{};for(const[a,n]of Object.entries(r)){const i=n.dist,s={version:a};if(n._npmUser!==void 0&&(s._npmUser=n._npmUser),n.maintainers!==void 0&&(s.maintainers=n.maintainers),n.bin!==void 0&&(s.bin=n.bin),i!==void 0){const l={};i.signatures!==void 0&&(l.signatures=i.signatures),i.attestations!==void 0&&(l.attestations=i.attestations),typeof i.integrity=="string"&&(l.integrity=i.integrity),typeof i.tarball=="string"&&(l.tarball=i.tarball),s.dist=l}n.repository!==void 0&&(s.repository=n.repository),n.license!==void 0&&(s.license=n.license),typeof n.readme=="string"&&(s.readme=n.readme),typeof n.readmeFilename=="string"&&(s.readmeFilename=n.readmeFilename),typeof n.private=="boolean"&&(s.private=n.private),typeof n.deprecated=="string"&&(s.deprecated=n.deprecated),n.scripts!==void 0&&typeof n.scripts=="object"&&(s.scripts=n.scripts),t[a]=s}const o={name:typeof e.name=="string"?e.name:"",versions:t};return e["dist-tags"]!==void 0&&(o["dist-tags"]=e["dist-tags"]),e.time!==void 0&&(o.time=e.time),typeof e.readme=="string"&&(o.readme=e.readme),o},"stripPackument"),H=c(e=>{const t={Accept:"application/json"};return e!==void 0&&e!==""&&(t.Authorization=`Bearer ${e}`),t},"buildHeaders"),z=c(async(e,t)=>{if(t.registryUrl!==void 0)return{authToken:t.authToken,url:t.registryUrl};if(t.workspaceRoot!==void 0){const{getRegistryForPackage:r,loadNpmrc:o}=await import("../packem_chunks/bin.js").then(s=>s.c7),a=o(t.workspaceRoot),{token:n,url:i}=r(e,a);return{authToken:t.authToken??n,url:i}}return{authToken:t.authToken,url:"https://registry.npmjs.org"}},"resolveRegistry"),I=c(async(e,t={})=>{const r=t.cacheTtlMs??E,o=x(e);if(o!==void 0)return o;const a=await z(e,t),n=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${e.replace("/","%2f")}`,i=new AbortController,s=setTimeout(()=>{i.abort()},L),l=c(()=>{i.abort()},"abortListener");t.signal?.addEventListener("abort",l,{once:!0});try{const m=await fetch(n,{headers:H(a.authToken),signal:i.signal});if(m.status===404)return;if(!m.ok)throw new Error(`Registry returned ${String(m.status)} for ${e}`);const _=await m.json(),y=B(_);return q(e,y,r),y}finally{clearTimeout(s),t.signal?.removeEventListener("abort",l)}},"getPackument"),te=c((e,t)=>{const r=Object.keys(e.versions);if(r.length===0)return;if(t===void 0||t===""||t==="latest")return e["dist-tags"]?.latest??r.at(-1);const o=e["dist-tags"]?.[t];return o!==void 0?o:Object.hasOwn(e.versions,t)?t:u.maxSatisfying(r,t)??void 0},"resolveVersionRange");c(()=>{const e=g();if(!k(e))return 0;let t=0;for(const r of O(e))r.endsWith(".json")&&(p(v(e,r),{force:!0}),t+=1);return t},"clearPackumentCache");var J=Object.defineProperty,h=d((e,t)=>J(e,"name",{value:t,configurable:!0}),"i");const j=h((e,t)=>e.versions[t]?.dist?.attestations?.provenance!==void 0,"hasProvenance"),Y=h((e,t)=>u.valid(t)?Object.keys(e.versions).filter(r=>u.valid(r)!==null&&u.lt(r,t)).filter(r=>u.satisfies(r,"*",{includePrerelease:!1})).filter(r=>j(e,r)).sort((r,o)=>u.lt(r,o)?1:-1)[0]:void 0,"findNewestPriorWithAttestations"),re=h(async(e,t={})=>{if(D("provenance"))return[];const r=new Set(t.allowlist),o=t.concurrency??F;return(await V(e,o,async({name:a,version:n})=>{if(r.has(a))return;const i=await I(a,{workspaceRoot:t.workspaceRoot});if(i===void 0||j(i,n))return;const s=Y(i,n);if(s!==void 0)return{packageName:a,priorVersionWithProvenance:s,version:n}})).filter(a=>a!==void 0)},"runProvenanceMarshall");export{F as D,te as a,Y as f,I as g,V as m,re as r};
1
+ var R=Object.defineProperty;var d=(e,t)=>R(e,"name",{value:t,configurable:!0});import{createRequire as M}from"node:module";import{s as u}from"./pm-runner-DmKT2FqF.js";import{s as $,b as S}from"../packem_chunks/config.js";import{M as v,l as k}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{o as U,i as D}from"../packem_chunks/bin.js";const T=M(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=d(e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,r]=f.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return f.getBuiltinModule(e)}return T(e)},"__cjs_getBuiltinModule"),{rmSync:p,writeFileSync:C,readdirSync:O}=A("node:fs");var N=Object.defineProperty,b=d((e,t)=>N(e,"name",{value:t,configurable:!0}),"o$1");const F=8,V=b(async(e,t,r)=>{if(e.length===0)return[];const o=Math.max(1,Math.min(t,e.length)),a=Array.from({length:e.length});let n=0;const i=b(async()=>{for(;n<e.length;){const s=n;n+=1;const l=e[s];a[s]=await r(l,s)}},"worker");return await Promise.all(Array.from({length:o},()=>i())),a},"mapWithConcurrency");var W=Object.defineProperty,c=d((e,t)=>W(e,"name",{value:t,configurable:!0}),"o");const w=2,E=1800*1e3,L=15e3,g=c(()=>v(U(),"packuments"),"getPackumentCacheDir"),P=c(e=>v(g(),`${encodeURIComponent(e)}.json`),"cacheFilePath"),x=c(e=>{const t=P(e);if(k(t))try{const r=$(t);if(r.cacheVersion!==w){p(t,{force:!0});return}if(Date.now()-r.createdAt>r.ttlMs){p(t,{force:!0});return}return r.packument}catch{p(t,{force:!0});return}},"readCached"),q=c((e,t,r)=>{S(g());const o={cacheVersion:w,createdAt:Date.now(),packument:t,ttlMs:r};C(P(e),JSON.stringify(o),"utf8")},"writeCached"),B=c(e=>{const t={},r=e.versions??{};for(const[a,n]of Object.entries(r)){const i=n.dist,s={version:a};if(n._npmUser!==void 0&&(s._npmUser=n._npmUser),n.maintainers!==void 0&&(s.maintainers=n.maintainers),n.bin!==void 0&&(s.bin=n.bin),i!==void 0){const l={};i.signatures!==void 0&&(l.signatures=i.signatures),i.attestations!==void 0&&(l.attestations=i.attestations),typeof i.integrity=="string"&&(l.integrity=i.integrity),typeof i.tarball=="string"&&(l.tarball=i.tarball),s.dist=l}n.repository!==void 0&&(s.repository=n.repository),n.license!==void 0&&(s.license=n.license),typeof n.readme=="string"&&(s.readme=n.readme),typeof n.readmeFilename=="string"&&(s.readmeFilename=n.readmeFilename),typeof n.private=="boolean"&&(s.private=n.private),typeof n.deprecated=="string"&&(s.deprecated=n.deprecated),n.scripts!==void 0&&typeof n.scripts=="object"&&(s.scripts=n.scripts),t[a]=s}const o={name:typeof e.name=="string"?e.name:"",versions:t};return e["dist-tags"]!==void 0&&(o["dist-tags"]=e["dist-tags"]),e.time!==void 0&&(o.time=e.time),typeof e.readme=="string"&&(o.readme=e.readme),o},"stripPackument"),H=c(e=>{const t={Accept:"application/json"};return e!==void 0&&e!==""&&(t.Authorization=`Bearer ${e}`),t},"buildHeaders"),z=c(async(e,t)=>{if(t.registryUrl!==void 0)return{authToken:t.authToken,url:t.registryUrl};if(t.workspaceRoot!==void 0){const{getRegistryForPackage:r,loadNpmrc:o}=await import("../packem_chunks/bin.js").then(s=>s.c7),a=o(t.workspaceRoot),{token:n,url:i}=r(e,a);return{authToken:t.authToken??n,url:i}}return{authToken:t.authToken,url:"https://registry.npmjs.org"}},"resolveRegistry"),I=c(async(e,t={})=>{const r=t.cacheTtlMs??E,o=x(e);if(o!==void 0)return o;const a=await z(e,t),n=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${e.replace("/","%2f")}`,i=new AbortController,s=setTimeout(()=>{i.abort()},L),l=c(()=>{i.abort()},"abortListener");t.signal?.addEventListener("abort",l,{once:!0});try{const m=await fetch(n,{headers:H(a.authToken),signal:i.signal});if(m.status===404)return;if(!m.ok)throw new Error(`Registry returned ${String(m.status)} for ${e}`);const _=await m.json(),y=B(_);return q(e,y,r),y}finally{clearTimeout(s),t.signal?.removeEventListener("abort",l)}},"getPackument"),te=c((e,t)=>{const r=Object.keys(e.versions);if(r.length===0)return;if(t===void 0||t===""||t==="latest")return e["dist-tags"]?.latest??r.at(-1);const o=e["dist-tags"]?.[t];return o!==void 0?o:Object.hasOwn(e.versions,t)?t:u.maxSatisfying(r,t)??void 0},"resolveVersionRange");c(()=>{const e=g();if(!k(e))return 0;let t=0;for(const r of O(e))r.endsWith(".json")&&(p(v(e,r),{force:!0}),t+=1);return t},"clearPackumentCache");var J=Object.defineProperty,h=d((e,t)=>J(e,"name",{value:t,configurable:!0}),"i");const j=h((e,t)=>e.versions[t]?.dist?.attestations?.provenance!==void 0,"hasProvenance"),Y=h((e,t)=>u.valid(t)?Object.keys(e.versions).filter(r=>u.valid(r)!==null&&u.lt(r,t)).filter(r=>u.satisfies(r,"*",{includePrerelease:!1})).filter(r=>j(e,r)).sort((r,o)=>u.lt(r,o)?1:-1)[0]:void 0,"findNewestPriorWithAttestations"),re=h(async(e,t={})=>{if(D("provenance"))return[];const r=new Set(t.allowlist),o=t.concurrency??F;return(await V(e,o,async({name:a,version:n})=>{if(r.has(a))return;const i=await I(a,{workspaceRoot:t.workspaceRoot});if(i===void 0||j(i,n))return;const s=Y(i,n);if(s!==void 0)return{packageName:a,priorVersionWithProvenance:s,version:n}})).filter(a=>a!==void 0)},"runProvenanceMarshall");export{F as D,te as a,Y as f,I as g,V as m,re as r};
@@ -1 +1 @@
1
- var v=Object.defineProperty;var a=(e,r)=>v(e,"name",{value:r,configurable:!0});import{createRequire as _}from"node:module";import{s as j,b as R}from"../packem_chunks/config.js";import{l as d,M as p}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{m as K}from"../packem_chunks/bin.js";const k=_(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=a(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[r,t]=n.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return n.getBuiltinModule(e)}return k(e)},"__cjs_getBuiltinModule"),{rmSync:m,writeFileSync:C}=b("node:fs");var M=Object.defineProperty,o=a((e,r)=>M(e,"name",{value:r,configurable:!0}),"r");const w=1440*60*1e3,A=15e3,S="https://registry.npmjs.org/-/npm/v1/keys",h=o(()=>p(K(),"registry-keys"),"getRegistryKeysCacheDir"),c=o(()=>p(h(),"npmjs.json"),"cacheFilePath"),T=o(()=>{const e=c();if(d(e))try{const r=j(e),t=Date.now()-r.createdAt>r.ttlMs;return{entry:r,expired:t}}catch{m(e,{force:!0});return}},"readCachedKeys"),D=o((e,r)=>{R(h());const t={createdAt:Date.now(),keys:e,ttlMs:r};C(c(),JSON.stringify(t),"utf8")},"writeCachedKeys"),N=o(async(e={})=>{const r=e.ttlMs??w,t=e.keysUrl??process.env.VIS_NPM_KEYS_URL??S,s=T();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const i=new AbortController,g=setTimeout(()=>{i.abort()},A),y=o(()=>{i.abort()},"abortListener");e.signal?.addEventListener("abort",y,{once:!0});try{const l=await fetch(t,{headers:{Accept:"application/json"},signal:i.signal});if(!l.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const f=await l.json(),u=Array.isArray(f.keys)?f.keys:[];return D(u,r),{fromCache:!1,keys:u}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(g),e.signal?.removeEventListener("abort",y)}},"fetchRegistryKeys"),B=o(()=>{const e=c();return d(e)?(m(e,{force:!0}),!0):!1},"clearRegistryKeysCache");export{B as c,N as f};
1
+ var v=Object.defineProperty;var a=(e,r)=>v(e,"name",{value:r,configurable:!0});import{createRequire as _}from"node:module";import{s as j,b as R}from"../packem_chunks/config.js";import{l as m,M as p}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{o as K}from"../packem_chunks/bin.js";const k=_(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=a(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[r,t]=n.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return n.getBuiltinModule(e)}return k(e)},"__cjs_getBuiltinModule"),{rmSync:d,writeFileSync:C}=b("node:fs");var M=Object.defineProperty,o=a((e,r)=>M(e,"name",{value:r,configurable:!0}),"r");const w=1440*60*1e3,A=15e3,S="https://registry.npmjs.org/-/npm/v1/keys",h=o(()=>p(K(),"registry-keys"),"getRegistryKeysCacheDir"),c=o(()=>p(h(),"npmjs.json"),"cacheFilePath"),T=o(()=>{const e=c();if(m(e))try{const r=j(e),t=Date.now()-r.createdAt>r.ttlMs;return{entry:r,expired:t}}catch{d(e,{force:!0});return}},"readCachedKeys"),D=o((e,r)=>{R(h());const t={createdAt:Date.now(),keys:e,ttlMs:r};C(c(),JSON.stringify(t),"utf8")},"writeCachedKeys"),N=o(async(e={})=>{const r=e.ttlMs??w,t=e.keysUrl??process.env.VIS_NPM_KEYS_URL??S,s=T();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const i=new AbortController,g=setTimeout(()=>{i.abort()},A),y=o(()=>{i.abort()},"abortListener");e.signal?.addEventListener("abort",y,{once:!0});try{const l=await fetch(t,{headers:{Accept:"application/json"},signal:i.signal});if(!l.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const f=await l.json(),u=Array.isArray(f.keys)?f.keys:[];return D(u,r),{fromCache:!1,keys:u}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(g),e.signal?.removeEventListener("abort",y)}},"fetchRegistryKeys"),B=o(()=>{const e=c();return m(e)?(d(e,{force:!0}),!0):!1},"clearRegistryKeysCache");export{B as c,N as f};
@@ -1,4 +1,4 @@
1
- var S=Object.defineProperty;var g=(e,a)=>S(e,"name",{value:a,configurable:!0});import{createRequire as C}from"node:module";import{s as _,i as P,p as y}from"../packem_chunks/bin.js";import{h as O,M as V,r as F,a as L,b as I,c as B,d as W,e as U,f as Y}from"./s1ngularity-DBcjspCC.js";import{m as f,D as v,g as k,r as q}from"./provenance-D8vU1u2L.js";import{r as H}from"./signatures-ChTfrQvT.js";import{s as z}from"./pm-runner-DmKT2FqF.js";import{d as G}from"./utils-DrNg0XTR.js";const E=C(import.meta.url),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=g(e=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[a,s]=w.versions.node.split(".").map(Number);if(a>22||a===22&&s>=3||a===20&&s>=16)return w.getBuiltinModule(e)}return E(e)},"__cjs_getBuiltinModule"),{createInterface:x}=j("node:readline");var J=Object.defineProperty,m=g((e,a)=>J(e,"name",{value:a,configurable:!0}),"s");const K=15,Q=m(e=>{if(e===void 0)return!1;const a=e.trim().toLowerCase();return a!==""&&a!=="0"&&a!=="false"&&a!=="no"},"isTruthyEnv"),X=m(e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},"shouldAnimateCountdown"),Z=m(async e=>{const a=x({input:process.stdin,output:process.stdout});try{return await new Promise(s=>{a.question(e,r=>{s(r.trim().toLowerCase())})})}finally{a.close()}},"defaultReadline"),N=m(async(e,a)=>{const s=await a(e);return s==="y"||s==="yes"},"promptYesNo"),ee=m(async(e,a,s,r)=>new Promise(c=>{if(r?.aborted){c(!1);return}const o=X(s)&&a.isTTY!==!1;let n=e;const i=m(()=>{o?a.write(`\rContinuing in ${String(n)}s... press Ctrl-C to abort. `):n===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
1
+ var S=Object.defineProperty;var g=(e,a)=>S(e,"name",{value:a,configurable:!0});import{createRequire as C}from"node:module";import{s as _,i as P,p as y}from"../packem_chunks/bin.js";import{h as O,M as V,r as F,a as L,b as I,c as B,d as W,e as U,f as Y}from"./s1ngularity-adnHbyTd.js";import{m as f,D as v,g as k,r as q}from"./provenance-Cu6VR1Hy.js";import{r as H}from"./signatures-FGbYV5QE.js";import{s as z}from"./pm-runner-DmKT2FqF.js";import{d as G}from"./utils-DrNg0XTR.js";const E=C(import.meta.url),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=g(e=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[a,s]=w.versions.node.split(".").map(Number);if(a>22||a===22&&s>=3||a===20&&s>=16)return w.getBuiltinModule(e)}return E(e)},"__cjs_getBuiltinModule"),{createInterface:x}=j("node:readline");var J=Object.defineProperty,m=g((e,a)=>J(e,"name",{value:a,configurable:!0}),"s");const K=15,Q=m(e=>{if(e===void 0)return!1;const a=e.trim().toLowerCase();return a!==""&&a!=="0"&&a!=="false"&&a!=="no"},"isTruthyEnv"),X=m(e=>{const a=(e.TERM??"").toLowerCase();return a!=="dumb"&&a!=="unknown"&&a!==""},"shouldAnimateCountdown"),Z=m(async e=>{const a=x({input:process.stdin,output:process.stdout});try{return await new Promise(s=>{a.question(e,r=>{s(r.trim().toLowerCase())})})}finally{a.close()}},"defaultReadline"),N=m(async(e,a)=>{const s=await a(e);return s==="y"||s==="yes"},"promptYesNo"),ee=m(async(e,a,s,r)=>new Promise(c=>{if(r?.aborted){c(!1);return}const o=X(s)&&a.isTTY!==!1;let n=e;const i=m(()=>{o?a.write(`\rContinuing in ${String(n)}s... press Ctrl-C to abort. `):n===e&&a.write(`Warnings present; proceeding in ${String(e)}s.
2
2
  `)},"render");i();const d=setInterval(()=>{if(n-=1,n<=0){clearInterval(d),r?.removeEventListener("abort",l),o&&a.write(`\rContinuing now.
3
3
  `),c(!0);return}i()},1e3),l=m(()=>{clearInterval(d),o&&a.write(`\rAborted.
4
4
  `),c(!1)},"onAbort");r?.addEventListener("abort",l,{once:!0})}),"runCountdown"),ae=m(async(e,a={})=>{if(e.length===0)return{proceed:!0};const s=a.env??process.env,r=a.isTty??!!process.stdin.isTTY,c=a.isCi??_,o=a.strict??!1,n=a.readline??Z,i=a.output??{isTTY:!!process.stdout.isTTY,write:m(u=>process.stdout.write(u),"write")},d=Q(s.VIS_DISABLE_AUTO_CONTINUE),l=Number.parseInt(s.VIS_AUTO_CONTINUE_SECONDS??"",10),t=a.countdownSeconds??(Number.isFinite(l)&&l>0?l:K);return e.some(u=>u.severity==="error")?o?{proceed:!1,reason:"errors-present"}:c?{proceed:!1,reason:"errors-present"}:r?await N("Proceed despite errors? [y/N] ",n)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!1,reason:"non-tty"}:o?{proceed:!1,reason:"ci-strict"}:r?d?await N("Proceed despite warnings? [y/N] ",n)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:await ee(t,i,s,a.signal)?{proceed:!0}:{proceed:!1,reason:"user-aborted"}:{proceed:!0}},"presentMarshallDecision"),Oe=m(async(e,a={})=>{if(e.isEmpty())return!0;const s=e.all(),r=a.output??{isTTY:!!process.stdout.isTTY,write:m(c=>process.stdout.write(c),"write")};for(const c of O(s))r.write(`${c}
@@ -1 +1 @@
1
- var ie=Object.defineProperty;var p=(r,e)=>ie(r,"name",{value:e,configurable:!0});import{createRequire as oe}from"node:module";import{T as Q,e as j}from"./Table-3pFgIUZ2-DABgc6rj.js";import{s as V,b as W}from"../packem_chunks/config.js";import{M as k,l as N}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{m as B,i as b}from"../packem_chunks/bin.js";import{m as D,D as M,g as S}from"./provenance-D8vU1u2L.js";import{s as g}from"./pm-runner-DmKT2FqF.js";const ae=oe(import.meta.url),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=p(r=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[e,t]=E.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return E.getBuiltinModule(r)}return ae(r)},"__cjs_getBuiltinModule"),{rmSync:y,writeFileSync:L,readdirSync:U}=F("node:fs"),{createHash:ce}=F("node:crypto"),{Resolver:de}=F("node:dns/promises");var le=Object.defineProperty,I=p((r,e)=>le(r,"name",{value:e,configurable:!0}),"t$2");class mr{static{p(this,"MarshallFindings")}static{I(this,"MarshallFindings")}entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const pr=I(r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(Q(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${Q("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${j("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(j(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${j("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${j("→")} ${s.suggestedAction}`)}return e},"formatMarshallFindingsAsTable"),gr=I(r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),"formatMarshallFindingsAsJson");var ue=Object.defineProperty,w=p((r,e)=>ue(r,"name",{value:e,configurable:!0}),"o$1");const he=1440*60*1e3,fe=15e3,ve="https://api.github.com/repos",H=w(()=>k(B(),"archived-repo"),"getArchivedRepoCacheDir"),te=w((r,e)=>k(H(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),"cacheFilePath"),me=w((r,e)=>{const t=te(r,e);if(N(t))try{const n=V(t);if(Date.now()-n.createdAt>n.ttlMs){y(t,{force:!0});return}return n}catch{y(t,{force:!0});return}},"readCachedRepo"),Z=w((r,e,t,n)=>{W(H());const s={createdAt:Date.now(),ttlMs:n,...t};L(te(r,e),JSON.stringify(s),"utf8")},"writeCachedRepo"),pe=w(r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},"parseGitHubUrl"),ge=w(async(r,e,t,n)=>{const s=`${ve}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},fe),i=w(()=>{c.abort()},"abortListener");n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,h=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:h,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},"fetchGitHubRepo"),we=w((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),wr=w(async(r,e={})=>{if(b("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??he,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??M,o=new Map,i=w(async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const h=me(a,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const f=await ge(a,d,s,e.signal);return f.kind==="missing"?Z(a,d,{archived:!1,missing:!0},n):f.kind==="ok"&&Z(a,d,{archived:f.archived===!0,archivedAt:f.archivedAt},n),f})(),o.set(l,u)),u},"fetchRepoOnce");return(await D(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await S(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[we(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const h=pe(u.repository?.url);if(h===void 0)return;const f=await i(h.owner,h.repo);if(f.kind!=="transient-error"){if(f.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:a,repo:h.repo};if(f.archived===!0)return{...f.archivedAt===void 0?{}:{archivedAt:f.archivedAt},kind:"archived",owner:h.owner,packageName:a,repo:h.repo}}})).filter(a=>a!==void 0)},"runArchivedRepoMarshall");w(()=>{const r=H();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearArchivedRepoCache");var ye=Object.defineProperty,O=p((r,e)=>ye(r,"name",{value:e,configurable:!0}),"h$1");const ke={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},$e=1440*60*1e3,J=O((r,e)=>(r-e)/$e,"daysBetween"),C=O(r=>{if(r!==void 0)return r.email??r.name},"userIdentity"),be=O((r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=J(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkRecentVersion"),De=O((r,e,t,n,s)=>{const c=r.versions[t],o=C(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>g.valid(u)!==null).filter(u=>g.lt(u,t));if(i.length===0||i.some(u=>C(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=J(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},"checkNewPublisher"),Me=O((r,e,t,n,s)=>{const c=r.versions[t],o=C(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||C(u._npmUser)!==o)continue;const h=r.time?.[l];if(h===void 0)continue;const f=new Date(h).getTime();Number.isFinite(f)&&i.push(f)}if(i.length===0)return;const a=Math.max(...i),d=J(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkDormantMaintainer"),yr=O(async(r,e={})=>{if(b("author"))return[];const t=new Set(e.allowlist),n={...ke,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??M;return(await D(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await S(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=be(a,o,i,d,n);u!==void 0&&l.push(u);const h=De(a,o,i,d,n);h!==void 0&&l.push(h);const f=Me(a,o,i,d,n);return f!==void 0&&l.push(f),l})).flat()},"runAuthorMarshall");var Re=Object.defineProperty,$=p((r,e)=>Re(r,"name",{value:e,configurable:!0}),"t$1");const Ae=1440*60*1e3,Ne=15e3,Se=20,Oe=1e4,Ee="https://api.npmjs.org/downloads/point/last-month",z=$(()=>k(B(),"downloads"),"getDownloadsCacheDir"),ne=$(r=>k(z(),`${encodeURIComponent(r)}.json`),"cacheFilePath"),Te=$(r=>{const e=ne(r);if(N(e))try{const t=V(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t.downloads}catch{y(e,{force:!0});return}},"readCachedDownloads"),je=$((r,e,t)=>{W(z());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};L(ne(r),JSON.stringify(n),"utf8")},"writeCachedDownloads"),Ce=$(async(r,e)=>{const t=`${Ee}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},Ne),c=$(()=>{n.abort()},"abortListener");e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},"fetchDownloads"),kr=$(async(r,e={})=>{if(b("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??Se,s=e.warnThreshold??Oe,c=e.cacheTtlMs??Ae,o=e.concurrency??M;return(await D(r,o,async i=>{if(t.has(i))return;let a=Te(i);if(a===void 0){const d=await Ce(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,je(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},"runDownloadsMarshall");$(()=>{const r=z();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearDownloadsCache");var xe=Object.defineProperty,m=p((r,e)=>xe(r,"name",{value:e,configurable:!0}),"t");const Pe=1440*60*1e3,_e=4e3,Fe=["1.1.1.1","8.8.8.8"],q=m(()=>k(B(),"expired-domains"),"getExpiredDomainsCacheDir"),se=m(r=>{const e=ce("sha256").update(r).digest("hex").slice(0,12);return k(q(),`${e}.json`)},"cacheFilePath"),Le=m(r=>{const e=se(r);if(N(e))try{const t=V(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t}catch{y(e,{force:!0});return}},"readCachedDomain"),Ue=m((r,e,t)=>{W(q());const n={createdAt:Date.now(),outcome:e,ttlMs:t};L(se(r),JSON.stringify(n),"utf8")},"writeCachedDomain"),Ve=m(r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},"extractDomain"),We=m((r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},"collectMaintainers"),Be=m(async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},"withTimeout"),Ie=m(r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},"isExpiredError"),He=m(async(r,e,t)=>{try{const n=await Be(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Ie(n)?{kind:"expired"}:{kind:"transient-error"}}},"resolveDomain"),Je=m((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),$r=m(async(r,e={})=>{if(b("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??Pe,c=e.perDomainTimeoutMs??_e,o=e.dnsServers??Fe,i=e.concurrency??M,a=e.createResolver===void 0?new de:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=m(async u=>{let h=d.get(u);return h===void 0&&(h=(async()=>{const f=Le(u);if(f!==void 0)return{kind:f.outcome==="ok"?"ok":"expired"};const v=await He(a,u,c);return v.kind!=="transient-error"&&Ue(u,v.kind,s),v})(),d.set(u,h)),h},"resolveDomainOnce");return(await D(r,i,async({name:u,version:h})=>{if(t.has(u))return[];const f=await S(u,{workspaceRoot:e.workspaceRoot});if(f===void 0)return[];const v=f.versions[h]??f.versions[Je(Object.keys(f.versions),f["dist-tags"]?.latest)??""];if(v===void 0)return[];const P=We(v.maintainers,v._npmUser),K=new Set,_=[];for(const T of P){const A=Ve(T.email);if(A===void 0||n.has(A))continue;const X=`${A}:${T.email??""}`;if(K.has(X))continue;K.add(X);const Y=await l(A);Y.kind==="expired"?_.push({domain:A,kind:"expired",maintainer:T.email??"",packageName:u,severity:"error"}):Y.kind==="transient-error"&&_.push({domain:A,kind:"unresolved",maintainer:T.email??"",packageName:u,severity:"warning"})}return _})).flat()},"runExpiredDomainsMarshall");m(()=>{const r=q();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearExpiredDomainsCache");var ze=Object.defineProperty,R=p((r,e)=>ze(r,"name",{value:e,configurable:!0}),"s");const qe=["readme","license","repo"],Ge=["ERROR: No README data found!","# Security holding package"],Ke=R(r=>{const e=r.trim();return e===""?!0:Ge.some(t=>e.startsWith(t))},"isPlaceholderReadme"),Xe=R((r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},"getReadme"),Ye=R((r,e)=>{const t=Xe(r,e);if(t===void 0)return"missing-readme";if(Ke(t))return"placeholder-readme"},"checkReadme"),Qe=R(r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},"checkLicense"),Ze=R(r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},"checkRepository"),er=R(r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},"resolveLatestVersion"),br=R(async(r,e={})=>{if(b("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??qe),s=e.concurrency??M;return(await D(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await S(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[er(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Ye(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Qe(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Ze(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},"runMetadataMarshall");var rr=Object.defineProperty,G=p((r,e)=>rr(r,"name",{value:e,configurable:!0}),"o");const ee=G((r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},"normalizeBin"),tr=G((r,e)=>g.valid(e)?Object.keys(r.versions).filter(t=>g.valid(t)!==null&&g.lt(t,e)).sort((t,n)=>g.lt(t,n)?1:-1)[0]:void 0,"findImmediatelyPriorVersion"),Dr=G(async(r,e={})=>{if(b("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??M;return(await D(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await S(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=tr(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=ee(a.bin,c),h=ee(l.bin,c),f=Object.entries(u).filter(([v])=>!(v in h)).filter(([v])=>!n.has(v)).map(([v,P])=>({command:P,name:v}));if(f.length!==0)return{fromVersion:d,newBins:f,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},"runNewBinMarshall");var nr=Object.defineProperty,x=p((r,e)=>nr(r,"name",{value:e,configurable:!0}),"a");const sr=["preinstall","install","postinstall"],re=x((r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,"hasProvenance"),ir=x((r,e)=>{if(g.valid(e)!==null)return Object.keys(r.versions).filter(t=>g.valid(t)!==null&&g.prerelease(t)===null&&g.lt(t,e)).sort((t,n)=>g.lt(t,n)?1:-1)[0]},"findNewestPriorStable"),or=x((r,e)=>{const t=r??{},n=e??{},s=[];for(const c of sr){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},"installHookChanges"),Mr=x(async(r,e={})=>{if(b("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??M;return(await D(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await S(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=ir(o,c);if(i===void 0||!re(o,i)||re(o,c))return;const a=or(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)},"runS1ngularityMarshall");export{mr as M,Mr as a,Dr as b,br as c,kr as d,$r as e,wr as f,gr as g,pr as h,yr as r};
1
+ var ie=Object.defineProperty;var p=(r,e)=>ie(r,"name",{value:e,configurable:!0});import{createRequire as oe}from"node:module";import{T as Q,e as j}from"./Table-3pFgIUZ2-DABgc6rj.js";import{s as V,b as W}from"../packem_chunks/config.js";import{M as k,l as N}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{o as B,i as b}from"../packem_chunks/bin.js";import{m as D,D as M,g as S}from"./provenance-Cu6VR1Hy.js";import{s as g}from"./pm-runner-DmKT2FqF.js";const ae=oe(import.meta.url),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=p(r=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[e,t]=E.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return E.getBuiltinModule(r)}return ae(r)},"__cjs_getBuiltinModule"),{rmSync:y,writeFileSync:L,readdirSync:U}=F("node:fs"),{createHash:ce}=F("node:crypto"),{Resolver:de}=F("node:dns/promises");var le=Object.defineProperty,I=p((r,e)=>le(r,"name",{value:e,configurable:!0}),"t$2");class mr{static{p(this,"MarshallFindings")}static{I(this,"MarshallFindings")}entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const pr=I(r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(Q(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${Q("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${j("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(j(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${j("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${j("→")} ${s.suggestedAction}`)}return e},"formatMarshallFindingsAsTable"),gr=I(r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),"formatMarshallFindingsAsJson");var ue=Object.defineProperty,w=p((r,e)=>ue(r,"name",{value:e,configurable:!0}),"o$1");const he=1440*60*1e3,fe=15e3,ve="https://api.github.com/repos",H=w(()=>k(B(),"archived-repo"),"getArchivedRepoCacheDir"),te=w((r,e)=>k(H(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),"cacheFilePath"),me=w((r,e)=>{const t=te(r,e);if(N(t))try{const n=V(t);if(Date.now()-n.createdAt>n.ttlMs){y(t,{force:!0});return}return n}catch{y(t,{force:!0});return}},"readCachedRepo"),Z=w((r,e,t,n)=>{W(H());const s={createdAt:Date.now(),ttlMs:n,...t};L(te(r,e),JSON.stringify(s),"utf8")},"writeCachedRepo"),pe=w(r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},"parseGitHubUrl"),ge=w(async(r,e,t,n)=>{const s=`${ve}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},fe),i=w(()=>{c.abort()},"abortListener");n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,h=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:h,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},"fetchGitHubRepo"),we=w((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),wr=w(async(r,e={})=>{if(b("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??he,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??M,o=new Map,i=w(async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const h=me(a,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const f=await ge(a,d,s,e.signal);return f.kind==="missing"?Z(a,d,{archived:!1,missing:!0},n):f.kind==="ok"&&Z(a,d,{archived:f.archived===!0,archivedAt:f.archivedAt},n),f})(),o.set(l,u)),u},"fetchRepoOnce");return(await D(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await S(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[we(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const h=pe(u.repository?.url);if(h===void 0)return;const f=await i(h.owner,h.repo);if(f.kind!=="transient-error"){if(f.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:a,repo:h.repo};if(f.archived===!0)return{...f.archivedAt===void 0?{}:{archivedAt:f.archivedAt},kind:"archived",owner:h.owner,packageName:a,repo:h.repo}}})).filter(a=>a!==void 0)},"runArchivedRepoMarshall");w(()=>{const r=H();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearArchivedRepoCache");var ye=Object.defineProperty,O=p((r,e)=>ye(r,"name",{value:e,configurable:!0}),"h$1");const ke={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},$e=1440*60*1e3,J=O((r,e)=>(r-e)/$e,"daysBetween"),C=O(r=>{if(r!==void 0)return r.email??r.name},"userIdentity"),be=O((r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=J(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkRecentVersion"),De=O((r,e,t,n,s)=>{const c=r.versions[t],o=C(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>g.valid(u)!==null).filter(u=>g.lt(u,t));if(i.length===0||i.some(u=>C(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=J(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},"checkNewPublisher"),Me=O((r,e,t,n,s)=>{const c=r.versions[t],o=C(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||C(u._npmUser)!==o)continue;const h=r.time?.[l];if(h===void 0)continue;const f=new Date(h).getTime();Number.isFinite(f)&&i.push(f)}if(i.length===0)return;const a=Math.max(...i),d=J(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkDormantMaintainer"),yr=O(async(r,e={})=>{if(b("author"))return[];const t=new Set(e.allowlist),n={...ke,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??M;return(await D(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await S(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=be(a,o,i,d,n);u!==void 0&&l.push(u);const h=De(a,o,i,d,n);h!==void 0&&l.push(h);const f=Me(a,o,i,d,n);return f!==void 0&&l.push(f),l})).flat()},"runAuthorMarshall");var Re=Object.defineProperty,$=p((r,e)=>Re(r,"name",{value:e,configurable:!0}),"t$1");const Ae=1440*60*1e3,Ne=15e3,Se=20,Oe=1e4,Ee="https://api.npmjs.org/downloads/point/last-month",z=$(()=>k(B(),"downloads"),"getDownloadsCacheDir"),ne=$(r=>k(z(),`${encodeURIComponent(r)}.json`),"cacheFilePath"),Te=$(r=>{const e=ne(r);if(N(e))try{const t=V(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t.downloads}catch{y(e,{force:!0});return}},"readCachedDownloads"),je=$((r,e,t)=>{W(z());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};L(ne(r),JSON.stringify(n),"utf8")},"writeCachedDownloads"),Ce=$(async(r,e)=>{const t=`${Ee}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},Ne),c=$(()=>{n.abort()},"abortListener");e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},"fetchDownloads"),kr=$(async(r,e={})=>{if(b("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??Se,s=e.warnThreshold??Oe,c=e.cacheTtlMs??Ae,o=e.concurrency??M;return(await D(r,o,async i=>{if(t.has(i))return;let a=Te(i);if(a===void 0){const d=await Ce(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,je(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},"runDownloadsMarshall");$(()=>{const r=z();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearDownloadsCache");var xe=Object.defineProperty,m=p((r,e)=>xe(r,"name",{value:e,configurable:!0}),"t");const Pe=1440*60*1e3,_e=4e3,Fe=["1.1.1.1","8.8.8.8"],q=m(()=>k(B(),"expired-domains"),"getExpiredDomainsCacheDir"),se=m(r=>{const e=ce("sha256").update(r).digest("hex").slice(0,12);return k(q(),`${e}.json`)},"cacheFilePath"),Le=m(r=>{const e=se(r);if(N(e))try{const t=V(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t}catch{y(e,{force:!0});return}},"readCachedDomain"),Ue=m((r,e,t)=>{W(q());const n={createdAt:Date.now(),outcome:e,ttlMs:t};L(se(r),JSON.stringify(n),"utf8")},"writeCachedDomain"),Ve=m(r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},"extractDomain"),We=m((r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},"collectMaintainers"),Be=m(async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},"withTimeout"),Ie=m(r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},"isExpiredError"),He=m(async(r,e,t)=>{try{const n=await Be(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Ie(n)?{kind:"expired"}:{kind:"transient-error"}}},"resolveDomain"),Je=m((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),$r=m(async(r,e={})=>{if(b("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??Pe,c=e.perDomainTimeoutMs??_e,o=e.dnsServers??Fe,i=e.concurrency??M,a=e.createResolver===void 0?new de:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=m(async u=>{let h=d.get(u);return h===void 0&&(h=(async()=>{const f=Le(u);if(f!==void 0)return{kind:f.outcome==="ok"?"ok":"expired"};const v=await He(a,u,c);return v.kind!=="transient-error"&&Ue(u,v.kind,s),v})(),d.set(u,h)),h},"resolveDomainOnce");return(await D(r,i,async({name:u,version:h})=>{if(t.has(u))return[];const f=await S(u,{workspaceRoot:e.workspaceRoot});if(f===void 0)return[];const v=f.versions[h]??f.versions[Je(Object.keys(f.versions),f["dist-tags"]?.latest)??""];if(v===void 0)return[];const P=We(v.maintainers,v._npmUser),K=new Set,_=[];for(const T of P){const A=Ve(T.email);if(A===void 0||n.has(A))continue;const X=`${A}:${T.email??""}`;if(K.has(X))continue;K.add(X);const Y=await l(A);Y.kind==="expired"?_.push({domain:A,kind:"expired",maintainer:T.email??"",packageName:u,severity:"error"}):Y.kind==="transient-error"&&_.push({domain:A,kind:"unresolved",maintainer:T.email??"",packageName:u,severity:"warning"})}return _})).flat()},"runExpiredDomainsMarshall");m(()=>{const r=q();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearExpiredDomainsCache");var ze=Object.defineProperty,R=p((r,e)=>ze(r,"name",{value:e,configurable:!0}),"s");const qe=["readme","license","repo"],Ge=["ERROR: No README data found!","# Security holding package"],Ke=R(r=>{const e=r.trim();return e===""?!0:Ge.some(t=>e.startsWith(t))},"isPlaceholderReadme"),Xe=R((r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},"getReadme"),Ye=R((r,e)=>{const t=Xe(r,e);if(t===void 0)return"missing-readme";if(Ke(t))return"placeholder-readme"},"checkReadme"),Qe=R(r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},"checkLicense"),Ze=R(r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},"checkRepository"),er=R(r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},"resolveLatestVersion"),br=R(async(r,e={})=>{if(b("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??qe),s=e.concurrency??M;return(await D(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await S(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[er(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Ye(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Qe(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Ze(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},"runMetadataMarshall");var rr=Object.defineProperty,G=p((r,e)=>rr(r,"name",{value:e,configurable:!0}),"o");const ee=G((r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},"normalizeBin"),tr=G((r,e)=>g.valid(e)?Object.keys(r.versions).filter(t=>g.valid(t)!==null&&g.lt(t,e)).sort((t,n)=>g.lt(t,n)?1:-1)[0]:void 0,"findImmediatelyPriorVersion"),Dr=G(async(r,e={})=>{if(b("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??M;return(await D(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await S(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=tr(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=ee(a.bin,c),h=ee(l.bin,c),f=Object.entries(u).filter(([v])=>!(v in h)).filter(([v])=>!n.has(v)).map(([v,P])=>({command:P,name:v}));if(f.length!==0)return{fromVersion:d,newBins:f,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},"runNewBinMarshall");var nr=Object.defineProperty,x=p((r,e)=>nr(r,"name",{value:e,configurable:!0}),"a");const sr=["preinstall","install","postinstall"],re=x((r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,"hasProvenance"),ir=x((r,e)=>{if(g.valid(e)!==null)return Object.keys(r.versions).filter(t=>g.valid(t)!==null&&g.prerelease(t)===null&&g.lt(t,e)).sort((t,n)=>g.lt(t,n)?1:-1)[0]},"findNewestPriorStable"),or=x((r,e)=>{const t=r??{},n=e??{},s=[];for(const c of sr){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},"installHookChanges"),Mr=x(async(r,e={})=>{if(b("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??M;return(await D(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await S(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=ir(o,c);if(i===void 0||!re(o,i)||re(o,c))return;const a=or(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)},"runS1ngularityMarshall");export{mr as M,Mr as a,Dr as b,br as c,kr as d,$r as e,wr as f,gr as g,pr as h,yr as r};
@@ -1,2 +1,2 @@
1
- var S=Object.defineProperty;var g=(s,r)=>S(s,"name",{value:r,configurable:!0});import{e as k,E as x,I as T,T as $}from"./Table-3pFgIUZ2-DABgc6rj.js";import{a5 as a,a6 as u,n as l,a7 as d,k as C,R as j,s as E}from"../packem_chunks/bin.js";import{n as R}from"./spinner-C8xs6QZv.js";import{D as w,W as P,T as O,C as A}from"./symbols-CQmER5MT.js";var D=Object.defineProperty,I=g((s,r)=>D(s,"name",{value:r,configurable:!0}),"l");const v=I(({rows:s})=>a.jsx(u,{flexDirection:"column",children:s.map(r=>{let t;switch(r.status){case"error":{t=a.jsx(l,{color:"red",children:A});break}case"ok":{t=a.jsx(l,{color:"green",children:O});break}case"running":{t=a.jsx(l,{color:"white",children:a.jsx(R,{type:"dots"})});break}case"warn":{t=a.jsx(l,{color:"yellow",children:P});break}default:{t=a.jsx(l,{dimColor:!0,children:w});break}}return a.jsxs(u,{children:[a.jsx(u,{width:3,children:t}),a.jsx(u,{flexGrow:1,children:a.jsx(l,{children:r.label})}),r.summary?a.jsx(u,{children:a.jsxs(l,{dimColor:!0,children:[w," ",r.summary]})}):null]},r.id)})}),"ScanProgressApp");var Y=Object.defineProperty,i=g((s,r)=>Y(s,"name",{value:r,configurable:!0}),"e");const G={error:$(d.failure),ok:T(d.success),pending:x(d.dash),skip:x(d.dash),warn:k(d.warning)},M=i((s,r,t)=>{const h=t?`${s} ${x(`— ${t}`)}`:s;return` ${G[r]} ${h}
1
+ var S=Object.defineProperty;var g=(s,r)=>S(s,"name",{value:r,configurable:!0});import{e as k,E as x,I as T,T as $}from"./Table-3pFgIUZ2-DABgc6rj.js";import{a7 as a,a8 as u,n as l,a9 as d,k as C,R as j,s as E}from"../packem_chunks/bin.js";import{n as R}from"./spinner-0acw5pd_.js";import{D as w,W as P,T as O,C as A}from"./symbols-CQmER5MT.js";var D=Object.defineProperty,I=g((s,r)=>D(s,"name",{value:r,configurable:!0}),"l");const v=I(({rows:s})=>a.jsx(u,{flexDirection:"column",children:s.map(r=>{let t;switch(r.status){case"error":{t=a.jsx(l,{color:"red",children:A});break}case"ok":{t=a.jsx(l,{color:"green",children:O});break}case"running":{t=a.jsx(l,{color:"white",children:a.jsx(R,{type:"dots"})});break}case"warn":{t=a.jsx(l,{color:"yellow",children:P});break}default:{t=a.jsx(l,{dimColor:!0,children:w});break}}return a.jsxs(u,{children:[a.jsx(u,{width:3,children:t}),a.jsx(u,{flexGrow:1,children:a.jsx(l,{children:r.label})}),r.summary?a.jsx(u,{children:a.jsxs(l,{dimColor:!0,children:[w," ",r.summary]})}):null]},r.id)})}),"ScanProgressApp");var Y=Object.defineProperty,i=g((s,r)=>Y(s,"name",{value:r,configurable:!0}),"e");const G={error:$(d.failure),ok:T(d.success),pending:x(d.dash),skip:x(d.dash),warn:k(d.warning)},M=i((s,r,t)=>{const h=t?`${s} ${x(`— ${t}`)}`:s;return` ${G[r]} ${h}
2
2
  `},"formatStaticRow"),L=i((s,r={})=>{const t=r.stream??process.stderr,h=typeof t.isTTY=="boolean"&&t.isTTY&&!E,y=r.live??h,n=new Map;for(const e of s)n.set(e.id,{id:e.id,label:e.label,status:"pending"});if(!y||s.length===0)return{finish:i((e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),t.write(M(c.label,o,f)))},"finish"),start:i(e=>{const o=n.get(e);o&&n.set(e,{...o,status:"running"})},"start"),stop:i(()=>{},"stop")};const b=i(()=>s.map(e=>n.get(e.id)),"buildRows");let m=C(j.createElement(v,{rows:b()}),{interactive:!0,patchConsole:!1});const p=i(()=>{m?.rerender(j.createElement(v,{rows:b()}))},"rerender");return{finish:i((e,o,f)=>{const c=n.get(e);c&&(n.set(e,{...c,status:o,summary:f}),p())},"finish"),start:i(e=>{const o=n.get(e);o&&(n.set(e,{...o,status:"running"}),p())},"start"),stop:i(()=>{m&&(p(),m.unmount(),m=void 0)},"stop")}},"startScanProgress");export{L as s};
@@ -1,2 +1,2 @@
1
- var b=Object.defineProperty;var y=(s,e)=>b(s,"name",{value:e,configurable:!0});import{createRequire as N}from"node:module";import{m as x,D as B,g as E}from"./provenance-D8vU1u2L.js";import{i as M}from"../packem_chunks/bin.js";import{f as j}from"./registry-keys-E3cZn4FI.js";const P=N(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=y(s=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[e,i]=g.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return g.getBuiltinModule(s)}return P(s)},"__cjs_getBuiltinModule"),{createPublicKey:S,createVerify:R}=_("node:crypto");var A=Object.defineProperty,h=y((s,e)=>A(s,"name",{value:e,configurable:!0}),"n");const C=h(s=>{const e=["-----BEGIN PUBLIC KEY-----"],i=s.replaceAll(/\s+/g,"");for(let t=0;t<i.length;t+=64)e.push(i.slice(t,t+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
1
+ var b=Object.defineProperty;var y=(s,e)=>b(s,"name",{value:e,configurable:!0});import{createRequire as N}from"node:module";import{m as x,D as B,g as E}from"./provenance-Cu6VR1Hy.js";import{i as M}from"../packem_chunks/bin.js";import{f as j}from"./registry-keys-CuBAVdsk.js";const P=N(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=y(s=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[e,i]=g.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return g.getBuiltinModule(s)}return P(s)},"__cjs_getBuiltinModule"),{createPublicKey:S,createVerify:R}=_("node:crypto");var A=Object.defineProperty,h=y((s,e)=>A(s,"name",{value:e,configurable:!0}),"n");const C=h(s=>{const e=["-----BEGIN PUBLIC KEY-----"],i=s.replaceAll(/\s+/g,"");for(let t=0;t<i.length;t+=64)e.push(i.slice(t,t+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
2
2
  `)},"wrapSpkiPem"),D=h(({keyBase64:s,message:e,signatureBase64:i})=>{try{const t=S({format:"pem",key:C(s)}),o=R("SHA256");return o.update(e),o.end(),o.verify(t,Buffer.from(i,"base64"))}catch{return!1}},"verifyEcdsaSignature");var L=Object.defineProperty,f=y((s,e)=>L(s,"name",{value:e,configurable:!0}),"g");const U=f((s,e)=>{if(s.expires===void 0||s.expires==="")return!1;const i=Date.parse(s.expires);return Number.isNaN(i)?!1:i<=e},"isKeyExpired"),K=f((s,e,i)=>`${s}@${e}:${i}`,"buildSignedMessage"),T=f((s,e)=>e!==void 0&&s.includes(e)?e:s.at(-1),"resolveLatestVersion"),V=f(async(s,e={})=>{if(M("signatures"))return[];const i=new Set(e.allowlist),t=e.treatExpiredAs??"warning",o=e.concurrency??B,k=await j({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(k===void 0)return s.filter(({name:r})=>!i.has(r)).map(({name:r,version:a})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:r,severity:"warning",version:a}));const v=new Map;for(const r of k.keys)v.set(r.keyid,r);const w=Date.now();return(await x(s,o,async({name:r,version:a})=>{if(i.has(r))return[];const c=await E(r,{workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const l=c.versions[a]??c.versions[T(Object.keys(c.versions),c["dist-tags"]?.latest)??""];if(l===void 0)return[];const p=l.dist?.signatures,m=l.dist?.integrity;if(p===void 0||p.length===0)return[{code:"missing-signature",message:`Package ${r}@${a} has no dist.signatures from the registry.`,packageName:r,severity:"warning",version:a}];if(typeof m!="string"||m==="")return[{code:"missing-signature",message:`Package ${r}@${a} has signatures but no dist.integrity to verify against.`,packageName:r,severity:"warning",version:a}];const $=K(r,a,m),u=[];for(const n of p){const d=v.get(n.keyid);if(d===void 0){u.push({code:"unknown-keyid",keyid:n.keyid,message:`Package ${r}@${a} was signed with an unrecognized keyid (${n.keyid}).`,packageName:r,severity:"error",version:a});continue}if(U(d,w)){u.push({code:"expired-key",keyid:n.keyid,message:`Package ${r}@${a} was signed with an expired key (${n.keyid}, expired ${d.expires??"unknown"}).`,packageName:r,severity:t,version:a});continue}D({keyBase64:d.key,message:$,signatureBase64:n.sig})||u.push({code:"invalid-signature",keyid:n.keyid,message:`Package ${r}@${a} signature did not verify against ${n.keyid}.`,packageName:r,severity:"error",version:a})}return u})).flat()},"runSignatureMarshall");export{V as r};
@@ -1 +1 @@
1
- var T=Object.defineProperty;var u=(e,r)=>T(e,"name",{value:r,configurable:!0});import{w as t,a8 as k,a5 as z,n as L}from"../packem_chunks/bin.js";import{$ as N}from"./spinners-f91Rbo99-Bjf3NcO0.js";var q=Object.defineProperty,y=u((e,r)=>q(e,"name",{value:r,configurable:!0}),"c$1"),w=Object.defineProperty,d=y((e,r)=>w(e,"name",{value:r,configurable:!0}),"c"),B=Object.defineProperty,E=d((e,r)=>B(e,"name",{value:r,configurable:!0}),"l");const I=100,D=2147483647,p={delta:0,frame:0,time:0};function f(e){const{interval:r=I,isActive:n=!0}=e??{},a=l(r),{renderThrottleMs:o,subscribe:x}=t.useContext(k),[i,S]=t.useState(0),[$,g]=t.useState(p),m=t.useRef(0),v=t.useRef(0),h=t.useRef({isActive:n,resetKey:i,safeInterval:a}),b=h.current,C=n&&(a!==b.safeInterval||!b.isActive||i!==b.resetKey),A=t.useCallback(()=>{S(c=>c+1)},[]);return t.useLayoutEffect(()=>{if(!n)return;g(p);let c=0;const{startTime:O,unsubscribe:F}=x(s=>{if(o>0&&s<m.current)return;const P=s-c,K=s-v.current;v.current=s,m.current=s+o,g({delta:K,frame:Math.floor(P/a),time:P})},a);return c=O,v.current=O,m.current=c+o,F},[a,n,x,o,i]),t.useLayoutEffect(()=>{h.current={isActive:n,resetKey:i,safeInterval:a}},[n,a,i]),C?{...p,reset:A}:{...$,reset:A}}u(f,"o");y(f,"N");d(f,"S");E(f,"useAnimation");function l(e){return Number.isFinite(e)?Math.min(D,Math.max(1,e)):I}u(l,"d");y(l,"C");d(l,"F");E(l,"normalizeAnimationInterval");var G=Object.defineProperty,M=u((e,r)=>G(e,"name",{value:r,configurable:!0}),"t"),H=Object.defineProperty,R=M((e,r)=>H(e,"name",{value:r,configurable:!0}),"t"),J=Object.defineProperty,Q=R((e,r)=>J(e,"name",{value:r,configurable:!0}),"t");function j({type:e="dots"}){const r=N(e),{frame:n}=f({interval:r.interval});return z.jsx(L,{children:r.frames[n%r.frames.length]})}u(j,"n");M(j,"l");R(j,"n");Q(j,"Spinner");export{j as n};
1
+ var T=Object.defineProperty;var u=(e,r)=>T(e,"name",{value:r,configurable:!0});import{x as t,aa as k,a7 as z,n as L}from"../packem_chunks/bin.js";import{$ as N}from"./spinners-f91Rbo99-Bjf3NcO0.js";var q=Object.defineProperty,y=u((e,r)=>q(e,"name",{value:r,configurable:!0}),"c$1"),w=Object.defineProperty,d=y((e,r)=>w(e,"name",{value:r,configurable:!0}),"c"),B=Object.defineProperty,E=d((e,r)=>B(e,"name",{value:r,configurable:!0}),"l");const I=100,D=2147483647,p={delta:0,frame:0,time:0};function f(e){const{interval:r=I,isActive:n=!0}=e??{},a=l(r),{renderThrottleMs:o,subscribe:x}=t.useContext(k),[i,S]=t.useState(0),[$,g]=t.useState(p),m=t.useRef(0),v=t.useRef(0),h=t.useRef({isActive:n,resetKey:i,safeInterval:a}),b=h.current,C=n&&(a!==b.safeInterval||!b.isActive||i!==b.resetKey),A=t.useCallback(()=>{S(c=>c+1)},[]);return t.useLayoutEffect(()=>{if(!n)return;g(p);let c=0;const{startTime:O,unsubscribe:F}=x(s=>{if(o>0&&s<m.current)return;const P=s-c,K=s-v.current;v.current=s,m.current=s+o,g({delta:K,frame:Math.floor(P/a),time:P})},a);return c=O,v.current=O,m.current=c+o,F},[a,n,x,o,i]),t.useLayoutEffect(()=>{h.current={isActive:n,resetKey:i,safeInterval:a}},[n,a,i]),C?{...p,reset:A}:{...$,reset:A}}u(f,"o");y(f,"N");d(f,"S");E(f,"useAnimation");function l(e){return Number.isFinite(e)?Math.min(D,Math.max(1,e)):I}u(l,"d");y(l,"C");d(l,"F");E(l,"normalizeAnimationInterval");var G=Object.defineProperty,M=u((e,r)=>G(e,"name",{value:r,configurable:!0}),"t"),H=Object.defineProperty,R=M((e,r)=>H(e,"name",{value:r,configurable:!0}),"t"),J=Object.defineProperty,Q=R((e,r)=>J(e,"name",{value:r,configurable:!0}),"t");function j({type:e="dots"}){const r=N(e),{frame:n}=f({interval:r.interval});return z.jsx(L,{children:r.frames[n%r.frames.length]})}u(j,"n");M(j,"l");R(j,"n");Q(j,"Spinner");export{j as n};
@@ -1 +1 @@
1
- var G=Object.defineProperty;var m=(e,o)=>G(e,"name",{value:o,configurable:!0});import{a5 as u,w as t,af as X,a6 as T,n as O}from"../packem_chunks/bin.js";var Y=Object.defineProperty,W=m((e,o)=>Y(e,"name",{value:o,configurable:!0}),"n"),Z=Object.defineProperty,q=W((e,o)=>Z(e,"name",{value:o,configurable:!0}),"a"),_=Object.defineProperty,ee=q((e,o)=>_(e,"name",{value:o,configurable:!0}),"t");function P({children:e}){return u.jsx(u.Fragment,{children:e})}m(P,"r");W(P,"c");q(P,"o");ee(P,"Tab");var re=Object.defineProperty,z=m((e,o)=>re(e,"name",{value:o,configurable:!0}),"A"),ne=Object.defineProperty,B=z((e,o)=>ne(e,"name",{value:o,configurable:!0}),"A"),oe=Object.defineProperty,v=B((e,o)=>oe(e,"name",{value:o,configurable:!0}),"b");const te=/^\d$/u,ce=v(e=>e!=null&&typeof e=="object"&&"props"in e&&"name"in e.props,"isTabElement"),ae=v(e=>{const o=[];for(const c of t.Children.toArray(e))ce(c)&&o.push(c);return o},"collectTabs"),V=v((e,o)=>e.some(c=>o[c]),"matchesAnyKey"),ue=v((e,o,c)=>e?o?{backgroundColor:c?.activeTab?.backgroundColor??"green",color:c?.activeTab?.color??"black"}:{backgroundColor:"gray",color:"black"}:{backgroundColor:void 0,color:void 0},"getActiveTabColors");function E({children:e,colors:o,defaultValue:c,flexDirection:g="row",isFocused:h,keyMap:l,onChange:M,showIndex:H=!0,value:j,width:y}){const s=ae(e),a=s.length,d=t.useRef(s);d.current=s;const i=g==="column"||g==="column-reverse",C=j!==void 0,[J,L]=t.useState(()=>{const r=j??c;if(r==null||a===0)return 0;const n=s.findIndex(p=>p.props.name===r);return n===-1?0:n}),x=C?Math.max(0,s.findIndex(r=>r.props.name===j)):J,Q=t.useCallback(()=>{},[]),f=C?Q:L,b=t.useRef(M);b.current=M,t.useEffect(()=>{if(C)return;const r=d.current[x];r&&b.current(r.props.name,r)},[]);const R=t.useMemo(()=>l?.previous??[i?"upArrow":"leftArrow"],[l?.previous,i]),I=t.useMemo(()=>l?.next??[i?"downArrow":"rightArrow"],[l?.next,i]),$=l?.useNumbers??!0,D=l?.useTab??!0,k=t.useRef(x);k.current=x;const F=t.useCallback(r=>{f(r);const n=d.current[r];n&&b.current(n.props.name,n)},[f]),w=t.useCallback(()=>{const r=(k.current+1)%a;f(r);const n=d.current[r];n&&b.current(n.props.name,n)},[a,f]),A=t.useCallback(()=>{const r=(k.current-1+a)%a;f(r);const n=d.current[r];n&&b.current(n.props.name,n)},[a,f]);X(t.useCallback((r,n)=>{if(V(R,n)){A();return}if(V(I,n)){w();return}if(n.tab&&D&&h==null){n.shift?A():w();return}if($&&n.meta&&te.test(r)){const p=r==="0"?9:Number.parseInt(r,10)-1;p<a&&F(p)}},[R,I,D,$,h,A,w,a,F]),{isActive:h!==!1});const K=typeof y=="number"?y:6,U=t.useMemo(()=>i?"─".repeat(K):" | ",[i,K]);return u.jsx(T,{flexDirection:g,width:y,children:s.map((r,n)=>{const{name:p}=r.props,N=ue(x===n,h!==!1,o);let S=null;return H&&(S=u.jsxs(O,{color:"grey",children:[n+1,"."," "]})),u.jsxs(T,{flexDirection:g,children:[n!==0&&u.jsx(O,{color:"dim",children:U}),u.jsxs(T,{children:[S,u.jsx(O,{backgroundColor:N.backgroundColor,color:N.color,children:r})]})]},p)})})}m(E,"g");z(E,"or");B(E,"W");v(E,"Tabs");export{E as g,P as r};
1
+ var G=Object.defineProperty;var m=(e,o)=>G(e,"name",{value:o,configurable:!0});import{a7 as u,x as t,ah as X,a8 as T,n as O}from"../packem_chunks/bin.js";var Y=Object.defineProperty,W=m((e,o)=>Y(e,"name",{value:o,configurable:!0}),"n"),Z=Object.defineProperty,q=W((e,o)=>Z(e,"name",{value:o,configurable:!0}),"a"),_=Object.defineProperty,ee=q((e,o)=>_(e,"name",{value:o,configurable:!0}),"t");function P({children:e}){return u.jsx(u.Fragment,{children:e})}m(P,"r");W(P,"c");q(P,"o");ee(P,"Tab");var re=Object.defineProperty,z=m((e,o)=>re(e,"name",{value:o,configurable:!0}),"A"),ne=Object.defineProperty,B=z((e,o)=>ne(e,"name",{value:o,configurable:!0}),"A"),oe=Object.defineProperty,h=B((e,o)=>oe(e,"name",{value:o,configurable:!0}),"b");const te=/^\d$/u,ce=h(e=>e!=null&&typeof e=="object"&&"props"in e&&"name"in e.props,"isTabElement"),ae=h(e=>{const o=[];for(const c of t.Children.toArray(e))ce(c)&&o.push(c);return o},"collectTabs"),V=h((e,o)=>e.some(c=>o[c]),"matchesAnyKey"),ue=h((e,o,c)=>e?o?{backgroundColor:c?.activeTab?.backgroundColor??"green",color:c?.activeTab?.color??"black"}:{backgroundColor:"gray",color:"black"}:{backgroundColor:void 0,color:void 0},"getActiveTabColors");function E({children:e,colors:o,defaultValue:c,flexDirection:v="row",isFocused:g,keyMap:l,onChange:M,showIndex:H=!0,value:j,width:y}){const s=ae(e),a=s.length,d=t.useRef(s);d.current=s;const i=v==="column"||v==="column-reverse",C=j!==void 0,[J,L]=t.useState(()=>{const r=j??c;if(r==null||a===0)return 0;const n=s.findIndex(p=>p.props.name===r);return n===-1?0:n}),x=C?Math.max(0,s.findIndex(r=>r.props.name===j)):J,Q=t.useCallback(()=>{},[]),f=C?Q:L,b=t.useRef(M);b.current=M,t.useEffect(()=>{if(C)return;const r=d.current[x];r&&b.current(r.props.name,r)},[]);const R=t.useMemo(()=>l?.previous??[i?"upArrow":"leftArrow"],[l?.previous,i]),I=t.useMemo(()=>l?.next??[i?"downArrow":"rightArrow"],[l?.next,i]),$=l?.useNumbers??!0,D=l?.useTab??!0,k=t.useRef(x);k.current=x;const F=t.useCallback(r=>{f(r);const n=d.current[r];n&&b.current(n.props.name,n)},[f]),w=t.useCallback(()=>{const r=(k.current+1)%a;f(r);const n=d.current[r];n&&b.current(n.props.name,n)},[a,f]),A=t.useCallback(()=>{const r=(k.current-1+a)%a;f(r);const n=d.current[r];n&&b.current(n.props.name,n)},[a,f]);X(t.useCallback((r,n)=>{if(V(R,n)){A();return}if(V(I,n)){w();return}if(n.tab&&D&&g==null){n.shift?A():w();return}if($&&n.meta&&te.test(r)){const p=r==="0"?9:Number.parseInt(r,10)-1;p<a&&F(p)}},[R,I,D,$,g,A,w,a,F]),{isActive:g!==!1});const K=typeof y=="number"?y:6,U=t.useMemo(()=>i?"─".repeat(K):" | ",[i,K]);return u.jsx(T,{flexDirection:v,width:y,children:s.map((r,n)=>{const{name:p}=r.props,N=ue(x===n,g!==!1,o);let S=null;return H&&(S=u.jsxs(O,{color:"grey",children:[n+1,"."," "]})),u.jsxs(T,{flexDirection:v,children:[n!==0&&u.jsx(O,{color:"dim",children:U}),u.jsxs(T,{children:[S,u.jsx(O,{backgroundColor:N.backgroundColor,color:N.color,children:r})]})]},p)})})}m(E,"g");z(E,"or");B(E,"W");h(E,"Tabs");export{E as g,P as r};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var n=(e,r)=>c(e,"name",{value:r,configurable:!0});import{w as s,Z as i}from"../packem_chunks/bin.js";var f=Object.defineProperty,g=n((e,r)=>f(e,"name",{value:r,configurable:!0}),"i");const d=g((e,r)=>{const u=s.useRef(null),[a,o]=s.useState(e);return s.useLayoutEffect(()=>{if(!u.current)return;const{height:t}=i(u.current);t>0&&t!==a&&(o(t),r?.(t))}),{measuredHeight:a,ref:u}},"useMeasuredHeight");export{d as u};
1
+ var c=Object.defineProperty;var n=(e,r)=>c(e,"name",{value:r,configurable:!0});import{x as s,Z as i}from"../packem_chunks/bin.js";var f=Object.defineProperty,g=n((e,r)=>f(e,"name",{value:r,configurable:!0}),"i");const d=g((e,r)=>{const u=s.useRef(null),[a,o]=s.useState(e);return s.useLayoutEffect(()=>{if(!u.current)return;const{height:t}=i(u.current);t>0&&t!==a&&(o(t),r?.(t))}),{measuredHeight:a,ref:u}},"useMeasuredHeight");export{d as u};
@@ -1 +1 @@
1
- var u=Object.defineProperty;var g=(n,s)=>u(n,"name",{value:s,configurable:!0});import{createRequire as m}from"node:module";import{M as i,l as a,B as f}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{r as $}from"../packem_chunks/bin.js";const j=m(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=g(n=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[s,o]=k.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return k.getBuiltinModule(n)}return j(n)},"__cjs_getBuiltinModule"),{readdirSync:v}=b("node:fs");var w=Object.defineProperty,l=g((n,s)=>w(n,"name",{value:s,configurable:!0}),"o");const _=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],D=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],S=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],M=l(n=>{const s=i(n,"package.json");if(!a(s))return[];let o;try{o=JSON.parse(f(s))}catch{return[]}const e=[];if(o.scripts)for(const[t,c]of Object.entries(o.scripts))typeof c=="string"&&(/\bgitleaks\b/.test(c)&&e.push({detail:`Script "${t}" still invokes gitleaks: ${c}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(c)&&e.push({detail:`Script "${t}" still invokes secretlint: ${c}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(c)&&e.push({detail:`Script "${t}" still invokes syncpack: ${c}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(c)&&e.push({detail:`Script "${t}" still invokes sherif: ${c}`,kind:"script",location:"package.json",tool:"sherif"}));if(o.devDependencies)for(const t of Object.keys(o.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return o.sherif&&e.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),e},"scanPackageJson"),O=l(n=>{const s=[];for(const o of _){const e=i(n,o);if(!a(e))continue;const t=f(e);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:o,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:o,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:o,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:o,tool:"sherif"})}return s},"scanHooks"),C=l(n=>{const s=[];for(const o of D)a(i(n,o))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:o,tool:"secretlint"});for(const o of S)a(i(n,o))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:o,tool:"syncpack"});return s},"scanConfigs"),N=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],q=l(n=>{const s=[],o=l(e=>{const t=i(n,e);if(!a(t))return;const c=f(t);/\bsyncpack\b/.test(c)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:e,tool:"syncpack"}),/\bsherif\b/.test(c)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:e,tool:"sherif"})},"scanFile");for(const e of N){const t=i(n,e);if(a(t)){if(e===".github/workflows"){try{for(const c of v(t))(c.endsWith(".yml")||c.endsWith(".yaml"))&&o(`.github/workflows/${c}`)}catch{}continue}o(e)}}return s},"scanCi"),B=l(n=>{const s=[],o=i(n,"pnpm-workspace.yaml");if(a(o)){let t;try{t=$(o)}catch{t=void 0}if(t&&typeof t=="object"){const c=t.catalog;c&&typeof c.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const r=t.catalogs;if(r&&typeof r=="object")for(const[d,p]of Object.entries(r))p&&typeof p.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${d}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const e=i(n,"package.json");if(a(e)){let t;try{t=JSON.parse(f(e))}catch{return s}const c=t.workspaces;if(c&&typeof c=="object"&&!Array.isArray(c)){const d=c.catalog;d&&typeof d.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const p=c.catalogs;if(p&&typeof p=="object")for(const[h,y]of Object.entries(p))y&&typeof y.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${h}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const r=t.catalog;r&&typeof r.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},"scanCatalogs"),I=l(n=>[...M(n),...O(n),...C(n),...q(n),...B(n)],"scanMigrationLeftovers"),A=l((n,s)=>{const o=I(n);if(o.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(o.length)} unmigrated reference(s):`);for(const e of o)s.warn(` [${e.kind}] ${e.location} — ${e.detail}`);return o},"verifyMigration");export{I as s,A as v};
1
+ var u=Object.defineProperty;var g=(n,s)=>u(n,"name",{value:s,configurable:!0});import{createRequire as m}from"node:module";import{M as i,l as a,B as f}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{t as $}from"../packem_chunks/bin.js";const j=m(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=g(n=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[s,o]=k.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return k.getBuiltinModule(n)}return j(n)},"__cjs_getBuiltinModule"),{readdirSync:v}=b("node:fs");var w=Object.defineProperty,l=g((n,s)=>w(n,"name",{value:s,configurable:!0}),"o");const _=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],D=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],S=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],M=l(n=>{const s=i(n,"package.json");if(!a(s))return[];let o;try{o=JSON.parse(f(s))}catch{return[]}const e=[];if(o.scripts)for(const[t,c]of Object.entries(o.scripts))typeof c=="string"&&(/\bgitleaks\b/.test(c)&&e.push({detail:`Script "${t}" still invokes gitleaks: ${c}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(c)&&e.push({detail:`Script "${t}" still invokes secretlint: ${c}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(c)&&e.push({detail:`Script "${t}" still invokes syncpack: ${c}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(c)&&e.push({detail:`Script "${t}" still invokes sherif: ${c}`,kind:"script",location:"package.json",tool:"sherif"}));if(o.devDependencies)for(const t of Object.keys(o.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return o.sherif&&e.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),e},"scanPackageJson"),O=l(n=>{const s=[];for(const o of _){const e=i(n,o);if(!a(e))continue;const t=f(e);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:o,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:o,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:o,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:o,tool:"sherif"})}return s},"scanHooks"),C=l(n=>{const s=[];for(const o of D)a(i(n,o))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:o,tool:"secretlint"});for(const o of S)a(i(n,o))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:o,tool:"syncpack"});return s},"scanConfigs"),N=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],q=l(n=>{const s=[],o=l(e=>{const t=i(n,e);if(!a(t))return;const c=f(t);/\bsyncpack\b/.test(c)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:e,tool:"syncpack"}),/\bsherif\b/.test(c)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:e,tool:"sherif"})},"scanFile");for(const e of N){const t=i(n,e);if(a(t)){if(e===".github/workflows"){try{for(const c of v(t))(c.endsWith(".yml")||c.endsWith(".yaml"))&&o(`.github/workflows/${c}`)}catch{}continue}o(e)}}return s},"scanCi"),B=l(n=>{const s=[],o=i(n,"pnpm-workspace.yaml");if(a(o)){let t;try{t=$(o)}catch{t=void 0}if(t&&typeof t=="object"){const c=t.catalog;c&&typeof c.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const r=t.catalogs;if(r&&typeof r=="object")for(const[d,p]of Object.entries(r))p&&typeof p.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${d}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const e=i(n,"package.json");if(a(e)){let t;try{t=JSON.parse(f(e))}catch{return s}const c=t.workspaces;if(c&&typeof c=="object"&&!Array.isArray(c)){const d=c.catalog;d&&typeof d.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const p=c.catalogs;if(p&&typeof p=="object")for(const[h,y]of Object.entries(p))y&&typeof y.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${h}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const r=t.catalog;r&&typeof r.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},"scanCatalogs"),I=l(n=>[...M(n),...O(n),...C(n),...q(n),...B(n)],"scanMigrationLeftovers"),A=l((n,s)=>{const o=I(n);if(o.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(o.length)} unmigrated reference(s):`);for(const e of o)s.warn(` [${e.kind}] ${e.location} — ${e.detail}`);return o},"verifyMigration");export{I as s,A as v};