From 1c7efc0644d7e75aacab752c187ad65429ad386c Mon Sep 17 00:00:00 2001 From: POPPIN-FUMI Date: Fri, 1 Sep 2023 22:13:07 +0200 Subject: [PATCH] update: release v1.5.11 --- dist/index.js | 3 ++- package.json | 4 ++-- src/lib/version.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3c8373c2..ad957148 100755 --- a/dist/index.js +++ b/dist/index.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node "use strict";var Z1t=Object.create;var iM=Object.defineProperty;var eTt=Object.getOwnPropertyDescriptor;var tTt=Object.getOwnPropertyNames;var oTt=Object.getPrototypeOf,nTt=Object.prototype.hasOwnProperty;var oa=(p,o)=>()=>(p&&(o=p(p=0)),o);var E=(p,o)=>()=>(o||p((o={exports:{}}).exports,o),o.exports),MQ=(p,o)=>{for(var s in o)iM(p,s,{get:o[s],enumerable:!0})},sge=(p,o,s,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of tTt(o))!nTt.call(p,l)&&l!==s&&iM(p,l,{get:()=>o[l],enumerable:!(u=eTt(o,l))||u.enumerable});return p};var bt=(p,o,s)=>(s=p!=null?Z1t(oTt(p)):{},sge(o||!p||!p.__esModule?iM(s,"default",{value:p,enumerable:!0}):s,p)),RQ=p=>sge(iM({},"__esModule",{value:!0}),p);var pge=E((XZo,iTt)=>{iTt.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var AQ=E((ZZo,aM)=>{var rTt=require("fs"),dge=require("path"),aTt=require("os"),lTt=pge(),cTt=lTt.version,uTt=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function sTt(p){let o={},s=p.toString();s=s.replace(/\r\n?/mg,` `);let u;for(;(u=uTt.exec(s))!=null;){let l=u[1],f=u[2]||"";f=f.trim();let y=f[0];f=f.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),y==='"'&&(f=f.replace(/\\n/g,` `),f=f.replace(/\\r/g,"\r")),o[l]=f}return o}function NQ(p){console.log(`[dotenv@${cTt}][DEBUG] ${p}`)}function pTt(p){return p[0]==="~"?dge.join(aTt.homedir(),p.slice(1)):p}function dTt(p){let o=dge.resolve(process.cwd(),".env"),s="utf8",u=!!(p&&p.debug),l=!!(p&&p.override);p&&(p.path!=null&&(o=pTt(p.path)),p.encoding!=null&&(s=p.encoding));try{let f=rM.parse(rTt.readFileSync(o,{encoding:s}));return Object.keys(f).forEach(function(y){Object.prototype.hasOwnProperty.call(process.env,y)?(l===!0&&(process.env[y]=f[y]),u&&NQ(l===!0?`"${y}" is already defined in \`process.env\` and WAS overwritten`:`"${y}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[y]=f[y]}),{parsed:f}}catch(f){return u&&NQ(`Failed to load ${o} ${f.message}`),{error:f}}}var rM={config:dTt,parse:sTt};aM.exports.config=rM.config;aM.exports.parse=rM.parse;aM.exports=rM});var uw=E(kQ=>{var lM=class extends Error{constructor(o,s,u){super(u),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=s,this.exitCode=o,this.nestedError=void 0}},IQ=class extends lM{constructor(o){super(1,"commander.invalidArgument",o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};kQ.CommanderError=lM;kQ.InvalidArgumentError=IQ});var cM=E(LQ=>{var{InvalidArgumentError:fTt}=uw(),FQ=class{constructor(o,s){switch(this.description=s||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,o[0]){case"<":this.required=!0,this._name=o.slice(1,-1);break;case"[":this.required=!1,this._name=o.slice(1,-1);break;default:this.required=!0,this._name=o;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(o,s){return s===this.defaultValue||!Array.isArray(s)?[o]:s.concat(o)}default(o,s){return this.defaultValue=o,this.defaultValueDescription=s,this}argParser(o){return this.parseArg=o,this}choices(o){return this.argChoices=o.slice(),this.parseArg=(s,u)=>{if(!this.argChoices.includes(s))throw new fTt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(s,u):s},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function mTt(p){let o=p.name()+(p.variadic===!0?"...":"");return p.required?"<"+o+">":"["+o+"]"}LQ.Argument=FQ;LQ.humanReadableArgName=mTt});var qQ=E(fge=>{var{humanReadableArgName:hTt}=cM(),JQ=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(o){let s=o.commands.filter(u=>!u._hidden);if(o._hasImplicitHelpCommand()){let[,u,l]=o._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),f=o.createCommand(u).helpOption(!1);f.description(o._helpCommandDescription),l&&f.arguments(l),s.push(f)}return this.sortSubcommands&&s.sort((u,l)=>u.name().localeCompare(l.name())),s}compareOptions(o,s){let u=l=>l.short?l.short.replace(/^-/,""):l.long.replace(/^--/,"");return u(o).localeCompare(u(s))}visibleOptions(o){let s=o.options.filter(f=>!f.hidden),u=o._hasHelpOption&&o._helpShortFlag&&!o._findOption(o._helpShortFlag),l=o._hasHelpOption&&!o._findOption(o._helpLongFlag);if(u||l){let f;u?l?f=o.createOption(o._helpFlags,o._helpDescription):f=o.createOption(o._helpShortFlag,o._helpDescription):f=o.createOption(o._helpLongFlag,o._helpDescription),s.push(f)}return this.sortOptions&&s.sort(this.compareOptions),s}visibleGlobalOptions(o){if(!this.showGlobalOptions)return[];let s=[];for(let u=o.parent;u;u=u.parent){let l=u.options.filter(f=>!f.hidden);s.push(...l)}return this.sortOptions&&s.sort(this.compareOptions),s}visibleArguments(o){return o._argsDescription&&o._args.forEach(s=>{s.description=s.description||o._argsDescription[s.name()]||""}),o._args.find(s=>s.description)?o._args:[]}subcommandTerm(o){let s=o._args.map(u=>hTt(u)).join(" ");return o._name+(o._aliases[0]?"|"+o._aliases[0]:"")+(o.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(o){return o.flags}argumentTerm(o){return o.name()}longestSubcommandTermLength(o,s){return s.visibleCommands(o).reduce((u,l)=>Math.max(u,s.subcommandTerm(l).length),0)}longestOptionTermLength(o,s){return s.visibleOptions(o).reduce((u,l)=>Math.max(u,s.optionTerm(l).length),0)}longestGlobalOptionTermLength(o,s){return s.visibleGlobalOptions(o).reduce((u,l)=>Math.max(u,s.optionTerm(l).length),0)}longestArgumentTermLength(o,s){return s.visibleArguments(o).reduce((u,l)=>Math.max(u,s.argumentTerm(l).length),0)}commandUsage(o){let s=o._name;o._aliases[0]&&(s=s+"|"+o._aliases[0]);let u="";for(let l=o.parent;l;l=l.parent)u=l.name()+" "+u;return u+s+" "+o.usage()}commandDescription(o){return o.description()}subcommandDescription(o){return o.summary()||o.description()}optionDescription(o){let s=[];return o.argChoices&&s.push(`choices: ${o.argChoices.map(u=>JSON.stringify(u)).join(", ")}`),o.defaultValue!==void 0&&(o.required||o.optional||o.isBoolean()&&typeof o.defaultValue=="boolean")&&s.push(`default: ${o.defaultValueDescription||JSON.stringify(o.defaultValue)}`),o.presetArg!==void 0&&o.optional&&s.push(`preset: ${JSON.stringify(o.presetArg)}`),o.envVar!==void 0&&s.push(`env: ${o.envVar}`),s.length>0?`${o.description} (${s.join(", ")})`:o.description}argumentDescription(o){let s=[];if(o.argChoices&&s.push(`choices: ${o.argChoices.map(u=>JSON.stringify(u)).join(", ")}`),o.defaultValue!==void 0&&s.push(`default: ${o.defaultValueDescription||JSON.stringify(o.defaultValue)}`),s.length>0){let u=`(${s.join(", ")})`;return o.description?`${o.description} ${u}`:u}return o.description}formatHelp(o,s){let u=s.padWidth(o,s),l=s.helpWidth||80,f=2,y=2;function g(a,d){if(d){let h=`${a.padEnd(u+y)}${d}`;return s.wrap(h,l-f,u+y)}return a}function m(a){return a.join(` @@ -833,7 +834,7 @@ export type Comment = { updatedAt?: Timestamp | FieldValue userId: string postId: string -}`}]});RH.firestorePrompt=vZo});var Kmt=E(NH=>{"use strict";Object.defineProperty(NH,"__esModule",{value:!0});NH.skeetFirestore=void 0;var TZo=sb(),OZo=Wmt(),SZo=async(p,o,s)=>{try{let u=(0,OZo.firestorePrompt)(),l=(0,TZo.generatePrompt)(u.context,u.examples,p,o);return o==="VertexAI"?await s.prompt(l):await s.prompt(l)}catch(u){throw new Error(`skeetNaming: ${u}`)}};NH.skeetFirestore=SZo});var vme=E(cp=>{"use strict";var PZo=cp&&cp.__createBinding||(Object.create?function(p,o,s,u){u===void 0&&(u=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(p,u,l)}:function(p,o,s,u){u===void 0&&(u=s),p[u]=o[s]}),xZo=cp&&cp.__setModuleDefault||(Object.create?function(p,o){Object.defineProperty(p,"default",{enumerable:!0,value:o})}:function(p,o){p.default=o}),wZo=cp&&cp.__importStar||function(p){if(p&&p.__esModule)return p;var o={};if(p!=null)for(var s in p)s!=="default"&&Object.prototype.hasOwnProperty.call(p,s)&&PZo(o,p,s);return xZo(o,p),o};Object.defineProperty(cp,"__esModule",{value:!0});cp.SkeetAI=void 0;var jZo=Cfe(),_Zo=Nfe(),Pme=wmt(),DZo=_mt(),EZo=Dmt(),CZo=wZo(iT()),MZo=Nmt(),RZo=Jmt(),NZo=Hmt(),AZo=jC(),IZo=Kmt();CZo.config();var _C=class{constructor(o={}){this.ai=o.ai||"VertexAI",this.model=o.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=o.maxTokens||1e3,this.temperature=o.temperature||0,this.ai==="VertexAI"?this.aiInstance=new _Zo.VertexAI({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new jZo.OpenAI({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=o}get initOptions(){return this._initOptions}async prisma(o){try{return await(0,DZo.skeetAiPrisma)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async skeet(o){try{return await(0,EZo.skeetPrompt)(o,this.ai,this.aiInstance)}catch(s){throw new Error(`skeet: ${s}`)}}async uploadFile(o){try{return await(0,Pme.uploadJsonlFile)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async createFineTuningJob(o,s="gpt-3.5-turbo-0613"){try{return await(0,Pme.createFineTuningJob)(o,s,this.ai,this.aiInstance)}catch(u){this.handleError(u)}}async showFineTuningJob(o){try{return await(0,Pme.showFineTuningJob)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async typedoc(o){try{return await(0,MZo.skeetGenTypedoc)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async naming(o,s=AZo.NamingEnum.FUNCTION){try{return await(0,RZo.skeetNaming)(o,this.ai,this.aiInstance,s)}catch(u){this.handleError(u)}}async translates(o,s="ja",u="en"){try{return await(0,NZo.skeetAiTranslates)(o,s,u,this.ai,this.aiInstance)}catch(l){this.handleError(l)}}async firestore(o){try{return await(0,IZo.skeetFirestore)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}handleError(o){console.error("Error:",o)}};cp.SkeetAI=_C;_C.PRISMA_SCHEMA_PATH="./graphql/prisma/schema.prisma";cp.default=_C});var AH=E(xn=>{"use strict";var $mt=xn&&xn.__createBinding||(Object.create?function(p,o,s,u){u===void 0&&(u=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(p,u,l)}:function(p,o,s,u){u===void 0&&(u=s),p[u]=o[s]}),kZo=xn&&xn.__setModuleDefault||(Object.create?function(p,o){Object.defineProperty(p,"default",{enumerable:!0,value:o})}:function(p,o){p.default=o}),FZo=xn&&xn.__importStar||function(p){if(p&&p.__esModule)return p;var o={};if(p!=null)for(var s in p)s!=="default"&&Object.prototype.hasOwnProperty.call(p,s)&&$mt(o,p,s);return kZo(o,p),o},Xmt=xn&&xn.__exportStar||function(p,o){for(var s in p)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&$mt(o,p,s)},LZo=xn&&xn.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(xn,"__esModule",{value:!0});xn.NamingEnum=xn.SkeetAI=xn.generatePrompt=xn.translate=xn.VertexAI=xn.OpenAI=xn.openai=xn.Stream=xn.aiplatform=void 0;var JZo=LZo(bde());xn.aiplatform=JZo.default;var qZo=FZo(wfe());xn.openai=qZo;var BZo=Ode();Object.defineProperty(xn,"Stream",{enumerable:!0,get:function(){return BZo.Stream}});Xmt(vdt(),xn);Xmt(Odt(),xn);var UZo=Cfe();Object.defineProperty(xn,"OpenAI",{enumerable:!0,get:function(){return UZo.OpenAI}});var VZo=Nfe();Object.defineProperty(xn,"VertexAI",{enumerable:!0,get:function(){return VZo.VertexAI}});var GZo=Omt();Object.defineProperty(xn,"translate",{enumerable:!0,get:function(){return GZo.translate}});var zZo=sb();Object.defineProperty(xn,"generatePrompt",{enumerable:!0,get:function(){return zZo.generatePrompt}});var HZo=vme();Object.defineProperty(xn,"SkeetAI",{enumerable:!0,get:function(){return HZo.SkeetAI}});var QZo=jC();Object.defineProperty(xn,"NamingEnum",{enumerable:!0,get:function(){return QZo.NamingEnum}})});var KZo={};MQ(KZo,{DEFAULT_FUNCTION_NAME:()=>_r,FIREBASERC_PATH:()=>I6,GRAPHQL_ENV_BUILD_PATH:()=>n_,GRAPHQL_ENV_PRODUCTION_PATH:()=>ms,GRAPHQL_PATH:()=>Nr,GRAPHQL_ROOT:()=>Ji,PRISMA_SCHEMA_PATH:()=>Wf,SKEET_CONFIG_PATH:()=>Mv,program:()=>jo});module.exports=RQ(KZo);var pht=bt(AQ());var _ge=bt(jge(),1),{program:aen,createCommand:len,createArgument:cen,createOption:uen,CommanderError:sen,InvalidArgumentError:pen,InvalidOptionArgumentError:den,Command:Dge,Argument:fen,Option:men,Help:hen}=_ge.default;var Ege="1.5.10";var Cge=(p=0)=>o=>`\x1B[${o+p}m`,Mge=(p=0)=>o=>`\x1B[${38+p};5;${o}m`,Rge=(p=0)=>(o,s,u)=>`\x1B[${38+p};2;${o};${s};${u}m`,bi={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ben=Object.keys(bi.modifier),CTt=Object.keys(bi.color),MTt=Object.keys(bi.bgColor),ven=[...CTt,...MTt];function RTt(){let p=new Map;for(let[o,s]of Object.entries(bi)){for(let[u,l]of Object.entries(s))bi[u]={open:`\x1B[${l[0]}m`,close:`\x1B[${l[1]}m`},s[u]=bi[u],p.set(l[0],l[1]);Object.defineProperty(bi,o,{value:s,enumerable:!1})}return Object.defineProperty(bi,"codes",{value:p,enumerable:!1}),bi.color.close="\x1B[39m",bi.bgColor.close="\x1B[49m",bi.color.ansi=Cge(),bi.color.ansi256=Mge(),bi.color.ansi16m=Rge(),bi.bgColor.ansi=Cge(10),bi.bgColor.ansi256=Mge(10),bi.bgColor.ansi16m=Rge(10),Object.defineProperties(bi,{rgbToAnsi256:{value(o,s,u){return o===s&&s===u?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(s/255*5)+Math.round(u/255*5)},enumerable:!1},hexToRgb:{value(o){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!s)return[0,0,0];let[u]=s;u.length===3&&(u=[...u].map(f=>f+f).join(""));let l=Number.parseInt(u,16);return[l>>16&255,l>>8&255,l&255]},enumerable:!1},hexToAnsi256:{value:o=>bi.rgbToAnsi256(...bi.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value(o){if(o<8)return 30+o;if(o<16)return 90+(o-8);let s,u,l;if(o>=232)s=((o-232)*10+8)/255,u=s,l=s;else{o-=16;let g=o%36;s=Math.floor(o/36)/5,u=Math.floor(g/6)/5,l=g%6/5}let f=Math.max(s,u,l)*2;if(f===0)return 30;let y=30+(Math.round(l)<<2|Math.round(u)<<1|Math.round(s));return f===2&&(y+=60),y},enumerable:!1},rgbToAnsi:{value:(o,s,u)=>bi.ansi256ToAnsi(bi.rgbToAnsi256(o,s,u)),enumerable:!1},hexToAnsi:{value:o=>bi.ansi256ToAnsi(bi.hexToAnsi256(o)),enumerable:!1}}),bi}var NTt=RTt(),rs=NTt;var pM=bt(require("node:process"),1),Age=bt(require("node:os"),1),QQ=bt(require("node:tty"),1);function Qc(p,o=globalThis.Deno?globalThis.Deno.args:pM.default.argv){let s=p.startsWith("-")?"":p.length===1?"-":"--",u=o.indexOf(s+p),l=o.indexOf("--");return u!==-1&&(l===-1||u=2,has16m:p>=3}}function kTt(p,{streamIsTTY:o,sniffFlags:s=!0}={}){let u=ATt();u!==void 0&&(sM=u);let l=s?sM:u;if(l===0)return 0;if(s){if(Qc("color=16m")||Qc("color=full")||Qc("color=truecolor"))return 3;if(Qc("color=256"))return 2}if("TF_BUILD"in Ei&&"AGENT_NAME"in Ei)return 1;if(p&&!o&&l===void 0)return 0;let f=l||0;if(Ei.TERM==="dumb")return f;if(pM.default.platform==="win32"){let y=Age.default.release().split(".");return Number(y[0])>=10&&Number(y[2])>=10586?Number(y[2])>=14931?3:2:1}if("CI"in Ei)return"GITHUB_ACTIONS"in Ei||"GITEA_ACTIONS"in Ei?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(y=>y in Ei)||Ei.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in Ei)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ei.TEAMCITY_VERSION)?1:0;if(Ei.COLORTERM==="truecolor"||Ei.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Ei){let y=Number.parseInt((Ei.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ei.TERM_PROGRAM){case"iTerm.app":return y>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ei.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ei.TERM)||"COLORTERM"in Ei?1:f}function Nge(p,o={}){let s=kTt(p,{streamIsTTY:p&&p.isTTY,...o});return ITt(s)}var FTt={stdout:Nge({isTTY:QQ.default.isatty(1)}),stderr:Nge({isTTY:QQ.default.isatty(2)})},Ige=FTt;function kge(p,o,s){let u=p.indexOf(o);if(u===-1)return p;let l=o.length,f=0,y="";do y+=p.slice(f,u)+o+s,f=u+l,u=p.indexOf(o,f);while(u!==-1);return y+=p.slice(f),y}function Fge(p,o,s,u){let l=0,f="";do{let y=p[u-1]==="\r";f+=p.slice(l,y?u-1:u)+o+(y?`\r +}`}]});RH.firestorePrompt=vZo});var Kmt=E(NH=>{"use strict";Object.defineProperty(NH,"__esModule",{value:!0});NH.skeetFirestore=void 0;var TZo=sb(),OZo=Wmt(),SZo=async(p,o,s)=>{try{let u=(0,OZo.firestorePrompt)(),l=(0,TZo.generatePrompt)(u.context,u.examples,p,o);return o==="VertexAI"?await s.prompt(l):await s.prompt(l)}catch(u){throw new Error(`skeetNaming: ${u}`)}};NH.skeetFirestore=SZo});var vme=E(cp=>{"use strict";var PZo=cp&&cp.__createBinding||(Object.create?function(p,o,s,u){u===void 0&&(u=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(p,u,l)}:function(p,o,s,u){u===void 0&&(u=s),p[u]=o[s]}),xZo=cp&&cp.__setModuleDefault||(Object.create?function(p,o){Object.defineProperty(p,"default",{enumerable:!0,value:o})}:function(p,o){p.default=o}),wZo=cp&&cp.__importStar||function(p){if(p&&p.__esModule)return p;var o={};if(p!=null)for(var s in p)s!=="default"&&Object.prototype.hasOwnProperty.call(p,s)&&PZo(o,p,s);return xZo(o,p),o};Object.defineProperty(cp,"__esModule",{value:!0});cp.SkeetAI=void 0;var jZo=Cfe(),_Zo=Nfe(),Pme=wmt(),DZo=_mt(),EZo=Dmt(),CZo=wZo(iT()),MZo=Nmt(),RZo=Jmt(),NZo=Hmt(),AZo=jC(),IZo=Kmt();CZo.config();var _C=class{constructor(o={}){this.ai=o.ai||"VertexAI",this.model=o.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=o.maxTokens||1e3,this.temperature=o.temperature||0,this.ai==="VertexAI"?this.aiInstance=new _Zo.VertexAI({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new jZo.OpenAI({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=o}get initOptions(){return this._initOptions}async prisma(o){try{return await(0,DZo.skeetAiPrisma)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async skeet(o){try{return await(0,EZo.skeetPrompt)(o,this.ai,this.aiInstance)}catch(s){throw new Error(`skeet: ${s}`)}}async uploadFile(o){try{return await(0,Pme.uploadJsonlFile)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async createFineTuningJob(o,s="gpt-3.5-turbo-0613"){try{return await(0,Pme.createFineTuningJob)(o,s,this.ai,this.aiInstance)}catch(u){this.handleError(u)}}async showFineTuningJob(o){try{return await(0,Pme.showFineTuningJob)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async typedoc(o){try{return await(0,MZo.skeetGenTypedoc)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}async naming(o,s=AZo.NamingEnum.FUNCTION){try{return await(0,RZo.skeetNaming)(o,this.ai,this.aiInstance,s)}catch(u){this.handleError(u)}}async translates(o,s="ja",u="en"){try{return await(0,NZo.skeetAiTranslates)(o,s,u,this.ai,this.aiInstance)}catch(l){this.handleError(l)}}async firestore(o){try{return await(0,IZo.skeetFirestore)(o,this.ai,this.aiInstance)}catch(s){this.handleError(s)}}handleError(o){console.error("Error:",o)}};cp.SkeetAI=_C;_C.PRISMA_SCHEMA_PATH="./graphql/prisma/schema.prisma";cp.default=_C});var AH=E(xn=>{"use strict";var $mt=xn&&xn.__createBinding||(Object.create?function(p,o,s,u){u===void 0&&(u=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(p,u,l)}:function(p,o,s,u){u===void 0&&(u=s),p[u]=o[s]}),kZo=xn&&xn.__setModuleDefault||(Object.create?function(p,o){Object.defineProperty(p,"default",{enumerable:!0,value:o})}:function(p,o){p.default=o}),FZo=xn&&xn.__importStar||function(p){if(p&&p.__esModule)return p;var o={};if(p!=null)for(var s in p)s!=="default"&&Object.prototype.hasOwnProperty.call(p,s)&&$mt(o,p,s);return kZo(o,p),o},Xmt=xn&&xn.__exportStar||function(p,o){for(var s in p)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&$mt(o,p,s)},LZo=xn&&xn.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(xn,"__esModule",{value:!0});xn.NamingEnum=xn.SkeetAI=xn.generatePrompt=xn.translate=xn.VertexAI=xn.OpenAI=xn.openai=xn.Stream=xn.aiplatform=void 0;var JZo=LZo(bde());xn.aiplatform=JZo.default;var qZo=FZo(wfe());xn.openai=qZo;var BZo=Ode();Object.defineProperty(xn,"Stream",{enumerable:!0,get:function(){return BZo.Stream}});Xmt(vdt(),xn);Xmt(Odt(),xn);var UZo=Cfe();Object.defineProperty(xn,"OpenAI",{enumerable:!0,get:function(){return UZo.OpenAI}});var VZo=Nfe();Object.defineProperty(xn,"VertexAI",{enumerable:!0,get:function(){return VZo.VertexAI}});var GZo=Omt();Object.defineProperty(xn,"translate",{enumerable:!0,get:function(){return GZo.translate}});var zZo=sb();Object.defineProperty(xn,"generatePrompt",{enumerable:!0,get:function(){return zZo.generatePrompt}});var HZo=vme();Object.defineProperty(xn,"SkeetAI",{enumerable:!0,get:function(){return HZo.SkeetAI}});var QZo=jC();Object.defineProperty(xn,"NamingEnum",{enumerable:!0,get:function(){return QZo.NamingEnum}})});var KZo={};MQ(KZo,{DEFAULT_FUNCTION_NAME:()=>_r,FIREBASERC_PATH:()=>I6,GRAPHQL_ENV_BUILD_PATH:()=>n_,GRAPHQL_ENV_PRODUCTION_PATH:()=>ms,GRAPHQL_PATH:()=>Nr,GRAPHQL_ROOT:()=>Ji,PRISMA_SCHEMA_PATH:()=>Wf,SKEET_CONFIG_PATH:()=>Mv,program:()=>jo});module.exports=RQ(KZo);var pht=bt(AQ());var _ge=bt(jge(),1),{program:aen,createCommand:len,createArgument:cen,createOption:uen,CommanderError:sen,InvalidArgumentError:pen,InvalidOptionArgumentError:den,Command:Dge,Argument:fen,Option:men,Help:hen}=_ge.default;var Ege="1.5.11";var Cge=(p=0)=>o=>`\x1B[${o+p}m`,Mge=(p=0)=>o=>`\x1B[${38+p};5;${o}m`,Rge=(p=0)=>(o,s,u)=>`\x1B[${38+p};2;${o};${s};${u}m`,bi={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ben=Object.keys(bi.modifier),CTt=Object.keys(bi.color),MTt=Object.keys(bi.bgColor),ven=[...CTt,...MTt];function RTt(){let p=new Map;for(let[o,s]of Object.entries(bi)){for(let[u,l]of Object.entries(s))bi[u]={open:`\x1B[${l[0]}m`,close:`\x1B[${l[1]}m`},s[u]=bi[u],p.set(l[0],l[1]);Object.defineProperty(bi,o,{value:s,enumerable:!1})}return Object.defineProperty(bi,"codes",{value:p,enumerable:!1}),bi.color.close="\x1B[39m",bi.bgColor.close="\x1B[49m",bi.color.ansi=Cge(),bi.color.ansi256=Mge(),bi.color.ansi16m=Rge(),bi.bgColor.ansi=Cge(10),bi.bgColor.ansi256=Mge(10),bi.bgColor.ansi16m=Rge(10),Object.defineProperties(bi,{rgbToAnsi256:{value(o,s,u){return o===s&&s===u?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(s/255*5)+Math.round(u/255*5)},enumerable:!1},hexToRgb:{value(o){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!s)return[0,0,0];let[u]=s;u.length===3&&(u=[...u].map(f=>f+f).join(""));let l=Number.parseInt(u,16);return[l>>16&255,l>>8&255,l&255]},enumerable:!1},hexToAnsi256:{value:o=>bi.rgbToAnsi256(...bi.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value(o){if(o<8)return 30+o;if(o<16)return 90+(o-8);let s,u,l;if(o>=232)s=((o-232)*10+8)/255,u=s,l=s;else{o-=16;let g=o%36;s=Math.floor(o/36)/5,u=Math.floor(g/6)/5,l=g%6/5}let f=Math.max(s,u,l)*2;if(f===0)return 30;let y=30+(Math.round(l)<<2|Math.round(u)<<1|Math.round(s));return f===2&&(y+=60),y},enumerable:!1},rgbToAnsi:{value:(o,s,u)=>bi.ansi256ToAnsi(bi.rgbToAnsi256(o,s,u)),enumerable:!1},hexToAnsi:{value:o=>bi.ansi256ToAnsi(bi.hexToAnsi256(o)),enumerable:!1}}),bi}var NTt=RTt(),rs=NTt;var pM=bt(require("node:process"),1),Age=bt(require("node:os"),1),QQ=bt(require("node:tty"),1);function Qc(p,o=globalThis.Deno?globalThis.Deno.args:pM.default.argv){let s=p.startsWith("-")?"":p.length===1?"-":"--",u=o.indexOf(s+p),l=o.indexOf("--");return u!==-1&&(l===-1||u=2,has16m:p>=3}}function kTt(p,{streamIsTTY:o,sniffFlags:s=!0}={}){let u=ATt();u!==void 0&&(sM=u);let l=s?sM:u;if(l===0)return 0;if(s){if(Qc("color=16m")||Qc("color=full")||Qc("color=truecolor"))return 3;if(Qc("color=256"))return 2}if("TF_BUILD"in Ei&&"AGENT_NAME"in Ei)return 1;if(p&&!o&&l===void 0)return 0;let f=l||0;if(Ei.TERM==="dumb")return f;if(pM.default.platform==="win32"){let y=Age.default.release().split(".");return Number(y[0])>=10&&Number(y[2])>=10586?Number(y[2])>=14931?3:2:1}if("CI"in Ei)return"GITHUB_ACTIONS"in Ei||"GITEA_ACTIONS"in Ei?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(y=>y in Ei)||Ei.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in Ei)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ei.TEAMCITY_VERSION)?1:0;if(Ei.COLORTERM==="truecolor"||Ei.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Ei){let y=Number.parseInt((Ei.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ei.TERM_PROGRAM){case"iTerm.app":return y>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ei.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ei.TERM)||"COLORTERM"in Ei?1:f}function Nge(p,o={}){let s=kTt(p,{streamIsTTY:p&&p.isTTY,...o});return ITt(s)}var FTt={stdout:Nge({isTTY:QQ.default.isatty(1)}),stderr:Nge({isTTY:QQ.default.isatty(2)})},Ige=FTt;function kge(p,o,s){let u=p.indexOf(o);if(u===-1)return p;let l=o.length,f=0,y="";do y+=p.slice(f,u)+o+s,f=u+l,u=p.indexOf(o,f);while(u!==-1);return y+=p.slice(f),y}function Fge(p,o,s,u){let l=0,f="";do{let y=p[u-1]==="\r";f+=p.slice(l,y?u-1:u)+o+(y?`\r `:` `)+s,l=u+1,u=p.indexOf(` `,l)}while(u!==-1);return f+=p.slice(l),f}var{stdout:Lge,stderr:Jge}=Ige,YQ=Symbol("GENERATOR"),IT=Symbol("STYLER"),dw=Symbol("IS_EMPTY"),qge=["ansi","ansi","ansi256","ansi16m"],kT=Object.create(null),LTt=(p,o={})=>{if(o.level&&!(Number.isInteger(o.level)&&o.level>=0&&o.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=Lge?Lge.level:0;p.level=o.level===void 0?s:o.level};var JTt=p=>{let o=(...s)=>s.join(" ");return LTt(o,p),Object.setPrototypeOf(o,fw.prototype),o};function fw(p){return JTt(p)}Object.setPrototypeOf(fw.prototype,Function.prototype);for(let[p,o]of Object.entries(rs))kT[p]={get(){let s=dM(this,KQ(o.open,o.close,this[IT]),this[dw]);return Object.defineProperty(this,p,{value:s}),s}};kT.visible={get(){let p=dM(this,this[IT],!0);return Object.defineProperty(this,"visible",{value:p}),p}};var WQ=(p,o,s,...u)=>p==="rgb"?o==="ansi16m"?rs[s].ansi16m(...u):o==="ansi256"?rs[s].ansi256(rs.rgbToAnsi256(...u)):rs[s].ansi(rs.rgbToAnsi(...u)):p==="hex"?WQ("rgb",o,s,...rs.hexToRgb(...u)):rs[s][p](...u),qTt=["rgb","hex","ansi256"];for(let p of qTt){kT[p]={get(){let{level:s}=this;return function(...u){let l=KQ(WQ(p,qge[s],"color",...u),rs.color.close,this[IT]);return dM(this,l,this[dw])}}};let o="bg"+p[0].toUpperCase()+p.slice(1);kT[o]={get(){let{level:s}=this;return function(...u){let l=KQ(WQ(p,qge[s],"bgColor",...u),rs.bgColor.close,this[IT]);return dM(this,l,this[dw])}}}}var BTt=Object.defineProperties(()=>{},{...kT,level:{enumerable:!0,get(){return this[YQ].level},set(p){this[YQ].level=p}}}),KQ=(p,o,s)=>{let u,l;return s===void 0?(u=p,l=o):(u=s.openAll+p,l=o+s.closeAll),{open:p,close:o,openAll:u,closeAll:l,parent:s}},dM=(p,o,s)=>{let u=(...l)=>UTt(u,l.length===1?""+l[0]:l.join(" "));return Object.setPrototypeOf(u,BTt),u[YQ]=p,u[IT]=o,u[dw]=s,u},UTt=(p,o)=>{if(p.level<=0||!o)return p[dw]?"":o;let s=p[IT];if(s===void 0)return o;let{openAll:u,closeAll:l}=s;if(o.includes("\x1B"))for(;s!==void 0;)o=kge(o,s.close,s.open),s=s.parent;let f=o.indexOf(` diff --git a/package.json b/package.json index 20b0078a..381bf19a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skeet-framework/cli", - "version": "1.5.10", + "version": "1.5.11", "description": "Skeet CLI", "main": "dist/index.js", "repository": "https://github.com/elsoul/skeet-cli", @@ -69,4 +69,4 @@ "tsconfig-paths": "4.2.0", "typescript": "5.0.4" } -} +} \ No newline at end of file diff --git a/src/lib/version.ts b/src/lib/version.ts index d7c1f54c..8f029635 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -1 +1 @@ -export const VERSION = '1.5.10' \ No newline at end of file +export const VERSION = '1.5.11' \ No newline at end of file