ts-pantry 0.9.35 → 0.9.36

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 (135) hide show
  1. package/dist/bin/cli.js +7 -7
  2. package/dist/{chunk-nkpmj4a5.js → chunk-1g8er1pr.js} +1 -1
  3. package/dist/{chunk-fwv0fmkb.js → chunk-bq6fs4xy.js} +1 -1
  4. package/dist/{chunk-hk26x4v2.js → chunk-hb9sfmr4.js} +1 -1
  5. package/dist/chunk-rtr3z1q1.js +2 -0
  6. package/dist/chunk-s1hre3d3.js +282 -0
  7. package/dist/chunk-ys5jjmq2.js +142 -0
  8. package/dist/desktop-apps.d.ts +14 -0
  9. package/dist/fetch.d.ts +37 -0
  10. package/dist/index.d.ts +2 -2
  11. package/dist/package-types.d.ts +1 -1
  12. package/dist/packages/alttabapp.d.ts +1 -1
  13. package/dist/packages/ansiblecom.d.ts +1 -1
  14. package/dist/packages/arkadedev.d.ts +1 -1
  15. package/dist/packages/aux4io.d.ts +1 -1
  16. package/dist/packages/bittensorcom.d.ts +1 -1
  17. package/dist/packages/bufbuild.d.ts +1 -1
  18. package/dist/packages/buildpacksio.d.ts +1 -1
  19. package/dist/packages/bytebasecom.d.ts +1 -1
  20. package/dist/packages/carapacesh.d.ts +1 -1
  21. package/dist/packages/casdoororg.d.ts +1 -1
  22. package/dist/packages/chezmoiio.d.ts +1 -1
  23. package/dist/packages/cligithubcom.d.ts +1 -1
  24. package/dist/packages/cmakeorg.d.ts +1 -1
  25. package/dist/packages/cnqueryio.d.ts +1 -1
  26. package/dist/packages/codercom.d.ts +1 -1
  27. package/dist/packages/consulio.d.ts +1 -1
  28. package/dist/packages/convcogithubio.d.ts +1 -1
  29. package/dist/packages/cythonorg.d.ts +1 -1
  30. package/dist/packages/daggerio.d.ts +1 -1
  31. package/dist/packages/daytonaio.d.ts +1 -1
  32. package/dist/packages/dblabdanvergaracom.d.ts +1 -1
  33. package/dist/packages/denoland.d.ts +1 -1
  34. package/dist/packages/depotdev.d.ts +1 -1
  35. package/dist/packages/dozzledev.d.ts +1 -1
  36. package/dist/packages/duckdborg.d.ts +1 -1
  37. package/dist/packages/eksctlio.d.ts +1 -1
  38. package/dist/packages/encoredev.d.ts +1 -1
  39. package/dist/packages/fastlanetools.d.ts +1 -1
  40. package/dist/packages/flyio.d.ts +1 -1
  41. package/dist/packages/getcomposerorg.d.ts +1 -1
  42. package/dist/packages/getsopsio.d.ts +1 -1
  43. package/dist/packages/ghostscriptcom.d.ts +1 -1
  44. package/dist/packages/gohugoio.d.ts +1 -1
  45. package/dist/packages/goreleasercom.d.ts +1 -1
  46. package/dist/packages/groongaorg.d.ts +1 -1
  47. package/dist/packages/hasuraio.d.ts +1 -1
  48. package/dist/packages/helmsh.d.ts +1 -1
  49. package/dist/packages/huggingfaceco.d.ts +1 -1
  50. package/dist/packages/imagemagickorg.d.ts +1 -1
  51. package/dist/packages/istioio.d.ts +1 -1
  52. package/dist/packages/jujuis.d.ts +1 -1
  53. package/dist/packages/kagglecom.d.ts +1 -1
  54. package/dist/packages/keephqdev.d.ts +1 -1
  55. package/dist/packages/kubesharkco.d.ts +1 -1
  56. package/dist/packages/laravelcom.d.ts +1 -1
  57. package/dist/packages/lavinmqcom.d.ts +1 -1
  58. package/dist/packages/libcxxllvmorg.d.ts +1 -1
  59. package/dist/packages/libgit2org.d.ts +1 -1
  60. package/dist/packages/libusbinfo.d.ts +1 -1
  61. package/dist/packages/llvmorg.d.ts +1 -1
  62. package/dist/packages/localaiio.d.ts +1 -1
  63. package/dist/packages/lxmlde.d.ts +1 -1
  64. package/dist/packages/mailpitaxllentorg.d.ts +1 -1
  65. package/dist/packages/mavenapacheorg.d.ts +1 -1
  66. package/dist/packages/meilisearchcom.d.ts +1 -1
  67. package/dist/packages/mercurerocks.d.ts +1 -1
  68. package/dist/packages/misejdxdev.d.ts +1 -1
  69. package/dist/packages/nginxorg.d.ts +1 -1
  70. package/dist/packages/nodejsorg.d.ts +1 -1
  71. package/dist/packages/nomadprojectio.d.ts +1 -1
  72. package/dist/packages/npmjscom.d.ts +1 -1
  73. package/dist/packages/numpyorg.d.ts +1 -1
  74. package/dist/packages/nushellsh.d.ts +1 -1
  75. package/dist/packages/odigosio.d.ts +1 -1
  76. package/dist/packages/ohmyposhdev.d.ts +1 -1
  77. package/dist/packages/ollamaai.d.ts +1 -1
  78. package/dist/packages/opencodeai.d.ts +1 -1
  79. package/dist/packages/openexrcom.d.ts +1 -1
  80. package/dist/packages/openmpllvmorg.d.ts +1 -1
  81. package/dist/packages/openpolicyagentorg.d.ts +1 -1
  82. package/dist/packages/opensearchorg.d.ts +1 -1
  83. package/dist/packages/opentofuorg.d.ts +1 -1
  84. package/dist/packages/planetscalecom.d.ts +1 -1
  85. package/dist/packages/plantumlcom.d.ts +1 -1
  86. package/dist/packages/pnpmio.d.ts +1 -1
  87. package/dist/packages/pocketbaseio.d.ts +1 -1
  88. package/dist/packages/postgrestorg.d.ts +1 -1
  89. package/dist/packages/prefixdev.d.ts +1 -1
  90. package/dist/packages/projenio.d.ts +1 -1
  91. package/dist/packages/protobufdev.d.ts +1 -1
  92. package/dist/packages/pulumiio.d.ts +1 -1
  93. package/dist/packages/rabbitmqcom.d.ts +1 -1
  94. package/dist/packages/railwayapp.d.ts +1 -1
  95. package/dist/packages/rcloneorg.d.ts +1 -1
  96. package/dist/packages/redisio.d.ts +1 -1
  97. package/dist/packages/riotermcom.d.ts +1 -1
  98. package/dist/packages/rsyncsambaorg.d.ts +1 -1
  99. package/dist/packages/rubocoporg.d.ts +1 -1
  100. package/dist/packages/rubygemsorg.d.ts +1 -1
  101. package/dist/packages/scalewaycom.d.ts +1 -1
  102. package/dist/packages/seaweedfscom.d.ts +1 -1
  103. package/dist/packages/sentryio.d.ts +1 -1
  104. package/dist/packages/skaffolddev.d.ts +1 -1
  105. package/dist/packages/spacetimedbcom.d.ts +1 -1
  106. package/dist/packages/sqlfluffcom.d.ts +1 -1
  107. package/dist/packages/squawkhqcom.d.ts +1 -1
  108. package/dist/packages/statsapp.d.ts +1 -1
  109. package/dist/packages/steampipeio.d.ts +1 -1
  110. package/dist/packages/stripecom.d.ts +1 -1
  111. package/dist/packages/systemdio.d.ts +1 -1
  112. package/dist/packages/tailscalecom.d.ts +1 -1
  113. package/dist/packages/talosdev.d.ts +1 -1
  114. package/dist/packages/taskfiledev.d.ts +1 -1
  115. package/dist/packages/terraformio.d.ts +1 -1
  116. package/dist/packages/terragruntgruntworkio.d.ts +1 -1
  117. package/dist/packages/toxwiki.d.ts +1 -1
  118. package/dist/packages/tursotech.d.ts +1 -1
  119. package/dist/packages/unboundnet.d.ts +1 -1
  120. package/dist/packages/valesh.d.ts +1 -1
  121. package/dist/packages/valkeyio.d.ts +1 -1
  122. package/dist/packages/vapoursynthcom.d.ts +1 -1
  123. package/dist/packages/vaultprojectio.d.ts +1 -1
  124. package/dist/packages/veleroio.d.ts +1 -1
  125. package/dist/packages/werfio.d.ts +1 -1
  126. package/dist/packages/zarfdev.d.ts +1 -1
  127. package/dist/packages/zeddev.d.ts +1 -1
  128. package/dist/packages/zotregistrydev.d.ts +1 -1
  129. package/dist/packages/zrokio.d.ts +1 -1
  130. package/dist/src/index.js +1 -1
  131. package/dist/types.d.ts +1 -1
  132. package/package.json +2 -2
  133. package/dist/chunk-7e3eta64.js +0 -282
  134. package/dist/chunk-gyn0s28q.js +0 -142
  135. package/dist/chunk-z7v78f5q.js +0 -2
package/dist/bin/cli.js CHANGED
@@ -1,12 +1,12 @@
1
- import{L as C6,M as v6,N as S6,P as y6,V as k6,W as h6,X as _6,Y as g6,Z as f6,ba as G6,ca as u6,da as i6}from"../chunk-7e3eta64.js";import"../chunk-0kzq4gm1.js";import{Ra as p,Sa as m6,Ua as X6,Va as r,_a as d6,cb as U6}from"../chunk-tv0zm8m0.js";import"../chunk-gs54v9m1.js";import{rb as l,sb as q6,tb as J6}from"../chunk-75fe09w8.js";import"../chunk-fwv0fmkb.js";import"../chunk-z7v78f5q.js";import{Nb as P6,Ob as tz}from"../chunk-s0s1vx8j.js";import"../chunk-m07cv1kh.js";import{Vb as h}from"../chunk-rjpqpn2z.js";import V from"node:fs";import N from"node:path";import H from"node:process";import{existsSync as l6}from"node:fs";import a from"node:fs/promises";import K6 from"node:os";import s from"node:path";import k from"node:process";import{EventEmitter as p6}from"node:events";import S from"node:process";import V6 from"node:process";import z6 from"node:process";import u from"node:process";import f from"node:process";import L6 from"node:tty";import yz,{stdin as B4,stdout as N4}from"node:process";import M6,{stdin as _z,stdout as gz}from"node:process";import fz from"node:readline";class B6{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let z=K6.homedir(),$=s.join(z,".config","clapp");this.configPath=s.join($,"telemetry.json")}async isEnabled(){if(k.env.DO_NOT_TRACK==="1"||k.env.DO_NOT_TRACK==="true")return!1;if(k.env.NO_TELEMETRY==="1"||k.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let z=await this.loadConfig();if(z.enabled=!0,!z.userId)z.userId=this.generateUserId();await this.saveConfig(z)}async disable(){let z=await this.loadConfig();z.enabled=!1,await this.saveConfig(z)}async track(z,$){if(!await this.isEnabled())return;let Z={event:z,...$,timestamp:Date.now(),platform:K6.platform(),nodeVersion:k.version};if(this.events.push(Z),this.events.length>=10)await this.send()}async trackCommand(z,$){await this.track("command",{command:z,duration:$})}async trackError(z,$){await this.track("error",{error:z,command:$})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let $=await this.loadConfig();return $.lastSent=Date.now(),await this.saveConfig($),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let $=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep($),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(z){return new Promise(($)=>setTimeout($,z))}async status(){let z=await this.loadConfig();return{enabled:z.enabled,doNotTrack:k.env.DO_NOT_TRACK==="1"||k.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:z.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(l6(this.configPath)){let z=await a.readFile(this.configPath,"utf-8");return this.config=JSON.parse(z),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(z){this.config=z;try{let $=s.dirname(this.configPath);await a.mkdir($,{recursive:!0}),await a.writeFile(this.configPath,JSON.stringify(z,null,2),"utf-8")}catch{}}generateUserId(){let z=Math.random().toString(36).substring(2,15),$=Date.now().toString(36);return`${z}-${$}`}}var U4=new B6;function r6(z,$={}){let Q={_:[]},Z=$.alias||{},Y=new Set($.boolean||[]),q={};for(let U of Object.keys(Z))for(let X of Z[U])q[X]=U;for(let U of Y)if(Z[U])for(let X of Z[U])Y.add(X);function J(U,X){let G=q[U]||U;if(Q[G]=X,Z[G])for(let K of Z[G])Q[K]=X;if(q[U]&&Z[q[U]])for(let K of Z[q[U]])Q[K]=X;Q[U]=X}for(let U=0;U<z.length;U++){let X=z[U];if(X==="--"){Q._.push(...z.slice(U+1));break}if(X.startsWith("--")){let G=X.indexOf("=");if(G!==-1){let K=X.slice(2,G),L=X.slice(G+1);J(K,L)}else{let K=X.slice(2);if(K.startsWith("no-")){let j=K.slice(3);J(j,!1);continue}let L=q[K]||K;if(Y.has(L)||Y.has(K))J(K,!0);else{let j=z[U+1];if(j!==void 0&&!j.startsWith("-"))J(K,j),U++;else J(K,!0)}}}else if(X.startsWith("-")&&X.length>1){let G=X.slice(1);for(let K=0;K<G.length;K++){let L=G[K],j=q[L]||L;if(K===G.length-1&&!Y.has(j)&&!Y.has(L)){let F=z[U+1];if(F!==void 0&&!F.startsWith("-"))J(L,F),U++;else J(L,!0)}else J(L,!0)}}else Q._.push(X)}return Q}function e(z){return z.replace(/[<[].+/,"").trim()}function a6(z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,Z=[],Y=(U)=>{let X=!1,G=U[1];if(G.startsWith("..."))G=G.slice(3),X=!0;return{required:U[0].startsWith("<"),value:G,variadic:X}},q;while(q=$.exec(z))Z.push(Y(q));let J;while(J=Q.exec(z))Z.push(Y(J));return Z}function s6(z){let $={alias:{},boolean:[]};for(let[Q,Z]of z.entries()){if(Z.names.length>1)$.alias[Z.names[0]]=Z.names.slice(1);if(Z.isBoolean)if(Z.negated){if(!z.some((q,J)=>{return J!==Q&&q.names.some((U)=>Z.names.includes(U))&&typeof q.required==="boolean"}))$.boolean.push(Z.names[0])}else $.boolean.push(Z.names[0])}return $}function F6(z){return z.reduce(($,Q)=>$.length>=Q.length?$:Q,"")}function t(z,$){return z.length>=$?z:`${z}${" ".repeat($-z.length)}`}function t6(z){return z.replace(/([a-z])-([a-z])/g,($,Q,Z)=>{return Q+Z.toUpperCase()})}function o6(z,$,Q){let Z=0,Y=$.length,q=z,J;for(;Z<Y;++Z)J=q[$[Z]],q=q[$[Z]]=Z===Y-1?Q:J!=null?J:!!~$[Z+1].indexOf(".")||!(+$[Z+1]>-1)?{}:[]}function e6(z,$){for(let Q of Object.keys($)){let Z=$[Q];if(Z.shouldTransform){if(z[Q]=Array.prototype.concat.call([],z[Q]),typeof Z.transformFunction==="function")z[Q]=z[Q].map(Z.transformFunction)}}}function zz(z){let $=/([^\\/]+)$/.exec(z);return $?$[1]:""}function N6(z){return z.split(".").map(($,Q)=>{return Q===0?t6($):$}).join(".")}class d extends Error{exitCode=2;isUsageError=!0;constructor(z){super(z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(z).stack}format(z=!1){if(z&&this.stack)return`${this.message}
1
+ import{L as C6,M as v6,N as S6,P as y6,V as k6,W as h6,X as _6,Y as g6,Z as f6,ba as G6,ca as u6,da as i6}from"../chunk-s1hre3d3.js";import"../chunk-0kzq4gm1.js";import{Ra as p,Sa as m6,Ua as X6,Va as r,_a as d6,cb as U6}from"../chunk-tv0zm8m0.js";import"../chunk-gs54v9m1.js";import{rb as l,sb as q6,tb as J6}from"../chunk-75fe09w8.js";import"../chunk-bq6fs4xy.js";import"../chunk-rtr3z1q1.js";import{Nb as P6,Ob as tz}from"../chunk-s0s1vx8j.js";import"../chunk-m07cv1kh.js";import{Vb as h}from"../chunk-rjpqpn2z.js";import V from"node:fs";import N from"node:path";import H from"node:process";import{existsSync as l6}from"node:fs";import a from"node:fs/promises";import K6 from"node:os";import s from"node:path";import k from"node:process";import{EventEmitter as p6}from"node:events";import S from"node:process";import V6 from"node:process";import z6 from"node:process";import u from"node:process";import f from"node:process";import L6 from"node:tty";import yz,{stdin as B4,stdout as N4}from"node:process";import M6,{stdin as _z,stdout as gz}from"node:process";import fz from"node:readline";class B6{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let z=K6.homedir(),$=s.join(z,".config","clapp");this.configPath=s.join($,"telemetry.json")}async isEnabled(){if(k.env.DO_NOT_TRACK==="1"||k.env.DO_NOT_TRACK==="true")return!1;if(k.env.NO_TELEMETRY==="1"||k.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let z=await this.loadConfig();if(z.enabled=!0,!z.userId)z.userId=this.generateUserId();await this.saveConfig(z)}async disable(){let z=await this.loadConfig();z.enabled=!1,await this.saveConfig(z)}async track(z,$){if(!await this.isEnabled())return;let Z={event:z,...$,timestamp:Date.now(),platform:K6.platform(),nodeVersion:k.version};if(this.events.push(Z),this.events.length>=10)await this.send()}async trackCommand(z,$){await this.track("command",{command:z,duration:$})}async trackError(z,$){await this.track("error",{error:z,command:$})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let $=await this.loadConfig();return $.lastSent=Date.now(),await this.saveConfig($),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let $=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep($),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(z){return new Promise(($)=>setTimeout($,z))}async status(){let z=await this.loadConfig();return{enabled:z.enabled,doNotTrack:k.env.DO_NOT_TRACK==="1"||k.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:z.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(l6(this.configPath)){let z=await a.readFile(this.configPath,"utf-8");return this.config=JSON.parse(z),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(z){this.config=z;try{let $=s.dirname(this.configPath);await a.mkdir($,{recursive:!0}),await a.writeFile(this.configPath,JSON.stringify(z,null,2),"utf-8")}catch{}}generateUserId(){let z=Math.random().toString(36).substring(2,15),$=Date.now().toString(36);return`${z}-${$}`}}var U4=new B6;function r6(z,$={}){let Q={_:[]},Z=$.alias||{},Y=new Set($.boolean||[]),q={};for(let U of Object.keys(Z))for(let X of Z[U])q[X]=U;for(let U of Y)if(Z[U])for(let X of Z[U])Y.add(X);function J(U,X){let G=q[U]||U;if(Q[G]=X,Z[G])for(let K of Z[G])Q[K]=X;if(q[U]&&Z[q[U]])for(let K of Z[q[U]])Q[K]=X;Q[U]=X}for(let U=0;U<z.length;U++){let X=z[U];if(X==="--"){Q._.push(...z.slice(U+1));break}if(X.startsWith("--")){let G=X.indexOf("=");if(G!==-1){let K=X.slice(2,G),L=X.slice(G+1);J(K,L)}else{let K=X.slice(2);if(K.startsWith("no-")){let j=K.slice(3);J(j,!1);continue}let L=q[K]||K;if(Y.has(L)||Y.has(K))J(K,!0);else{let j=z[U+1];if(j!==void 0&&!j.startsWith("-"))J(K,j),U++;else J(K,!0)}}}else if(X.startsWith("-")&&X.length>1){let G=X.slice(1);for(let K=0;K<G.length;K++){let L=G[K],j=q[L]||L;if(K===G.length-1&&!Y.has(j)&&!Y.has(L)){let F=z[U+1];if(F!==void 0&&!F.startsWith("-"))J(L,F),U++;else J(L,!0)}else J(L,!0)}}else Q._.push(X)}return Q}function e(z){return z.replace(/[<[].+/,"").trim()}function a6(z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,Z=[],Y=(U)=>{let X=!1,G=U[1];if(G.startsWith("..."))G=G.slice(3),X=!0;return{required:U[0].startsWith("<"),value:G,variadic:X}},q;while(q=$.exec(z))Z.push(Y(q));let J;while(J=Q.exec(z))Z.push(Y(J));return Z}function s6(z){let $={alias:{},boolean:[]};for(let[Q,Z]of z.entries()){if(Z.names.length>1)$.alias[Z.names[0]]=Z.names.slice(1);if(Z.isBoolean)if(Z.negated){if(!z.some((q,J)=>{return J!==Q&&q.names.some((U)=>Z.names.includes(U))&&typeof q.required==="boolean"}))$.boolean.push(Z.names[0])}else $.boolean.push(Z.names[0])}return $}function F6(z){return z.reduce(($,Q)=>$.length>=Q.length?$:Q,"")}function t(z,$){return z.length>=$?z:`${z}${" ".repeat($-z.length)}`}function t6(z){return z.replace(/([a-z])-([a-z])/g,($,Q,Z)=>{return Q+Z.toUpperCase()})}function o6(z,$,Q){let Z=0,Y=$.length,q=z,J;for(;Z<Y;++Z)J=q[$[Z]],q=q[$[Z]]=Z===Y-1?Q:J!=null?J:!!~$[Z+1].indexOf(".")||!(+$[Z+1]>-1)?{}:[]}function e6(z,$){for(let Q of Object.keys($)){let Z=$[Q];if(Z.shouldTransform){if(z[Q]=Array.prototype.concat.call([],z[Q]),typeof Z.transformFunction==="function")z[Q]=z[Q].map(Z.transformFunction)}}}function zz(z){let $=/([^\\/]+)$/.exec(z);return $?$[1]:""}function N6(z){return z.split(".").map(($,Q)=>{return Q===0?t6($):$}).join(".")}class d extends Error{exitCode=2;isUsageError=!0;constructor(z){super(z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(z).stack}format(z=!1){if(z&&this.stack)return`${this.message}
2
2
 
3
3
  Stack trace:
4
- ${this.stack}`;return this.message}}function $z(){let{env:z}=V6,{TERM:$,TERM_PROGRAM:Q}=z;if(V6.platform!=="win32")return $!=="linux";return Boolean(z.WT_SESSION)||Boolean(z.TERMINUS_SUBLIME)||z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var c="\x1B",x=`${c}[`;var v={to(z,$){if(!$)return`${x}${z+1}G`;return`${x}${$+1};${z+1}H`},move(z,$){let Q="";if(z<0)Q+=`${x}${-z}D`;else if(z>0)Q+=`${x}${z}C`;if($<0)Q+=`${x}${-$}A`;else if($>0)Q+=`${x}${$}B`;return Q},up:(z=1)=>`${x}${z}A`,down:(z=1)=>`${x}${z}B`,forward:(z=1)=>`${x}${z}C`,backward:(z=1)=>`${x}${z}D`,nextLine:(z=1)=>`${x}E`.repeat(z),prevLine:(z=1)=>`${x}F`.repeat(z),left:`${x}G`,hide:`${x}?25l`,show:`${x}?25h`,save:`${c}7`,restore:`${c}8`};var o={screen:`${x}2J`,up:(z=1)=>`${x}1J`.repeat(z),down:(z=1)=>`${x}J`.repeat(z),line:`${x}2K`,lineEnd:`${x}K`,lineStart:`${x}1K`,lines(z){let $="";for(let Q=0;Q<z;Q++)$+=this.line+(Q<z-1?v.up():"");if(z)$+=v.left;return $}},K4={screen:`${c}c`};function Qz(z,$){let Q=[];for(let Z=0;Z<=$.length;Z++)Q[Z]=[Z];for(let Z=0;Z<=z.length;Z++)Q[0][Z]=Z;for(let Z=1;Z<=$.length;Z++)for(let Y=1;Y<=z.length;Y++)if($.charAt(Z-1)===z.charAt(Y-1))Q[Z][Y]=Q[Z-1][Y-1];else Q[Z][Y]=Math.min(Q[Z-1][Y-1]+1,Q[Z][Y-1]+1,Q[Z-1][Y]+1);return Q[$.length][z.length]}function b6(z,$,Q=2,Z=3){return $.map((Y)=>({cmd:Y,distance:Qz(z,Y)})).filter(({distance:Y})=>Y<=Q).sort((Y,q)=>Y.distance-q.distance).slice(0,Z).map(({cmd:Y})=>Y)}class D6{rawName;description;name;names;isBoolean;required;config;negated;constructor(z,$,Q){if(this.rawName=z,this.description=$,this.config=Object.assign({},Q),z=z.replace(/\.\*/g,""),this.negated=!1,this.names=e(z).split(",").map((Z)=>{let Y=Z.trim().replace(/^-{1,2}/,"");if(Y.startsWith("no-"))this.negated=!0,Y=Y.replace(/^no-/,"");return N6(Y)}).sort((Z,Y)=>Z.length>Y.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(z.includes("<"))this.required=!0;else if(z.includes("["))this.required=!1;else this.isBoolean=!0}}var F4=z6.argv,Zz=`${z6.platform}-${z6.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,W6=u.argv,Yz=`${u.platform}-${u.arch} node-${u.version}`;class $6{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(z,$,Q,Z){this.rawName=z,this.description=$,this.config=Q,this.cli=Z,this.options=[],this.aliasNames=[],this.name=e(z);let Y=e(z),q=Y.indexOf(":");if(q>0)this.namespace=Y.substring(0,q),this.name=Y.substring(q+1);if(this.args=a6(z),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!Q)this.config={}}usage(z){return this.usageText=z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(z,$="-v, --version"){return this.versionNumber=z,this.option($,"Display version number"),this}example(z){return this.examples.push(z),this}option(z,$,Q){let Z=new D6(z,$,Q);return this.options.push(Z),this}alias(z){return this.aliasNames.push(z),this}action(z){return this.commandAction=z,this}before(z){return this.beforeHooks.push(z),this}after(z){return this.afterHooks.push(z),this}use(z){return this.middleware.push(z),this}isMatched(z){return this.name===z||this.aliasNames.includes(z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof Q6}hasOption(z){return z=z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(z)})}outputHelp(){let{name:z,commands:$}=this.cli,{versionNumber:Q,options:Z,helpCallback:Y}=this.cli.globalCommand,q=[{body:`${z}${Q?`/${Q}`:""}`}];if(q.push({title:"Usage",body:` $ ${z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let X=F6($.map((F)=>F.rawName)),G=new Map,K=[];for(let F of $)if(F.namespace){if(!G.has(F.namespace))G.set(F.namespace,[]);G.get(F.namespace).push(F)}else K.push(F);let L="";if(K.length>0)L+=K.map((F)=>{return` ${t(F.rawName,X.length)} ${F.description}`}).join(`
4
+ ${this.stack}`;return this.message}}function $z(){let{env:z}=V6,{TERM:$,TERM_PROGRAM:Q}=z;if(V6.platform!=="win32")return $!=="linux";return Boolean(z.WT_SESSION)||Boolean(z.TERMINUS_SUBLIME)||z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var c="\x1B",x=`${c}[`;var v={to(z,$){if(!$)return`${x}${z+1}G`;return`${x}${$+1};${z+1}H`},move(z,$){let Q="";if(z<0)Q+=`${x}${-z}D`;else if(z>0)Q+=`${x}${z}C`;if($<0)Q+=`${x}${-$}A`;else if($>0)Q+=`${x}${$}B`;return Q},up:(z=1)=>`${x}${z}A`,down:(z=1)=>`${x}${z}B`,forward:(z=1)=>`${x}${z}C`,backward:(z=1)=>`${x}${z}D`,nextLine:(z=1)=>`${x}E`.repeat(z),prevLine:(z=1)=>`${x}F`.repeat(z),left:`${x}G`,hide:`${x}?25l`,show:`${x}?25h`,save:`${c}7`,restore:`${c}8`};var o={screen:`${x}2J`,up:(z=1)=>`${x}1J`.repeat(z),down:(z=1)=>`${x}J`.repeat(z),line:`${x}2K`,lineEnd:`${x}K`,lineStart:`${x}1K`,lines(z){let $="";for(let Q=0;Q<z;Q++)$+=this.line+(Q<z-1?v.up():"");if(z)$+=v.left;return $}},K4={screen:`${c}c`};function Qz(z,$){let Q=[];for(let Z=0;Z<=$.length;Z++)Q[Z]=[Z];for(let Z=0;Z<=z.length;Z++)Q[0][Z]=Z;for(let Z=1;Z<=$.length;Z++)for(let Y=1;Y<=z.length;Y++)if($.charAt(Z-1)===z.charAt(Y-1))Q[Z][Y]=Q[Z-1][Y-1];else Q[Z][Y]=Math.min(Q[Z-1][Y-1]+1,Q[Z][Y-1]+1,Q[Z-1][Y]+1);return Q[$.length][z.length]}function b6(z,$,Q=2,Z=3){return $.map((Y)=>({cmd:Y,distance:Qz(z,Y)})).filter(({distance:Y})=>Y<=Q).sort((Y,q)=>Y.distance-q.distance).slice(0,Z).map(({cmd:Y})=>Y)}class D6{rawName;description;name;names;isBoolean;required;config;negated;constructor(z,$,Q){if(this.rawName=z,this.description=$,this.config=Object.assign({},Q),z=z.replace(/\.\*/g,""),this.negated=!1,this.names=e(z).split(",").map((Z)=>{let Y=Z.trim().replace(/^-{1,2}/,"");if(Y.startsWith("no-"))this.negated=!0,Y=Y.replace(/^no-/,"");return N6(Y)}).sort((Z,Y)=>Z.length>Y.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(z.includes("<"))this.required=!0;else if(z.includes("["))this.required=!1;else this.isBoolean=!0}}var F4=z6.argv,Zz=`${z6.platform}-${z6.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,W6=u.argv,Yz=`${u.platform}-${u.arch} node-${u.version}`;class $6{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(z,$,Q,Z){this.rawName=z,this.description=$,this.config=Q,this.cli=Z,this.options=[],this.aliasNames=[],this.name=e(z);let Y=e(z),q=Y.indexOf(":");if(q>0)this.namespace=Y.substring(0,q),this.name=Y.substring(q+1);if(this.args=a6(z),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!Q)this.config={}}usage(z){return this.usageText=z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(z,$="-v, --version"){return this.versionNumber=z,this.option($,"Display version number"),this}example(z){return this.examples.push(z),this}option(z,$,Q){let Z=new D6(z,$,Q);return this.options.push(Z),this}alias(z){return this.aliasNames.push(z),this}action(z){return this.commandAction=z,this}before(z){return this.beforeHooks.push(z),this}after(z){return this.afterHooks.push(z),this}use(z){return this.middleware.push(z),this}isMatched(z){if(this.aliasNames.includes(z))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===z;return this.name===z}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof Q6}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption(z){return z=z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(z)})}outputHelp(){let{name:z,commands:$}=this.cli,{versionNumber:Q,options:Z,helpCallback:Y}=this.cli.globalCommand,q=[{body:`${z}${Q?`/${Q}`:""}`}];if(q.push({title:"Usage",body:` $ ${z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let X=F6($.map((F)=>F.rawName)),G=new Map,K=[];for(let F of $)if(F.namespace){if(!G.has(F.namespace))G.set(F.namespace,[]);G.get(F.namespace).push(F)}else K.push(F);let L="";if(K.length>0)L+=K.map((F)=>{return` ${t(F.rawName,X.length)} ${F.description}`}).join(`
5
5
  `);let j=Array.from(G.keys()).sort();for(let F of j){let W=G.get(F);if(L.length>0)L+=`
6
6
 
7
7
  `;L+=` ${F}:
8
8
  `,L+=W.map((B)=>{return` ${t(B.rawName,X.length-2)} ${B.description}`}).join(`
9
- `)}q.push({title:"Commands",body:L}),q.push({title:"For more info, run any command with the `--help` flag",body:$.map((F)=>` $ ${z}${F.name===""?"":` ${F.name}`} --help`).join(`
9
+ `)}q.push({title:"Commands",body:L}),q.push({title:"For more info, run any command with the `--help` flag",body:$.map((F)=>` $ ${z}${F.displayName===""?"":` ${F.displayName}`} --help`).join(`
10
10
  `)})}let U=this.isGlobalCommand?Z:[...this.options,...Z||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)U=U.filter((X)=>X.name!=="version");if(U.length>0){let X=F6(U.map((G)=>G.rawName));q.push({title:"Options",body:U.map((G)=>{return` ${t(G.rawName,X.length)} ${G.description} ${G.config.default===void 0?"":`(default: ${G.config.default})`}`}).join(`
11
11
  `)})}if(this.examples.length>0)q.push({title:"Examples",body:this.examples.map((X)=>{if(typeof X==="function")return X(z);return X}).join(`
12
12
  `)});if(Y)q=Y(q)||q;console.log(q.map((X)=>{return X.title?`${X.title}:
@@ -25,7 +25,7 @@ Example: ${this.cli.name} ${this.rawName} ${Z.rawName} <value>`)}}}}class Q6 ext
25
25
 
26
26
  Received ${Q}, cleaning up...`),z)try{await z()}catch(Z){console.error("Error during cleanup:",Z)}S.exit(0)};return S.on("SIGINT",()=>$("SIGINT")),S.on("SIGTERM",()=>$("SIGTERM")),this.signalHandlersSet=!0,this}didYouMean(z=!0){return this.enableDidYouMean=z,this}verbose(){return this.globalCommand.option("-v, --verbose","Enable verbose output"),this}quiet(){return this.globalCommand.option("-q, --quiet","Suppress non-essential output"),this}debug(){return this.globalCommand.option("--debug","Enable debug mode with detailed error information"),this}noInteraction(){return this.globalCommand.option("-n, --no-interaction","Do not ask any interactive questions (for CI/CD)"),this}env(){return this.globalCommand.option("--env <environment>","Target environment (e.g., production, staging, local)"),this}dryRun(){return this.globalCommand.option("--dry-run","Preview actions without executing them"),this}force(){return this.globalCommand.option("-f, --force","Skip confirmation prompts"),this}emoji(){return this.globalCommand.option("--no-emoji","Disable emoji in output"),this}themes(){return this.globalCommand.option("--theme <theme>","Color theme (default, dracula, nord, solarized, monokai)"),this}cache(){return this.globalCommand.option("--no-cache","Disable caching"),this}usage(z){return this.globalCommand.usage(z),this}command(z,$,Q){if(!Q)Q={};let Z=new qz(z,$||"",Q,this);return Z.globalCommand=this.globalCommand,this.commands.push(Z),Z}option(z,$,Q){return this.globalCommand.option(z,$,Q),this}help(z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=z,this.showHelpOnExit=!0,this}version(z,$="-v, --version"){return this.globalCommand.version(z,$),this.showVersionOnExit=!0,this}example(z){return this.globalCommand.example(z),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:z,options:$},Q,Z){if(this.args=z,this.options=$,Q)this.matchedCommand=Q;if(Z)this.matchedCommandName=Z;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}showCommandNotFound(z){if(console.log(g.red(`
27
27
  ✗ Command "${z}" not found.
28
- `)),this.enableDidYouMean){let $=[];for(let Z of this.commands){if(Z.name)$.push(Z.name);if(Z.aliasNames)$.push(...Z.aliasNames)}let Q=b6(z,$);if(Q.length>0)console.log(g.yellow("Did you mean one of these?")),Q.forEach((Z)=>console.log(` ${g.dim("•")} ${this.name} ${Z}`)),console.log("")}console.log(g.dim("Run"),`${this.name} --help`,g.dim("to see all available commands")),S.exit(1)}async parse(z=W6,$={}){let{run:Q=!0,exitOnError:Z=!1}=$;if(Z)try{return await this.parse(z,{run:Q})}catch(X){throw this.handleUsageError(X),X}if(this.rawArgs=z,!this.name)this.name=z[1]?zz(z[1]):"cli";let Y=!0,q=z.slice(2),J=q[0];if(J&&!J.startsWith("-")){for(let X of this.commands)if(X.isMatched(J)){let G=this.mri(q,X);Y=!1;let K={...G,args:G.args.slice(1)};this.setParsedInfo(K,X,J),this.emit(`command:${J}`,X);break}}if(Y){for(let X of this.commands)if(X.name===""){Y=!1;let G=this.mri(q,X);this.setParsedInfo(G,X),this.emit("command:!",X);break}}if(Y){let X=this.mri(z.slice(2));this.setParsedInfo(X)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji!==void 0)this.useEmoji=!this.options.noEmoji;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache!==void 0)this.isNoCache=Boolean(this.options.noCache);if(this.options.help&&this.showHelpOnExit)this.outputHelp(),Q=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),Q=!1,this.unsetMatchedCommand();let U={args:this.args,options:this.options};if(Q)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return U}mri(z,$){let Q=[...this.globalCommand.options,...$?$.options:[]],Z=s6(Q),Y=[],q=z.indexOf("--");if(q>-1)Y=z.slice(q+1),z=z.slice(0,q);let J=r6(z,Z),U={_:J._};for(let j of Object.keys(J))if(j!=="_")U[N6(j)]=J[j];let X=U._,G={"--":Y},K=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,L=Object.create(null);for(let j of Q){if(!K&&j.config.default!==void 0)for(let F of j.names)G[F]=j.config.default;if(Array.isArray(j.config.type)){if(L[j.name]===void 0)L[j.name]={shouldTransform:!0,transformFunction:j.config.type[0]}}}for(let j of Object.keys(U))if(j!=="_"){let F=j.split(".");o6(G,F,U[j]),e6(G,L)}return{args:X,options:G}}async run(z=W6){return this.parse(z,{run:!0,exitOnError:!0})}handleUsageError(z){if(!(!!z&&typeof z==="object"&&z.name==="ClappError"&&z.isUsageError!==!1))return;let Z=z,Y=Z.message??"command-line error",q=this.name?`${this.name}: `:"",J=/--help/.test(Y)?"":`
28
+ `)),this.enableDidYouMean){let $=[];for(let Z of this.commands){if(Z.displayName)$.push(Z.displayName);if(Z.aliasNames)$.push(...Z.aliasNames)}let Q=b6(z,$);if(Q.length>0)console.log(g.yellow("Did you mean one of these?")),Q.forEach((Z)=>console.log(` ${g.dim("•")} ${this.name} ${Z}`)),console.log("")}console.log(g.dim("Run"),`${this.name} --help`,g.dim("to see all available commands")),S.exit(1)}async parse(z=W6,$={}){let{run:Q=!0,exitOnError:Z=!1}=$;if(Z)try{return await this.parse(z,{run:Q})}catch(X){throw this.handleUsageError(X),X}if(this.rawArgs=z,!this.name)this.name=z[1]?zz(z[1]):"cli";let Y=!0,q=z.slice(2),J=q[0];if(J&&!J.startsWith("-")){for(let X of this.commands)if(X.isMatched(J)){let G=this.mri(q,X);Y=!1;let K={...G,args:G.args.slice(1)};this.setParsedInfo(K,X,J),this.emit(`command:${J}`,X);break}}if(Y){for(let X of this.commands)if(X.name===""){Y=!1;let G=this.mri(q,X);this.setParsedInfo(G,X),this.emit("command:!",X);break}}if(Y){let X=this.mri(z.slice(2));this.setParsedInfo(X)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji!==void 0)this.useEmoji=!this.options.noEmoji;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache!==void 0)this.isNoCache=Boolean(this.options.noCache);if(this.options.help&&this.showHelpOnExit)this.outputHelp(),Q=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),Q=!1,this.unsetMatchedCommand();let U={args:this.args,options:this.options};if(Q)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return U}mri(z,$){let Q=[...this.globalCommand.options,...$?$.options:[]],Z=s6(Q),Y=[],q=z.indexOf("--");if(q>-1)Y=z.slice(q+1),z=z.slice(0,q);let J=r6(z,Z),U={_:J._};for(let j of Object.keys(J))if(j!=="_")U[N6(j)]=J[j];let X=U._,G={"--":Y},K=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,L=Object.create(null);for(let j of Q){if(!K&&j.config.default!==void 0)for(let F of j.names)G[F]=j.config.default;if(Array.isArray(j.config.type)){if(L[j.name]===void 0)L[j.name]={shouldTransform:!0,transformFunction:j.config.type[0]}}}for(let j of Object.keys(U))if(j!=="_"){let F=j.split(".");o6(G,F,U[j]),e6(G,L)}return{args:X,options:G}}async run(z=W6){return this.parse(z,{run:!0,exitOnError:!0})}handleUsageError(z){if(!(!!z&&typeof z==="object"&&z.name==="ClappError"&&z.isUsageError!==!1))return;let Z=z,Y=Z.message??"command-line error",q=this.name?`${this.name}: `:"",J=/--help/.test(Y)?"":`
29
29
  Run \`${this.name??"cli"} --help\` for usage.`;S.stderr.write(`${q}${Y}${J}
30
30
  `),S.exit(Z.exitCode??2)}async runMatchedCommand(){let{args:z,options:$,matchedCommand:Q}=this;if(!Q||!Q.commandAction)return;Q.checkUnknownOptions(),Q.checkOptionValue(),Q.checkRequiredArgs();let Z=[];Q.args.forEach((U,X)=>{if(U.variadic)Z.push(z.slice(X));else Z.push(z[X])}),Z.push($);let Y={command:Q,args:Z,options:$};for(let U of Q.beforeHooks)await U(Y);let q,J=async()=>{let U=Q.commandAction.apply(this,Z);if(U instanceof Promise)q=await U;else q=U;return q};if(Q.middleware.length>0){let U=0,X=async()=>{if(U<Q.middleware.length){let G=Q.middleware[U++];await G({...Y,next:X})}else await J()};await X()}else await J();for(let U of Q.afterHooks)await U(Y);return q}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return S.removeAllListeners("SIGINT"),S.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class T6{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(z){if(!this.enabled){this.misses++;return}let $=this.cache.get(z);if(!$){this.misses++;return}if(Date.now()-$.timestamp>$.ttl){this.cache.delete(z),this.misses++;return}return this.hits++,$.value}set(z,$,Q=5000){if(!this.enabled)return;this.cache.set(z,{value:$,timestamp:Date.now(),ttl:Q})}has(z){if(!this.enabled)return!1;let $=this.cache.get(z);if(!$)return!1;if(Date.now()-$.timestamp>$.ttl)return this.cache.delete(z),!1;return!0}delete(z){this.cache.delete(z)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let z=Date.now();for(let[$,Q]of this.cache.entries())if(z-Q.timestamp>Q.ttl)this.cache.delete($)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var L4=new T6;function Uz(){if("FORCE_COLOR"in f.env)return f.env.FORCE_COLOR!=="0";if("NO_COLOR"in f.env||f.env.TERM==="dumb")return!1;if(f.platform==="win32")return!0;return L6.isatty(1)&&L6.isatty(2)}var E6=Uz();function T(z,$){if(!E6)return(Q)=>Q;return(Q)=>z+Q+$}var Gz=T("\x1B[0m","\x1B[0m"),jz=T("\x1B[31m","\x1B[39m"),Hz=T("\x1B[32m","\x1B[39m"),Kz=T("\x1B[33m","\x1B[39m"),Vz=T("\x1B[34m","\x1B[39m"),Fz=T("\x1B[35m","\x1B[39m"),Wz=T("\x1B[36m","\x1B[39m"),Lz=T("\x1B[37m","\x1B[39m"),wz=T("\x1B[90m","\x1B[39m"),Mz=T("\x1B[1m","\x1B[22m"),Oz=T("\x1B[3m","\x1B[23m"),Bz=T("\x1B[4m","\x1B[24m"),Nz=T("\x1B[2m","\x1B[22m"),bz=T("\x1B[7m","\x1B[27m"),Dz=T("\x1B[8m","\x1B[28m"),Tz=T("\x1B[9m","\x1B[29m"),Ez=T("\x1B[41m","\x1B[49m"),xz=T("\x1B[42m","\x1B[49m"),Iz=T("\x1B[43m","\x1B[49m"),Rz=T("\x1B[44m","\x1B[49m"),Az=T("\x1B[45m","\x1B[49m"),Pz=T("\x1B[46m","\x1B[49m"),Cz=T("\x1B[47m","\x1B[49m"),vz=E6,Sz={reset:Gz,red:jz,green:Hz,yellow:Kz,blue:Vz,magenta:Fz,cyan:Wz,white:Lz,gray:wz,bold:Mz,italic:Oz,underline:Bz,dim:Nz,inverse:bz,hidden:Dz,strikethrough:Tz,bgRed:Ez,bgGreen:xz,bgYellow:Iz,bgBlue:Rz,bgMagenta:Az,bgCyan:Pz,bgWhite:Cz,isColorSupported:vz},i=Sz,kz=["up","down","left","right","space","enter","cancel"],n={actions:new Set(kz),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function x6(z,$){if(typeof z==="string")return n.aliases.get(z)===$;for(let Q of z){if(Q===void 0)continue;if(x6(Q,$))return!0}return!1}function hz(z,$){if(z===$)return[];let Q=z.split(`
31
31
  `),Z=$.split(`
@@ -36,7 +36,7 @@ Run \`${this.name??"cli"} --help\` for usage.`;S.stderr.write(`${q}${Y}${J}
36
36
  `).length-1;this.output.write(v.move(-999,z*-1))}render(){let z=O6(this._render(this)??"",M6.stdout.columns,{hard:!0,trim:!1});if(z===this._prevFrame)return;if(this.state==="initial")this.output.write(v.hide);else{let $=hz(this._prevFrame,z);if(this.restoreCursor(),$&&$?.length===1){let Q=$[0];this.output.write(v.move(0,Q)),this.output.write(o.lines(1));let Z=z.split(`
37
37
  `);this.output.write(Z[Q]),this._prevFrame=z,this.output.write(v.move(0,Z.length-Q-1));return}if($&&$?.length>1){let Q=$[0];this.output.write(v.move(0,Q)),this.output.write(o.down());let Y=z.split(`
38
38
  `).slice(Q);this.output.write(Y.join(`
39
- `)),this._prevFrame=z;return}this.output.write(o.down())}if(this.output.write(z),this.state==="initial")this.state="active";this._prevFrame=z}}function uz(z,$){if(z===void 0)return 0;if($.length===0)return 0;let Z=$.findIndex((Y)=>Y.value===z);return Z!==-1?Z:0}function iz(z,$){return($.label??String($.value)).toLowerCase().includes(z.toLowerCase())}function nz(z,$){if(!$)return;if(z)return $;return $[0]}class cz extends Y6{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#z=0;#Q="";#Z;#$;get cursor(){return this.#z}get userInputWithCursor(){if(!this.userInput)return i.inverse(i.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let z=this.userInput.slice(0,this._cursor),[$,...Q]=this.userInput.slice(this._cursor);return`${z}${i.inverse($)}${Q.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(z){super(z);this.#$=z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=z.multiple===!0,this.#Z=z.filter??iz;let Q;if(z.initialValue&&Array.isArray(z.initialValue))if(this.multiple)Q=z.initialValue;else Q=z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Q=[this.options[0].value];if(Q)for(let Z of Q){let Y=$.findIndex((q)=>q.value===Z);if(Y!==-1)this.toggleSelected(Z),this.#z=Y}this.focusedValue=this.options[this.#z]?.value,this.on("key",(Z,Y)=>this.#Y(Z,Y)),this.on("userInput",(Z)=>this.#q(Z))}_isActionKey(z,$){return z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&z!==void 0&&z!==""}#Y(z,$){let Q=$.name==="up",Z=$.name==="down",Y=$.name==="return";if(Q||Z){if(this.#z=Math.max(0,Math.min(this.#z+(Q?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Y)this.value=nz(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(z))this.selectedValues=this.selectedValues.filter(($)=>$!==z);else this.selectedValues=[...this.selectedValues,z];else this.selectedValues=[z]}#q(z){if(z!==this.#Q){this.#Q=z;let $=this.options;if(z)this.filteredOptions=$.filter((Q)=>this.#Z(z,Q));else this.filteredOptions=[...$];if(this.#z=uz(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class lz extends Y6{options;cursor=0;#z;getGroupItems(z){return this.options.filter(($)=>$.group===z)}isGroupSelected(z){let $=this.getGroupItems(z),Q=this.value;if(Q===void 0)return!1;return $.every((Z)=>Q.includes(Z.value))}toggleValue(){let z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(z.group===!0){let $=z.value,Q=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((Z)=>Q.findIndex((Y)=>Y.value===Z)===-1);else this.value=[...this.value,...Q.map((Z)=>Z.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(z.value);this.value=$?this.value.filter((Q)=>Q!==z.value):[...this.value,z.value]}}constructor(z){super(z,!1);let{options:$}=z;this.#z=z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Q,Z])=>[{value:Q,group:!0,label:Q},...Z.map((Y)=>({...Y,group:Q}))]),this.value=[...z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===z.cursorAt),this.#z?0:1),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var pz=$z();var D=(z,$)=>pz?z:$,E4=D("◆","*"),x4=D("■","x"),I4=D("▲","x"),R4=D("◇","o"),A4=D("┌","T"),rz=D("│","|"),P4=D("└","—"),C4=D("●",">"),v4=D("○"," "),S4=D("◻","[•]"),y4=D("◼","[+]"),k4=D("◻","[ ]"),h4=D("▪","•"),_4=D("─","-"),g4=D("╮","+"),f4=D("├","+"),m4=D("╯","+"),d4=D("●","•"),u4=D("◆","*"),i4=D("▲","!"),n4=D("■","x");var c4={light:D("─","-"),heavy:D("━","="),block:D("█","#")};function az(){return`${i.gray(rz)} `}var l4=az();var I6="0.9.35";tz();async function oz(z="src/pantry"){if(!V.existsSync(z))throw Error(`Pantry directory not found: ${z}. Please run 'bun ./bin/cli.ts update-pantry' first.`);let $=[];function Q(Z,Y=""){let q=V.readdirSync(Z,{withFileTypes:!0}),J=N.join(Z,"package.yml");if(Y&&V.existsSync(J))$.push(Y);for(let U of q)if(U.isDirectory()&&!U.name.startsWith(".")){let X=Y?`${Y}/${U.name}`:U.name,G=N.join(Z,U.name);Q(G,X)}}return Q(z),console.log(`\uD83D\uDCE6 Found ${$.length} packages in local pantry`),$.sort()}async function ez(z=!1){async function $(J){let U=new URL("https://s3.amazonaws.com/dist.tea.xyz/");if(U.searchParams.set("list-type","2"),U.searchParams.set("prefix",""),U.searchParams.set("max-keys","1000"),J)U.searchParams.set("continuation-token",J);let X=await fetch(U.toString());if(!X.ok)throw Error(`Failed to fetch S3 listing: ${X.status}`);let G=await X.text(),K=[],L=G.match(/<Key>([^<]+)<\/Key>/g);if(L)for(let B of L){let E=B.replace(/<Key>([^<]+)<\/Key>/,"$1");K.push({Key:E})}let j=G.includes("<IsTruncated>true</IsTruncated>"),F=G.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/),W=F?F[1]:void 0;return{IsTruncated:j,NextContinuationToken:W,Contents:K}}console.log("Scraping packages from S3 registry...");let Q=new Set,Z;do{let J=await $(Z);for(let U of J.Contents){let X=U.Key,G=X.split("/");if(G.length===0)continue;if(G[0].startsWith(".")||G[0].includes(" ")||X.match(/\.(md|txt|yml|yaml|json)$/i))continue;let K=["darwin","linux","windows"],L=-1;for(let j=1;j<G.length;j++)if(K.includes(G[j])){L=j;break}if(L>0){let j=G.slice(0,L).join("/");if(j.includes("."))Q.add(j)}else if(G.length>=2&&G[0].includes(".")&&!G[1].startsWith("v")&&!G[1].match(/^\d/)){let j=`${G[0]}/${G[1]}`;Q.add(j)}else if(G.length>=1&&G[0].includes("."))Q.add(G[0])}Z=J.NextContinuationToken,console.log(`Found ${Q.size} packages so far...`)}while(Z);let Y=Array.from(Q).sort(),q=[];for(let J of Y){if(!J.includes(".")||J.match(/^[a-z0-9.-]+\.[a-z]{2,}(\/[\w.-]+){0,20}$/i)===null)continue;if(J.endsWith("/README.rst")||J.endsWith("/README")||J.includes("/docs/"))continue;if(J.endsWith("/.pkgroot"))continue;if(["amazon.com/aws","charm.sh","code.videolan.org","crates.io"].includes(J))continue;q.push(J)}return console.log(`\uD83D\uDCE6 Found ${q.length} valid packages in registry`),q}async function z4(z,$){let Z=`/**
39
+ `)),this._prevFrame=z;return}this.output.write(o.down())}if(this.output.write(z),this.state==="initial")this.state="active";this._prevFrame=z}}function uz(z,$){if(z===void 0)return 0;if($.length===0)return 0;let Z=$.findIndex((Y)=>Y.value===z);return Z!==-1?Z:0}function iz(z,$){return($.label??String($.value)).toLowerCase().includes(z.toLowerCase())}function nz(z,$){if(!$)return;if(z)return $;return $[0]}class cz extends Y6{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#z=0;#Q="";#Z;#$;get cursor(){return this.#z}get userInputWithCursor(){if(!this.userInput)return i.inverse(i.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let z=this.userInput.slice(0,this._cursor),[$,...Q]=this.userInput.slice(this._cursor);return`${z}${i.inverse($)}${Q.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(z){super(z);this.#$=z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=z.multiple===!0,this.#Z=z.filter??iz;let Q;if(z.initialValue&&Array.isArray(z.initialValue))if(this.multiple)Q=z.initialValue;else Q=z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Q=[this.options[0].value];if(Q)for(let Z of Q){let Y=$.findIndex((q)=>q.value===Z);if(Y!==-1)this.toggleSelected(Z),this.#z=Y}this.focusedValue=this.options[this.#z]?.value,this.on("key",(Z,Y)=>this.#Y(Z,Y)),this.on("userInput",(Z)=>this.#q(Z))}_isActionKey(z,$){return z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&z!==void 0&&z!==""}#Y(z,$){let Q=$.name==="up",Z=$.name==="down",Y=$.name==="return";if(Q||Z){if(this.#z=Math.max(0,Math.min(this.#z+(Q?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Y)this.value=nz(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(z))this.selectedValues=this.selectedValues.filter(($)=>$!==z);else this.selectedValues=[...this.selectedValues,z];else this.selectedValues=[z]}#q(z){if(z!==this.#Q){this.#Q=z;let $=this.options;if(z)this.filteredOptions=$.filter((Q)=>this.#Z(z,Q));else this.filteredOptions=[...$];if(this.#z=uz(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class lz extends Y6{options;cursor=0;#z;getGroupItems(z){return this.options.filter(($)=>$.group===z)}isGroupSelected(z){let $=this.getGroupItems(z),Q=this.value;if(Q===void 0)return!1;return $.every((Z)=>Q.includes(Z.value))}toggleValue(){let z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(z.group===!0){let $=String(z.value),Q=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((Z)=>Q.findIndex((Y)=>Y.value===Z)===-1);else this.value=[...this.value,...Q.map((Z)=>Z.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(z.value);this.value=$?this.value.filter((Q)=>Q!==z.value):[...this.value,z.value]}}constructor(z){super(z,!1);let{options:$}=z;this.#z=z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Q,Z])=>[{value:Q,group:!0,label:Q},...Z.map((Y)=>({...Y,group:Q}))]),this.value=[...z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===z.cursorAt),this.#z?0:1),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var pz=$z();var D=(z,$)=>pz?z:$,E4=D("◆","*"),x4=D("■","x"),I4=D("▲","x"),R4=D("◇","o"),A4=D("┌","T"),rz=D("│","|"),P4=D("└","—"),C4=D("●",">"),v4=D("○"," "),S4=D("◻","[•]"),y4=D("◼","[+]"),k4=D("◻","[ ]"),h4=D("▪","•"),_4=D("─","-"),g4=D("╮","+"),f4=D("├","+"),m4=D("╯","+"),d4=D("●","•"),u4=D("◆","*"),i4=D("▲","!"),n4=D("■","x");var c4={light:D("─","-"),heavy:D("━","="),block:D("█","#")};function az(){return`${i.gray(rz)} `}var l4=az();var I6="0.9.36";tz();async function oz(z="src/pantry"){if(!V.existsSync(z))throw Error(`Pantry directory not found: ${z}. Please run 'bun ./bin/cli.ts update-pantry' first.`);let $=[];function Q(Z,Y=""){let q=V.readdirSync(Z,{withFileTypes:!0}),J=N.join(Z,"package.yml");if(Y&&V.existsSync(J))$.push(Y);for(let U of q)if(U.isDirectory()&&!U.name.startsWith(".")){let X=Y?`${Y}/${U.name}`:U.name,G=N.join(Z,U.name);Q(G,X)}}return Q(z),console.log(`\uD83D\uDCE6 Found ${$.length} packages in local pantry`),$.sort()}async function ez(z=!1){async function $(J){let U=new URL("https://s3.amazonaws.com/dist.tea.xyz/");if(U.searchParams.set("list-type","2"),U.searchParams.set("prefix",""),U.searchParams.set("max-keys","1000"),J)U.searchParams.set("continuation-token",J);let X=await fetch(U.toString());if(!X.ok)throw Error(`Failed to fetch S3 listing: ${X.status}`);let G=await X.text(),K=[],L=G.match(/<Key>([^<]+)<\/Key>/g);if(L)for(let B of L){let E=B.replace(/<Key>([^<]+)<\/Key>/,"$1");K.push({Key:E})}let j=G.includes("<IsTruncated>true</IsTruncated>"),F=G.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/),W=F?F[1]:void 0;return{IsTruncated:j,NextContinuationToken:W,Contents:K}}console.log("Scraping packages from S3 registry...");let Q=new Set,Z;do{let J=await $(Z);for(let U of J.Contents){let X=U.Key,G=X.split("/");if(G.length===0)continue;if(G[0].startsWith(".")||G[0].includes(" ")||X.match(/\.(md|txt|yml|yaml|json)$/i))continue;let K=["darwin","linux","windows"],L=-1;for(let j=1;j<G.length;j++)if(K.includes(G[j])){L=j;break}if(L>0){let j=G.slice(0,L).join("/");if(j.includes("."))Q.add(j)}else if(G.length>=2&&G[0].includes(".")&&!G[1].startsWith("v")&&!G[1].match(/^\d/)){let j=`${G[0]}/${G[1]}`;Q.add(j)}else if(G.length>=1&&G[0].includes("."))Q.add(G[0])}Z=J.NextContinuationToken,console.log(`Found ${Q.size} packages so far...`)}while(Z);let Y=Array.from(Q).sort(),q=[];for(let J of Y){if(!J.includes(".")||J.match(/^[a-z0-9.-]+\.[a-z]{2,}(\/[\w.-]+){0,20}$/i)===null)continue;if(J.endsWith("/README.rst")||J.endsWith("/README")||J.includes("/docs/"))continue;if(J.endsWith("/.pkgroot"))continue;if(["amazon.com/aws","charm.sh","code.videolan.org","crates.io"].includes(J))continue;q.push(J)}return console.log(`\uD83D\uDCE6 Found ${q.length} valid packages in registry`),q}async function z4(z,$){let Z=`/**
40
40
  * Constants used throughout the ts-pkgx package
41
41
  * This file is auto-generated from ${$}. Do not edit manually.
42
42
  * Generated on ${new Date().toISOString()}
@@ -101,9 +101,9 @@ Conflicts found:`),j.conflicts.forEach((W)=>{console.log(` ${W.package}: ${W.ve
101
101
  \uD83D\uDE80 Install commands:`),console.log(`
102
102
  Using pkgx:`);let W=j.uniquePackages.map((B)=>`+${B}`).join(" ");console.log(`sh <(curl https://pkgx.sh) ${W} -- $SHELL -i`),console.log(`
103
103
  Or install individually:`),j.uniquePackages.forEach((B)=>{console.log(`pkgx +${B}`)})}if(Object.values(j.osSpecificDeps).reduce((W,B)=>W+B.length,0)>0)console.log(`
104
- \uD83D\uDDA5️ OS-specific dependencies:`),Object.entries(j.osSpecificDeps).forEach(([W,B])=>{if(B.length>0)console.log(` ${W}: ${B.map((E)=>E.name).join(", ")}`)})}H.exit(0)}catch(Q){if($.json){let Z={success:!1,error:String(Q),timestamp:new Date().toISOString()};console.log(JSON.stringify(Z))}else console.error("Error resolving dependencies:",Q);H.exit(1)}});I.command("get-php-versions","Get PHP versions suitable for CI/CD workflows").option("--format <type>","Output format: json (default), yaml, or csv",{default:"json"}).option("--branches <branches>","Comma-separated list of PHP branches to include (e.g., 8.4,8.3,8.2)").option("--fallback <versions>","Comma-separated list of fallback versions if detection fails").action(async(z)=>{try{let{getPhpVersionsForWorkflow:$}=await import("../chunk-nkpmj4a5.js"),Q={};if(z.branches)Q.supportedBranches=z.branches.split(",").map((Y)=>Y.trim());if(z.fallback)Q.fallbackVersions=z.fallback.split(",").map((Y)=>Y.trim());let Z=$(Q);switch(z.format.toLowerCase()){case"yaml":console.log(`php_versions:
104
+ \uD83D\uDDA5️ OS-specific dependencies:`),Object.entries(j.osSpecificDeps).forEach(([W,B])=>{if(B.length>0)console.log(` ${W}: ${B.map((E)=>E.name).join(", ")}`)})}H.exit(0)}catch(Q){if($.json){let Z={success:!1,error:String(Q),timestamp:new Date().toISOString()};console.log(JSON.stringify(Z))}else console.error("Error resolving dependencies:",Q);H.exit(1)}});I.command("get-php-versions","Get PHP versions suitable for CI/CD workflows").option("--format <type>","Output format: json (default), yaml, or csv",{default:"json"}).option("--branches <branches>","Comma-separated list of PHP branches to include (e.g., 8.4,8.3,8.2)").option("--fallback <versions>","Comma-separated list of fallback versions if detection fails").action(async(z)=>{try{let{getPhpVersionsForWorkflow:$}=await import("../chunk-1g8er1pr.js"),Q={};if(z.branches)Q.supportedBranches=z.branches.split(",").map((Y)=>Y.trim());if(z.fallback)Q.fallbackVersions=z.fallback.split(",").map((Y)=>Y.trim());let Z=$(Q);switch(z.format.toLowerCase()){case"yaml":console.log(`php_versions:
105
105
  ${Z.map((Y)=>` - "${Y}"`).join(`
106
- `)}`);break;case"csv":console.log(Z.join(","));break;case"json":default:console.log(JSON.stringify(Z));break}H.exit(0)}catch($){console.error("Error getting PHP versions:",$),H.exit(1)}});I.command("generate-zig","Generate Zig package definitions from TypeScript packages").option("--packages-dir <dir>","Directory containing TypeScript package files",{default:"src/packages"}).option("--output <file>","Output Zig file path",{default:"packages.zig"}).option("--aliases","Also generate aliases file").option("--aliases-output <file>","Output file for Zig aliases",{default:"aliases.zig"}).action(async(z)=>{try{let{generateZigDefinitions:$,generateZigAliases:Q}=await import("../chunk-gyn0s28q.js"),{packagesDir:Z="src/packages",output:Y="packages.zig",aliases:q=!1,aliasesOutput:J="aliases.zig"}=z;if(console.log("\uD83D\uDE80 Generating Zig package definitions..."),await $(Z,Y),q)console.log(`
106
+ `)}`);break;case"csv":console.log(Z.join(","));break;case"json":default:console.log(JSON.stringify(Z));break}H.exit(0)}catch($){console.error("Error getting PHP versions:",$),H.exit(1)}});I.command("generate-zig","Generate Zig package definitions from TypeScript packages").option("--packages-dir <dir>","Directory containing TypeScript package files",{default:"src/packages"}).option("--output <file>","Output Zig file path",{default:"packages.zig"}).option("--aliases","Also generate aliases file").option("--aliases-output <file>","Output file for Zig aliases",{default:"aliases.zig"}).action(async(z)=>{try{let{generateZigDefinitions:$,generateZigAliases:Q}=await import("../chunk-ys5jjmq2.js"),{packagesDir:Z="src/packages",output:Y="packages.zig",aliases:q=!1,aliasesOutput:J="aliases.zig"}=z;if(console.log("\uD83D\uDE80 Generating Zig package definitions..."),await $(Z,Y),q)console.log(`
107
107
  \uD83D\uDE80 Generating Zig package aliases...`),await Q(Z,J);console.log(`
108
108
  ✅ Zig code generation complete!`),H.exit(0)}catch($){console.error("Error generating Zig definitions:",$),H.exit(1)}});I.command("apps","List installed desktop applications with version info").option("-j, --json","Output as JSON").action(async(z)=>{try{let{scanInstalledApps:$}=await import("../chunk-xkqrwk69.js"),Q=$();if(z.json)console.log(JSON.stringify({success:!0,apps:Q,total:Q.length}));else{console.log(`
109
109
  Installed Desktop Apps (${Q.length}):
@@ -1 +1 @@
1
- import{Ab as e,Bb as f,Cb as g,Db as h,Eb as i,Fb as j,Gb as k,Hb as l,Ib as m,wb as a,xb as b,yb as c,zb as d}from"./chunk-fwv0fmkb.js";import"./chunk-z7v78f5q.js";import"./chunk-s0s1vx8j.js";import"./chunk-rjpqpn2z.js";export{l as validatePackageSpec,h as searchPackages,m as resolveVersionFromMetadata,e as resolveVersion,g as resolvePackageDomain,d as isVersionAvailable,j as getPopularPackages,c as getPhpVersionsForWorkflow,i as getPackagesByPattern,f as getPackageInfo,a as getLatestVersion,b as getAvailableVersions,k as getActivePackages};
1
+ import{Ab as e,Bb as f,Cb as g,Db as h,Eb as i,Fb as j,Gb as k,Hb as l,Ib as m,wb as a,xb as b,yb as c,zb as d}from"./chunk-bq6fs4xy.js";import"./chunk-rtr3z1q1.js";import"./chunk-s0s1vx8j.js";import"./chunk-rjpqpn2z.js";export{l as validatePackageSpec,h as searchPackages,m as resolveVersionFromMetadata,e as resolveVersion,g as resolvePackageDomain,d as isVersionAvailable,j as getPopularPackages,c as getPhpVersionsForWorkflow,i as getPackagesByPattern,f as getPackageInfo,a as getLatestVersion,b as getAvailableVersions,k as getActivePackages};
@@ -1,2 +1,2 @@
1
- import{Lb as I,Mb as T}from"./chunk-z7v78f5q.js";import{Nb as _,Ob as w}from"./chunk-s0s1vx8j.js";import{Sb as y,Vb as M}from"./chunk-rjpqpn2z.js";w();async function Y(){try{let{packages:E}=await import("./chunk-hk26x4v2.js");return E}catch{return{}}}async function F(E){let q=Z(E);if(!q)return null;let z=(await Y())[q];if(!z||!z.versions||z.versions.length===0)return null;return z.versions[0]}async function x(E){let q=Z(E);if(!q)return[];let z=(await Y())[q];if(!z||!z.versions)return[];return[...z.versions]}function f(E={}){let q=["8.4.11","8.3.14","8.2.26","8.1.30"],H=E.fallbackVersions||q;try{let{pantry:z}=(T(),y(I)),G=z.phpnet||z.php;if(!G||!G.versions||G.versions.length===0)return H;let K=[...G.versions],J=E.supportedBranches||D(K),Q=new Map;for(let R of K){let[U,X]=R.split(".");if(!U||!X)continue;let W=`${U}.${X}`;if(J.includes(W)&&!Q.has(W))Q.set(W,R)}let O=J.map((R)=>Q.get(R)).filter(Boolean);return O.length>0?O:H}catch{return H}}function D(E){let q=new Map;for(let z of E){let[G,K]=z.split(".");if(!G||!K)continue;let J=`${G}.${K}`;q.set(J,(q.get(J)||0)+1)}return Array.from(q.keys()).filter((z)=>{let[G]=z.split(".");return G==="8"&&q.get(z)>3}).sort((z,G)=>{let[K,J]=z.split(".").map(Number),[Q,O]=G.split(".").map(Number);if(K!==Q)return Q-K;return O-J}).slice(0,4)}async function C(E,q){return(await x(E)).includes(q)}async function h(E,q="latest"){if(q==="latest")return await F(E);let H=await x(E);if(H.length===0)return null;if(H.includes(q))return q;if(q.startsWith("^")){let G=q.slice(1).split(".")[0];return H.filter((J)=>J.startsWith(`${G}.`))[0]||null}if(q.startsWith("~")){let z=q.slice(1),[G,K]=z.split("."),J=`${G}.${K}.`;return H.filter((O)=>O.startsWith(J))[0]||null}if(q.startsWith(">=")){let G=q.slice(2).split(".").map(Number);return H.filter((J)=>{let Q=J.split(".").map(Number);for(let O=0;O<Math.max(Q.length,G.length);O++){let R=Q[O]??0,U=G[O]??0;if(R>U)return!0;if(R<U)return!1}return!0})[0]||null}return await F(E)}async function $(E){let q=Z(E);if(!q)return null;let z=(await Y())[q];if(!z)return null;let G=await F(E);if(!G)return null;return{name:String(E),domain:q,description:z.description||"",latestVersion:G,totalVersions:z.versions?.length||0,programs:[...z.programs||[]],dependencies:[...z.dependencies||[]],companions:[...z.companions||[]],versions:[...z.versions||[]]}}function Z(E){let q=String(E);if(q in _){let H=_[q];return L(H)}return L(q)}function L(E){if(E.includes("/")){let[q,...H]=E.split("/"),z=H.join("/"),G=q.replace(/\./g,""),K=z.replace(/[/\-_.]/g,"").toLowerCase();return`${G}${K}`.toLowerCase()}return E.replace(/[.\-_]/g,"").toLowerCase()}async function N(E){let q=[],H=E.toLowerCase();for(let[G,K]of Object.entries(_))if(G.toLowerCase().includes(H)){let J=await $(G);if(J)q.push(J)}let z=await Y();for(let[G,K]of Object.entries(z))if(G.toLowerCase().includes(H)||K.description?.toLowerCase().includes(H)){let J=await $(G);if(J&&!q.some((Q)=>Q.domain===G))q.push(J)}return q}async function P(E){let q=[],H=await Y();for(let z of Object.keys(H))if(E.test(z)){let G=await $(z);if(G)q.push(G)}return q}async function j(E=10){let q=[],H=await Y();for(let z of Object.keys(H)){let G=await $(z);if(G&&G.totalVersions>=E)q.push(G)}return q.sort((z,G)=>G.totalVersions-z.totalVersions)}async function S(E=50){return(await j(5)).slice(0,E)}async function V(E){try{let q=E.lastIndexOf("@");if(q===-1){let J=E;if(!Z(J))return{isValid:!1,error:`Unknown package: ${J}`};return{isValid:!0,packageName:J}}let H=E.slice(0,q),z=E.slice(q+1);if(!Z(H))return{isValid:!1,error:`Unknown package: ${H}`};if(z==="latest")return{isValid:!0,packageName:H,version:z};if(!await C(H,z))return{isValid:!1,packageName:H,version:z,error:`Version ${z} not available for package ${H}`};return{isValid:!0,packageName:H,version:z}}catch{return{isValid:!1,error:`Invalid package specification: ${E}`}}}function d(E,q){if(!q||q.length===0)return null;let H=[...q].sort((O,R)=>{let U=O.split(".").map(Number),X=R.split(".").map(Number);for(let W=0;W<Math.max(U.length,X.length);W++){let A=U[W]||0,B=X[W]||0;if(A!==B)return B-A}return 0}),z=E.replace(/^[\^~]/,""),G=z.split("."),K=Number.parseInt(G[0],10),J=Number.parseInt(G[1]||"0",10);if(E.startsWith("^"))return H.filter((R)=>{return Number.parseInt(R.split(".")[0],10)===K})[0]||null;if(E.startsWith("~"))return H.filter((R)=>{let U=R.split("."),X=Number.parseInt(U[0],10),W=Number.parseInt(U[1]||"0",10);return X===K&&W===J})[0]||null;if(H.includes(z))return z;return H.filter((O)=>O.startsWith(z))[0]||H[0]||null}
1
+ import{Lb as I,Mb as T}from"./chunk-rtr3z1q1.js";import{Nb as _,Ob as w}from"./chunk-s0s1vx8j.js";import{Sb as y,Vb as M}from"./chunk-rjpqpn2z.js";w();async function Y(){try{let{packages:E}=await import("./chunk-hb9sfmr4.js");return E}catch{return{}}}async function F(E){let q=Z(E);if(!q)return null;let z=(await Y())[q];if(!z||!z.versions||z.versions.length===0)return null;return z.versions[0]}async function x(E){let q=Z(E);if(!q)return[];let z=(await Y())[q];if(!z||!z.versions)return[];return[...z.versions]}function f(E={}){let q=["8.4.11","8.3.14","8.2.26","8.1.30"],H=E.fallbackVersions||q;try{let{pantry:z}=(T(),y(I)),G=z.phpnet||z.php;if(!G||!G.versions||G.versions.length===0)return H;let K=[...G.versions],J=E.supportedBranches||D(K),Q=new Map;for(let R of K){let[U,X]=R.split(".");if(!U||!X)continue;let W=`${U}.${X}`;if(J.includes(W)&&!Q.has(W))Q.set(W,R)}let O=J.map((R)=>Q.get(R)).filter(Boolean);return O.length>0?O:H}catch{return H}}function D(E){let q=new Map;for(let z of E){let[G,K]=z.split(".");if(!G||!K)continue;let J=`${G}.${K}`;q.set(J,(q.get(J)||0)+1)}return Array.from(q.keys()).filter((z)=>{let[G]=z.split(".");return G==="8"&&q.get(z)>3}).sort((z,G)=>{let[K,J]=z.split(".").map(Number),[Q,O]=G.split(".").map(Number);if(K!==Q)return Q-K;return O-J}).slice(0,4)}async function C(E,q){return(await x(E)).includes(q)}async function h(E,q="latest"){if(q==="latest")return await F(E);let H=await x(E);if(H.length===0)return null;if(H.includes(q))return q;if(q.startsWith("^")){let G=q.slice(1).split(".")[0];return H.filter((J)=>J.startsWith(`${G}.`))[0]||null}if(q.startsWith("~")){let z=q.slice(1),[G,K]=z.split("."),J=`${G}.${K}.`;return H.filter((O)=>O.startsWith(J))[0]||null}if(q.startsWith(">=")){let G=q.slice(2).split(".").map(Number);return H.filter((J)=>{let Q=J.split(".").map(Number);for(let O=0;O<Math.max(Q.length,G.length);O++){let R=Q[O]??0,U=G[O]??0;if(R>U)return!0;if(R<U)return!1}return!0})[0]||null}return await F(E)}async function $(E){let q=Z(E);if(!q)return null;let z=(await Y())[q];if(!z)return null;let G=await F(E);if(!G)return null;return{name:String(E),domain:q,description:z.description||"",latestVersion:G,totalVersions:z.versions?.length||0,programs:[...z.programs||[]],dependencies:[...z.dependencies||[]],companions:[...z.companions||[]],versions:[...z.versions||[]]}}function Z(E){let q=String(E);if(q in _){let H=_[q];return L(H)}return L(q)}function L(E){if(E.includes("/")){let[q,...H]=E.split("/"),z=H.join("/"),G=q.replace(/\./g,""),K=z.replace(/[/\-_.]/g,"").toLowerCase();return`${G}${K}`.toLowerCase()}return E.replace(/[.\-_]/g,"").toLowerCase()}async function N(E){let q=[],H=E.toLowerCase();for(let[G,K]of Object.entries(_))if(G.toLowerCase().includes(H)){let J=await $(G);if(J)q.push(J)}let z=await Y();for(let[G,K]of Object.entries(z))if(G.toLowerCase().includes(H)||K.description?.toLowerCase().includes(H)){let J=await $(G);if(J&&!q.some((Q)=>Q.domain===G))q.push(J)}return q}async function P(E){let q=[],H=await Y();for(let z of Object.keys(H))if(E.test(z)){let G=await $(z);if(G)q.push(G)}return q}async function j(E=10){let q=[],H=await Y();for(let z of Object.keys(H)){let G=await $(z);if(G&&G.totalVersions>=E)q.push(G)}return q.sort((z,G)=>G.totalVersions-z.totalVersions)}async function S(E=50){return(await j(5)).slice(0,E)}async function V(E){try{let q=E.lastIndexOf("@");if(q===-1){let J=E;if(!Z(J))return{isValid:!1,error:`Unknown package: ${J}`};return{isValid:!0,packageName:J}}let H=E.slice(0,q),z=E.slice(q+1);if(!Z(H))return{isValid:!1,error:`Unknown package: ${H}`};if(z==="latest")return{isValid:!0,packageName:H,version:z};if(!await C(H,z))return{isValid:!1,packageName:H,version:z,error:`Version ${z} not available for package ${H}`};return{isValid:!0,packageName:H,version:z}}catch{return{isValid:!1,error:`Invalid package specification: ${E}`}}}function d(E,q){if(!q||q.length===0)return null;let H=[...q].sort((O,R)=>{let U=O.split(".").map(Number),X=R.split(".").map(Number);for(let W=0;W<Math.max(U.length,X.length);W++){let A=U[W]||0,B=X[W]||0;if(A!==B)return B-A}return 0}),z=E.replace(/^[\^~]/,""),G=z.split("."),K=Number.parseInt(G[0],10),J=Number.parseInt(G[1]||"0",10);if(E.startsWith("^"))return H.filter((R)=>{return Number.parseInt(R.split(".")[0],10)===K})[0]||null;if(E.startsWith("~"))return H.filter((R)=>{let U=R.split("."),X=Number.parseInt(U[0],10),W=Number.parseInt(U[1]||"0",10);return X===K&&W===J})[0]||null;if(H.includes(z))return z;return H.filter((O)=>O.startsWith(z))[0]||H[0]||null}
2
2
  export{F as wb,x as xb,f as yb,C as zb,h as Ab,$ as Bb,Z as Cb,N as Db,P as Eb,j as Fb,S as Gb,V as Hb,d as Ib};
@@ -1 +1 @@
1
- import{Jb as b,Kb as c,Mb as d}from"./chunk-z7v78f5q.js";import{Nb as a}from"./chunk-s0s1vx8j.js";import"./chunk-rjpqpn2z.js";d();export{b as pantry,c as packages,a as aliases};
1
+ import{Jb as b,Kb as c,Mb as d}from"./chunk-rtr3z1q1.js";import{Nb as a}from"./chunk-s0s1vx8j.js";import"./chunk-rjpqpn2z.js";d();export{b as pantry,c as packages,a as aliases};