Lines 1-81javascript
2import{createRequire as IJ}from"node:module";var qJ=Object.create;var{getPrototypeOf:AJ,defineProperty:I6,getOwnPropertyNames:UJ}=Object;var WJ=Object.prototype.hasOwnProperty;function NJ(D){return this[D]}var $J,VJ,HD=(D,F,u)=>{var E=D!=null&&typeof D==="object";if(E){var B=F?$J??=new WeakMap:VJ??=new WeakMap,C=B.get(D);if(C)return C}u=D!=null?qJ(AJ(D)):{};let Z=F||!D||!D.__esModule?I6(u,"default",{value:D,enumerable:!0}):u;for(let J of UJ(D))if(!WJ.call(Z,J))I6(Z,J,{get:NJ.bind(D,J),enumerable:!0});if(E)B.set(D,Z);return Z};var T=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var i= ...
3`).reduce(function(B,C){return k6(C)>B?k6(C):B},0)}function MF(D,F){return Array(F+1).join(D)}function LJ(D,F,u,E){let B=tD(D);if(F+1>=B){let C=F-B;switch(E){case"right":{D=MF(u,C)+D;break}case"center":{let Z=Math.ceil(C/2),J=C-Z;D=MF(u,J)+D+MF(u,Z);break}default:{D=D+MF(u,C);break}}}return D}var r0={};function TF(D,F,u){F="\x1B["+F+"m",u="\x1B["+u+"m",r0[F]={set:D,to:!0},r0[u]={set:D,to:!1},r0[D]={on:F,off:u}}TF("bold",1,22);TF("italics",3,23);TF("underline",4,24);TF("inverse",7,27);TF("strikethrough",9,29);function y6(D,F){let u=F[1]?parseInt(F[1].split(";")[0]):0;if(u>=30&&u<=39||u>=90&&u<= ...
4`);let B=u?yJ:bJ;for(let C=0;C<F.length;C++)E.push.apply(E,B(D,F[C]));return E}function vJ(D){let
5`)!=-1,E=this._styles,B=E.length;while(B--){var C=R0[E[B]];if(F=C.open+F.replace(C.closeRe,C.open)+C.close,u)F=F.replace(lJ,function(Z){return C.close+Z+C.open})}return F}n.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}fo ...
6`))}wrapLines(D){let F=wD.colorizeLines(D);if(this.href)return F.map((u)=>wD.hyperlink(this.href,u));return F}init(D){let F=this.x,u=this.y;this.widths=D.colWidths.slice(F,F
7`)}get width(){return this.toString().split(`
8`)[0].length}}y3.reset=()=>J0.reset();function k3(D,F,u){let E=[];D.forEach(function(C){E.push(C.draw(F))});let B=E.join("");if(B.length)u.push(B)}W9.exports=y3});var f3=T((NN,b3)=>{var M2=process||{},$9=M2.argv||[],I2=M2.env||{},ZY=!(!!I2.NO_COLOR||$9.includes("--no-color"))&&(!!I2.FORCE_COLOR||$9.includes("--color")||M2.platform==="win32"||(M2.stdout||{}).isTTY&&I2.TERM!=="dumb"||!!I2.CI),JY=(D,F,u=D)=>(E)=>{let B=""+E,C=B.indexOf(F,D.length);return~C?D+YY(B,F,u,C)+F:D+B+F},YY=(D,F,u,E)=>{let B="",C=0;do B+=D.substring(C,E)+u,C=E+F.length,E=D.indexOf(F,C);while(~E);return B+D.substring(C)},V ...
9GFS4: `),console.error(D)};if(!CD[KD]){if(v3=global[KD]||[],P9(CD,v3),CD.close=function(D){function F(u,E){return D.call(CD,u,function(B){if(!B
11`;function s7(D,F){var u=[],E="";if(typeof F==="string")F={section:F,whitespace:!1};else F=F||{},F.whitespace=F.whitespace===!0;var B=F.whitespace?" = ":"=";if(Object.keys(D).forEach(function(C,Z,J){var X=D[C];if(X&&Array.isArray(X))X.forEach(function(Y){E+=JF(C+"[]")+B+JF(Y)+`
12`});else if(X&&typeof X==="object")u.push(C);else E+=JF(C)+B+JF(X)+Q1}),F.section&&E.length)E="["+JF(F.section)+"]"+Q1+E;return u.forEach(function(C,Z,J){var X=o7(C).join("\\."),Y=(F.section?F.section+".":"")+X,H=s7(D[C],{section:Y,whitespace:F.whitespace});if(E.length&&H.length)E+=Q1;E+=H}),E}function o7(D){return D.replace(/\1/g,"\x02LITERAL\\1LITERAL\x02").replace(/\\\./g,"\x01").split(/\./).map(function(F){return F.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"\x01")})}function OH(D){var F={},u=F,E=null,B=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,C=D.split(/[\r\n]+/g);return C.forEach(f ...
13`){Y++,C=!1,J+=X(D,Z,Y),Z=Y;continue}else if(C===K1&&u===`
14`)C=!1,J+=X(D,Z,Y),Z=Y;else if(!C&&u+E==="/*"){J+=D.slice(Z,Y),Z=Y,C=D4,Y++
15 * @description Recursive object extending
16 * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
19 * The MIT License (MIT)
21 * Copyright (c) 2013-2018 Viacheslav Lotsmanov
23 * Permission is hereby granted, free of charge, to any person obtaining a copy of
24 * this software and associated documentation files (the "Software"), to deal in
25 * the Software without restriction, including without limitation the rights to
26 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
27 * the Software, and to permit persons to whom the Software is furnished to do so,
28 * subject to the following conditions:
30 * The above copyright notice and this permission notice shall be included in all
31 * copies or substantial portions of the Software.
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
35 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
36 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 */function Z4(D){return D instanceof Buffer||D instanceof Date||D instanceof RegExp?!0:!1}function J4(D){if(D instanceof Buffer){var F=Buffer.alloc?
40GFS4: `),console.error(D)};if(!ZD[qD]){if(A1=global[qD]||[],R4(ZD,A1),ZD.close=function(D){function F(u,E){return D.call(ZD,u,function(B){if(!B)L4();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(F,e2,{value:D}),F}(ZD.close),ZD.closeSync=function(D){function F(u){D.apply(ZD,arguments),L4()}return Object.defineProperty(F,e2,{value:D}),F}(ZD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){k0(ZD[qD]),i("assert").equal(ZD[qD].length,0)})}var A1;if(!global[qD])R4(global,ZD[qD]);N1.exports=U1(aH(ZD));if(process.env.TEST_GRACEFUL_F ...
42`;function y4(D,F){var u=[],E="";if(typeof F==="string")F={section:F,whitespace:!1};else F=F||{},F.whitespace=F.whitespace===!0;var
43`});else if(X&&typeof X==="object")u.push(C);else E+=GF(C)+B+GF(X)+$1}),F.section&&E.length)E="["+GF(F.section)+"]"+
47`);return E.split(",")}switch(D){case"hoist-pattern":case"public-hoist-pattern":return u(F)}return F}F5.exports=D5});var Y5=T((J5)=>{var C5=i("os"),H0=i("path"),Z5=C5.tmpdir(),bX=process.getuid?process.getuid():process.pid,fX=()=>!0,E5=process.platform==="win32",B5={editor:()=>process.env.EDITOR||process.env.VISUAL||(E5?"notepad.exe":"vi"),shell:()=>E5?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},vX={fromString:()=>process.umask()},QF=C5.homedir();if(QF)process.env.HOME=QF;else QF=H0.resolve(Z5,"npm-"+bX);var hX=process.platform==="win32"?"npm-cache":".npm",gX=process.platfor ...
48`:`
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/photon.jsView on unpkg · L38 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/photon.jsView on unpkg · L42 49`,E=F.whitespace?" = ":"=",B=[],C=F.sort?Object.keys(D).sort():Object.keys(D),Z=0;if(F.align)Z=X0(C.filter((Y)=>D
50`,B=F.pad||" ",C=u!=="right"?eK:Dz,Z=!1;if(!Array.isArray(D))Z=!0,D=String(D).split(E);let J,X=0;return D=D.map(function(Y){return Y=String(Y),J=tK(Y),X=Math.max(J,X),{str:Y,width:J}}).map(function(Y){return Array(C(X,Y.width)+1).join(B)+Y.str}),Z?D.join(E):D}m0.left=function(F){return m0(F,{align:"left"})};m0.center=function(F){return m0(F,{align:"center"})};m0.right=function(F){return m0(F,{align:"right"})};NB.exports=m0;function eK(D,F){return Math.floor((D-F)/2)}function Dz(D,F){return D-F}});var D2=T((jz)=>{class Hu extends Error{constructor(D,F,u){super(u);Error.captureStackTrace(this,th ...
51`)}displayWidth(D){return iB(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F==="[command]")return this.styleSubcommandText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleCommandText(F)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D ...
52`+" ".repeat(F+J));return C+Z+" ".repeat(J)+H.replace(/\n/g,`
53${C}`)}boxWrap(D,F){if(F<this.minWidthToWrap)return D;let u=D.split(/\r\n|\n/),E=/[\s]*[^\s]+/g,B=[];return u.forEach((C)=>{let Z=C.match(E);if(Z===null){B.push("");return}let J=[Z.shift()],X=this.displayWidth(J[0]);Z.forEach((Y)=>{let H=this.displayWidth(Y);if(X+H<=F){J.push(Y),X+=H;return}B.push(J.join(""));let G=Y.trimStart();J=[G],X=this.displayWidth(G)}),B.push(J.join(""))}),B.join(`
54`)}}function iB(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}vz.Help=pB;vz.stripColor=iB});var Gu=T((cz)=>{var{InvalidArgumentError:mz}=D2();class aB{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let u=dz(D);if(this.short=u.shortFlag,this.long=u.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.arg ...
55- a short flag is a single dash and a single character
56 - either use a single dash and a single character (for a short flag)
57 - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(E.test(Z))throw Error(`${J}
58- too many short flags`);if(B.test(Z))throw Error(`${J}
59- too many long flags`);throw Error(`${J}
60- unrecognised flag format`)}if(F===void 0&&u===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:u}}cz.Option=aB;cz.DualOptions=rB});var sB=T((az)=>{function iz(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D
61(Did you mean one of ${E.join(", ")}?)`;if(E.length===1)return`
62(Did you mean ${E[0]}?)`;return""}az.suggestSimilar=nz});var DC=T((uq)=>{var sz=i("node:events").EventEmitter,Qu=i("node:child_process"),G0=i("node:path"),R8=i("node:fs"),o=i("node:process"),{Argument:oz,humanReadableArgName:tz}=L8(),{CommanderError:Ku}=D2(),{Help:ez,stripColor:Dq}=Xu(),{Option:oB,DualOptions:Fq}=Gu(),{suggestSimilar:tB}=sB();class qu extends sz{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.proces ...
63- specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new oz(D,F)}argument(D,F,u,E){let B=this.createArgument(D,F);if(typeof u==="function")B.default(E).argParser(u);else B.default(u);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F?.variadic)throw Error(`only the la ...
HighChild Process
Package source references child process execution.
dist/photon.jsView on unpkg · L61 64Expecting one of '${u.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,u){if(this._exitCallback)this._exitCallback(new Ku(D,F,u));o.exit(D)}action(D){let F=(u)=>{let E=this.registeredArguments.length,B=u.slice(0,E);if(this._storeOptionsAsProperties)B[E]=this;else B[E]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=F,this}createOption(D,F){return n ...
65- already used by option '${F.flags}'`)}this._initOptionGroup(D),this.options.push(D)}_registerCommand(D){let F=(E)=>{return[E.name()].concat(E.aliases())},u=F(D).find((E
66- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(D,F,u){if(R8.existsSync(D))return;let E=F?`searched for local subcommand relative to directory '${F}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",B=`'${D}' does not exist
67 - if '${u}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
68 - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
69 - ${E}`;throw Error(B)}_executeSubCommand(D,F){F=F.slice();let u=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function B(Y,H){let G=G0.resolve(Y,H);if(R8.existsSync(G))return G;if(E.includes(G0.extname(H)))return;let K=E.find((Q)=>R8.existsSync(`${G}${Q}`));if(K)return`${G}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let C=D._executableFile||`${this._name}-${D._name}`,Z=this._executableDir||"";if(this._scriptPath){let Y;try{Y=R8.realpathSync(this._scriptPath)}catch{Y=this._scriptPath}Z=G0.resolve(G0.dirname(Y),Z)}if(Z){let Y=B(Z,C);if(!Y&&!D._executableFi ...
70`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
71`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
72`),this.outputHelp({error:!0});let u=F||{},E=u.exitCode||1,B=u.code||"commander.error";this._exit(E,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar
73`),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let u=this.parent?._findCommand(D);if(u){let E=[u.name()].concat(u.aliases()).join("|");throw ...
74Expecting one of '${u.join("', '")}'`);let E=`${D}Help`;return this.on(E,(B)=>{let C;if(typeof F==="function")C=F({error:B.error,command:B.command});else
75`)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((E)=>F.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function eB(
77`;throw D}class k2{constructor(D,F,u={}){if(this._path=u.configPath??wY(D,u.globalConfigPath),this._clearInvalidConfig=u.clearInvalidConfig??!0,F)this.all={...F,...this.all}}get all(){try{return JSON.parse(SF.default.readFileSync(this._path,"utf8"))}catch(D){if(D.code==="ENOENT")return{};if(D.name==="SyntaxError"){if(this._clearInvalidConfig)return w2(this._path,"",F7),{};throw D}return u7(D),{}}}set all(D){try{SF.default.mkdirSync(jF.dirname(this._path),kY),w2(this._path,JSON.stringify(D,void 0,"\t"),F7)}catch(F){u7(F)}}get size(){return Object.keys(this.all||{}).length}get(D){return t9(this. ...
79`)+u,B=E+1,E=D.indexOf(`
80`,B)}while(E!==-1);return C+=D.slice(B),C}var{stdout:G7,stderr:Q7}=Y7,o3=Symbol("GENERATOR"),DF=Symbol("STYLER"),PF=Symbol("IS_EMPTY"),K7=["ansi","ansi",
81`);if(C!==-1)F=X7(F,B,E,C);return E+F+B};Object.defineProperties(wF.prototype,FF);var rY=wF(),r$=wF({level:Q7?Q7.level:0});var OD=rY;var gB=HD(B1(),1),mB=HD(EF(),1);class BF extends Error{response;request;options;constructor(D,F,u){let E=D.status||D.status===0?D.status:"",B=D.statusText??"",C=`${E} ${B}`.trim(),Z=C?`status code ${C}`:"an unknown error";super(`Request failed with ${Z}: ${F.method} ${F.url}`);this.name="HTTPError",this.response=D,this.request=F,this.options=u}}class yF extends Error{name="NonError";value;constructor(D){let F="Non-error value was thrown";try{if(typeof D==="string ...
Long lines were clipped for display.