ts-pantry 0.11.144 → 0.11.145

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 (44) hide show
  1. package/dist/bin/cli.js +3 -3
  2. package/dist/bin/desktop.js +1 -1
  3. package/dist/{chunk-eh44n2cy.js → chunk-0dr09n6t.js} +1 -1
  4. package/dist/chunk-0y2671yw.js +528 -0
  5. package/dist/{chunk-n7b9nk9x.js → chunk-1e62ct8j.js} +1 -1
  6. package/dist/chunk-6nmn1zbg.js +1 -0
  7. package/dist/{chunk-903jj630.js → chunk-9bfnpnzd.js} +1 -1
  8. package/dist/{chunk-e9vjv0jw.js → chunk-fzr830kg.js} +1 -1
  9. package/dist/chunk-m0gz72mn.js +1 -0
  10. package/dist/{chunk-aw424hgb.js → chunk-z9wb2cyn.js} +1 -1
  11. package/dist/generated-package-names.d.ts +28 -28
  12. package/dist/src/index.js +1 -1
  13. package/dist/src/packages/apps/zeddev.d.ts +2 -2
  14. package/dist/src/packages/biomejsdev.d.ts +3 -3
  15. package/dist/src/packages/bitcoinorg.d.ts +3 -3
  16. package/dist/src/packages/circlecicom.d.ts +3 -3
  17. package/dist/src/packages/cnqueryio.d.ts +3 -3
  18. package/dist/src/packages/codercom.d.ts +3 -3
  19. package/dist/src/packages/craft-native.org.d.ts +3 -3
  20. package/dist/src/packages/digitalocean.com/doctl.d.ts +3 -3
  21. package/dist/src/packages/flyio.d.ts +3 -3
  22. package/dist/src/packages/github.com/ggerganov/llama.cpp.d.ts +3 -3
  23. package/dist/src/packages/github.com/krzysztofzablocki/Sourcery.d.ts +3 -3
  24. package/dist/src/packages/github.com/router-for-me/CLIProxyAPI.d.ts +3 -3
  25. package/dist/src/packages/hatchpypaio.d.ts +3 -3
  26. package/dist/src/packages/hurldev.d.ts +3 -3
  27. package/dist/src/packages/misejdxdev.d.ts +3 -3
  28. package/dist/src/packages/nodejsorg.d.ts +3 -3
  29. package/dist/src/packages/nomadprojectio.d.ts +3 -3
  30. package/dist/src/packages/odigosio.d.ts +3 -3
  31. package/dist/src/packages/opencodeai.d.ts +2 -2
  32. package/dist/src/packages/pipenvpypaio.d.ts +2 -2
  33. package/dist/src/packages/projenio.d.ts +3 -3
  34. package/dist/src/packages/pulumiio.d.ts +3 -3
  35. package/dist/src/packages/surrealdbcom.d.ts +2 -2
  36. package/dist/src/packages/terraformio.d.ts +3 -3
  37. package/dist/src/packages/tinygoorg.d.ts +3 -3
  38. package/dist/src/packages/toxwiki.d.ts +3 -3
  39. package/dist/src/packages/upxgithubio.d.ts +3 -3
  40. package/dist/src/packages/virtualenvpypaio.d.ts +3 -3
  41. package/package.json +1 -1
  42. package/dist/chunk-0g44sq79.js +0 -528
  43. package/dist/chunk-qscjg7zb.js +0 -1
  44. package/dist/chunk-xbe21bah.js +0 -1
package/dist/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{_,B}from"../chunk-eh44n2cy.js";import{a,U,r,h,f,C,J,ye,b,q,D,R,X,ke,ve,n,Z,A,d,ae,I,z,L,O,l,te,Ce,je,Se,ua,ha}from"../chunk-0g44sq79.js";import"../chunk-fyr7re9j.js";import"../chunk-63zdvbqd.js";import{ja}from"../chunk-76wpkhh6.js";import g from"node:fs";import x from"node:path";import s from"node:process";U();async function se(t="src/pantry"){if(!g.existsSync(t))throw Error(`Pantry directory not found: ${t}. Please run 'bun ./bin/cli.ts update-pantry' first.`);let e=[];function o(i,c=""){let u=g.readdirSync(i,{withFileTypes:!0}),p=x.join(i,"package.yml");if(c&&g.existsSync(p))e.push(c);for(let w of u)if(w.isDirectory()&&!w.name.startsWith(".")){let k=c?`${c}/${w.name}`:w.name,S=x.join(i,w.name);o(S,k)}}return o(t),console.log(`\uD83D\uDCE6 Found ${e.length} packages in local pantry`),e.sort()}async function ce(t=!1){async function e(p){let w=new URL("https://s3.amazonaws.com/dist.tea.xyz/");if(w.searchParams.set("list-type","2"),w.searchParams.set("prefix",""),w.searchParams.set("max-keys","1000"),p)w.searchParams.set("continuation-token",p);let k=await fetch(w.toString());if(!k.ok)throw Error(`Failed to fetch S3 listing: ${k.status}`);let S=await k.text(),M=[],G=S.match(/<Key>([^<]+)<\/Key>/g);if(G)for(let H of G){let N=H.replace(/<Key>([^<]+)<\/Key>/,"$1");M.push({Key:N})}let y=S.includes("<IsTruncated>true</IsTruncated>"),j=S.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/),m=j?j[1]:void 0;return{IsTruncated:y,NextContinuationToken:m,Contents:M}}console.log("Scraping packages from S3 registry...");let o=new Set,i;do{let p=await e(i);for(let w of p.Contents){let k=w.Key,S=k.split("/");if(S.length===0)continue;if(S[0].startsWith(".")||S[0].includes(" ")||k.match(/\.(md|txt|yml|yaml|json)$/i))continue;let M=["darwin","linux","windows"],G=-1;for(let y=1;y<S.length;y++)if(M.includes(S[y])){G=y;break}if(G>0){let y=S.slice(0,G).join("/");if(y.includes("."))o.add(y)}else if(S.length>=2&&S[0].includes(".")&&!S[1].startsWith("v")&&!S[1].match(/^\d/)){let y=`${S[0]}/${S[1]}`;o.add(y)}else if(S.length>=1&&S[0].includes("."))o.add(S[0])}i=p.NextContinuationToken,console.log(`Found ${o.size} packages so far...`)}while(i);let c=Array.from(o).sort(),u=[];for(let p of c){if(!p.includes(".")||p.match(/^[a-z0-9.-]+\.[a-z]{2,}(\/[\w.-]+){0,20}$/i)===null)continue;if(p.endsWith("/README.rst")||p.endsWith("/README")||p.includes("/docs/"))continue;if(p.endsWith("/.pkgroot"))continue;if(["amazon.com/aws","charm.sh","code.videolan.org","crates.io"].includes(p))continue;u.push(p)}return console.log(`\uD83D\uDCE6 Found ${u.length} valid packages in registry`),u}async function le(t,e){let i=`/**
2
+ import{_,B}from"../chunk-0dr09n6t.js";import{a,U,r,h,f,C,J,ye,b,q,D,R,X,ke,ve,n,Z,A,d,ae,I,z,L,O,l,te,Ce,je,Se,ua,ha}from"../chunk-0y2671yw.js";import"../chunk-fyr7re9j.js";import"../chunk-63zdvbqd.js";import{ja}from"../chunk-76wpkhh6.js";import g from"node:fs";import x from"node:path";import s from"node:process";U();async function se(t="src/pantry"){if(!g.existsSync(t))throw Error(`Pantry directory not found: ${t}. Please run 'bun ./bin/cli.ts update-pantry' first.`);let e=[];function o(i,c=""){let u=g.readdirSync(i,{withFileTypes:!0}),p=x.join(i,"package.yml");if(c&&g.existsSync(p))e.push(c);for(let w of u)if(w.isDirectory()&&!w.name.startsWith(".")){let k=c?`${c}/${w.name}`:w.name,S=x.join(i,w.name);o(S,k)}}return o(t),console.log(`\uD83D\uDCE6 Found ${e.length} packages in local pantry`),e.sort()}async function ce(t=!1){async function e(p){let w=new URL("https://s3.amazonaws.com/dist.tea.xyz/");if(w.searchParams.set("list-type","2"),w.searchParams.set("prefix",""),w.searchParams.set("max-keys","1000"),p)w.searchParams.set("continuation-token",p);let k=await fetch(w.toString());if(!k.ok)throw Error(`Failed to fetch S3 listing: ${k.status}`);let S=await k.text(),M=[],G=S.match(/<Key>([^<]+)<\/Key>/g);if(G)for(let H of G){let N=H.replace(/<Key>([^<]+)<\/Key>/,"$1");M.push({Key:N})}let y=S.includes("<IsTruncated>true</IsTruncated>"),j=S.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/),m=j?j[1]:void 0;return{IsTruncated:y,NextContinuationToken:m,Contents:M}}console.log("Scraping packages from S3 registry...");let o=new Set,i;do{let p=await e(i);for(let w of p.Contents){let k=w.Key,S=k.split("/");if(S.length===0)continue;if(S[0].startsWith(".")||S[0].includes(" ")||k.match(/\.(md|txt|yml|yaml|json)$/i))continue;let M=["darwin","linux","windows"],G=-1;for(let y=1;y<S.length;y++)if(M.includes(S[y])){G=y;break}if(G>0){let y=S.slice(0,G).join("/");if(y.includes("."))o.add(y)}else if(S.length>=2&&S[0].includes(".")&&!S[1].startsWith("v")&&!S[1].match(/^\d/)){let y=`${S[0]}/${S[1]}`;o.add(y)}else if(S.length>=1&&S[0].includes("."))o.add(S[0])}i=p.NextContinuationToken,console.log(`Found ${o.size} packages so far...`)}while(i);let c=Array.from(o).sort(),u=[];for(let p of c){if(!p.includes(".")||p.match(/^[a-z0-9.-]+\.[a-z]{2,}(\/[\w.-]+){0,20}$/i)===null)continue;if(p.endsWith("/README.rst")||p.endsWith("/README")||p.includes("/docs/"))continue;if(p.endsWith("/.pkgroot"))continue;if(["amazon.com/aws","charm.sh","code.videolan.org","crates.io"].includes(p))continue;u.push(p)}return console.log(`\uD83D\uDCE6 Found ${u.length} valid packages in registry`),u}async function le(t,e){let i=`/**
3
3
  * Constants used throughout the ts-pantry package
4
4
  * This file is auto-generated from ${e}. Do not edit manually.
5
5
  * Generated on ${new Date().toISOString()}
@@ -62,9 +62,9 @@ ${c.join(`
62
62
  Conflicts found:`),y.conflicts.forEach((m)=>{console.log(` ${m.package}: ${m.versions.join(", ")}`)});if(console.log(`
63
63
  \uD83D\uDCCB All unique packages to install:`),y.uniquePackages.forEach((m,H)=>{let N=y.allDependencies.find((F)=>F.name===m),v=N&&N.version&&N.version!=="latest"?` (${N.version})`:"";console.log(` ${H+1}. ${m}${v}`)}),S)console.log(`
64
64
  \uD83D\uDE80 Install command:`),console.log(`pantry install ${y.uniquePackages.join(" ")}`);if(Object.values(y.osSpecificDeps).reduce((m,H)=>m+H.length,0)>0)console.log(`
65
- \uD83D\uDDA5️ OS-specific dependencies:`),Object.entries(y.osSpecificDeps).forEach(([m,H])=>{if(H.length>0)console.log(` ${m}: ${H.map((N)=>N.name).join(", ")}`)})}s.exit(0)}catch(o){if(e.json){let i={success:!1,error:String(o),timestamp:new Date().toISOString()};console.log(JSON.stringify(i))}else console.error("Error resolving dependencies:",o);s.exit(1)}});E.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(t)=>{try{let{getPhpVersionsForWorkflow:e}=await import("../chunk-n7b9nk9x.js"),o={};if(t.branches)o.supportedBranches=t.branches.split(",").map((c)=>c.trim());if(t.fallback)o.fallbackVersions=t.fallback.split(",").map((c)=>c.trim());let i=e(o);switch(t.format.toLowerCase()){case"yaml":console.log(`php_versions:
65
+ \uD83D\uDDA5️ OS-specific dependencies:`),Object.entries(y.osSpecificDeps).forEach(([m,H])=>{if(H.length>0)console.log(` ${m}: ${H.map((N)=>N.name).join(", ")}`)})}s.exit(0)}catch(o){if(e.json){let i={success:!1,error:String(o),timestamp:new Date().toISOString()};console.log(JSON.stringify(i))}else console.error("Error resolving dependencies:",o);s.exit(1)}});E.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(t)=>{try{let{getPhpVersionsForWorkflow:e}=await import("../chunk-1e62ct8j.js"),o={};if(t.branches)o.supportedBranches=t.branches.split(",").map((c)=>c.trim());if(t.fallback)o.fallbackVersions=t.fallback.split(",").map((c)=>c.trim());let i=e(o);switch(t.format.toLowerCase()){case"yaml":console.log(`php_versions:
66
66
  ${i.map((c)=>` - "${c}"`).join(`
67
- `)}`);break;case"csv":console.log(i.join(","));break;case"json":default:console.log(JSON.stringify(i));break}s.exit(0)}catch(e){console.error("Error getting PHP versions:",e),s.exit(1)}});E.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(t)=>{try{let{generateZigDefinitions:e,generateZigAliases:o}=await import("../chunk-qscjg7zb.js"),{packagesDir:i="src/packages",output:c="packages.zig",aliases:u=!1,aliasesOutput:p="aliases.zig"}=t;if(console.log("\uD83D\uDE80 Generating Zig package definitions..."),await e(i,c),u)console.log(`
67
+ `)}`);break;case"csv":console.log(i.join(","));break;case"json":default:console.log(JSON.stringify(i));break}s.exit(0)}catch(e){console.error("Error getting PHP versions:",e),s.exit(1)}});E.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(t)=>{try{let{generateZigDefinitions:e,generateZigAliases:o}=await import("../chunk-m0gz72mn.js"),{packagesDir:i="src/packages",output:c="packages.zig",aliases:u=!1,aliasesOutput:p="aliases.zig"}=t;if(console.log("\uD83D\uDE80 Generating Zig package definitions..."),await e(i,c),u)console.log(`
68
68
  \uD83D\uDE80 Generating Zig package aliases...`),await o(i,p);console.log(`
69
69
  ✅ Zig code generation complete!`),s.exit(0)}catch(e){console.error("Error generating Zig definitions:",e),s.exit(1)}});E.command("release [type]","Release a Zig package (changelog, bump, commit, tag, push, publish)").option("-y, --yes","Non-interactive mode (skip confirmation prompts)").option("--dry-run","Preview the release without changing anything").option("--no-changelog","Skip changelog generation").option("--no-push","Skip pushing the commit and tag").option("--no-publish","Skip publishing to the pantry registry").action(async(t,e)=>{let o=(t??"patch").toLowerCase();if(!["patch","minor","major"].includes(o))console.error(`error: invalid release type "${o}" (expected: patch | minor | major)`),s.exit(1);let{runRelease:i}=await import("../chunk-cwa30yjr.js"),c=await i({type:o,yes:e.yes,dryRun:e.dryRun,noChangelog:e.changelog===!1,noPush:e.push===!1,noPublish:e.publish===!1});s.exit(c.exitCode)});E.command("apps","List installed desktop applications with version info").option("-j, --json","Output as JSON").action(async(t)=>{try{let{scanInstalledApps:e}=await import("../chunk-359r0aep.js"),o=e();if(t.json)console.log(JSON.stringify({success:!0,apps:o,total:o.length}));else{console.log(`
70
70
  Installed Desktop Apps (${o.length}):
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import{_,B}from"../chunk-eh44n2cy.js";import"../chunk-63zdvbqd.js";import"../chunk-je6hvsr6.js";import{F,Y,ue,Re}from"../chunk-hnykqejt.js";import{chmodSync as h,mkdirSync as m,renameSync as v,rmSync as P,writeFileSync as k}from"node:fs";import{homedir as b}from"node:os";import{isAbsolute as S,join as s}from"node:path";var a=(t)=>t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;");function x(t,e,r){return`<?xml version="1.0" encoding="UTF-8"?>
2
+ import{_,B}from"../chunk-0dr09n6t.js";import"../chunk-63zdvbqd.js";import"../chunk-je6hvsr6.js";import{F,Y,ue,Re}from"../chunk-hnykqejt.js";import{chmodSync as h,mkdirSync as m,renameSync as v,rmSync as P,writeFileSync as k}from"node:fs";import{homedir as b}from"node:os";import{isAbsolute as S,join as s}from"node:path";var a=(t)=>t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;");function x(t,e,r){return`<?xml version="1.0" encoding="UTF-8"?>
3
3
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4
4
  <plist version="1.0"><dict>
5
5
  <key>Label</key><string>dev.pantry.desktop</string>
@@ -27,5 +27,5 @@ Received ${s}, cleaning up...`),e)try{await e()}catch(i){console.error("Error du
27
27
  `)),this.enableDidYouMean){let t=[];for(let i of this.commands){if(i.displayName)t.push(i.displayName);if(i.aliasNames)t.push(...i.aliasNames)}let s=q(e,t);if(s.length>0)console.log(C.yellow("Did you mean one of these?")),s.forEach((i)=>console.log(` ${C.dim("•")} ${this.name} ${i}`)),console.log("")}console.log(C.dim("Run"),`${this.name} --help`,C.dim("to see all available commands")),v.exit(1)}async parse(e=G,t={}){let{run:s=!0,exitOnError:i=!1}=t;if(i)try{return await this.parse(e,{run:s})}catch(n){throw this.handleUsageError(n),n}if(this.rawArgs=e,!this.name)this.name=e[1]?ne(e[1]):"cli";let o=!0,a=e.slice(2),h=a[0];if(h&&!h.startsWith("-")){for(let n of this.commands)if(n.isMatched(h)){let r=this.mri(a,n);o=!1;let u={...r,args:r.args.slice(1)};this.setParsedInfo(u,n,h),this.emit(`command:${h}`,n);break}if(o){let n=a[1];if(n&&!n.startsWith("-")){let r=`${h}:${n}`;for(let u of this.commands)if(u.isMatched(r)){let m=this.mri(a,u);o=!1;let l={...m,args:m.args.slice(2)};this.setParsedInfo(l,u,r),this.emit(`command:${r}`,u);break}}}}if(o){for(let n of this.commands)if(n.name===""){o=!1;let r=this.mri(a,n);this.setParsedInfo(r,n),this.emit("command:!",n);break}}if(o){let n=this.mri(e.slice(2));this.setParsedInfo(n)}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.options.interaction===!1)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||this.options.emoji===!1)this.useEmoji=!1;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache||this.options.cache===!1)this.isNoCache=!0;if(this.options.help&&this.showHelpOnExit)this.outputHelp(),s=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),s=!1,this.unsetMatchedCommand();let c={args:this.args,options:this.options};if(s)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return c}mri(e,t){let s=[...this.globalCommand.options,...t?t.options:[]],i=te(s),o=[],a=e.indexOf("--");if(a>-1)o=e.slice(a+1),e=e.slice(0,a);let h=le(e,i),c={_:h._};for(let l of Object.keys(h))if(l!=="_")c[I(l)]=h[l];let n=c._,r={"--":o},u=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,m=Object.create(null);for(let l of s){if(!u&&l.config.default!==void 0)for(let b of l.names)r[b]=l.config.default;if(Array.isArray(l.config.type)){if(m[l.name]===void 0)m[l.name]={shouldTransform:!0,transformFunction:l.config.type[0]}}}for(let l of Object.keys(c))if(l!=="_"){let b=l.split(".");se(r,b,c[l]),ie(r,m)}return{args:n,options:r}}async run(e=G){return this.parse(e,{run:!0,exitOnError:!0})}handleUsageError(e){if(!re(e)||e.isUsageError===!1)return;let t=e.message||"command-line error",s=this.name?`${this.name}: `:"",i=/--help/.test(t)?"":e.usage?`
28
28
  Usage: ${e.usage}`:`
29
29
  Run \`${this.name??"cli"} --help\` for usage.`;v.stderr.write(`${s}${t}${i}
30
- `),v.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:s}=this;if(!s||!s.commandAction)return;s.checkUnknownOptions(),s.checkOptionValue(),s.checkRequiredArgs();let i=[];s.args.forEach((c,n)=>{if(c.variadic)i.push(e.slice(n));else i.push(e[n])}),i.push(t);let o={command:s,args:i,options:t};for(let c of s.beforeHooks)await c(o);let a,h=async()=>{let c=s.commandAction.apply(this,i);if(c instanceof Promise)a=await c;else a=c;return a};if(s.middleware.length>0){let c=0,n=async()=>{if(c<s.middleware.length){let r=s.middleware[c++];await r({...o,next:n})}else await h()};await n()}else await h();for(let c of s.afterHooks)await c(o);return a}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return v.removeAllListeners("SIGINT"),v.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 J{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(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,s=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:s})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}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 e=Date.now();for(let[t,s]of this.cache.entries())if(e-s.timestamp>s.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var at=new J;function fe(){if("FORCE_COLOR"in S.env)return S.env.FORCE_COLOR!=="0";if("NO_COLOR"in S.env||S.env.TERM==="dumb")return!1;if(S.platform==="win32")return!0;return U.isatty(1)&&U.isatty(2)}var Q=fe();function p(e,t){if(!Q)return(s)=>s;return(s)=>e+s+t}var pe=p("\x1B[0m","\x1B[0m"),ge=p("\x1B[31m","\x1B[39m"),$e=p("\x1B[32m","\x1B[39m"),be=p("\x1B[33m","\x1B[39m"),ve=p("\x1B[34m","\x1B[39m"),we=p("\x1B[35m","\x1B[39m"),ye=p("\x1B[36m","\x1B[39m"),xe=p("\x1B[37m","\x1B[39m"),Ce=p("\x1B[90m","\x1B[39m"),Se=p("\x1B[1m","\x1B[22m"),Ie=p("\x1B[3m","\x1B[23m"),_e=p("\x1B[4m","\x1B[24m"),Oe=p("\x1B[2m","\x1B[22m"),ke=p("\x1B[7m","\x1B[27m"),Ee=p("\x1B[8m","\x1B[28m"),Be=p("\x1B[9m","\x1B[29m"),Te=p("\x1B[41m","\x1B[49m"),je=p("\x1B[42m","\x1B[49m"),Ve=p("\x1B[43m","\x1B[49m"),Ae=p("\x1B[44m","\x1B[49m"),Me=p("\x1B[45m","\x1B[49m"),Ne=p("\x1B[46m","\x1B[49m"),Re=p("\x1B[47m","\x1B[49m"),Le=Q,De={reset:pe,red:ge,green:$e,yellow:be,blue:ve,magenta:we,cyan:ye,white:xe,gray:Ce,bold:Se,italic:Ie,underline:_e,dim:Oe,inverse:ke,hidden:Ee,strikethrough:Be,bgRed:Te,bgGreen:je,bgYellow:Ve,bgBlue:Ae,bgMagenta:Me,bgCyan:Ne,bgWhite:Re,isColorSupported:Le},We=De,ze=["up","down","left","right","space","enter","cancel"],dt={actions:new Set(ze),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var ft=Pe.platform.startsWith("win"),pt=Symbol("clapp:cancel");var Fe=oe();var f=(e,t)=>Fe?e:t,gt=f("◆","*"),$t=f("■","x"),bt=f("▲","x"),vt=f("◇","o"),wt=f("┌","T"),He=f("│","|"),yt=f("└","—"),xt=f("●",">"),Ct=f("○"," "),St=f("◻","[•]"),It=f("◼","[+]"),_t=f("◻","[ ]"),Ot=f("▪","•"),kt=f("─","-"),Et=f("╮","+"),Bt=f("├","+"),Tt=f("╯","+"),jt=f("●","•"),Vt=f("◆","*"),At=f("▲","!"),Mt=f("■","x");var Nt={light:f("─","-"),heavy:f("━","="),block:f("█","#")};function Ge(){return`${We.gray(He)} `}var Rt=Ge();var B="0.11.144";
30
+ `),v.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:s}=this;if(!s||!s.commandAction)return;s.checkUnknownOptions(),s.checkOptionValue(),s.checkRequiredArgs();let i=[];s.args.forEach((c,n)=>{if(c.variadic)i.push(e.slice(n));else i.push(e[n])}),i.push(t);let o={command:s,args:i,options:t};for(let c of s.beforeHooks)await c(o);let a,h=async()=>{let c=s.commandAction.apply(this,i);if(c instanceof Promise)a=await c;else a=c;return a};if(s.middleware.length>0){let c=0,n=async()=>{if(c<s.middleware.length){let r=s.middleware[c++];await r({...o,next:n})}else await h()};await n()}else await h();for(let c of s.afterHooks)await c(o);return a}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return v.removeAllListeners("SIGINT"),v.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 J{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(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,s=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:s})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}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 e=Date.now();for(let[t,s]of this.cache.entries())if(e-s.timestamp>s.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var at=new J;function fe(){if("FORCE_COLOR"in S.env)return S.env.FORCE_COLOR!=="0";if("NO_COLOR"in S.env||S.env.TERM==="dumb")return!1;if(S.platform==="win32")return!0;return U.isatty(1)&&U.isatty(2)}var Q=fe();function p(e,t){if(!Q)return(s)=>s;return(s)=>e+s+t}var pe=p("\x1B[0m","\x1B[0m"),ge=p("\x1B[31m","\x1B[39m"),$e=p("\x1B[32m","\x1B[39m"),be=p("\x1B[33m","\x1B[39m"),ve=p("\x1B[34m","\x1B[39m"),we=p("\x1B[35m","\x1B[39m"),ye=p("\x1B[36m","\x1B[39m"),xe=p("\x1B[37m","\x1B[39m"),Ce=p("\x1B[90m","\x1B[39m"),Se=p("\x1B[1m","\x1B[22m"),Ie=p("\x1B[3m","\x1B[23m"),_e=p("\x1B[4m","\x1B[24m"),Oe=p("\x1B[2m","\x1B[22m"),ke=p("\x1B[7m","\x1B[27m"),Ee=p("\x1B[8m","\x1B[28m"),Be=p("\x1B[9m","\x1B[29m"),Te=p("\x1B[41m","\x1B[49m"),je=p("\x1B[42m","\x1B[49m"),Ve=p("\x1B[43m","\x1B[49m"),Ae=p("\x1B[44m","\x1B[49m"),Me=p("\x1B[45m","\x1B[49m"),Ne=p("\x1B[46m","\x1B[49m"),Re=p("\x1B[47m","\x1B[49m"),Le=Q,De={reset:pe,red:ge,green:$e,yellow:be,blue:ve,magenta:we,cyan:ye,white:xe,gray:Ce,bold:Se,italic:Ie,underline:_e,dim:Oe,inverse:ke,hidden:Ee,strikethrough:Be,bgRed:Te,bgGreen:je,bgYellow:Ve,bgBlue:Ae,bgMagenta:Me,bgCyan:Ne,bgWhite:Re,isColorSupported:Le},We=De,ze=["up","down","left","right","space","enter","cancel"],dt={actions:new Set(ze),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var ft=Pe.platform.startsWith("win"),pt=Symbol("clapp:cancel");var Fe=oe();var f=(e,t)=>Fe?e:t,gt=f("◆","*"),$t=f("■","x"),bt=f("▲","x"),vt=f("◇","o"),wt=f("┌","T"),He=f("│","|"),yt=f("└","—"),xt=f("●",">"),Ct=f("○"," "),St=f("◻","[•]"),It=f("◼","[+]"),_t=f("◻","[ ]"),Ot=f("▪","•"),kt=f("─","-"),Et=f("╮","+"),Bt=f("├","+"),Tt=f("╯","+"),jt=f("●","•"),Vt=f("◆","*"),At=f("▲","!"),Mt=f("■","x");var Nt={light:f("─","-"),heavy:f("━","="),block:f("█","#")};function Ge(){return`${We.gray(He)} `}var Rt=Ge();var B="0.11.145";
31
31
  export{_,B};