@socketsecurity/lib 3.2.6 → 3.2.8

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 (45) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/constants/node.js +1 -1
  3. package/dist/constants/packages.js +4 -4
  4. package/dist/external/@inquirer/confirm.js +3199 -18
  5. package/dist/external/@inquirer/input.js +3223 -18
  6. package/dist/external/@inquirer/password.js +3331 -18
  7. package/dist/external/@inquirer/search.js +3328 -21
  8. package/dist/external/@inquirer/select.js +3445 -21
  9. package/dist/external/@npmcli/package-json/lib/read-package.js +149 -2
  10. package/dist/external/@npmcli/package-json/lib/sort.js +96 -1
  11. package/dist/external/@npmcli/package-json.js +16758 -13
  12. package/dist/external/@npmcli/promise-spawn.js +480 -1
  13. package/dist/external/@socketregistry/is-unicode-supported.js +42 -1
  14. package/dist/external/@socketregistry/packageurl-js.js +6493 -2
  15. package/dist/external/@socketregistry/yocto-spinner.js +460 -4
  16. package/dist/external/@yarnpkg/extensions.js +1025 -1
  17. package/dist/external/cacache.js +13016 -12
  18. package/dist/external/debug.js +27 -1
  19. package/dist/external/del.js +7088 -2
  20. package/dist/external/fast-glob.js +5721 -2
  21. package/dist/external/fast-sort.js +140 -1
  22. package/dist/external/get-east-asian-width.js +90 -1
  23. package/dist/external/libnpmexec.js +33 -1
  24. package/dist/external/libnpmpack.js +67595 -129
  25. package/dist/external/make-fetch-happen.js +22595 -21
  26. package/dist/external/normalize-package-data.js +4474 -2
  27. package/dist/external/npm-package-arg.js +4511 -2
  28. package/dist/external/pacote.js +50270 -57
  29. package/dist/external/picomatch.js +1520 -1
  30. package/dist/external/semver.js +1930 -1
  31. package/dist/external/spdx-correct.js +1380 -1
  32. package/dist/external/spdx-expression-parse.js +1043 -1
  33. package/dist/external/streaming-iterables.js +1056 -1
  34. package/dist/external/validate-npm-package-name.js +100 -1
  35. package/dist/external/which.js +258 -1
  36. package/dist/external/yargs-parser.js +1075 -1
  37. package/dist/external/yoctocolors-cjs.js +88 -1
  38. package/dist/external/zod.js +15207 -13
  39. package/dist/lifecycle-script-names.js +3 -4
  40. package/dist/maintained-node-versions.js +3 -4
  41. package/dist/package-default-node-range.js +4 -5
  42. package/dist/package-default-socket-categories.js +3 -4
  43. package/dist/package-extensions.js +3 -4
  44. package/dist/utils/get-ipc.js +3 -5
  45. package/package.json +1 -1
@@ -3,4 +3,483 @@
3
3
  * Bundled from @npmcli/promise-spawn
4
4
  * This is a zero-dependency bundle created by esbuild.
5
5
  */
6
- "use strict";var Z=Object.defineProperty;var c=(e,t)=>Z(e,"name",{value:t,configurable:!0});var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var P=g(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.sync=x.isexe=void 0;var k=require("fs"),ee=require("fs/promises"),te=c(async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return b(await(0,ee.stat)(e),t)}catch(n){let s=n;if(r||s.code==="EACCES")return!1;throw s}},"isexe");x.isexe=te;var re=c((e,t={})=>{let{ignoreErrors:r=!1}=t;try{return b((0,k.statSync)(e),t)}catch(n){let s=n;if(r||s.code==="EACCES")return!1;throw s}},"sync");x.sync=re;var b=c((e,t)=>e.isFile()&&se(e,t),"checkStat"),se=c((e,t)=>{let r=t.uid??process.getuid?.(),n=t.groups??process.getgroups?.()??[],s=t.gid??process.getgid?.()??n[0];if(r===void 0||s===void 0)throw new Error("cannot get uid or gid");let o=new Set([s,...n]),i=e.mode,h=e.uid,w=e.gid,l=parseInt("100",8),d=parseInt("010",8),E=parseInt("001",8),f=l|d;return!!(i&E||i&d&&o.has(w)||i&l&&h===r||i&f&&r===0)},"checkMode")});var m=g(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.sync=y.isexe=void 0;var ne=require("fs"),oe=require("fs/promises"),ce=c(async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return S(await(0,oe.stat)(e),e,t)}catch(n){let s=n;if(r||s.code==="EACCES")return!1;throw s}},"isexe");y.isexe=ce;var ie=c((e,t={})=>{let{ignoreErrors:r=!1}=t;try{return S((0,ne.statSync)(e),e,t)}catch(n){let s=n;if(r||s.code==="EACCES")return!1;throw s}},"sync");y.sync=ie;var ae=c((e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,n=r.split(";");if(n.indexOf("")!==-1)return!0;for(let s=0;s<n.length;s++){let o=n[s].toLowerCase(),i=e.substring(e.length-o.length).toLowerCase();if(o&&i===o)return!0}return!1},"checkPathExt"),S=c((e,t,r)=>e.isFile()&&ae(t,r),"checkStat")});var C=g(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0})});var M=g(u=>{"use strict";var j=u&&u.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:c(function(){return t[r]},"get")}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),ue=u&&u.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),A=u&&u.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&j(t,e,r);return ue(t,e),t},le=u&&u.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&j(t,e,r)};Object.defineProperty(u,"__esModule",{value:!0});u.sync=u.isexe=u.posix=u.win32=void 0;var T=A(P());u.posix=T;var q=A(m());u.win32=q;le(C(),u);var fe=process.env._ISEXE_TEST_PLATFORM_||process.platform,$=fe==="win32"?q:T;u.isexe=$.isexe;u.sync=$.sync});var D=g((Me,N)=>{var{isexe:he,sync:pe}=M(),{join:de,delimiter:Ee,sep:R,posix:L}=require("path"),B=process.platform==="win32",H=new RegExp(`[${L.sep}${R===L.sep?"":R}]`.replace(/(\\)/g,"\\$1")),we=new RegExp(`^\\.${H.source}`),I=c(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),W=c((e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=Ee})=>{let s=e.match(H)?[""]:[...B?[process.cwd()]:[],...(t||"").split(n)];if(B){let o=r||[".EXE",".CMD",".BAT",".COM"].join(n),i=o.split(n).flatMap(h=>[h,h.toLowerCase()]);return e.includes(".")&&i[0]!==""&&i.unshift(""),{pathEnv:s,pathExt:i,pathExtExe:o}}return{pathEnv:s,pathExt:[""]}},"getPathInfo"),X=c((e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&we.test(t)?t.slice(0,2):"")+de(r,t)},"getPathPart"),F=c(async(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:s}=W(e,t),o=[];for(let i of r){let h=X(i,e);for(let w of n){let l=h+w;if(await he(l,{pathExt:s,ignoreErrors:!0})){if(!t.all)return l;o.push(l)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw I(e)},"which"),ge=c((e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:s}=W(e,t),o=[];for(let i of r){let h=X(i,e);for(let w of n){let l=h+w;if(pe(l,{pathExt:s,ignoreErrors:!0})){if(!t.all)return l;o.push(l)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw I(e)},"whichSync");N.exports=F;F.sync=ge});var K=g((Le,G)=>{"use strict";var xe=c((e,t)=>{if(!e.length)return'""';let r;if(!/[ \t\n\v"]/.test(e))r=e;else{r='"';for(let n=0;n<=e.length;++n){let s=0;for(;e[n]==="\\";)++n,++s;if(n===e.length){r+="\\".repeat(s*2);break}e[n]==='"'?(r+="\\".repeat(s*2+1),r+=e[n]):(r+="\\".repeat(s),r+=e[n])}r+='"'}return r=r.replace(/[ !%^&()<>|"]/g,"^$&"),t&&(r=r.replace(/[ !%^&()<>|"]/g,"^$&")),r},"cmd"),ye=c(e=>e.length?/[\t\n\r "#$&'()*;<>?\\`|~]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`.replace(/^(?:'')+(?!$)/,"").replace(/\\'''/g,"\\'"):e:"''","sh");G.exports={cmd:xe,sh:ye}});var J=g((He,z)=>{"use strict";var{spawn:ve}=require("child_process"),_e=require("os"),be=D(),Q=K(),_=c((e,t,r={},n={})=>{if(r.shell)return V(e,t,r,n);let s,o,i=new Promise((a,p)=>{s=a,o=p}),h=new Error("command failed"),w=[],l=[],d=c(a=>({cmd:e,args:t,...a,...Se(w,l,r),...n}),"getResult"),E=c((a,p)=>{let Y=d(p);o(Object.assign(a,Y))},"rejectWithOpts"),f=ve(e,t,r);return i.stdin=f.stdin,i.process=f,f.on("error",E),f.stdout&&(f.stdout.on("data",a=>w.push(a)),f.stdout.on("error",E)),f.stderr&&(f.stderr.on("data",a=>l.push(a)),f.stderr.on("error",E)),f.on("close",(a,p)=>{a||p?E(h,{code:a,signal:p}):s(d({code:a,signal:p}))}),i},"promiseSpawn"),V=c((e,t,r,n)=>{let s=r.shell;s===!0&&(s=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"sh");let o={...r,shell:!1},i=[],h=e;if(/(?:^|\\)cmd(?:\.exe)?$/i.test(s)){let l=!1,d="",E=!1;for(let a=0;a<e.length;++a){let p=e.charAt(a);if(p===" "&&!E)break;d+=p,(p==='"'||p==="'")&&(E=!E)}let f;try{f=be.sync(d,{path:o.env&&U(o.env,"PATH")||process.env.PATH,pathext:o.env&&U(o.env,"PATHEXT")||process.env.PATHEXT}).toLowerCase()}catch{f=d.toLowerCase()}l=f.endsWith(".cmd")||f.endsWith(".bat");for(let a of t)h+=` ${Q.cmd(a,l)}`;i.push("/d","/s","/c",h),o.windowsVerbatimArguments=!0}else{for(let l of t)h+=` ${Q.sh(l)}`;i.push("-c",h)}return _(s,i,o,n)},"spawnWithShell"),Pe=c((e,t={},r={})=>{let n={...t,shell:!0},s=[].concat(e),o=process.platform;if(o==="linux"&&_e.release().toLowerCase().includes("microsoft")&&(o="wsl",!process.env.BROWSER))return Promise.reject(new Error("Set the BROWSER environment variable to your desired browser."));let i=n.command;return i||(o==="win32"?(n.shell=process.env.ComSpec,i='start ""'):o==="wsl"?i="sensible-browser":o==="darwin"?i="open":i="xdg-open"),V(i,s,n,r)},"open");_.open=Pe;var v=c((e="pipe",t)=>e==="pipe"||e===null?!0:Array.isArray(e)?v(e[t],t):!1,"isPipe"),Se=c((e,t,{stdioString:r=!0,stdio:n})=>{let s={stdout:null,stderr:null};return v(n,1)&&(s.stdout=Buffer.concat(e),r&&(s.stdout=s.stdout.toString().trim())),v(n,2)&&(s.stderr=Buffer.concat(t),r&&(s.stderr=s.stderr.toString().trim())),s},"stdioResult"),U=c((e,t)=>{t=t.toLowerCase();for(let r of Object.keys(e).sort())if(r.toLowerCase()===t)return e[r]},"findInObject");z.exports=_});module.exports=J();
6
+ "use strict";
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+
14
+ // node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js
15
+ var require_posix = __commonJS({
16
+ "node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js"(exports2) {
17
+ "use strict";
18
+ Object.defineProperty(exports2, "__esModule", { value: true });
19
+ exports2.sync = exports2.isexe = void 0;
20
+ var fs_1 = require("fs");
21
+ var promises_1 = require("fs/promises");
22
+ var isexe = /* @__PURE__ */ __name(async (path, options = {}) => {
23
+ const { ignoreErrors = false } = options;
24
+ try {
25
+ return checkStat(await (0, promises_1.stat)(path), options);
26
+ } catch (e) {
27
+ const er = e;
28
+ if (ignoreErrors || er.code === "EACCES")
29
+ return false;
30
+ throw er;
31
+ }
32
+ }, "isexe");
33
+ exports2.isexe = isexe;
34
+ var sync = /* @__PURE__ */ __name((path, options = {}) => {
35
+ const { ignoreErrors = false } = options;
36
+ try {
37
+ return checkStat((0, fs_1.statSync)(path), options);
38
+ } catch (e) {
39
+ const er = e;
40
+ if (ignoreErrors || er.code === "EACCES")
41
+ return false;
42
+ throw er;
43
+ }
44
+ }, "sync");
45
+ exports2.sync = sync;
46
+ var checkStat = /* @__PURE__ */ __name((stat, options) => stat.isFile() && checkMode(stat, options), "checkStat");
47
+ var checkMode = /* @__PURE__ */ __name((stat, options) => {
48
+ const myUid = options.uid ?? process.getuid?.();
49
+ const myGroups = options.groups ?? process.getgroups?.() ?? [];
50
+ const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
51
+ if (myUid === void 0 || myGid === void 0) {
52
+ throw new Error("cannot get uid or gid");
53
+ }
54
+ const groups = /* @__PURE__ */ new Set([myGid, ...myGroups]);
55
+ const mod = stat.mode;
56
+ const uid = stat.uid;
57
+ const gid = stat.gid;
58
+ const u = parseInt("100", 8);
59
+ const g = parseInt("010", 8);
60
+ const o = parseInt("001", 8);
61
+ const ug = u | g;
62
+ return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0);
63
+ }, "checkMode");
64
+ }
65
+ });
66
+
67
+ // node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/win32.js
68
+ var require_win32 = __commonJS({
69
+ "node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/win32.js"(exports2) {
70
+ "use strict";
71
+ Object.defineProperty(exports2, "__esModule", { value: true });
72
+ exports2.sync = exports2.isexe = void 0;
73
+ var fs_1 = require("fs");
74
+ var promises_1 = require("fs/promises");
75
+ var isexe = /* @__PURE__ */ __name(async (path, options = {}) => {
76
+ const { ignoreErrors = false } = options;
77
+ try {
78
+ return checkStat(await (0, promises_1.stat)(path), path, options);
79
+ } catch (e) {
80
+ const er = e;
81
+ if (ignoreErrors || er.code === "EACCES")
82
+ return false;
83
+ throw er;
84
+ }
85
+ }, "isexe");
86
+ exports2.isexe = isexe;
87
+ var sync = /* @__PURE__ */ __name((path, options = {}) => {
88
+ const { ignoreErrors = false } = options;
89
+ try {
90
+ return checkStat((0, fs_1.statSync)(path), path, options);
91
+ } catch (e) {
92
+ const er = e;
93
+ if (ignoreErrors || er.code === "EACCES")
94
+ return false;
95
+ throw er;
96
+ }
97
+ }, "sync");
98
+ exports2.sync = sync;
99
+ var checkPathExt = /* @__PURE__ */ __name((path, options) => {
100
+ const { pathExt = process.env.PATHEXT || "" } = options;
101
+ const peSplit = pathExt.split(";");
102
+ if (peSplit.indexOf("") !== -1) {
103
+ return true;
104
+ }
105
+ for (let i = 0; i < peSplit.length; i++) {
106
+ const p = peSplit[i].toLowerCase();
107
+ const ext = path.substring(path.length - p.length).toLowerCase();
108
+ if (p && ext === p) {
109
+ return true;
110
+ }
111
+ }
112
+ return false;
113
+ }, "checkPathExt");
114
+ var checkStat = /* @__PURE__ */ __name((stat, path, options) => stat.isFile() && checkPathExt(path, options), "checkStat");
115
+ }
116
+ });
117
+
118
+ // node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/options.js
119
+ var require_options = __commonJS({
120
+ "node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/options.js"(exports2) {
121
+ "use strict";
122
+ Object.defineProperty(exports2, "__esModule", { value: true });
123
+ }
124
+ });
125
+
126
+ // node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/index.js
127
+ var require_cjs = __commonJS({
128
+ "node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/index.js"(exports2) {
129
+ "use strict";
130
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
131
+ if (k2 === void 0) k2 = k;
132
+ var desc = Object.getOwnPropertyDescriptor(m, k);
133
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
134
+ desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
135
+ return m[k];
136
+ }, "get") };
137
+ }
138
+ Object.defineProperty(o, k2, desc);
139
+ }) : (function(o, m, k, k2) {
140
+ if (k2 === void 0) k2 = k;
141
+ o[k2] = m[k];
142
+ }));
143
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
144
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
145
+ }) : function(o, v) {
146
+ o["default"] = v;
147
+ });
148
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
149
+ if (mod && mod.__esModule) return mod;
150
+ var result = {};
151
+ if (mod != null) {
152
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
153
+ }
154
+ __setModuleDefault(result, mod);
155
+ return result;
156
+ };
157
+ var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
158
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
159
+ };
160
+ Object.defineProperty(exports2, "__esModule", { value: true });
161
+ exports2.sync = exports2.isexe = exports2.posix = exports2.win32 = void 0;
162
+ var posix = __importStar(require_posix());
163
+ exports2.posix = posix;
164
+ var win32 = __importStar(require_win32());
165
+ exports2.win32 = win32;
166
+ __exportStar(require_options(), exports2);
167
+ var platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
168
+ var impl = platform === "win32" ? win32 : posix;
169
+ exports2.isexe = impl.isexe;
170
+ exports2.sync = impl.sync;
171
+ }
172
+ });
173
+
174
+ // node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js
175
+ var require_lib = __commonJS({
176
+ "node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js"(exports2, module2) {
177
+ var { isexe, sync: isexeSync } = require_cjs();
178
+ var { join, delimiter, sep, posix } = require("path");
179
+ var isWindows = process.platform === "win32";
180
+ var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
181
+ var rRel = new RegExp(`^\\.${rSlash.source}`);
182
+ var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
183
+ var getPathInfo = /* @__PURE__ */ __name((cmd, {
184
+ path: optPath = process.env.PATH,
185
+ pathExt: optPathExt = process.env.PATHEXT,
186
+ delimiter: optDelimiter = delimiter
187
+ }) => {
188
+ const pathEnv = cmd.match(rSlash) ? [""] : [
189
+ // windows always checks the cwd first
190
+ ...isWindows ? [process.cwd()] : [],
191
+ ...(optPath || /* istanbul ignore next: very unusual */
192
+ "").split(optDelimiter)
193
+ ];
194
+ if (isWindows) {
195
+ const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
196
+ const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
197
+ if (cmd.includes(".") && pathExt[0] !== "") {
198
+ pathExt.unshift("");
199
+ }
200
+ return { pathEnv, pathExt, pathExtExe };
201
+ }
202
+ return { pathEnv, pathExt: [""] };
203
+ }, "getPathInfo");
204
+ var getPathPart = /* @__PURE__ */ __name((raw, cmd) => {
205
+ const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
206
+ const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
207
+ return prefix + join(pathPart, cmd);
208
+ }, "getPathPart");
209
+ var which = /* @__PURE__ */ __name(async (cmd, opt = {}) => {
210
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
211
+ const found = [];
212
+ for (const envPart of pathEnv) {
213
+ const p = getPathPart(envPart, cmd);
214
+ for (const ext of pathExt) {
215
+ const withExt = p + ext;
216
+ const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
217
+ if (is) {
218
+ if (!opt.all) {
219
+ return withExt;
220
+ }
221
+ found.push(withExt);
222
+ }
223
+ }
224
+ }
225
+ if (opt.all && found.length) {
226
+ return found;
227
+ }
228
+ if (opt.nothrow) {
229
+ return null;
230
+ }
231
+ throw getNotFoundError(cmd);
232
+ }, "which");
233
+ var whichSync = /* @__PURE__ */ __name((cmd, opt = {}) => {
234
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
235
+ const found = [];
236
+ for (const pathEnvPart of pathEnv) {
237
+ const p = getPathPart(pathEnvPart, cmd);
238
+ for (const ext of pathExt) {
239
+ const withExt = p + ext;
240
+ const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
241
+ if (is) {
242
+ if (!opt.all) {
243
+ return withExt;
244
+ }
245
+ found.push(withExt);
246
+ }
247
+ }
248
+ }
249
+ if (opt.all && found.length) {
250
+ return found;
251
+ }
252
+ if (opt.nothrow) {
253
+ return null;
254
+ }
255
+ throw getNotFoundError(cmd);
256
+ }, "whichSync");
257
+ module2.exports = which;
258
+ which.sync = whichSync;
259
+ }
260
+ });
261
+
262
+ // node_modules/.pnpm/@npmcli+promise-spawn@8.0.3/node_modules/@npmcli/promise-spawn/lib/escape.js
263
+ var require_escape = __commonJS({
264
+ "node_modules/.pnpm/@npmcli+promise-spawn@8.0.3/node_modules/@npmcli/promise-spawn/lib/escape.js"(exports2, module2) {
265
+ "use strict";
266
+ var cmd = /* @__PURE__ */ __name((input, doubleEscape) => {
267
+ if (!input.length) {
268
+ return '""';
269
+ }
270
+ let result;
271
+ if (!/[ \t\n\v"]/.test(input)) {
272
+ result = input;
273
+ } else {
274
+ result = '"';
275
+ for (let i = 0; i <= input.length; ++i) {
276
+ let slashCount = 0;
277
+ while (input[i] === "\\") {
278
+ ++i;
279
+ ++slashCount;
280
+ }
281
+ if (i === input.length) {
282
+ result += "\\".repeat(slashCount * 2);
283
+ break;
284
+ }
285
+ if (input[i] === '"') {
286
+ result += "\\".repeat(slashCount * 2 + 1);
287
+ result += input[i];
288
+ } else {
289
+ result += "\\".repeat(slashCount);
290
+ result += input[i];
291
+ }
292
+ }
293
+ result += '"';
294
+ }
295
+ result = result.replace(/[ !%^&()<>|"]/g, "^$&");
296
+ if (doubleEscape) {
297
+ result = result.replace(/[ !%^&()<>|"]/g, "^$&");
298
+ }
299
+ return result;
300
+ }, "cmd");
301
+ var sh = /* @__PURE__ */ __name((input) => {
302
+ if (!input.length) {
303
+ return `''`;
304
+ }
305
+ if (!/[\t\n\r "#$&'()*;<>?\\`|~]/.test(input)) {
306
+ return input;
307
+ }
308
+ const result = `'${input.replace(/'/g, `'\\''`)}'`.replace(/^(?:'')+(?!$)/, "").replace(/\\'''/g, `\\'`);
309
+ return result;
310
+ }, "sh");
311
+ module2.exports = {
312
+ cmd,
313
+ sh
314
+ };
315
+ }
316
+ });
317
+
318
+ // node_modules/.pnpm/@npmcli+promise-spawn@8.0.3/node_modules/@npmcli/promise-spawn/lib/index.js
319
+ var require_lib2 = __commonJS({
320
+ "node_modules/.pnpm/@npmcli+promise-spawn@8.0.3/node_modules/@npmcli/promise-spawn/lib/index.js"(exports2, module2) {
321
+ "use strict";
322
+ var { spawn } = require("child_process");
323
+ var os = require("os");
324
+ var which = require_lib();
325
+ var escape = require_escape();
326
+ var promiseSpawn = /* @__PURE__ */ __name((cmd, args, opts = {}, extra = {}) => {
327
+ if (opts.shell) {
328
+ return spawnWithShell(cmd, args, opts, extra);
329
+ }
330
+ let resolve, reject;
331
+ const promise = new Promise((_resolve, _reject) => {
332
+ resolve = _resolve;
333
+ reject = _reject;
334
+ });
335
+ const closeError = new Error("command failed");
336
+ const stdout = [];
337
+ const stderr = [];
338
+ const getResult = /* @__PURE__ */ __name((result) => ({
339
+ cmd,
340
+ args,
341
+ ...result,
342
+ ...stdioResult(stdout, stderr, opts),
343
+ ...extra
344
+ }), "getResult");
345
+ const rejectWithOpts = /* @__PURE__ */ __name((er, erOpts) => {
346
+ const resultError = getResult(erOpts);
347
+ reject(Object.assign(er, resultError));
348
+ }, "rejectWithOpts");
349
+ const proc = spawn(cmd, args, opts);
350
+ promise.stdin = proc.stdin;
351
+ promise.process = proc;
352
+ proc.on("error", rejectWithOpts);
353
+ if (proc.stdout) {
354
+ proc.stdout.on("data", (c) => stdout.push(c));
355
+ proc.stdout.on("error", rejectWithOpts);
356
+ }
357
+ if (proc.stderr) {
358
+ proc.stderr.on("data", (c) => stderr.push(c));
359
+ proc.stderr.on("error", rejectWithOpts);
360
+ }
361
+ proc.on("close", (code, signal) => {
362
+ if (code || signal) {
363
+ rejectWithOpts(closeError, { code, signal });
364
+ } else {
365
+ resolve(getResult({ code, signal }));
366
+ }
367
+ });
368
+ return promise;
369
+ }, "promiseSpawn");
370
+ var spawnWithShell = /* @__PURE__ */ __name((cmd, args, opts, extra) => {
371
+ let command = opts.shell;
372
+ if (command === true) {
373
+ command = process.platform === "win32" ? process.env.ComSpec || "cmd.exe" : "sh";
374
+ }
375
+ const options = { ...opts, shell: false };
376
+ const realArgs = [];
377
+ let script = cmd;
378
+ const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(command);
379
+ if (isCmd) {
380
+ let doubleEscape = false;
381
+ let initialCmd = "";
382
+ let insideQuotes = false;
383
+ for (let i = 0; i < cmd.length; ++i) {
384
+ const char = cmd.charAt(i);
385
+ if (char === " " && !insideQuotes) {
386
+ break;
387
+ }
388
+ initialCmd += char;
389
+ if (char === '"' || char === "'") {
390
+ insideQuotes = !insideQuotes;
391
+ }
392
+ }
393
+ let pathToInitial;
394
+ try {
395
+ pathToInitial = which.sync(initialCmd, {
396
+ path: options.env && findInObject(options.env, "PATH") || process.env.PATH,
397
+ pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
398
+ }).toLowerCase();
399
+ } catch (err) {
400
+ pathToInitial = initialCmd.toLowerCase();
401
+ }
402
+ doubleEscape = pathToInitial.endsWith(".cmd") || pathToInitial.endsWith(".bat");
403
+ for (const arg of args) {
404
+ script += ` ${escape.cmd(arg, doubleEscape)}`;
405
+ }
406
+ realArgs.push("/d", "/s", "/c", script);
407
+ options.windowsVerbatimArguments = true;
408
+ } else {
409
+ for (const arg of args) {
410
+ script += ` ${escape.sh(arg)}`;
411
+ }
412
+ realArgs.push("-c", script);
413
+ }
414
+ return promiseSpawn(command, realArgs, options, extra);
415
+ }, "spawnWithShell");
416
+ var open = /* @__PURE__ */ __name((_args, opts = {}, extra = {}) => {
417
+ const options = { ...opts, shell: true };
418
+ const args = [].concat(_args);
419
+ let platform = process.platform;
420
+ if (platform === "linux" && os.release().toLowerCase().includes("microsoft")) {
421
+ platform = "wsl";
422
+ if (!process.env.BROWSER) {
423
+ return Promise.reject(
424
+ new Error("Set the BROWSER environment variable to your desired browser.")
425
+ );
426
+ }
427
+ }
428
+ let command = options.command;
429
+ if (!command) {
430
+ if (platform === "win32") {
431
+ options.shell = process.env.ComSpec;
432
+ command = 'start ""';
433
+ } else if (platform === "wsl") {
434
+ command = "sensible-browser";
435
+ } else if (platform === "darwin") {
436
+ command = "open";
437
+ } else {
438
+ command = "xdg-open";
439
+ }
440
+ }
441
+ return spawnWithShell(command, args, options, extra);
442
+ }, "open");
443
+ promiseSpawn.open = open;
444
+ var isPipe = /* @__PURE__ */ __name((stdio = "pipe", fd) => {
445
+ if (stdio === "pipe" || stdio === null) {
446
+ return true;
447
+ }
448
+ if (Array.isArray(stdio)) {
449
+ return isPipe(stdio[fd], fd);
450
+ }
451
+ return false;
452
+ }, "isPipe");
453
+ var stdioResult = /* @__PURE__ */ __name((stdout, stderr, { stdioString = true, stdio }) => {
454
+ const result = {
455
+ stdout: null,
456
+ stderr: null
457
+ };
458
+ if (isPipe(stdio, 1)) {
459
+ result.stdout = Buffer.concat(stdout);
460
+ if (stdioString) {
461
+ result.stdout = result.stdout.toString().trim();
462
+ }
463
+ }
464
+ if (isPipe(stdio, 2)) {
465
+ result.stderr = Buffer.concat(stderr);
466
+ if (stdioString) {
467
+ result.stderr = result.stderr.toString().trim();
468
+ }
469
+ }
470
+ return result;
471
+ }, "stdioResult");
472
+ var findInObject = /* @__PURE__ */ __name((obj, key) => {
473
+ key = key.toLowerCase();
474
+ for (const objKey of Object.keys(obj).sort()) {
475
+ if (objKey.toLowerCase() === key) {
476
+ return obj[objKey];
477
+ }
478
+ }
479
+ }, "findInObject");
480
+ module2.exports = promiseSpawn;
481
+ }
482
+ });
483
+
484
+ // src/external/@npmcli/promise-spawn.js
485
+ module.exports = require_lib2();
@@ -3,4 +3,45 @@
3
3
  * Bundled from @socketregistry/is-unicode-supported
4
4
  * This is a zero-dependency bundle created by esbuild.
5
5
  */
6
- "use strict";var d=Object.defineProperty;var i=(t,e)=>d(t,"name",{value:e,configurable:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var c=T((M,u)=>{"use strict";var o;function E(){return o===void 0&&(o=require("process")),o}i(E,"getProcess");u.exports=i(function(){let e=E();if(e.platform!=="win32")return e.env.TERM!=="linux";let{env:r}=e;if(r.WT_SESSION||r.TERMINUS_SUBLIME||r.ConEmuTask==="{cmd::Cmder}")return!0;let{TERM:n,TERM_PROGRAM:s}=r;return s==="Terminus-Sublime"||s==="vscode"||n==="xterm-256color"||n==="alacritty"||n==="rxvt-unicode"||n==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"},"isUnicodeSupported")});module.exports=c();
6
+ "use strict";
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+
14
+ // node_modules/.pnpm/@socketregistry+is-unicode-supported@1.0.5/node_modules/@socketregistry/is-unicode-supported/index.cjs
15
+ var require_is_unicode_supported = __commonJS({
16
+ "node_modules/.pnpm/@socketregistry+is-unicode-supported@1.0.5/node_modules/@socketregistry/is-unicode-supported/index.cjs"(exports2, module2) {
17
+ "use strict";
18
+ var _process;
19
+ function getProcess() {
20
+ if (_process === void 0) {
21
+ _process = require("process");
22
+ }
23
+ return _process;
24
+ }
25
+ __name(getProcess, "getProcess");
26
+ module2.exports = /* @__PURE__ */ __name(function isUnicodeSupported() {
27
+ const process = getProcess();
28
+ if (process.platform !== "win32") {
29
+ return process.env.TERM !== "linux";
30
+ }
31
+ const { env } = process;
32
+ if (
33
+ // Windows Terminal.
34
+ env.WT_SESSION || // Terminus (<0.2.27).
35
+ env.TERMINUS_SUBLIME || // ConEmu and cmder.
36
+ env.ConEmuTask === "{cmd::Cmder}"
37
+ ) {
38
+ return true;
39
+ }
40
+ const { TERM, TERM_PROGRAM } = env;
41
+ return TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
42
+ }, "isUnicodeSupported");
43
+ }
44
+ });
45
+
46
+ // src/external/@socketregistry/is-unicode-supported.js
47
+ module.exports = require_is_unicode_supported();