edgeone 1.6.29 → 1.6.30
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.
- package/edgeone-dist/cli.js +5 -5
- package/edgeone-dist/pages/dev/runner-worker.js +3 -3
- package/edgeone-dist/pages/templates/agent-python/__pycache__/memory.cpython-313.pyc +0 -0
- package/edgeone-dist/studio/ui/assets/agent-obs-BpTIot8x.js +4 -0
- package/edgeone-dist/studio/ui/assets/agent-obs-CEOY4DZz.css +1 -0
- package/edgeone-dist/studio/ui/assets/{index-DD3d108t.js → index-DN8YhmEp.js} +1 -1
- package/edgeone-dist/studio/ui/index.html +3 -3
- package/package.json +1 -1
- package/edgeone-dist/studio/ui/assets/agent-obs-Dvi4IpEy.js +0 -4
- package/edgeone-dist/studio/ui/assets/agent-obs-qDJCE0TQ.css +0 -1
package/edgeone-dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ var lrr=Object.create;var KQ=Object.defineProperty;var prr=Object.getOwnProperty
|
|
|
18
18
|
`;return fu(e,r)}function KO(e){let t=que.join(process.cwd(),".edgeone","auth.json");GI(t,{EDGEONE_PAGES_API_TOKEN:e.token,EDGEONE_PAGES_API_REGION:e.region})}function VI(){try{let e=que.join(process.cwd(),".edgeone","auth.json");if(!sh.default.existsSync(e))return null;let t=JSON.parse(sh.default.readFileSync(e,"utf-8"));return{token:t==null?void 0:t.EDGEONE_PAGES_API_TOKEN,region:t==null?void 0:t.EDGEONE_PAGES_API_REGION}}catch{return null}}function kMe(e){return sh.default.unlinkSync(e)}function TMe(e,t){return Mw(e)?sh.default.appendFileSync(e,t):sh.default.writeFileSync(e,t)}var _Me,sh,CMe,qG,que,Mc=Sf(()=>{_Me=Ct(MG()),sh=Ct(require("fs")),CMe=Ct(require("os"));jc();qG=SMe(),que=require("path")});async function $G(e){var t,r;try{let n=JSON.parse(await BMe.default.promises.readFile(DMe.default.join(e,"package.json"),"utf-8"));return((t=n.dependencies)==null?void 0:t.nuxt)||((r=n.devDependencies)==null?void 0:r.nuxt)||"latest"}catch{return"latest"}}function $ue(){return process.env.LANG==="zh_CN.UTF-8"}var Rnr,Nnr,BMe,DMe,XO=Sf(()=>{Rnr=Ct(require("crypto")),Nnr=require("lodash"),BMe=Ct(require("fs")),DMe=Ct(require("path"))});var Wue=R((uli,zMe)=>{var Gue=Object.defineProperty,Onr=Object.getOwnPropertyDescriptor,Fnr=Object.getOwnPropertyNames,Lnr=Object.prototype.hasOwnProperty,jnr=(e,t)=>{for(var r in t)Gue(e,r,{get:t[r],enumerable:!0})},Mnr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fnr(t))!Lnr.call(e,o)&&o!==r&&Gue(e,o,{get:()=>t[o],enumerable:!(n=Onr(t,o))||n.enumerable});return e},Qnr=e=>Mnr(Gue({},"__esModule",{value:!0}),e),NMe={};jnr(NMe,{defineConfig:()=>iir,envConfigSchema:()=>nir,filteredTefConfigSchema:()=>tir,nodeFunctionsConfigSchema:()=>qMe,pathMatch:()=>ZO,sandboxConfigSchema:()=>$Me,showError:()=>u8,tefBuildConfigSchema:()=>OMe,tefConfCachesSchema:()=>UMe,tefConfigSchema:()=>Vue,tefDevConfigSchema:()=>LMe,tefDevSiteConfigSchema:()=>FMe,tefPublishConfigSchema:()=>QMe,tefRuleConditionSchema:()=>jMe,tefRuleConfigSchema:()=>MMe,validateConfig:()=>sir});zMe.exports=Qnr(NMe);var rr=require("zod"),OMe=rr.z.object({monitor:rr.z.array(rr.z.string()).optional(),command:rr.z.string().optional(),cwd:rr.z.string().optional(),target_file:rr.z.string()}),FMe=rr.z.object({assets_dir:rr.z.string().optional(),proxy_path:rr.z.string().optional()}),LMe=rr.z.object({port:rr.z.union([rr.z.number(),rr.z.string()]).optional(),origin:rr.z.string().optional(),timeout:rr.z.union([rr.z.number(),rr.z.string()]).optional(),sandbox:rr.z.boolean().optional(),favicon:rr.z.boolean().optional(),minify:rr.z.boolean().optional(),site:FMe.optional()}),jMe=rr.z.object({target:rr.z.string(),operator:rr.z.union([rr.z.literal("equal"),rr.z.literal("notequal")]),values:rr.z.array(rr.z.string())}),MMe=rr.z.object({condition:rr.z.array(jMe)}),QMe=rr.z.object({minify:rr.z.boolean().optional(),rule:rr.z.array(MMe).optional()}),qMe=rr.z.object({maxDuration:rr.z.number().min(10).max(120).optional()}),cli=rr.z.object({type:rr.z.enum(["header","cookie","host","query"]),key:rr.z.string(),value:rr.z.string().optional()}),ZO=(e,t)=>{var o,s;let r=e.replace(/\\([?*])/g,"$1");return r.length===0?t.addIssue({code:rr.z.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(r)?t.addIssue({code:rr.z.ZodIssueCode.custom,message:"char match error"}):((s=(o=r.match(/\*/g))==null?void 0:o.length)!=null?s:0)>1?t.addIssue({code:rr.z.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(r)||/:(?![a-zA-Z0-9]+)/.test(r)?t.addIssue({code:rr.z.ZodIssueCode.custom,message:": match error"}):!0},HG=rr.z.object({source:rr.z.string().superRefine(ZO)});function qnr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),o=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let s=`${o}=86400`;if(n===-1)return`value match error: Cache-Control directive "${o}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`value match error: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}var Unr=rr.z.object({key:rr.z.string().min(1).max(100).superRefine((e,t)=>/[^a-zA-Z0-9-]/.test(e)?t.addIssue({code:rr.z.ZodIssueCode.custom,message:"char match error"}):!0),value:rr.z.string().min(1).max(1e3).superRefine((e,t)=>/[\u4e00-\u9fa5]/.test(e)?t.addIssue({code:rr.z.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((e,t)=>{if(e.key.toLowerCase()==="cache-control"){let r=qnr(e.value);r&&t.addIssue({code:rr.z.ZodIssueCode.custom,path:["value"],message:r})}}),$nr=Unr.array().min(1),znr=HG.merge(rr.z.object({headers:$nr})).array(),Hnr=rr.z.union([rr.z.literal(307),rr.z.literal(301),rr.z.literal(302),rr.z.literal(308),rr.z.literal(303),rr.z.literal(304)]),Gnr=HG.merge(rr.z.object({destination:rr.z.string().superRefine(ZO),permanent:rr.z.boolean().optional(),statusCode:Hnr.optional()})).array(),Vnr=HG.merge(rr.z.object({destination:rr.z.string().superRefine(ZO)})),Wnr=rr.z.object({src:rr.z.string().superRefine(ZO),dest:rr.z.string().superRefine(ZO)}),Ynr=rr.z.union([Vnr,Wnr]).array(),UMe=HG.merge(rr.z.object({cacheTtl:rr.z.number()})).array(),PMe=rr.z.object({included_files:rr.z.array(rr.z.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:rr.z.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:rr.z.array(rr.z.string()).optional().describe("Node modules to be treated as external dependencies")}),Jnr=rr.z.object({includeFiles:rr.z.array(rr.z.string()).optional().describe("Glob patterns for files to include in the function bundle"),externalNodeModules:rr.z.array(rr.z.string()).optional().describe("Node modules to be treated as external dependencies"),maxDuration:rr.z.number().min(10).max(120).optional().describe("Maximum execution duration for a single invocation (seconds)")}),RMe=rr.z.object({maxDuration:rr.z.number().min(10).max(120).optional().describe("Maximum execution duration for a single invocation (seconds)")}),Knr=rr.z.object({dir:rr.z.string().optional().describe("Directory containing agent route files, relative to project root"),framework:rr.z.enum(["claude-agent-sdk","openai-sdk","openai-agents-sdk","langgraph","crewai","deepagents"]).optional().describe("Agent framework hint for runtime adapters"),runtime:rr.z.string().regex(/^(agent-node|agent-python):(\d+|\d+\.\d+\.\d+)(\|(agent-node|agent-python):(\d+|\d+\.\d+\.\d+))*$/).optional().describe("Agent runtime image tag, e.g. agent-node:1 or agent-python:1.2.0"),timeout:rr.z.number().min(1).max(1800).optional().describe("Maximum execution duration for a single agent run (seconds)"),idleTimeout:rr.z.number().int().min(1).max(21600).optional().describe("Maximum idle time for an agent session before recycling (seconds)"),maxLifetime:rr.z.number().int().min(1).max(604800).optional().describe("Maximum lifetime of an agent session (seconds)"),memoryQuota:rr.z.object({maxMessagesPerConversation:rr.z.number().int().positive().optional().describe("Maximum messages allowed in a single memory conversation")}).optional().describe("Agent memory quota settings"),includeFiles:rr.z.array(rr.z.string()).optional().describe("Glob patterns for files to include in the agent bundle"),sandbox:rr.z.object({timeout:rr.z.number().int().positive().optional().describe("Sandbox instance lifetime/idle timeout in seconds")}).optional().describe("Sandbox configuration for agent runtime"),externalNodeModules:rr.z.array(rr.z.string()).optional().describe("Node modules to be treated as external dependencies for agent runtime")}),$Me=rr.z.object({timeout:rr.z.number().int().positive().optional().describe("Sandbox instance lifetime/idle timeout in seconds")}),Xnr=rr.z.object({maxDuration:rr.z.number().min(10).max(120).optional().describe("Maximum execution duration for a single invocation (seconds)"),regions:rr.z.object({mainland:rr.z.array(rr.z.string()).optional().describe('\u56FD\u5185 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-beijing"]'),overseas:rr.z.array(rr.z.string()).optional().describe('\u6D77\u5916 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-tokyo"]')}).optional(),includeFiles:rr.z.array(rr.z.string()).optional().describe("Glob patterns for files to include in the function bundle"),externalNodeModules:rr.z.array(rr.z.string()).optional().describe("Node modules to be treated as external dependencies"),nodejs:Jnr.optional(),python:RMe.optional(),go:RMe.optional(),mainlandRegions:rr.z.array(rr.z.string()).optional().describe('\u56FD\u5185 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-shanghai"]'),overseasRegions:rr.z.array(rr.z.string()).optional().describe('\u6D77\u5916 SCF \u90E8\u7F72\u5730\u57DF, \u5982 ["ap-bangkok"]')}),Znr=rr.z.object({name:rr.z.string().min(1).max(128).describe("Unique name for the schedule task within the project"),cron:rr.z.string().min(1).describe("Standard 5-field cron expression, e.g. */5 * * * *"),timezone:rr.z.string().optional().describe("Timezone for cron parsing, e.g. Asia/Shanghai. Defaults to local system timezone at build time"),method:rr.z.enum(["GET","POST","PUT","DELETE","PATCH","HEAD"]).optional().default("POST").describe("HTTP method for the trigger request. Defaults to POST"),path:rr.z.string().min(1).describe("HTTP path of the cloud function to trigger, e.g. /api/cron/tick"),payload:rr.z.record(rr.z.unknown()).optional().describe("JSON payload to send with the trigger request")}),eir=rr.z.array(Znr).max(10),Vue=rr.z.object({name:rr.z.string().optional(),main:rr.z.string().optional(),zone_id:rr.z.string().optional(),create_date:rr.z.string().optional(),dev:LMe.optional(),publish:QMe.optional(),build:OMe.optional(),$schema:rr.z.string().transform(e=>"").optional(),outputDirectory:rr.z.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:rr.z.string().optional().describe("the install command to run."),buildCommand:rr.z.string().optional().describe("the build command to run."),nodeVersion:rr.z.string().optional().describe("the node version to use."),nodeFunctionsConfig:qMe.optional(),cloudFunctions:Xnr.optional(),agents:Knr.optional(),sandbox:$Me.optional(),headers:znr.optional(),redirects:Gnr.optional(),rewrites:Ynr.optional(),caches:UMe.optional(),"node-functions":PMe.optional().describe("Node function specific configuration"),"edge-functions":PMe.optional().describe("Edge function specific configuration"),schedules:eir.optional().describe("Cron schedule tasks that trigger cloud functions")}),zue=Symbol("filteredSchema"),zG=Symbol("symFilteredValue"),tir=Hue(Vue);function rir(e){return e.errors.map(t=>`${t.message}`).join(`
|
|
19
19
|
`)}function u8(){return!0}function Hue(e,t=["root"]){if(e[zue])return e;let r=e;if((e instanceof rr.z.ZodOptional||e instanceof rr.z.ZodNullable||e instanceof rr.z.ZodReadonly||e instanceof rr.z.ZodPromise||e instanceof rr.z.ZodBranded)&&(r=e.unwrap()),r[zue])return r;let n=null;try{if(r instanceof rr.z.ZodArray){let o=Hue(r.element,[...t,"[]"]);return n=rr.z.array(rr.z.any()).optional().transform(s=>{if(t.length===4&&t.includes("headers")&&(s?s!=null&&s.length||console.warn('"error in root.headers.[].headers": length is invalid, min 1 length error'):console.warn('"error in root.headers.[].headers": undefined is invalid, Required')),!s)return;if(!s.length)return[];let c=[];for(let p=0;p<s.length;p++){let f=s[p];if(f===zG)continue;let h=o.safeParse(f,{path:[...t,`[${p}]`]});if(!h.success){u8();continue}!h.data||h.data===zG||c.push(h.data)}let u=30;return t.length===4&&t[3]==="headers"&&c.length>3?(console.warn(`"error in root.headers.[].headers": length is invalid, max ${u} length error`),c.slice(0,u)):c}),n}return r instanceof rr.z.ZodObject?(n=rr.z.object(Object.fromEntries(Object.entries(r.shape).map(([o,s])=>[o,Hue(s,[...t,o])]))).transform(o=>{let s=e.safeParse(o,{path:t});return s.success?s.data:(u8(),zG)}),n):(n=rr.z.any().transform(o=>{if(o===zG)return;let s=e.safeParse(o,{path:t});if(!s.success){u8()&&console.warn(`"error in ${t.join(".")}": ${JSON.stringify(o)} is invalid, ${rir(s.error)}`);return}return s.data}),n)}catch(o){u8()&&console.error("%c [ e ]-220","font-size:13px; background:pink; color:#bf2c9f;",o)}finally{n&&(n[zue]=!0)}return n}var nir=rr.z.object({TENCENT_SECRET_KEY:rr.z.string(),TENCENT_SECRET_ID:rr.z.string(),DEV_SERVER_ENDPOINT:rr.z.string().optional(),DEV_SERVER_PORT:rr.z.union([rr.z.number(),rr.z.string()]).optional()});function iir(e){return e}function sir(e){return Vue.safeParse(e)}});var tm={};fG(tm,{default:()=>Yue});var GG,Yue,VG=Sf(()=>{GG=Ct(Wue());XQ(tm,Ct(Wue()));Yue={tefConfigSchema:GG.tefConfigSchema,envConfigSchema:GG.envConfigSchema}});function oir(e){return e.length===1?e[0].toString():e.reduce((t,r)=>{if(typeof r=="number")return`${t}[${r.toString()}]`;if(r.includes('"'))return`${t}["${r.replace(/"/g,'\\"')}"]`;if(!/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u.test(r))return`${t}["${r}"]`;let n=t.length===0?"":".";return t+n+r},"")}function HMe(e,t,r){var n;if(e.code==="invalid_union")return e.unionErrors.reduce((o,s)=>{let c=s.issues.map(u=>HMe(u,t,r)).join(t);return o.includes(c)||o.push(c),o},[]).join(r);if(((n=e.path)==null?void 0:n.length)!==0){if(e.path.length===1){let o=e.path[0];if(typeof o=="number")return`${e.message} at index ${o}`}return`${e.message} at "${oir(e.path)}"`}return e.message}function air(e,t,r){return e.length>0?[t,e].join(r):t}function cir(e,t){let{issueSeparator:r=`
|
|
20
20
|
`,unionSeparator:n=", or ",prefixSeparator:o=`
|
|
21
|
-
`,prefix:s}=t,c=e.errors.map(u=>HMe(u,r,n)).join(r);return air(c,s,o)}var l8,fD,WG,YG,Jue=Sf(()=>{l8=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}},fD=class extends l8{constructor(t){super(`[ConfigLoadError] ${t}`)}},WG=class extends l8{constructor(t){super(`[ConfigSaveError] ${t}`)}};YG=class extends l8{details;constructor(t,r){let n=cir(r,{prefix:`${t}:`});super(`[ValidationError] ${n}`),this.details=r.errors}}});var Kue,fli,GMe=Sf(()=>{Kue=class{log(t,r){try{let n=this.format(r),o=JSON.stringify({key:t,value:n});process.send(o)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},fli=new Kue});function rm(e){return Object.prototype.toString.call(e)==="[object Object]"}function Y_(e){return Object.prototype.toString.call(e)==="[object Array]"}function D0(e){return Object.prototype.toString.call(e)==="[object String]"}function ile(e){return Object.prototype.toString.call(e)==="[object Number]"}function KMe(e){return Object.prototype.toString.call(e)==="[object Undefined]"}function f8(e){var n;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return Ri.min_string;if(t.length>500)return Ri.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((n=t.match(/\*/g))==null?void 0:n.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return Ri.char_match;if(t.length){let o=t.split("/");if(o.some(u=>u.includes(":")&&(u.includes("*")||u.includes(".")))||o.some(u=>u.split(":").length>2))return Ri.char_match}}function nle(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return Ri.min_string;if(e.length>500)return Ri.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return Ri.char_match}function uir(e){if(e.length===0)return Ri.min_string;if(e.length>100)return Ri.max_string;if(/[^a-zA-Z0-9-]/.test(e))return Ri.char_match}function lir(e){if(e.length===0)return Ri.min_string;if(e.length>1e3)return Ri.max_string;if(/[\u4e00-\u9fa5]/.test(e))return Ri.char_match}function pir(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),o=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let s=`${o}=86400`;if(n===-1)return`${Ri.value_match}: Cache-Control directive "${o}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`${Ri.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}function fir(e){if(![301,302,303,304,307,308].includes(e))return Ri.value_match}function dir(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return Ri.value_match}function hir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{key:c,value:u}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"key"],message:Ri.invalid_type});continue}let p=uir(c);if(p){n.push({path:[...t,`[${o}]`,"key"],message:p});continue}if(!D0(u)){n.push({path:[...t,`[${o}]`,"value"],message:Ri.invalid_type});continue}let f=lir(u);if(f){n.push({path:[...t,`[${o}]`,"value"],message:f});continue}if(c.toLowerCase()==="cache-control"){let h=pir(u);if(h){n.push({path:[...t,`[${o}]`,"value"],message:h});continue}}r.push({key:c,value:u})}return[r,n]}function mir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{source:c,headers:u}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let p=f8(c);if(p){n.push({path:[...t,`[${o}]`,"source"],message:p});continue}let[f,h]=hir(u,[...t,`[${o}]`,"headers"]);f.length>100&&(h.push({path:[...t,`[${o}]`,"headers"],message:Ri.max_length}),f=f.slice(0,100)),(u==null?void 0:u.length)<1&&f.length<1&&h.push({path:[...t,`[${o}]`,"headers"],message:Ri.min_length}),f.length&&r.push({source:c,headers:f}),n.push(...h)}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function gir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{source:c,destination:u,statusCode:p}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let f=f8(c);if(f){n.push({path:[...t,`[${o}]`,"source"],message:f});continue}if(!D0(u)){n.push({path:[...t,`[${o}]`,"destination"],message:Ri.invalid_type});continue}let h=nle(u);if(h){n.push({path:[...t,`[${o}]`,"destination"],message:h});continue}if(!ile(p)){n.push({path:[...t,`[${o}]`,"statusCode"],message:Ri.invalid_type});continue}let g=fir(p);if(g){n.push({path:[...t,`[${o}]`,"statusCode"],message:g});continue}r.push({source:c,destination:u,statusCode:p})}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function Air(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}if("src"in s||"dest"in s){let{src:g,dest:y}=s;if(!D0(g)){n.push({path:[...t,`[${o}]`,"src"],message:Ri.invalid_type});continue}let v=f8(g);if(v){n.push({path:[...t,`[${o}]`,"src"],message:v});continue}if(!D0(y)){n.push({path:[...t,`[${o}]`,"dest"],message:Ri.invalid_type});continue}let A=nle(y);if(A){n.push({path:[...t,`[${o}]`,"dest"],message:A});continue}r.push({src:g,dest:y});continue}let{source:u,destination:p}=s;if(!D0(u)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let f=f8(u);if(f){n.push({path:[...t,`[${o}]`,"source"],message:f});continue}if(!D0(p)){n.push({path:[...t,`[${o}]`,"destination"],message:Ri.invalid_type});continue}let h=nle(p);if(h){n.push({path:[...t,`[${o}]`,"destination"],message:h});continue}r.push({source:u,destination:p})}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function yir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{source:c,cacheTtl:u}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let p=f8(c);if(p){n.push({path:[...t,`[${o}]`,"source"],message:p});continue}if(!ile(u)){n.push({path:[...t,`[${o}]`,"cacheTtl"],message:Ri.invalid_type});continue}let f=dir(u);if(f){n.push({path:[...t,`[${o}]`,"cacheTtl"],message:f});continue}r.push({source:c,cacheTtl:u})}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function WI(e){if(!Y_(e))return;let t=e.filter(r=>D0(r)&&r.trim().length>0);return t.length>0?t:[]}function Xue(e){if(!D0(e))return;let t=e.trim();return t.length>0?t:void 0}function JG(e,t,r,n){let o=[],s=[];if(KMe(e))return[void 0,s];if(!Y_(e))return s.push({path:[...t],message:Ri.invalid_type}),[void 0,s];for(let c in e){let u=e[c];if(!D0(u)){s.push({path:[...t,`[${c}]`],message:Ri.invalid_type});continue}let p=u.trim();if(!r.has(p)){s.push({code:"invalid_region",path:[...t,`[${c}]`],message:`${Ri.value_match}: region id must be one of [${n.join(", ")}]`});continue}o.push(p)}return[o,s]}function XMe(e,t){return Y_(e)&&Y_(t)?e.length===t.length&&e.every((r,n)=>r===t[n]):e===t}function JMe({newValue:e,newPath:t,legacySources:r,path:n}){let o=[],s=WI(e),c=s!==void 0?t:void 0;for(let u of r){let p=WI(u.value);if(p!==void 0){if(o.push({code:"deprecated_config",path:[...n,...u.path],message:u.deprecatedMessage}),s===void 0){s=p,c=u.displayPath;continue}u.checkConflict!==!1&&!XMe(s,p)&&o.push({code:p8.conflict,path:[...n,...u.path],message:`[CONFIG_CONFLICT] ${c} and ${u.displayPath} have conflicting values. Please keep only ${t}.`})}}return[s,o]}function Zue(e,t,r){if(!KMe(e)){if(!ile(e)||!Number.isFinite(e)){r.push({path:[...t],message:Ri.invalid_type});return}return e}}function vir(e,t){var be,Ne,He;let r=rm(e.cloudFunctions)?e.cloudFunctions:{},n=rm(r.nodejs)?r.nodejs:{},o=rm(r.regions)?r.regions:{},s=rm(e["node-functions"])?e["node-functions"]:{},c=rm(e.nodeFunctionsConfig)?e.nodeFunctionsConfig:{},u=[];!YMe&&D0(s.included_files_base_path)&&s.included_files_base_path.trim()&&(YMe=!0,console.warn("`node-functions.included_files_base_path` is deprecated and no longer takes effect. `cloudFunctions.includeFiles` is always resolved from the project root."));let[p,f]=JMe({newValue:r.includeFiles,newPath:"cloudFunctions.includeFiles",path:t,legacySources:[{value:n.includeFiles,path:["cloudFunctions","nodejs","includeFiles"],displayPath:"cloudFunctions.nodejs.includeFiles",deprecatedMessage:"[DEPRECATED] Detected cloudFunctions.nodejs.includeFiles, please migrate to cloudFunctions.includeFiles. The old field will be removed in a future version."},{value:s.included_files,path:["node-functions","included_files"],displayPath:"node-functions.included_files",checkConflict:!1,deprecatedMessage:"[DEPRECATED] Detected node-functions.included_files, which has been mapped to cloudFunctions.includeFiles. Please migrate to the new field."}]}),[h,g]=JMe({newValue:r.externalNodeModules,newPath:"cloudFunctions.externalNodeModules",path:t,legacySources:[{value:n.externalNodeModules,path:["cloudFunctions","nodejs","externalNodeModules"],displayPath:"cloudFunctions.nodejs.externalNodeModules",deprecatedMessage:"[DEPRECATED] Detected cloudFunctions.nodejs.externalNodeModules, please migrate to cloudFunctions.externalNodeModules. The old field will be removed in a future version."},{value:s.external_node_modules,path:["node-functions","external_node_modules"],displayPath:"node-functions.external_node_modules",checkConflict:!1,deprecatedMessage:"[DEPRECATED] Detected node-functions.external_node_modules, which has been mapped to cloudFunctions.externalNodeModules. Please migrate to the new field."}]});u.push(...f,...g);let y={};p!==void 0&&(y.includeFiles=p),h!==void 0&&(y.externalNodeModules=h);let v=Zue(r.maxDuration,[...t,"cloudFunctions","maxDuration"],u),A=[];for(let ft of["nodejs","python","go"]){let wt=rm(r[ft])?r[ft]:{},Ye=Zue(wt.maxDuration,[...t,"cloudFunctions",ft,"maxDuration"],u);Ye!==void 0&&(A.push({runtime:ft,value:Ye,displayPath:`cloudFunctions.${ft}.maxDuration`}),u.push({code:"deprecated_config",path:[...t,"cloudFunctions",ft,"maxDuration"],message:`[DEPRECATED] Detected cloudFunctions.${ft}.maxDuration, which has been mapped to cloudFunctions.maxDuration. Please migrate to the top-level field.`}))}let S=Zue(c.maxDuration,[...t,"nodeFunctionsConfig","maxDuration"],u);S!==void 0&&u.push({code:"deprecated_config",path:[...t,"nodeFunctionsConfig","maxDuration"],message:"[DEPRECATED] Detected nodeFunctionsConfig.maxDuration, which has been mapped to cloudFunctions.maxDuration. Please migrate to the top-level field."});let E=A.find(({runtime:ft})=>ft==="nodejs");E&&S!==void 0&&E.value!==S&&u.push({code:p8.conflict,path:[...t,"nodeFunctionsConfig","maxDuration"],message:"[CONFIG_CONFLICT] cloudFunctions.nodejs.maxDuration and nodeFunctionsConfig.maxDuration have conflicting values. Please keep only cloudFunctions.maxDuration."});let I=[...A];S!==void 0&&E===void 0&&I.push({runtime:"nodejs",value:S,displayPath:"nodeFunctionsConfig.maxDuration"});let D=v;if(v!==void 0)for(let{displayPath:ft,value:wt}of I)wt!==v&&u.push({code:p8.conflict,path:[...t,...ft.split(".")],message:`[CONFIG_CONFLICT] cloudFunctions.maxDuration and ${ft} have conflicting values. Please keep only cloudFunctions.maxDuration.`});else if(I.length>0)if(new Set(I.map(({value:wt})=>wt)).size>1){let wt=I.map(({runtime:Ye,value:Ke})=>`${Ye}: ${Ke}`).join(", ");u.push({code:p8.migrationRequired,path:[...t,"cloudFunctions"],message:`[MIGRATION_REQUIRED] Detected conflicting cloudFunctions.*.maxDuration values (${wt}). The new structure only supports a single cloudFunctions.maxDuration; please choose one value and migrate.`})}else D=I[0].value;D!==void 0&&(y.maxDuration=D);let[j,F]=JG(o.mainland,[...t,"cloudFunctions","regions","mainland"],VMe,tle),[U,te]=JG(r.mainlandRegions,[...t,"cloudFunctions","mainlandRegions"],VMe,tle),[Y,me]=JG(o.overseas,[...t,"cloudFunctions","regions","overseas"],WMe,rle),[re,ce]=JG(r.overseasRegions,[...t,"cloudFunctions","overseasRegions"],WMe,rle);u.push(...F,...te,...me,...ce);function Z({newValue:ft,legacyValue:wt,legacyField:Ye,newField:Ke}){return wt!==void 0&&(u.push({code:"deprecated_config",path:[...t,...Ye.split(".")],message:`[DEPRECATED] Detected ${Ye}, please migrate to ${Ke}. The old field will be removed in a future version.`}),ft!==void 0&&!XMe(ft,wt)&&u.push({code:p8.conflict,path:[...t,...Ye.split(".")],message:`[CONFIG_CONFLICT] ${Ye} and ${Ke} have conflicting values. Please keep only ${Ke}.`})),ft!==void 0?ft:wt}let ge=Z({newValue:j,legacyValue:U,legacyField:"cloudFunctions.mainlandRegions",newField:"cloudFunctions.regions.mainland"}),J=Z({newValue:Y,legacyValue:re,legacyField:"cloudFunctions.overseasRegions",newField:"cloudFunctions.regions.overseas"});(ge!==void 0||J!==void 0)&&(y.regions={},ge!==void 0&&(y.regions.mainland=ge),J!==void 0&&(y.regions.overseas=J));let $={},de=(be=WI(n.includeFiles))!=null?be:WI(s.included_files),Oe=(Ne=WI(n.externalNodeModules))!=null?Ne:WI(s.external_node_modules);de!==void 0&&($.includeFiles=de),Oe!==void 0&&($.externalNodeModules=Oe);let ye=(He=E==null?void 0:E.value)!=null?He:S;ye!==void 0&&($.maxDuration=ye),Object.keys($).length>0&&Object.defineProperty(y,"nodejs",{configurable:!0,value:$});for(let ft of["python","go"]){let wt=A.find(Ye=>Ye.runtime===ft);wt&&Object.defineProperty(y,ft,{configurable:!0,value:{maxDuration:wt.value}})}return U!==void 0&&Object.defineProperty(y,"mainlandRegions",{configurable:!0,value:U}),re!==void 0&&Object.defineProperty(y,"overseasRegions",{configurable:!0,value:re}),[y,u]}function ele(e,t,r){return typeof e!="number"||!Number.isFinite(e)?t:Math.min(Math.max(Math.floor(e),1),r)}function bir(){let e=process.env.EDGEONE_EMIT_AGENT_LIFECYCLE_FIELDS;return e==="1"||(e==null?void 0:e.toLowerCase())==="true"?!0:e==="0"||(e==null?void 0:e.toLowerCase())==="false"?!1:xir}function Eir(e){let t=rm(e.agents),r=t?e.agents:{},n=bir(),o=Xue(r.dir),s=Xue(r.framework),c=Xue(r.runtime),u=t?ele(r.timeout,300,1800):void 0,p=n&&t&&r.idleTimeout!==void 0?ele(r.idleTimeout,void 0,21600):void 0,f=n&&t&&r.maxLifetime!==void 0?ele(r.maxLifetime,void 0,604800):void 0,h=WI(r.includeFiles),g=WI(r.externalNodeModules),y=rm(r.sandbox)?r.sandbox:void 0,v=ZMe(y==null?void 0:y.timeout),A=rm(r.memoryQuota)?r.memoryQuota:void 0,S=A&&typeof A.maxMessagesPerConversation=="number"?A.maxMessagesPerConversation:void 0,E={};return o!==void 0&&(E.dir=o),s!==void 0&&(E.framework=s),c!==void 0&&(E.runtime=c),u!==void 0&&(E.timeout=u),p!==void 0&&(E.idleTimeout=p),f!==void 0&&(E.maxLifetime=f),S!==void 0&&(E.memoryQuota={maxMessagesPerConversation:S}),v!==void 0&&(E.sandbox={timeout:v}),h!==void 0&&(E.includeFiles=h),g!==void 0&&(E.externalNodeModules=g),E}function ZMe(e){if(typeof e!="number"||!Number.isFinite(e))return;let t=Math.floor(e);return t>0?t:void 0}function wir(e){let t=rm(e.sandbox)?e.sandbox:void 0,r={};if(!t)return r;let n=ZMe(t.timeout);return n!==void 0?r.timeout=n:t.timeout!==void 0&&(r.timeout=t.timeout),r}function d8(e,t){let r={headers:[],redirects:[],rewrites:[],caches:[]},n=[];if(!rm(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];let{headers:o=[],redirects:s=[],rewrites:c=[],caches:u=[]}=e,[p,f]=mir(o,[...t,"headers"]),[h,g]=gir(s,[...t,"redirects"]),[y,v]=Air(c,[...t,"rewrites"]),[A,S]=yir(u,[...t,"caches"]);r.headers=p,r.redirects=h,r.rewrites=y,r.caches=A;let[E,I]=vir(e,t),D=I.filter(Y=>(Y==null?void 0:Y.code)==="deprecated_config"),j=I.filter(Y=>(Y==null?void 0:Y.code)!=="deprecated_config"),F=Eir(e),U=wir(e);r["edge-functions"]=e["edge-functions"],r.trailingSlash=e.trailingSlash,Object.keys(E).length>0&&(r.cloudFunctions=E),Object.keys(F).length>0&&(r.agents=F),Object.keys(U).length>0&&(r.sandbox=U);let te=["outputDirectory","installCommand","buildCommand","nodeVersion","schedules"];for(let Y in e)te.includes(Y)&&e[Y]&&(r[Y]=e[Y]);return n.push(...j,...f,...g,...v,...S),[r,n,D]}var Ri,tle,rle,VMe,WMe,YMe,p8,xir,sle=Sf(()=>{Ri={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"},tle=["ap-guangzhou","ap-shanghai","ap-nanjing","ap-beijing","ap-chengdu"],rle=["ap-singapore","ap-hongkong","ap-bangkok","ap-jakarta","ap-seoul","ap-tokyo","eu-frankfurt","na-ashburn","na-siliconvalley"],VMe=new Set(tle),WMe=new Set(rle);YMe=!1,p8={conflict:"config_conflict",migrationRequired:"migration_required"};xir=!1});var yb,Sir,eQe,_ir,Cir,Iir,kir,Tir,Bir,Dir,tQe,rQe=Sf(()=>{yb=require("zod"),Sir=/^(?=.{2,30}$)[a-z0-9]+(-[a-z0-9]+)*-?[a-z0-9]+$/,eQe=yb.z.string().refine(e=>Sir.test(e)),_ir=yb.z.enum(["vps-react-ts","vps-react","vps-vue-ts","vps-vue","manaia-demo","manaia-demo-ts"]),Cir=yb.z.object({name:eQe}),Iir=yb.z.object({name:eQe,template:_ir}),kir=yb.z.object({script:yb.z.string().optional()}),Tir=yb.z.object({script:yb.z.string().optional()}),Bir=yb.z.object({}),Dir=yb.z.object({}),tQe={initArgsSchema:Cir,generateArgsSchema:Iir,devArgsSchema:kir,publishArgsSchema:Tir,deleteArgsSchema:Bir,testArgsSchema:Dir}});function Pir(e,t){return r=>{try{e.parse(r)}catch(n){throw new YG(`Failed to validate ${t}`,n)}}}function Rir(){let e={};return Object.entries({...tQe,...Yue}).forEach(([t,r])=>{let n=t.replace("Schema","");e[n]=Pir(r,n)}),e}var vli,nQe=Sf(()=>{rQe();VG();Jue();vli=Rir()});function dD(e="",t={confPath:""}){try{e=e||process.cwd();let[r,n]=m8(e);if(t.exists=n,!n)return t.showError||(0,tm.showError)(),{headers:[],redirects:[],rewrites:[]};if(t.confPath=r,r.endsWith(".ts"))return Oir(r);let o=UG(r);return oQe.default.parse(o)}catch{t.showError||(0,tm.showError)()}}function Oir(e){var g,y,v,A,S,E,I,D,j;let t=ole.default.statSync(e),r=iQe.get(e);if(r&&r.mtimeMs===t.mtimeMs)return r.config;let n=(0,h8.createRequire)("file:///Users/jesper/Desktop/develop/full-stack-deployment/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js"),o=JA.default.join(JA.default.dirname((0,aQe.fileURLToPath)("file:///Users/jesper/Desktop/develop/full-stack-deployment/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js")),"config-schema.js"),s=ole.default.existsSync(o)?o:n.resolve("@edgeone/types/config"),c;try{c=(0,sQe.buildSync)({entryPoints:[e],bundle:!0,platform:"node",format:"cjs",write:!1,target:"node12",logLevel:"silent",absWorkingDir:JA.default.dirname(e),alias:{"@edgeone/types/config":s},external:[]})}catch(F){throw new fD(`Failed to load ${JA.default.basename(e)}:
|
|
21
|
+
`,prefix:s}=t,c=e.errors.map(u=>HMe(u,r,n)).join(r);return air(c,s,o)}var l8,fD,WG,YG,Jue=Sf(()=>{l8=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}},fD=class extends l8{constructor(t){super(`[ConfigLoadError] ${t}`)}},WG=class extends l8{constructor(t){super(`[ConfigSaveError] ${t}`)}};YG=class extends l8{details;constructor(t,r){let n=cir(r,{prefix:`${t}:`});super(`[ValidationError] ${n}`),this.details=r.errors}}});var Kue,fli,GMe=Sf(()=>{Kue=class{log(t,r){try{let n=this.format(r),o=JSON.stringify({key:t,value:n});process.send(o)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},fli=new Kue});function rm(e){return Object.prototype.toString.call(e)==="[object Object]"}function Y_(e){return Object.prototype.toString.call(e)==="[object Array]"}function D0(e){return Object.prototype.toString.call(e)==="[object String]"}function ile(e){return Object.prototype.toString.call(e)==="[object Number]"}function KMe(e){return Object.prototype.toString.call(e)==="[object Undefined]"}function f8(e){var n;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return Ri.min_string;if(t.length>500)return Ri.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((n=t.match(/\*/g))==null?void 0:n.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return Ri.char_match;if(t.length){let o=t.split("/");if(o.some(u=>u.includes(":")&&(u.includes("*")||u.includes(".")))||o.some(u=>u.split(":").length>2))return Ri.char_match}}function nle(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return Ri.min_string;if(e.length>500)return Ri.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return Ri.char_match}function uir(e){if(e.length===0)return Ri.min_string;if(e.length>100)return Ri.max_string;if(/[^a-zA-Z0-9-]/.test(e))return Ri.char_match}function lir(e){if(e.length===0)return Ri.min_string;if(e.length>1e3)return Ri.max_string;if(/[\u4e00-\u9fa5]/.test(e))return Ri.char_match}function pir(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),o=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let s=`${o}=86400`;if(n===-1)return`${Ri.value_match}: Cache-Control directive "${o}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`${Ri.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}function fir(e){if(![301,302,303,304,307,308].includes(e))return Ri.value_match}function dir(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return Ri.value_match}function hir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{key:c,value:u}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"key"],message:Ri.invalid_type});continue}let p=uir(c);if(p){n.push({path:[...t,`[${o}]`,"key"],message:p});continue}if(!D0(u)){n.push({path:[...t,`[${o}]`,"value"],message:Ri.invalid_type});continue}let f=lir(u);if(f){n.push({path:[...t,`[${o}]`,"value"],message:f});continue}if(c.toLowerCase()==="cache-control"){let h=pir(u);if(h){n.push({path:[...t,`[${o}]`,"value"],message:h});continue}}r.push({key:c,value:u})}return[r,n]}function mir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{source:c,headers:u}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let p=f8(c);if(p){n.push({path:[...t,`[${o}]`,"source"],message:p});continue}let[f,h]=hir(u,[...t,`[${o}]`,"headers"]);f.length>100&&(h.push({path:[...t,`[${o}]`,"headers"],message:Ri.max_length}),f=f.slice(0,100)),(u==null?void 0:u.length)<1&&f.length<1&&h.push({path:[...t,`[${o}]`,"headers"],message:Ri.min_length}),f.length&&r.push({source:c,headers:f}),n.push(...h)}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function gir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{source:c,destination:u,statusCode:p}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let f=f8(c);if(f){n.push({path:[...t,`[${o}]`,"source"],message:f});continue}if(!D0(u)){n.push({path:[...t,`[${o}]`,"destination"],message:Ri.invalid_type});continue}let h=nle(u);if(h){n.push({path:[...t,`[${o}]`,"destination"],message:h});continue}if(!ile(p)){n.push({path:[...t,`[${o}]`,"statusCode"],message:Ri.invalid_type});continue}let g=fir(p);if(g){n.push({path:[...t,`[${o}]`,"statusCode"],message:g});continue}r.push({source:c,destination:u,statusCode:p})}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function Air(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}if("src"in s||"dest"in s){let{src:g,dest:y}=s;if(!D0(g)){n.push({path:[...t,`[${o}]`,"src"],message:Ri.invalid_type});continue}let v=f8(g);if(v){n.push({path:[...t,`[${o}]`,"src"],message:v});continue}if(!D0(y)){n.push({path:[...t,`[${o}]`,"dest"],message:Ri.invalid_type});continue}let A=nle(y);if(A){n.push({path:[...t,`[${o}]`,"dest"],message:A});continue}r.push({src:g,dest:y});continue}let{source:u,destination:p}=s;if(!D0(u)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let f=f8(u);if(f){n.push({path:[...t,`[${o}]`,"source"],message:f});continue}if(!D0(p)){n.push({path:[...t,`[${o}]`,"destination"],message:Ri.invalid_type});continue}let h=nle(p);if(h){n.push({path:[...t,`[${o}]`,"destination"],message:h});continue}r.push({source:u,destination:p})}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function yir(e,t){let r=[],n=[];if(!Y_(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];for(let o in e){let s=e[o];if(!rm(s)){n.push({path:[...t,`[${o}]`],message:Ri.invalid_type});continue}let{source:c,cacheTtl:u}=s;if(!D0(c)){n.push({path:[...t,`[${o}]`,"source"],message:Ri.invalid_type});continue}let p=f8(c);if(p){n.push({path:[...t,`[${o}]`,"source"],message:p});continue}if(!ile(u)){n.push({path:[...t,`[${o}]`,"cacheTtl"],message:Ri.invalid_type});continue}let f=dir(u);if(f){n.push({path:[...t,`[${o}]`,"cacheTtl"],message:f});continue}r.push({source:c,cacheTtl:u})}return r.length>100&&(n.push({path:[...t],message:Ri.max_length}),r=r.slice(0,100)),[r,n]}function WI(e){if(!Y_(e))return;let t=e.filter(r=>D0(r)&&r.trim().length>0);return t.length>0?t:[]}function Xue(e){if(!D0(e))return;let t=e.trim();return t.length>0?t:void 0}function JG(e,t,r,n){let o=[],s=[];if(KMe(e))return[void 0,s];if(!Y_(e))return s.push({path:[...t],message:Ri.invalid_type}),[void 0,s];for(let c in e){let u=e[c];if(!D0(u)){s.push({path:[...t,`[${c}]`],message:Ri.invalid_type});continue}let p=u.trim();if(!r.has(p)){s.push({code:"invalid_region",path:[...t,`[${c}]`],message:`${Ri.value_match}: region id must be one of [${n.join(", ")}]`});continue}o.push(p)}return[o,s]}function XMe(e,t){return Y_(e)&&Y_(t)?e.length===t.length&&e.every((r,n)=>r===t[n]):e===t}function JMe({newValue:e,newPath:t,legacySources:r,path:n}){let o=[],s=WI(e),c=s!==void 0?t:void 0;for(let u of r){let p=WI(u.value);if(p!==void 0){if(o.push({code:"deprecated_config",path:[...n,...u.path],message:u.deprecatedMessage}),s===void 0){s=p,c=u.displayPath;continue}u.checkConflict!==!1&&!XMe(s,p)&&o.push({code:p8.conflict,path:[...n,...u.path],message:`[CONFIG_CONFLICT] ${c} and ${u.displayPath} have conflicting values. Please keep only ${t}.`})}}return[s,o]}function Zue(e,t,r){if(!KMe(e)){if(!ile(e)||!Number.isFinite(e)){r.push({path:[...t],message:Ri.invalid_type});return}return e}}function vir(e,t){var be,Ne,He;let r=rm(e.cloudFunctions)?e.cloudFunctions:{},n=rm(r.nodejs)?r.nodejs:{},o=rm(r.regions)?r.regions:{},s=rm(e["node-functions"])?e["node-functions"]:{},c=rm(e.nodeFunctionsConfig)?e.nodeFunctionsConfig:{},u=[];!YMe&&D0(s.included_files_base_path)&&s.included_files_base_path.trim()&&(YMe=!0,console.warn("`node-functions.included_files_base_path` is deprecated and no longer takes effect. `cloudFunctions.includeFiles` is always resolved from the project root."));let[p,f]=JMe({newValue:r.includeFiles,newPath:"cloudFunctions.includeFiles",path:t,legacySources:[{value:n.includeFiles,path:["cloudFunctions","nodejs","includeFiles"],displayPath:"cloudFunctions.nodejs.includeFiles",deprecatedMessage:"[DEPRECATED] Detected cloudFunctions.nodejs.includeFiles, please migrate to cloudFunctions.includeFiles. The old field will be removed in a future version."},{value:s.included_files,path:["node-functions","included_files"],displayPath:"node-functions.included_files",checkConflict:!1,deprecatedMessage:"[DEPRECATED] Detected node-functions.included_files, which has been mapped to cloudFunctions.includeFiles. Please migrate to the new field."}]}),[h,g]=JMe({newValue:r.externalNodeModules,newPath:"cloudFunctions.externalNodeModules",path:t,legacySources:[{value:n.externalNodeModules,path:["cloudFunctions","nodejs","externalNodeModules"],displayPath:"cloudFunctions.nodejs.externalNodeModules",deprecatedMessage:"[DEPRECATED] Detected cloudFunctions.nodejs.externalNodeModules, please migrate to cloudFunctions.externalNodeModules. The old field will be removed in a future version."},{value:s.external_node_modules,path:["node-functions","external_node_modules"],displayPath:"node-functions.external_node_modules",checkConflict:!1,deprecatedMessage:"[DEPRECATED] Detected node-functions.external_node_modules, which has been mapped to cloudFunctions.externalNodeModules. Please migrate to the new field."}]});u.push(...f,...g);let y={};p!==void 0&&(y.includeFiles=p),h!==void 0&&(y.externalNodeModules=h);let v=Zue(r.maxDuration,[...t,"cloudFunctions","maxDuration"],u),A=[];for(let ft of["nodejs","python","go"]){let wt=rm(r[ft])?r[ft]:{},Ye=Zue(wt.maxDuration,[...t,"cloudFunctions",ft,"maxDuration"],u);Ye!==void 0&&(A.push({runtime:ft,value:Ye,displayPath:`cloudFunctions.${ft}.maxDuration`}),u.push({code:"deprecated_config",path:[...t,"cloudFunctions",ft,"maxDuration"],message:`[DEPRECATED] Detected cloudFunctions.${ft}.maxDuration, which has been mapped to cloudFunctions.maxDuration. Please migrate to the top-level field.`}))}let S=Zue(c.maxDuration,[...t,"nodeFunctionsConfig","maxDuration"],u);S!==void 0&&u.push({code:"deprecated_config",path:[...t,"nodeFunctionsConfig","maxDuration"],message:"[DEPRECATED] Detected nodeFunctionsConfig.maxDuration, which has been mapped to cloudFunctions.maxDuration. Please migrate to the top-level field."});let E=A.find(({runtime:ft})=>ft==="nodejs");E&&S!==void 0&&E.value!==S&&u.push({code:p8.conflict,path:[...t,"nodeFunctionsConfig","maxDuration"],message:"[CONFIG_CONFLICT] cloudFunctions.nodejs.maxDuration and nodeFunctionsConfig.maxDuration have conflicting values. Please keep only cloudFunctions.maxDuration."});let I=[...A];S!==void 0&&E===void 0&&I.push({runtime:"nodejs",value:S,displayPath:"nodeFunctionsConfig.maxDuration"});let D=v;if(v!==void 0)for(let{displayPath:ft,value:wt}of I)wt!==v&&u.push({code:p8.conflict,path:[...t,...ft.split(".")],message:`[CONFIG_CONFLICT] cloudFunctions.maxDuration and ${ft} have conflicting values. Please keep only cloudFunctions.maxDuration.`});else if(I.length>0)if(new Set(I.map(({value:wt})=>wt)).size>1){let wt=I.map(({runtime:Ye,value:Ke})=>`${Ye}: ${Ke}`).join(", ");u.push({code:p8.migrationRequired,path:[...t,"cloudFunctions"],message:`[MIGRATION_REQUIRED] Detected conflicting cloudFunctions.*.maxDuration values (${wt}). The new structure only supports a single cloudFunctions.maxDuration; please choose one value and migrate.`})}else D=I[0].value;D!==void 0&&(y.maxDuration=D);let[j,F]=JG(o.mainland,[...t,"cloudFunctions","regions","mainland"],VMe,tle),[U,te]=JG(r.mainlandRegions,[...t,"cloudFunctions","mainlandRegions"],VMe,tle),[Y,me]=JG(o.overseas,[...t,"cloudFunctions","regions","overseas"],WMe,rle),[re,ce]=JG(r.overseasRegions,[...t,"cloudFunctions","overseasRegions"],WMe,rle);u.push(...F,...te,...me,...ce);function Z({newValue:ft,legacyValue:wt,legacyField:Ye,newField:Ke}){return wt!==void 0&&(u.push({code:"deprecated_config",path:[...t,...Ye.split(".")],message:`[DEPRECATED] Detected ${Ye}, please migrate to ${Ke}. The old field will be removed in a future version.`}),ft!==void 0&&!XMe(ft,wt)&&u.push({code:p8.conflict,path:[...t,...Ye.split(".")],message:`[CONFIG_CONFLICT] ${Ye} and ${Ke} have conflicting values. Please keep only ${Ke}.`})),ft!==void 0?ft:wt}let ge=Z({newValue:j,legacyValue:U,legacyField:"cloudFunctions.mainlandRegions",newField:"cloudFunctions.regions.mainland"}),J=Z({newValue:Y,legacyValue:re,legacyField:"cloudFunctions.overseasRegions",newField:"cloudFunctions.regions.overseas"});(ge!==void 0||J!==void 0)&&(y.regions={},ge!==void 0&&(y.regions.mainland=ge),J!==void 0&&(y.regions.overseas=J));let $={},de=(be=WI(n.includeFiles))!=null?be:WI(s.included_files),Oe=(Ne=WI(n.externalNodeModules))!=null?Ne:WI(s.external_node_modules);de!==void 0&&($.includeFiles=de),Oe!==void 0&&($.externalNodeModules=Oe);let ye=(He=E==null?void 0:E.value)!=null?He:S;ye!==void 0&&($.maxDuration=ye),Object.keys($).length>0&&Object.defineProperty(y,"nodejs",{configurable:!0,value:$});for(let ft of["python","go"]){let wt=A.find(Ye=>Ye.runtime===ft);wt&&Object.defineProperty(y,ft,{configurable:!0,value:{maxDuration:wt.value}})}return U!==void 0&&Object.defineProperty(y,"mainlandRegions",{configurable:!0,value:U}),re!==void 0&&Object.defineProperty(y,"overseasRegions",{configurable:!0,value:re}),[y,u]}function ele(e,t,r){return typeof e!="number"||!Number.isFinite(e)?t:Math.min(Math.max(Math.floor(e),1),r)}function bir(){let e=process.env.EDGEONE_EMIT_AGENT_LIFECYCLE_FIELDS;return e==="1"||(e==null?void 0:e.toLowerCase())==="true"?!0:e==="0"||(e==null?void 0:e.toLowerCase())==="false"?!1:xir}function Eir(e){let t=rm(e.agents),r=t?e.agents:{},n=bir(),o=Xue(r.dir),s=Xue(r.framework),c=Xue(r.runtime),u=t?ele(r.timeout,300,1800):void 0,p=n&&t&&r.idleTimeout!==void 0?ele(r.idleTimeout,void 0,21600):void 0,f=n&&t&&r.maxLifetime!==void 0?ele(r.maxLifetime,void 0,604800):void 0,h=WI(r.includeFiles),g=WI(r.externalNodeModules),y=rm(r.sandbox)?r.sandbox:void 0,v=ZMe(y==null?void 0:y.timeout),A=rm(r.memoryQuota)?r.memoryQuota:void 0,S=A&&typeof A.maxMessagesPerConversation=="number"?A.maxMessagesPerConversation:void 0,E={};return o!==void 0&&(E.dir=o),s!==void 0&&(E.framework=s),c!==void 0&&(E.runtime=c),u!==void 0&&(E.timeout=u),p!==void 0&&(E.idleTimeout=p),f!==void 0&&(E.maxLifetime=f),S!==void 0&&(E.memoryQuota={maxMessagesPerConversation:S}),v!==void 0&&(E.sandbox={timeout:v}),h!==void 0&&(E.includeFiles=h),g!==void 0&&(E.externalNodeModules=g),E}function ZMe(e){if(typeof e!="number"||!Number.isFinite(e))return;let t=Math.floor(e);return t>0?t:void 0}function wir(e){let t=rm(e.sandbox)?e.sandbox:void 0,r={};if(!t)return r;let n=ZMe(t.timeout);return n!==void 0?r.timeout=n:t.timeout!==void 0&&(r.timeout=t.timeout),r}function d8(e,t){let r={headers:[],redirects:[],rewrites:[],caches:[]},n=[];if(!rm(e))return n.push({path:[...t],message:Ri.invalid_type}),[r,n];let{headers:o=[],redirects:s=[],rewrites:c=[],caches:u=[]}=e,[p,f]=mir(o,[...t,"headers"]),[h,g]=gir(s,[...t,"redirects"]),[y,v]=Air(c,[...t,"rewrites"]),[A,S]=yir(u,[...t,"caches"]);r.headers=p,r.redirects=h,r.rewrites=y,r.caches=A;let[E,I]=vir(e,t),D=I.filter(Y=>(Y==null?void 0:Y.code)==="deprecated_config"),j=I.filter(Y=>(Y==null?void 0:Y.code)!=="deprecated_config"),F=Eir(e),U=wir(e);r["edge-functions"]=e["edge-functions"],r.trailingSlash=e.trailingSlash,Object.keys(E).length>0&&(r.cloudFunctions=E),Object.keys(F).length>0&&(r.agents=F),Object.keys(U).length>0&&(r.sandbox=U);let te=["outputDirectory","installCommand","buildCommand","nodeVersion","schedules"];for(let Y in e)te.includes(Y)&&e[Y]&&(r[Y]=e[Y]);return n.push(...j,...f,...g,...v,...S),[r,n,D]}var Ri,tle,rle,VMe,WMe,YMe,p8,xir,sle=Sf(()=>{Ri={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"},tle=["ap-guangzhou","ap-shanghai","ap-nanjing","ap-beijing","ap-chengdu"],rle=["ap-singapore","ap-hongkong","ap-bangkok","ap-jakarta","ap-seoul","ap-tokyo","eu-frankfurt","na-ashburn","na-siliconvalley"],VMe=new Set(tle),WMe=new Set(rle);YMe=!1,p8={conflict:"config_conflict",migrationRequired:"migration_required"};xir=!1});var yb,Sir,eQe,_ir,Cir,Iir,kir,Tir,Bir,Dir,tQe,rQe=Sf(()=>{yb=require("zod"),Sir=/^(?=.{2,30}$)[a-z0-9]+(-[a-z0-9]+)*-?[a-z0-9]+$/,eQe=yb.z.string().refine(e=>Sir.test(e)),_ir=yb.z.enum(["vps-react-ts","vps-react","vps-vue-ts","vps-vue","manaia-demo","manaia-demo-ts"]),Cir=yb.z.object({name:eQe}),Iir=yb.z.object({name:eQe,template:_ir}),kir=yb.z.object({script:yb.z.string().optional()}),Tir=yb.z.object({script:yb.z.string().optional()}),Bir=yb.z.object({}),Dir=yb.z.object({}),tQe={initArgsSchema:Cir,generateArgsSchema:Iir,devArgsSchema:kir,publishArgsSchema:Tir,deleteArgsSchema:Bir,testArgsSchema:Dir}});function Pir(e,t){return r=>{try{e.parse(r)}catch(n){throw new YG(`Failed to validate ${t}`,n)}}}function Rir(){let e={};return Object.entries({...tQe,...Yue}).forEach(([t,r])=>{let n=t.replace("Schema","");e[n]=Pir(r,n)}),e}var vli,nQe=Sf(()=>{rQe();VG();Jue();vli=Rir()});function dD(e="",t={confPath:""}){try{e=e||process.cwd();let[r,n]=m8(e);if(t.exists=n,!n)return t.showError||(0,tm.showError)(),{headers:[],redirects:[],rewrites:[]};if(t.confPath=r,r.endsWith(".ts"))return Oir(r);let o=UG(r);return oQe.default.parse(o)}catch{t.showError||(0,tm.showError)()}}function Oir(e){var g,y,v,A,S,E,I,D,j;let t=ole.default.statSync(e),r=iQe.get(e);if(r&&r.mtimeMs===t.mtimeMs)return r.config;let n=(0,h8.createRequire)("file:///Users/vincentlli/Documents/demo/ali-cli/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js"),o=JA.default.join(JA.default.dirname((0,aQe.fileURLToPath)("file:///Users/vincentlli/Documents/demo/ali-cli/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js")),"config-schema.js"),s=ole.default.existsSync(o)?o:n.resolve("@edgeone/types/config"),c;try{c=(0,sQe.buildSync)({entryPoints:[e],bundle:!0,platform:"node",format:"cjs",write:!1,target:"node12",logLevel:"silent",absWorkingDir:JA.default.dirname(e),alias:{"@edgeone/types/config":s},external:[]})}catch(F){throw new fD(`Failed to load ${JA.default.basename(e)}:
|
|
22
22
|
${(g=F==null?void 0:F.message)!=null?g:F}`)}if((y=c.errors)!=null&&y.length)throw new fD(`Failed to load ${JA.default.basename(e)}:
|
|
23
23
|
`+c.errors.map(F=>`${F.text}${F.location?` (${F.location.file}:${F.location.line})`:""}`).join(`
|
|
24
24
|
`));let u=(S=(A=(v=c.outputFiles)==null?void 0:v[0])==null?void 0:A.text)!=null?S:"",p=new h8.default(e);p.filename=e,p.paths=h8.default._nodeModulePaths(JA.default.dirname(e)),p._compile(u,e);let f=(j=(D=(E=p.exports)==null?void 0:E.default)!=null?D:(I=p.exports)==null?void 0:I.config)!=null?j:p.exports,h=typeof f=="function"?f():f;if(!h||typeof h!="object"||Array.isArray(h))throw new fD(`${JA.default.basename(e)} must default-export a config object.`);return iQe.set(e,{mtimeMs:t.mtimeMs,config:h}),h}function Lir(e){let t=new Error(e);return t.code=uQe,t}function jir(e){if((e==null?void 0:e.code)===uQe)return!0;let t=typeof e=="string"?e:e==null?void 0:e.message;return t==null?void 0:t.includes(Fir)}async function XG(e=!1){var s,c,u,p,f,h,g,y,v;!e&&console.log(`
|
|
@@ -513,7 +513,7 @@ caused by: `+Ma.fullStack(t):e.stack};Ma.errorFromList=function(e){return uf.arr
|
|
|
513
513
|
`)}rowToString(t,r){return this.rasterize(t).forEach((n,o)=>{let s="";n.forEach((c,u)=>{let{width:p}=t[u],f=this.negatePadding(t[u]),h=c;if(f>HA.stringWidth(c)&&(h+=" ".repeat(f-HA.stringWidth(c))),t[u].align&&t[u].align!=="left"&&this.wrap){let y=Srr[t[u].align];h=y(h,f),HA.stringWidth(h)<f&&(h+=" ".repeat((p||0)-HA.stringWidth(h)-1))}let g=t[u].padding||[0,0,0,0];g[vG]&&(s+=" ".repeat(g[vG])),s+=i4e(t[u],h,"| "),s+=h,s+=i4e(t[u],h," |"),g[yG]&&(s+=" ".repeat(g[yG])),o===0&&r.length>0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:t.span})}),r}renderInline(t,r){let n=t.match(/^ */),o=n?n[0].length:0,s=r.text,c=HA.stringWidth(s.trimRight());return r.span?this.wrap?o<c?t:(r.hidden=!0,s.trimRight()+" ".repeat(o-c)+t.trimLeft()):(r.hidden=!0,s+t):t}rasterize(t){let r=[],n=this.columnWidths(t),o;return t.forEach((s,c)=>{s.width=n[c],this.wrap?o=HA.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
|
514
514
|
`):o=s.text.split(`
|
|
515
515
|
`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[_rr]||0).fill("")),o.push(...new Array(s.padding[Crr]||0).fill(""))),o.forEach((u,p)=>{r[p]||r.push([]);let f=r[p];for(let h=0;h<c;h++)f[h]===void 0&&f.push("");f.push(u)})}),r}negatePadding(t){let r=t.width||0;return t.padding&&(r-=(t.padding[vG]||0)+(t.padding[yG]||0)),t.border&&(r-=4),r}columnWidths(t){if(!this.wrap)return t.map(c=>c.width||HA.stringWidth(c.text));let r=t.length,n=this.width,o=t.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,u)=>c===void 0?Math.max(s,Irr(t[u])):c)}};function i4e(e,t,r){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?r:" ":""}function Irr(e){let t=e.padding||[],r=1+(t[vG]||0)+(t[yG]||0);return e.border?r+4:r}function krr(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Trr(e,t){e=e.trim();let r=HA.stringWidth(e);return r<t?" ".repeat(t-r)+e:e}function Brr(e,t){e=e.trim();let r=HA.stringWidth(e);return r>=t?e:" ".repeat(t-r>>1)+e}var HA;function s4e(e,t){return HA=t,new rue({width:(e==null?void 0:e.width)||krr(),wrap:e==null?void 0:e.wrap})}var o4e=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function nue(e){return e.replace(o4e,"")}function a4e(e,t){let[r,n]=e.match(o4e)||["",""];e=nue(e);let o="";for(let s=0;s<e.length;s++)s!==0&&s%t===0&&(o+=`
|
|
516
|
-
`),o+=e.charAt(s);return r&&n&&(o=`${r}${o}${n}`),o}function iue(e){return s4e(e,{stringWidth:t=>[...t].length,stripAnsi:nue,wrap:a4e})}var zO=require("path"),xG=require("fs");function c4e(e,t){let r=(0,zO.resolve)(".",e),n;for((0,xG.statSync)(r).isDirectory()||(r=(0,zO.dirname)(r));;){if(n=t(r,(0,xG.readdirSync)(r)),n)return(0,zO.resolve)(r,n);if(r=(0,zO.dirname)(n=r),n===r)break}}var m4e=require("util"),g4e=require("fs"),A4e=require("url");var mb=require("path");var HO=require("fs"),u4e=require("util"),l4e=require("path"),p4e={fs:{readFileSync:HO.readFileSync,writeFile:HO.writeFile},format:u4e.format,resolve:l4e.resolve,exists:e=>{try{return(0,HO.statSync)(e).isFile()}catch{return!1}}};var hb,sue=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=t.shift(),n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),hb.format.apply(hb.format,[this.cache[this.locale][r]||r].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),r=t.shift(),n=t.shift(),o=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let u=[c];return~c.indexOf("%d")&&u.push(o),hb.format.apply(hb.format,u.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.cache[this.locale][r]=t[r])}_taggedLiteral(t,...r){let n="";return t.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),u=JSON.stringify(this.cache[o],null,2);hb.fs.writeFile(c,u,"utf-8",function(p){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(p)})}_readLocaleFile(){let t={},r=this._resolveLocaleFile(this.directory,this.locale);try{hb.fs.readFileSync&&(t=JSON.parse(hb.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,r){let n=hb.resolve(t,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=hb.resolve(t,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(t){return hb.exists(t)}};function f4e(e,t){hb=t;let r=new sue(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var Drr=e=>f4e(e,p4e),d4e=Drr;var Prr="require is not supported by ESM",h4e="loading a directory of commands is not supported yet for ESM",r8;try{r8=(0,A4e.fileURLToPath)("file:///Users/jesper/Desktop/develop/full-stack-deployment/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js")}catch{r8=process.cwd()}var Rrr=r8.substring(0,r8.lastIndexOf("node_modules")),oue={assert:{notStrictEqual:bG.notStrictEqual,strictEqual:bG.strictEqual},cliui:iue,findUp:c4e,getEnv:e=>process.env[e],inspect:m4e.inspect,getCallerFile:()=>{throw new Du(h4e)},getProcessArgvBin:J3e,mainFilename:Rrr||process.cwd(),Parser:tue,path:{basename:mb.basename,dirname:mb.dirname,extname:mb.extname,relative:mb.relative,resolve:mb.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:g4e.readFileSync,require:()=>{throw new Du(Prr)},requireDirectory:()=>{throw new Du(h4e)},stringWidth:e=>[...e].length,y18n:d4e({directory:(0,mb.resolve)(r8,"../../../locales"),updateFiles:!1})};function eg(e,t,r,n){r.assert.notStrictEqual(e,t,n)}function aue(e,t){t.assert.strictEqual(typeof e,"string")}function GO(e){return Object.keys(e)}function Pu(e){return!!e&&!!e.then&&typeof e.then=="function"}function MI(e){let r=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${e}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,u)=>{let p=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&u===r.length-1&&(p=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:p}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:p})}),s}var Nrr=["first","second","third","fourth","fifth","sixth"];function ti(e,t,r){function n(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[MI(`cmd ${e}`),t,r]}try{let o=0,[s,c,u]=n(),p=[].slice.call(c);for(;p.length&&p[p.length-1]===void 0;)p.pop();let f=u||p.length;if(f<s.demanded.length)throw new Du(`Not enough arguments provided. Expected ${s.demanded.length} but received ${p.length}.`);let h=s.demanded.length+s.optional.length;if(f>h)throw new Du(`Too many arguments provided. Expected max ${h} but received ${f}.`);s.demanded.forEach(g=>{let y=p.shift(),v=y4e(y);g.cmd.filter(S=>S===v||S==="*").length===0&&v4e(v,g.cmd,o),o+=1}),s.optional.forEach(g=>{if(p.length===0)return;let y=p.shift(),v=y4e(y);g.cmd.filter(S=>S===v||S==="*").length===0&&v4e(v,g.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}function y4e(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function v4e(e,t,r){throw new Du(`Invalid ${Nrr[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var EG=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,r,n=!0,o=!1){if(ti("<array|function> [boolean] [boolean] [boolean]",[t,r,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let c=t[s];c.applyBeforeValidation=r,c.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=r,s.global=n,s.mutates=o,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(o=>{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),t.option=r,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function x4e(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function XB(e,t,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(Pu(o))return o.then(c=>Promise.all([c,s(c,t)])).then(([c,u])=>Object.assign(c,u));{let c=s(o,t);return Pu(c)?c.then(u=>Object.assign(o,u)):Object.assign(o,c)}},e)}function ZB(e,t,r=n=>{throw n}){try{let n=Orr(e)?e():e;return Pu(n)?n.then(o=>t(o)):t(n)}catch(n){return r(n)}}function Orr(e){return typeof e=="function"}function cue(e){if(typeof require>"u")return null;for(let t=0,r=Object.keys(require.cache),n;t<r.length;t++)if(n=require.cache[r[t]],n.exports===e)return n;return null}var VO=/(^\*)|(^\$0)/,uue=class{constructor(t,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=t,this.globalMiddleware=n,this.validation=r}addDirectory(t,r,n,o){o=o||{},typeof o.recurse!="boolean"&&(o.recurse=!1),Array.isArray(o.extensions)||(o.extensions=["js"]);let s=typeof o.visit=="function"?o.visit:c=>c;o.visit=(c,u,p)=>{let f=s(c,u,p);if(f){if(this.requireCache.has(u))return f;this.requireCache.add(u),this.addHandler(f)}return f},this.shim.requireDirectory({require:r,filename:n},t,o)}addHandler(t,r,n,o,s,c){let u=[],p=x4e(s);if(o=o||(()=>{}),Array.isArray(t))if(Frr(t))[t,...u]=t;else for(let f of t)this.addHandler(f);else if(jrr(t)){let f=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(f=[].concat(f).concat(t.aliases)),this.addHandler(f,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(b4e(n)){this.addHandler([t].concat(u),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let f=MI(t);u=u.map(y=>MI(y).cmd);let h=!1,g=[f.cmd].concat(u).filter(y=>VO.test(y)?(h=!0,!1):!0);g.length===0&&h&&g.push("$0"),h&&(f.cmd=g[0],u=g.slice(1),t=t.replace(VO,f.cmd)),u.forEach(y=>{this.aliasMap[y]=f.cmd}),r!==!1&&this.usage.command(t,r,h,u,c),this.handlers[f.cmd]={original:t,description:r,handler:o,builder:n||{},middlewares:p,deprecated:c,demanded:f.demanded,optional:f.optional},h&&(this.defaultCommand=this.handlers[f.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,r,n,o,s,c){let u=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,p=r.getInternalMethods().getContext(),f=p.commands.slice(),h=!t;t&&(p.commands.push(t),p.fullCommands.push(u.original));let g=this.applyBuilderUpdateUsageAndParse(h,u,r,n.aliases,f,o,s,c);return Pu(g)?g.then(y=>this.applyMiddlewareAndGetResult(h,u,y.innerArgv,p,s,y.aliases,r)):this.applyMiddlewareAndGetResult(h,u,g.innerArgv,p,s,g.aliases,r)}applyBuilderUpdateUsageAndParse(t,r,n,o,s,c,u,p){let f=r.builder,h=n;if(wG(f)){n.getInternalMethods().getUsageInstance().freeze();let g=f(n.getInternalMethods().reset(o),p);if(Pu(g))return g.then(y=>(h=w4e(y)?y:n,this.parseAndUpdateUsage(t,r,h,s,c,u)))}else Lrr(f)&&(n.getInternalMethods().getUsageInstance().freeze(),h=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(g=>{h.option(g,f[g])}));return this.parseAndUpdateUsage(t,r,h,s,c,u)}parseAndUpdateUsage(t,r,n,o,s,c){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let u=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return Pu(u)?u.then(p=>({aliases:n.parsed.aliases,innerArgv:p})):{aliases:n.parsed.aliases,innerArgv:u}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,r){let n=VO.test(r.original)?r.original.replace(VO,"").trim():r.original,o=t.filter(s=>!VO.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(t,r,n,o,s,c,u,p){if(!c.getInternalMethods().getHasOutput()){let f=c.getInternalMethods().runValidation(s,p,c.parsed.error,t);n=ZB(n,h=>(f(h),h))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let f=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,f,!1,!1),n=XB(n,c,u,!1),n=ZB(n,h=>{let g=r.handler(h);return Pu(g)?g.then(()=>h):h}),t||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Pu(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(h=>{try{c.getInternalMethods().getUsageInstance().fail(null,h)}catch{}})}return t||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,r,n,o,s,c,u){let p={};if(s)return n;u.getInternalMethods().getHasOutput()||(p=this.populatePositionals(r,n,o,u));let f=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),h=XB(n,u,f,!0);return Pu(h)?h.then(g=>this.handleValidationAndGetResult(t,r,g,o,c,u,f,p)):this.handleValidationAndGetResult(t,r,h,o,c,u,f,p)}populatePositionals(t,r,n,o){r._=r._.slice(n.commands.length);let s=t.demanded.slice(0),c=t.optional.slice(0),u={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let p=s.shift();this.populatePositional(p,r,u)}for(;c.length;){let p=c.shift();this.populatePositional(p,r,u)}return r._=n.commands.concat(r._.map(p=>""+p)),this.postProcessPositionals(r,u,this.cmdToParseOptions(t.original),o),u}populatePositional(t,r,n){let o=t.cmd[0];t.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(t){let r={array:[],default:{},alias:{},demand:{}},n=MI(t);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(t,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let f of Object.keys(n.alias))s.alias[f]=(s.alias[f]||[]).concat(n.alias[f]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(f=>{r[f].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[f]=!0),c.push(`--${f}`),c.push(h)})}),!c.length)return;let u=Object.assign({},s.configuration,{"populate--":!1}),p=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:u}));if(p.error)o.getInternalMethods().getUsageInstance().fail(p.error.message,p.error);else{let f=Object.keys(r);Object.keys(r).forEach(h=>{f.push(...p.aliases[h])}),Object.keys(p.argv).forEach(h=>{f.includes(h)&&(r[h]||(r[h]=p.argv[h]),!this.isInConfigs(o,h)&&!this.isDefaulted(o,h)&&Object.prototype.hasOwnProperty.call(t,h)&&Object.prototype.hasOwnProperty.call(p.argv,h)&&(Array.isArray(t[h])||Array.isArray(p.argv[h]))?t[h]=[].concat(t[h],p.argv[h]):t[h]=p.argv[h])})}}isDefaulted(t,r){let{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(t,r){let{configObjects:n}=t.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=VO.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(wG(r))return r(t,!0);b4e(r)||Object.keys(r).forEach(n=>{t.option(n,r[n])})}moduleName(t){let r=cue(t);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(r.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:r,desc:n}){for(let o of[t,r,n]){if(typeof o=="string"||o===!1)return o;eg(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();eg(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function E4e(e,t,r,n){return new uue(e,t,r,n)}function b4e(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Frr(e){return e.every(t=>typeof t=="string")}function wG(e){return typeof e=="function"}function Lrr(e){return typeof e=="object"}function jrr(e){return typeof e=="object"&&!Array.isArray(e)}function QI(e={},t=()=>!0){let r={};return GO(e).forEach(n=>{t(n,e[n])&&(r[n]=e[n])}),r}function qI(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let r=t;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(e)})}function Mrr(e){return typeof e=="boolean"}function _4e(e,t){let r=t.y18n.__,n={},o=[];n.failFn=function(ge){o.push(ge)};let s=null,c=null,u=!0;n.showHelpOnFail=function(ge=!0,J){let[$,de]=typeof ge=="string"?[!0,ge]:[ge,J];return e.getInternalMethods().isGlobalContext()&&(c=de),s=de,u=$,n};let p=!1;n.fail=function(ge,J){let $=e.getInternalMethods().getLoggerInstance();if(o.length)for(let de=o.length-1;de>=0;--de){let Oe=o[de];if(Mrr(Oe)){if(J)throw J;if(ge)throw Error(ge)}else Oe(ge,J,n)}else{if(e.getExitProcess()&&qI(!0),!p){p=!0,u&&(e.showHelp("error"),$.error()),(ge||J)&&$.error(ge||J);let de=s||c;de&&((ge||J)&&$.error(""),$.error(de))}if(J=J||new Du(ge),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,J);throw J}};let f=[],h=!1;n.usage=(Z,ge)=>Z===null?(h=!0,f=[],n):(h=!1,f.push([Z,ge||""]),n),n.getUsage=()=>f,n.getUsageDisabled=()=>h,n.getPositionalGroupName=()=>r("Positionals:");let g=[];n.example=(Z,ge)=>{g.push([Z,ge||""])};let y=[];n.command=function(ge,J,$,de,Oe=!1){$&&(y=y.map(ye=>(ye[2]=!1,ye))),y.push([ge,J||"",$,de,Oe])},n.getCommands=()=>y;let v={};n.describe=function(ge,J){Array.isArray(ge)?ge.forEach($=>{n.describe($,J)}):typeof ge=="object"?Object.keys(ge).forEach($=>{n.describe($,ge[$])}):v[ge]=J},n.getDescriptions=()=>v;let A=[];n.epilog=Z=>{A.push(Z)};let S=!1,E;n.wrap=Z=>{S=!0,E=Z},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(S||(E=me(),S=!0),E);let I="__yargsString__:";n.deferY18nLookup=Z=>I+Z,n.help=function(){if(F)return F;j();let ge=e.customScriptName?e.$0:t.path.basename(e.$0),J=e.getDemandedOptions(),$=e.getDemandedCommands(),de=e.getDeprecatedOptions(),Oe=e.getGroups(),ye=e.getOptions(),be=[];be=be.concat(Object.keys(v)),be=be.concat(Object.keys(J)),be=be.concat(Object.keys($)),be=be.concat(Object.keys(ye.default)),be=be.filter(te),be=Object.keys(be.reduce((et,yt)=>(yt!=="_"&&(et[yt]=!0),et),{}));let Ne=n.getWrap(),He=t.cliui({width:Ne,wrap:!!Ne});if(!h){if(f.length)f.forEach(et=>{He.div({text:`${et[0].replace(/\$0/g,ge)}`}),et[1]&&He.div({text:`${et[1]}`,padding:[1,0,0,0]})}),He.div();else if(y.length){let et=null;$._?et=`${ge} <${r("command")}>
|
|
516
|
+
`),o+=e.charAt(s);return r&&n&&(o=`${r}${o}${n}`),o}function iue(e){return s4e(e,{stringWidth:t=>[...t].length,stripAnsi:nue,wrap:a4e})}var zO=require("path"),xG=require("fs");function c4e(e,t){let r=(0,zO.resolve)(".",e),n;for((0,xG.statSync)(r).isDirectory()||(r=(0,zO.dirname)(r));;){if(n=t(r,(0,xG.readdirSync)(r)),n)return(0,zO.resolve)(r,n);if(r=(0,zO.dirname)(n=r),n===r)break}}var m4e=require("util"),g4e=require("fs"),A4e=require("url");var mb=require("path");var HO=require("fs"),u4e=require("util"),l4e=require("path"),p4e={fs:{readFileSync:HO.readFileSync,writeFile:HO.writeFile},format:u4e.format,resolve:l4e.resolve,exists:e=>{try{return(0,HO.statSync)(e).isFile()}catch{return!1}}};var hb,sue=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=t.shift(),n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),hb.format.apply(hb.format,[this.cache[this.locale][r]||r].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),r=t.shift(),n=t.shift(),o=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let u=[c];return~c.indexOf("%d")&&u.push(o),hb.format.apply(hb.format,u.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.cache[this.locale][r]=t[r])}_taggedLiteral(t,...r){let n="";return t.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),u=JSON.stringify(this.cache[o],null,2);hb.fs.writeFile(c,u,"utf-8",function(p){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(p)})}_readLocaleFile(){let t={},r=this._resolveLocaleFile(this.directory,this.locale);try{hb.fs.readFileSync&&(t=JSON.parse(hb.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,r){let n=hb.resolve(t,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=hb.resolve(t,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(t){return hb.exists(t)}};function f4e(e,t){hb=t;let r=new sue(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var Drr=e=>f4e(e,p4e),d4e=Drr;var Prr="require is not supported by ESM",h4e="loading a directory of commands is not supported yet for ESM",r8;try{r8=(0,A4e.fileURLToPath)("file:///Users/vincentlli/Documents/demo/ali-cli/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js")}catch{r8=process.cwd()}var Rrr=r8.substring(0,r8.lastIndexOf("node_modules")),oue={assert:{notStrictEqual:bG.notStrictEqual,strictEqual:bG.strictEqual},cliui:iue,findUp:c4e,getEnv:e=>process.env[e],inspect:m4e.inspect,getCallerFile:()=>{throw new Du(h4e)},getProcessArgvBin:J3e,mainFilename:Rrr||process.cwd(),Parser:tue,path:{basename:mb.basename,dirname:mb.dirname,extname:mb.extname,relative:mb.relative,resolve:mb.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:g4e.readFileSync,require:()=>{throw new Du(Prr)},requireDirectory:()=>{throw new Du(h4e)},stringWidth:e=>[...e].length,y18n:d4e({directory:(0,mb.resolve)(r8,"../../../locales"),updateFiles:!1})};function eg(e,t,r,n){r.assert.notStrictEqual(e,t,n)}function aue(e,t){t.assert.strictEqual(typeof e,"string")}function GO(e){return Object.keys(e)}function Pu(e){return!!e&&!!e.then&&typeof e.then=="function"}function MI(e){let r=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${e}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,u)=>{let p=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&u===r.length-1&&(p=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:p}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:p})}),s}var Nrr=["first","second","third","fourth","fifth","sixth"];function ti(e,t,r){function n(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[MI(`cmd ${e}`),t,r]}try{let o=0,[s,c,u]=n(),p=[].slice.call(c);for(;p.length&&p[p.length-1]===void 0;)p.pop();let f=u||p.length;if(f<s.demanded.length)throw new Du(`Not enough arguments provided. Expected ${s.demanded.length} but received ${p.length}.`);let h=s.demanded.length+s.optional.length;if(f>h)throw new Du(`Too many arguments provided. Expected max ${h} but received ${f}.`);s.demanded.forEach(g=>{let y=p.shift(),v=y4e(y);g.cmd.filter(S=>S===v||S==="*").length===0&&v4e(v,g.cmd,o),o+=1}),s.optional.forEach(g=>{if(p.length===0)return;let y=p.shift(),v=y4e(y);g.cmd.filter(S=>S===v||S==="*").length===0&&v4e(v,g.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}function y4e(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function v4e(e,t,r){throw new Du(`Invalid ${Nrr[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var EG=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,r,n=!0,o=!1){if(ti("<array|function> [boolean] [boolean] [boolean]",[t,r,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let c=t[s];c.applyBeforeValidation=r,c.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=r,s.global=n,s.mutates=o,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(o=>{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),t.option=r,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function x4e(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function XB(e,t,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(Pu(o))return o.then(c=>Promise.all([c,s(c,t)])).then(([c,u])=>Object.assign(c,u));{let c=s(o,t);return Pu(c)?c.then(u=>Object.assign(o,u)):Object.assign(o,c)}},e)}function ZB(e,t,r=n=>{throw n}){try{let n=Orr(e)?e():e;return Pu(n)?n.then(o=>t(o)):t(n)}catch(n){return r(n)}}function Orr(e){return typeof e=="function"}function cue(e){if(typeof require>"u")return null;for(let t=0,r=Object.keys(require.cache),n;t<r.length;t++)if(n=require.cache[r[t]],n.exports===e)return n;return null}var VO=/(^\*)|(^\$0)/,uue=class{constructor(t,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=t,this.globalMiddleware=n,this.validation=r}addDirectory(t,r,n,o){o=o||{},typeof o.recurse!="boolean"&&(o.recurse=!1),Array.isArray(o.extensions)||(o.extensions=["js"]);let s=typeof o.visit=="function"?o.visit:c=>c;o.visit=(c,u,p)=>{let f=s(c,u,p);if(f){if(this.requireCache.has(u))return f;this.requireCache.add(u),this.addHandler(f)}return f},this.shim.requireDirectory({require:r,filename:n},t,o)}addHandler(t,r,n,o,s,c){let u=[],p=x4e(s);if(o=o||(()=>{}),Array.isArray(t))if(Frr(t))[t,...u]=t;else for(let f of t)this.addHandler(f);else if(jrr(t)){let f=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(f=[].concat(f).concat(t.aliases)),this.addHandler(f,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(b4e(n)){this.addHandler([t].concat(u),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let f=MI(t);u=u.map(y=>MI(y).cmd);let h=!1,g=[f.cmd].concat(u).filter(y=>VO.test(y)?(h=!0,!1):!0);g.length===0&&h&&g.push("$0"),h&&(f.cmd=g[0],u=g.slice(1),t=t.replace(VO,f.cmd)),u.forEach(y=>{this.aliasMap[y]=f.cmd}),r!==!1&&this.usage.command(t,r,h,u,c),this.handlers[f.cmd]={original:t,description:r,handler:o,builder:n||{},middlewares:p,deprecated:c,demanded:f.demanded,optional:f.optional},h&&(this.defaultCommand=this.handlers[f.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,r,n,o,s,c){let u=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,p=r.getInternalMethods().getContext(),f=p.commands.slice(),h=!t;t&&(p.commands.push(t),p.fullCommands.push(u.original));let g=this.applyBuilderUpdateUsageAndParse(h,u,r,n.aliases,f,o,s,c);return Pu(g)?g.then(y=>this.applyMiddlewareAndGetResult(h,u,y.innerArgv,p,s,y.aliases,r)):this.applyMiddlewareAndGetResult(h,u,g.innerArgv,p,s,g.aliases,r)}applyBuilderUpdateUsageAndParse(t,r,n,o,s,c,u,p){let f=r.builder,h=n;if(wG(f)){n.getInternalMethods().getUsageInstance().freeze();let g=f(n.getInternalMethods().reset(o),p);if(Pu(g))return g.then(y=>(h=w4e(y)?y:n,this.parseAndUpdateUsage(t,r,h,s,c,u)))}else Lrr(f)&&(n.getInternalMethods().getUsageInstance().freeze(),h=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(g=>{h.option(g,f[g])}));return this.parseAndUpdateUsage(t,r,h,s,c,u)}parseAndUpdateUsage(t,r,n,o,s,c){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let u=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return Pu(u)?u.then(p=>({aliases:n.parsed.aliases,innerArgv:p})):{aliases:n.parsed.aliases,innerArgv:u}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,r){let n=VO.test(r.original)?r.original.replace(VO,"").trim():r.original,o=t.filter(s=>!VO.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(t,r,n,o,s,c,u,p){if(!c.getInternalMethods().getHasOutput()){let f=c.getInternalMethods().runValidation(s,p,c.parsed.error,t);n=ZB(n,h=>(f(h),h))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let f=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,f,!1,!1),n=XB(n,c,u,!1),n=ZB(n,h=>{let g=r.handler(h);return Pu(g)?g.then(()=>h):h}),t||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Pu(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(h=>{try{c.getInternalMethods().getUsageInstance().fail(null,h)}catch{}})}return t||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,r,n,o,s,c,u){let p={};if(s)return n;u.getInternalMethods().getHasOutput()||(p=this.populatePositionals(r,n,o,u));let f=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),h=XB(n,u,f,!0);return Pu(h)?h.then(g=>this.handleValidationAndGetResult(t,r,g,o,c,u,f,p)):this.handleValidationAndGetResult(t,r,h,o,c,u,f,p)}populatePositionals(t,r,n,o){r._=r._.slice(n.commands.length);let s=t.demanded.slice(0),c=t.optional.slice(0),u={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let p=s.shift();this.populatePositional(p,r,u)}for(;c.length;){let p=c.shift();this.populatePositional(p,r,u)}return r._=n.commands.concat(r._.map(p=>""+p)),this.postProcessPositionals(r,u,this.cmdToParseOptions(t.original),o),u}populatePositional(t,r,n){let o=t.cmd[0];t.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(t){let r={array:[],default:{},alias:{},demand:{}},n=MI(t);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(t,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let f of Object.keys(n.alias))s.alias[f]=(s.alias[f]||[]).concat(n.alias[f]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(f=>{r[f].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[f]=!0),c.push(`--${f}`),c.push(h)})}),!c.length)return;let u=Object.assign({},s.configuration,{"populate--":!1}),p=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:u}));if(p.error)o.getInternalMethods().getUsageInstance().fail(p.error.message,p.error);else{let f=Object.keys(r);Object.keys(r).forEach(h=>{f.push(...p.aliases[h])}),Object.keys(p.argv).forEach(h=>{f.includes(h)&&(r[h]||(r[h]=p.argv[h]),!this.isInConfigs(o,h)&&!this.isDefaulted(o,h)&&Object.prototype.hasOwnProperty.call(t,h)&&Object.prototype.hasOwnProperty.call(p.argv,h)&&(Array.isArray(t[h])||Array.isArray(p.argv[h]))?t[h]=[].concat(t[h],p.argv[h]):t[h]=p.argv[h])})}}isDefaulted(t,r){let{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(t,r){let{configObjects:n}=t.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=VO.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(wG(r))return r(t,!0);b4e(r)||Object.keys(r).forEach(n=>{t.option(n,r[n])})}moduleName(t){let r=cue(t);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(r.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:r,desc:n}){for(let o of[t,r,n]){if(typeof o=="string"||o===!1)return o;eg(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();eg(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function E4e(e,t,r,n){return new uue(e,t,r,n)}function b4e(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Frr(e){return e.every(t=>typeof t=="string")}function wG(e){return typeof e=="function"}function Lrr(e){return typeof e=="object"}function jrr(e){return typeof e=="object"&&!Array.isArray(e)}function QI(e={},t=()=>!0){let r={};return GO(e).forEach(n=>{t(n,e[n])&&(r[n]=e[n])}),r}function qI(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let r=t;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(e)})}function Mrr(e){return typeof e=="boolean"}function _4e(e,t){let r=t.y18n.__,n={},o=[];n.failFn=function(ge){o.push(ge)};let s=null,c=null,u=!0;n.showHelpOnFail=function(ge=!0,J){let[$,de]=typeof ge=="string"?[!0,ge]:[ge,J];return e.getInternalMethods().isGlobalContext()&&(c=de),s=de,u=$,n};let p=!1;n.fail=function(ge,J){let $=e.getInternalMethods().getLoggerInstance();if(o.length)for(let de=o.length-1;de>=0;--de){let Oe=o[de];if(Mrr(Oe)){if(J)throw J;if(ge)throw Error(ge)}else Oe(ge,J,n)}else{if(e.getExitProcess()&&qI(!0),!p){p=!0,u&&(e.showHelp("error"),$.error()),(ge||J)&&$.error(ge||J);let de=s||c;de&&((ge||J)&&$.error(""),$.error(de))}if(J=J||new Du(ge),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,J);throw J}};let f=[],h=!1;n.usage=(Z,ge)=>Z===null?(h=!0,f=[],n):(h=!1,f.push([Z,ge||""]),n),n.getUsage=()=>f,n.getUsageDisabled=()=>h,n.getPositionalGroupName=()=>r("Positionals:");let g=[];n.example=(Z,ge)=>{g.push([Z,ge||""])};let y=[];n.command=function(ge,J,$,de,Oe=!1){$&&(y=y.map(ye=>(ye[2]=!1,ye))),y.push([ge,J||"",$,de,Oe])},n.getCommands=()=>y;let v={};n.describe=function(ge,J){Array.isArray(ge)?ge.forEach($=>{n.describe($,J)}):typeof ge=="object"?Object.keys(ge).forEach($=>{n.describe($,ge[$])}):v[ge]=J},n.getDescriptions=()=>v;let A=[];n.epilog=Z=>{A.push(Z)};let S=!1,E;n.wrap=Z=>{S=!0,E=Z},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(S||(E=me(),S=!0),E);let I="__yargsString__:";n.deferY18nLookup=Z=>I+Z,n.help=function(){if(F)return F;j();let ge=e.customScriptName?e.$0:t.path.basename(e.$0),J=e.getDemandedOptions(),$=e.getDemandedCommands(),de=e.getDeprecatedOptions(),Oe=e.getGroups(),ye=e.getOptions(),be=[];be=be.concat(Object.keys(v)),be=be.concat(Object.keys(J)),be=be.concat(Object.keys($)),be=be.concat(Object.keys(ye.default)),be=be.filter(te),be=Object.keys(be.reduce((et,yt)=>(yt!=="_"&&(et[yt]=!0),et),{}));let Ne=n.getWrap(),He=t.cliui({width:Ne,wrap:!!Ne});if(!h){if(f.length)f.forEach(et=>{He.div({text:`${et[0].replace(/\$0/g,ge)}`}),et[1]&&He.div({text:`${et[1]}`,padding:[1,0,0,0]})}),He.div();else if(y.length){let et=null;$._?et=`${ge} <${r("command")}>
|
|
517
517
|
`:et=`${ge} [${r("command")}]
|
|
518
518
|
`,He.div(`${et}`)}}if(y.length>1||y.length===1&&!y[0][2]){He.div(r("Commands:"));let et=e.getInternalMethods().getContext(),yt=et.commands.length?`${et.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(y=y.sort((St,At)=>St[0].localeCompare(At[0])));let Ot=ge?`${ge} `:"";y.forEach(St=>{let At=`${Ot}${yt}${St[0].replace(/^\$0 ?/,"")}`;He.span({text:At,padding:[0,2,0,2],width:D(y,Ne,`${ge}${yt}`)+4},{text:St[1]});let dt=[];St[2]&&dt.push(`[${r("default")}]`),St[3]&&St[3].length&&dt.push(`[${r("aliases:")} ${St[3].join(", ")}]`),St[4]&&(typeof St[4]=="string"?dt.push(`[${r("deprecated: %s",St[4])}]`):dt.push(`[${r("deprecated")}]`)),dt.length?He.div({text:dt.join(" "),padding:[0,0,0,2],align:"right"}):He.div()}),He.div()}let ft=(Object.keys(ye.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);be=be.filter(et=>!e.parsed.newAliases[et]&&ft.every(yt=>(ye.alias[yt]||[]).indexOf(et)===-1));let wt=r("Options:");Oe[wt]||(Oe[wt]=[]),U(be,ye.alias,Oe,wt);let Ye=et=>/^--/.test(SG(et)),Ke=Object.keys(Oe).filter(et=>Oe[et].length>0).map(et=>{let yt=Oe[et].filter(te).map(Ot=>{if(ft.includes(Ot))return Ot;for(let St=0,At;(At=ft[St])!==void 0;St++)if((ye.alias[At]||[]).includes(Ot))return At;return Ot});return{groupName:et,normalizedKeys:yt}}).filter(({normalizedKeys:et})=>et.length>0).map(({groupName:et,normalizedKeys:yt})=>{let Ot=yt.reduce((St,At)=>(St[At]=[At].concat(ye.alias[At]||[]).map(dt=>et===n.getPositionalGroupName()?dt:(/^[0-9]$/.test(dt)?ye.boolean.includes(At)?"-":"--":dt.length>1?"--":"-")+dt).sort((dt,B)=>Ye(dt)===Ye(B)?0:Ye(dt)?1:-1).join(", "),St),{});return{groupName:et,normalizedKeys:yt,switches:Ot}});if(Ke.filter(({groupName:et})=>et!==n.getPositionalGroupName()).some(({normalizedKeys:et,switches:yt})=>!et.every(Ot=>Ye(yt[Ot])))&&Ke.filter(({groupName:et})=>et!==n.getPositionalGroupName()).forEach(({normalizedKeys:et,switches:yt})=>{et.forEach(Ot=>{Ye(yt[Ot])&&(yt[Ot]=Qrr(yt[Ot],4))})}),Ke.forEach(({groupName:et,normalizedKeys:yt,switches:Ot})=>{He.div(et),yt.forEach(St=>{let At=Ot[St],dt=v[St]||"",B=null;dt.includes(I)&&(dt=r(dt.substring(I.length))),ye.boolean.includes(St)&&(B=`[${r("boolean")}]`),ye.count.includes(St)&&(B=`[${r("count")}]`),ye.string.includes(St)&&(B=`[${r("string")}]`),ye.normalize.includes(St)&&(B=`[${r("string")}]`),ye.array.includes(St)&&(B=`[${r("array")}]`),ye.number.includes(St)&&(B=`[${r("number")}]`);let Je=we=>typeof we=="string"?`[${r("deprecated: %s",we)}]`:`[${r("deprecated")}]`,ct=[St in de?Je(de[St]):null,B,St in J?`[${r("required")}]`:null,ye.choices&&ye.choices[St]?`[${r("choices:")} ${n.stringifiedValues(ye.choices[St])}]`:null,Y(ye.default[St],ye.defaultDescription[St])].filter(Boolean).join(" ");He.span({text:SG(At),padding:[0,2,0,2+S4e(At)],width:D(Ot,Ne)+4},dt);let Ce=e.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ct&&!Ce?He.div({text:ct,padding:[0,0,0,2],align:"right"}):He.div()}),He.div()}),g.length&&(He.div(r("Examples:")),g.forEach(et=>{et[0]=et[0].replace(/\$0/g,ge)}),g.forEach(et=>{et[1]===""?He.div({text:et[0],padding:[0,2,0,2]}):He.div({text:et[0],padding:[0,2,0,2],width:D(g,Ne)+4},{text:et[1]})}),He.div()),A.length>0){let et=A.map(yt=>yt.replace(/\$0/g,ge)).join(`
|
|
519
519
|
`);He.div(`${et}
|
|
@@ -571,9 +571,9 @@ ${A.join(`
|
|
|
571
571
|
`;y.forEach(A=>{v+=A}),t.fail(v)}};let p={};s.conflicts=function(g,y){ti("<string|object> [array|string]",[g,y],arguments.length),typeof g=="object"?Object.keys(g).forEach(v=>{s.conflicts(v,g[v])}):(e.global(g),p[g]||(p[g]=[]),Array.isArray(y)?y.forEach(v=>s.conflicts(g,v)):p[g].push(y))},s.getConflicting=()=>p,s.conflicting=function(g){Object.keys(g).forEach(y=>{p[y]&&p[y].forEach(v=>{v&&g[y]!==void 0&&g[v]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",y,v))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(p).forEach(y=>{p[y].forEach(v=>{v&&g[r.Parser.camelCase(y)]!==void 0&&g[r.Parser.camelCase(v)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",y,v))})})},s.recommendCommands=function(g,y){y=y.sort((E,I)=>I.length-E.length);let A=null,S=1/0;for(let E=0,I;(I=y[E])!==void 0;E++){let D=T4e(g,I);D<=3&&D<S&&(S=D,A=I)}A&&t.fail(n("Did you mean %s?",A))},s.reset=function(g){return c=QI(c,y=>!g[y]),p=QI(p,y=>!g[y]),s};let f=[];return s.freeze=function(){f.push({implied:c,conflicting:p})},s.unfreeze=function(){let g=f.pop();eg(g,void 0,r),{implied:c,conflicting:p}=g},s}var ii=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},Ge=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Bp,eD,n8,bv,GA,_G,UI,tD,CG,Ev,IG,wv,Fw,VA,Sv,kG,WO,cd,_i,TG,BG,WA,rD,YO,nD,$I,DG,As,iD,sD,oD,Ps,PG,Lw,rp;function K4e(e){return(t=[],r=e.process.cwd(),n)=>{let o=new Eue(t,r,n,e);return Object.defineProperty(o,"argv",{get:()=>o.parse(),enumerable:!0}),o.help(),o.version(),o}}var P4e=Symbol("copyDoubleDash"),R4e=Symbol("copyDoubleDash"),fue=Symbol("deleteFromParserHintObject"),N4e=Symbol("emitWarning"),O4e=Symbol("freeze"),F4e=Symbol("getDollarZero"),aD=Symbol("getParserConfiguration"),L4e=Symbol("getUsageConfiguration"),due=Symbol("guessLocale"),j4e=Symbol("guessVersion"),M4e=Symbol("parsePositionalNumbers"),hue=Symbol("pkgUp"),zI=Symbol("populateParserHintArray"),JO=Symbol("populateParserHintSingleValueDictionary"),mue=Symbol("populateParserHintArrayDictionary"),gue=Symbol("populateParserHintDictionary"),Aue=Symbol("sanitizeKey"),yue=Symbol("setKey"),vue=Symbol("unfreeze"),Q4e=Symbol("validateAsync"),q4e=Symbol("getCommandInstance"),U4e=Symbol("getContext"),$4e=Symbol("getHasOutput"),z4e=Symbol("getLoggerInstance"),H4e=Symbol("getParseContext"),G4e=Symbol("getUsageInstance"),V4e=Symbol("getValidationInstance"),RG=Symbol("hasParseCallback"),W4e=Symbol("isGlobalContext"),cD=Symbol("postProcess"),Y4e=Symbol("rebase"),xue=Symbol("reset"),i8=Symbol("runYargsParserAndExecuteCommands"),bue=Symbol("runValidation"),J4e=Symbol("setHasOutput"),uD=Symbol("kTrackManuallySetKeys"),Eue=class{constructor(t=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Bp.set(this,void 0),eD.set(this,void 0),n8.set(this,{commands:[],fullCommands:[]}),bv.set(this,null),GA.set(this,null),_G.set(this,"show-hidden"),UI.set(this,null),tD.set(this,!0),CG.set(this,{}),Ev.set(this,!0),IG.set(this,[]),wv.set(this,void 0),Fw.set(this,{}),VA.set(this,!1),Sv.set(this,null),kG.set(this,!0),WO.set(this,void 0),cd.set(this,""),_i.set(this,void 0),TG.set(this,void 0),BG.set(this,{}),WA.set(this,null),rD.set(this,null),YO.set(this,{}),nD.set(this,{}),$I.set(this,void 0),DG.set(this,!1),As.set(this,void 0),iD.set(this,!1),sD.set(this,!1),oD.set(this,!1),Ps.set(this,void 0),PG.set(this,{}),Lw.set(this,null),rp.set(this,void 0),ii(this,As,o,"f"),ii(this,$I,t,"f"),ii(this,eD,r,"f"),ii(this,TG,n,"f"),ii(this,wv,new EG(this),"f"),this.$0=this[F4e](),this[xue](),ii(this,Bp,Ge(this,Bp,"f"),"f"),ii(this,Ps,Ge(this,Ps,"f"),"f"),ii(this,rp,Ge(this,rp,"f"),"f"),ii(this,_i,Ge(this,_i,"f"),"f"),Ge(this,_i,"f").showHiddenOpt=Ge(this,_G,"f"),ii(this,WO,this[R4e](),"f")}addHelpOpt(t,r){let n="help";return ti("[string|boolean] [string]",[t,r],arguments.length),Ge(this,Sv,"f")&&(this[fue](Ge(this,Sv,"f")),ii(this,Sv,null,"f")),t===!1&&r===void 0?this:(ii(this,Sv,typeof t=="string"?t:n,"f"),this.boolean(Ge(this,Sv,"f")),this.describe(Ge(this,Sv,"f"),r||Ge(this,Ps,"f").deferY18nLookup("Show help")),this)}help(t,r){return this.addHelpOpt(t,r)}addShowHiddenOpt(t,r){if(ti("[string|boolean] [string]",[t,r],arguments.length),t===!1&&r===void 0)return this;let n=typeof t=="string"?t:Ge(this,_G,"f");return this.boolean(n),this.describe(n,r||Ge(this,Ps,"f").deferY18nLookup("Show hidden options")),Ge(this,_i,"f").showHiddenOpt=n,this}showHidden(t,r){return this.addShowHiddenOpt(t,r)}alias(t,r){return ti("<object|string|array> [string|array]",[t,r],arguments.length),this[mue](this.alias.bind(this),"alias",t,r),this}array(t){return ti("<array|string>",[t],arguments.length),this[zI]("array",t),this[uD](t),this}boolean(t){return ti("<array|string>",[t],arguments.length),this[zI]("boolean",t),this[uD](t),this}check(t,r){return ti("<function> [boolean]",[t,r],arguments.length),this.middleware((n,o)=>ZB(()=>t(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Ge(this,Ps,"f").fail(s.toString(),s):Ge(this,Ps,"f").fail(Ge(this,As,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(Ge(this,Ps,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(t,r){return ti("<object|string|array> [string|array]",[t,r],arguments.length),this[mue](this.choices.bind(this),"choices",t,r),this}coerce(t,r){if(ti("<object|string|array> [function]",[t,r],arguments.length),Array.isArray(t)){if(!r)throw new Du("coerce callback must be provided");for(let n of t)this.coerce(n,r);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!r)throw new Du("coerce callback must be provided");return Ge(this,_i,"f").key[t]=!0,Ge(this,wv,"f").addCoerceMiddleware((n,o)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?ZB(()=>(s=o.getAliases(),r(n[t])),u=>{n[t]=u;let p=o.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&p!==!0)for(let f of s[t])n[f]=u;return n},u=>{throw new Du(u.message)}):n},t),this}conflicts(t,r){return ti("<string|object> [string|array]",[t,r],arguments.length),Ge(this,rp,"f").conflicts(t,r),this}config(t="config",r,n){return ti("[object|string] [string|function] [function]",[t,r,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=e8(t,Ge(this,eD,"f"),this[aD]()["deep-merge-config"]||!1,Ge(this,As,"f")),Ge(this,_i,"f").configObjects=(Ge(this,_i,"f").configObjects||[]).concat(t),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(t,r||Ge(this,Ps,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(o=>{Ge(this,_i,"f").config[o]=n||!0}),this)}completion(t,r,n){return ti("[string] [string|boolean|function] [function]",[t,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),ii(this,GA,t||Ge(this,GA,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Ge(this,GA,"f"),r),n&&Ge(this,bv,"f").registerFunction(n),this}command(t,r,n,o,s,c){return ti("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,r,n,o,s,c],arguments.length),Ge(this,Bp,"f").addHandler(t,r,n,o,s,c),this}commands(t,r,n,o,s,c){return this.command(t,r,n,o,s,c)}commandDir(t,r){ti("<string> [object]",[t,r],arguments.length);let n=Ge(this,TG,"f")||Ge(this,As,"f").require;return Ge(this,Bp,"f").addDirectory(t,n,Ge(this,As,"f").getCallerFile(),r),this}count(t){return ti("<array|string>",[t],arguments.length),this[zI]("count",t),this[uD](t),this}default(t,r,n){return ti("<object|string|array> [*] [string]",[t,r,n],arguments.length),n&&(aue(t,Ge(this,As,"f")),Ge(this,_i,"f").defaultDescription[t]=n),typeof r=="function"&&(aue(t,Ge(this,As,"f")),Ge(this,_i,"f").defaultDescription[t]||(Ge(this,_i,"f").defaultDescription[t]=Ge(this,Ps,"f").functionDescription(r)),r=r.call()),this[JO](this.default.bind(this),"default",t,r),this}defaults(t,r,n){return this.default(t,r,n)}demandCommand(t=1,r,n,o){return ti("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),Ge(this,_i,"f").demandedCommands._={min:t,max:r,minMsg:n,maxMsg:o},this}demand(t,r,n){return Array.isArray(r)?(r.forEach(o=>{eg(n,!0,Ge(this,As,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof t=="number"?(eg(n,!0,Ge(this,As,"f")),this.demandCommand(t,r,n,n)):Array.isArray(t)?t.forEach(o=>{eg(n,!0,Ge(this,As,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,r){return ti("<object|string|array> [string]",[t,r],arguments.length),this[JO](this.demandOption.bind(this),"demandedOptions",t,r),this}deprecateOption(t,r){return ti("<string> [string|boolean]",[t,r],arguments.length),Ge(this,_i,"f").deprecatedOptions[t]=r,this}describe(t,r){return ti("<object|string|array> [string]",[t,r],arguments.length),this[yue](t,!0),Ge(this,Ps,"f").describe(t,r),this}detectLocale(t){return ti("<boolean>",[t],arguments.length),ii(this,tD,t,"f"),this}env(t){return ti("[string|boolean]",[t],arguments.length),t===!1?delete Ge(this,_i,"f").envPrefix:Ge(this,_i,"f").envPrefix=t||"",this}epilogue(t){return ti("<string>",[t],arguments.length),Ge(this,Ps,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,r){return ti("<string|array> [string]",[t,r],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):Ge(this,Ps,"f").example(t,r),this}exit(t,r){ii(this,VA,!0,"f"),ii(this,UI,r,"f"),Ge(this,Ev,"f")&&Ge(this,As,"f").process.exit(t)}exitProcess(t=!0){return ti("[boolean]",[t],arguments.length),ii(this,Ev,t,"f"),this}fail(t){if(ti("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Du("Invalid first argument. Expected function or boolean 'false'");return Ge(this,Ps,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,r){return ti("<array> [function]",[t,r],arguments.length),r?Ge(this,bv,"f").getCompletion(t,r):new Promise((n,o)=>{Ge(this,bv,"f").getCompletion(t,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return ti([],0),Ge(this,_i,"f").demandedOptions}getDemandedCommands(){return ti([],0),Ge(this,_i,"f").demandedCommands}getDeprecatedOptions(){return ti([],0),Ge(this,_i,"f").deprecatedOptions}getDetectLocale(){return Ge(this,tD,"f")}getExitProcess(){return Ge(this,Ev,"f")}getGroups(){return Object.assign({},Ge(this,Fw,"f"),Ge(this,nD,"f"))}getHelp(){if(ii(this,VA,!0,"f"),!Ge(this,Ps,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[i8](Ge(this,$I,"f"),void 0,void 0,0,!0);if(Pu(r))return r.then(()=>Ge(this,Ps,"f").help())}let t=Ge(this,Bp,"f").runDefaultBuilderOn(this);if(Pu(t))return t.then(()=>Ge(this,Ps,"f").help())}return Promise.resolve(Ge(this,Ps,"f").help())}getOptions(){return Ge(this,_i,"f")}getStrict(){return Ge(this,iD,"f")}getStrictCommands(){return Ge(this,sD,"f")}getStrictOptions(){return Ge(this,oD,"f")}global(t,r){return ti("<string|array> [boolean]",[t,r],arguments.length),t=[].concat(t),r!==!1?Ge(this,_i,"f").local=Ge(this,_i,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{Ge(this,_i,"f").local.includes(n)||Ge(this,_i,"f").local.push(n)}),this}group(t,r){ti("<string|array> <string>",[t,r],arguments.length);let n=Ge(this,nD,"f")[r]||Ge(this,Fw,"f")[r];Ge(this,nD,"f")[r]&&delete Ge(this,nD,"f")[r];let o={};return Ge(this,Fw,"f")[r]=(n||[]).concat(t).filter(s=>o[s]?!1:o[s]=!0),this}hide(t){return ti("<string>",[t],arguments.length),Ge(this,_i,"f").hiddenOptions.push(t),this}implies(t,r){return ti("<string|object> [number|string|array]",[t,r],arguments.length),Ge(this,rp,"f").implies(t,r),this}locale(t){return ti("[string]",[t],arguments.length),t===void 0?(this[due](),Ge(this,As,"f").y18n.getLocale()):(ii(this,tD,!1,"f"),Ge(this,As,"f").y18n.setLocale(t),this)}middleware(t,r,n){return Ge(this,wv,"f").addMiddleware(t,!!r,n)}nargs(t,r){return ti("<string|object|array> [number]",[t,r],arguments.length),this[JO](this.nargs.bind(this),"narg",t,r),this}normalize(t){return ti("<array|string>",[t],arguments.length),this[zI]("normalize",t),this}number(t){return ti("<array|string>",[t],arguments.length),this[zI]("number",t),this[uD](t),this}option(t,r){if(ti("<string|object> [object]",[t,r],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof r!="object"&&(r={}),this[uD](t),Ge(this,Lw,"f")&&(t==="version"||(r==null?void 0:r.alias)==="version")&&this[N4e](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
572
572
|
`),void 0,"versionWarning"),Ge(this,_i,"f").key[t]=!0,r.alias&&this.alias(t,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(t,n);let o=r.demand||r.required||r.require;o&&this.demand(t,o),r.demandOption&&this.demandOption(t,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(t,r.conflicts),"default"in r&&this.default(t,r.default),r.implies!==void 0&&this.implies(t,r.implies),r.nargs!==void 0&&this.nargs(t,r.nargs),r.config&&this.config(t,r.configParser),r.normalize&&this.normalize(t),r.choices&&this.choices(t,r.choices),r.coerce&&this.coerce(t,r.coerce),r.group&&this.group(t,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(t),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(t),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(t),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(t),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(t),typeof r.global=="boolean"&&this.global(t,r.global),r.defaultDescription&&(Ge(this,_i,"f").defaultDescription[t]=r.defaultDescription),r.skipValidation&&this.skipValidation(t);let s=r.describe||r.description||r.desc,c=Ge(this,Ps,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,t)||typeof s=="string")&&this.describe(t,s),r.hidden&&this.hide(t),r.requiresArg&&this.requiresArg(t)}return this}options(t,r){return this.option(t,r)}parse(t,r,n){ti("[string|array] [function|boolean|object] [function]",[t,r,n],arguments.length),this[O4e](),typeof t>"u"&&(t=Ge(this,$I,"f")),typeof r=="object"&&(ii(this,rD,r,"f"),r=n),typeof r=="function"&&(ii(this,WA,r,"f"),r=!1),r||ii(this,$I,t,"f"),Ge(this,WA,"f")&&ii(this,Ev,!1,"f");let o=this[i8](t,!!r),s=this.parsed;return Ge(this,bv,"f").setParsed(this.parsed),Pu(o)?o.then(c=>(Ge(this,WA,"f")&&Ge(this,WA,"f").call(this,Ge(this,UI,"f"),c,Ge(this,cd,"f")),c)).catch(c=>{throw Ge(this,WA,"f")&&Ge(this,WA,"f")(c,this.parsed.argv,Ge(this,cd,"f")),c}).finally(()=>{this[vue](),this.parsed=s}):(Ge(this,WA,"f")&&Ge(this,WA,"f").call(this,Ge(this,UI,"f"),o,Ge(this,cd,"f")),this[vue](),this.parsed=s,o)}parseAsync(t,r,n){let o=this.parse(t,r,n);return Pu(o)?o:Promise.resolve(o)}parseSync(t,r,n){let o=this.parse(t,r,n);if(Pu(o))throw new Du(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(t){return ti("<object>",[t],arguments.length),ii(this,BG,t,"f"),this}pkgConf(t,r){ti("<string> [string]",[t,r],arguments.length);let n=null,o=this[hue](r||Ge(this,eD,"f"));return o[t]&&typeof o[t]=="object"&&(n=e8(o[t],r||Ge(this,eD,"f"),this[aD]()["deep-merge-config"]||!1,Ge(this,As,"f")),Ge(this,_i,"f").configObjects=(Ge(this,_i,"f").configObjects||[]).concat(n)),this}positional(t,r){ti("<string> <object>",[t,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=QI(r,(c,u)=>c==="type"&&!["string","number","boolean"].includes(u)?!1:n.includes(c));let o=Ge(this,n8,"f").fullCommands[Ge(this,n8,"f").fullCommands.length-1],s=o?Ge(this,Bp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return GO(s).forEach(c=>{let u=s[c];Array.isArray(u)?u.indexOf(t)!==-1&&(r[c]=!0):u[t]&&!(c in r)&&(r[c]=u[t])}),this.group(t,Ge(this,Ps,"f").getPositionalGroupName()),this.option(t,r)}recommendCommands(t=!0){return ti("[boolean]",[t],arguments.length),ii(this,DG,t,"f"),this}required(t,r,n){return this.demand(t,r,n)}require(t,r,n){return this.demand(t,r,n)}requiresArg(t){return ti("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&Ge(this,_i,"f").narg[t]?this:(this[JO](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,r){return ti("[string] [string]",[t,r],arguments.length),t=t||this.$0,Ge(this,WO,"f").log(Ge(this,bv,"f").generateCompletionScript(t,r||Ge(this,GA,"f")||"completion")),this}showHelp(t){if(ti("[string|function]",[t],arguments.length),ii(this,VA,!0,"f"),!Ge(this,Ps,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[i8](Ge(this,$I,"f"),void 0,void 0,0,!0);if(Pu(n))return n.then(()=>{Ge(this,Ps,"f").showHelp(t)}),this}let r=Ge(this,Bp,"f").runDefaultBuilderOn(this);if(Pu(r))return r.then(()=>{Ge(this,Ps,"f").showHelp(t)}),this}return Ge(this,Ps,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,r){return ti("[boolean|string] [string]",[t,r],arguments.length),Ge(this,Ps,"f").showHelpOnFail(t,r),this}showVersion(t){return ti("[string|function]",[t],arguments.length),Ge(this,Ps,"f").showVersion(t),this}skipValidation(t){return ti("<array|string>",[t],arguments.length),this[zI]("skipValidation",t),this}strict(t){return ti("[boolean]",[t],arguments.length),ii(this,iD,t!==!1,"f"),this}strictCommands(t){return ti("[boolean]",[t],arguments.length),ii(this,sD,t!==!1,"f"),this}strictOptions(t){return ti("[boolean]",[t],arguments.length),ii(this,oD,t!==!1,"f"),this}string(t){return ti("<array|string>",[t],arguments.length),this[zI]("string",t),this[uD](t),this}terminalWidth(){return ti([],0),Ge(this,As,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return ti("<object>",[t],arguments.length),ii(this,tD,!1,"f"),Ge(this,As,"f").y18n.updateLocale(t),this}usage(t,r,n,o){if(ti("<string|null|undefined> [string|boolean] [function|object] [function]",[t,r,n,o],arguments.length),r!==void 0){if(eg(t,null,Ge(this,As,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,r,n,o);throw new Du(".usage() description must start with $0 if being used as alias for .command()")}else return Ge(this,Ps,"f").usage(t),this}usageConfiguration(t){return ti("<object>",[t],arguments.length),ii(this,PG,t,"f"),this}version(t,r,n){let o="version";if(ti("[boolean|string] [string] [string]",[t,r,n],arguments.length),Ge(this,Lw,"f")&&(this[fue](Ge(this,Lw,"f")),Ge(this,Ps,"f").version(void 0),ii(this,Lw,null,"f")),arguments.length===0)n=this[j4e](),t=o;else if(arguments.length===1){if(t===!1)return this;n=t,t=o}else arguments.length===2&&(n=r,r=void 0);return ii(this,Lw,typeof t=="string"?t:o,"f"),r=r||Ge(this,Ps,"f").deferY18nLookup("Show version number"),Ge(this,Ps,"f").version(n||void 0),this.boolean(Ge(this,Lw,"f")),this.describe(Ge(this,Lw,"f"),r),this}wrap(t){return ti("<number|null|undefined>",[t],arguments.length),Ge(this,Ps,"f").wrap(t),this}[(Bp=new WeakMap,eD=new WeakMap,n8=new WeakMap,bv=new WeakMap,GA=new WeakMap,_G=new WeakMap,UI=new WeakMap,tD=new WeakMap,CG=new WeakMap,Ev=new WeakMap,IG=new WeakMap,wv=new WeakMap,Fw=new WeakMap,VA=new WeakMap,Sv=new WeakMap,kG=new WeakMap,WO=new WeakMap,cd=new WeakMap,_i=new WeakMap,TG=new WeakMap,BG=new WeakMap,WA=new WeakMap,rD=new WeakMap,YO=new WeakMap,nD=new WeakMap,$I=new WeakMap,DG=new WeakMap,As=new WeakMap,iD=new WeakMap,sD=new WeakMap,oD=new WeakMap,Ps=new WeakMap,PG=new WeakMap,Lw=new WeakMap,rp=new WeakMap,P4e)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[R4e](){return{log:(...t)=>{this[RG]()||console.log(...t),ii(this,VA,!0,"f"),Ge(this,cd,"f").length&&ii(this,cd,Ge(this,cd,"f")+`
|
|
573
573
|
`,"f"),ii(this,cd,Ge(this,cd,"f")+t.join(" "),"f")},error:(...t)=>{this[RG]()||console.error(...t),ii(this,VA,!0,"f"),Ge(this,cd,"f").length&&ii(this,cd,Ge(this,cd,"f")+`
|
|
574
|
-
`,"f"),ii(this,cd,Ge(this,cd,"f")+t.join(" "),"f")}}}[fue](t){GO(Ge(this,_i,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Ge(this,_i,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete Ge(this,Ps,"f").getDescriptions()[t]}[N4e](t,r,n){Ge(this,CG,"f")[n]||(Ge(this,As,"f").process.emitWarning(t,r),Ge(this,CG,"f")[n]=!0)}[O4e](){Ge(this,IG,"f").push({options:Ge(this,_i,"f"),configObjects:Ge(this,_i,"f").configObjects.slice(0),exitProcess:Ge(this,Ev,"f"),groups:Ge(this,Fw,"f"),strict:Ge(this,iD,"f"),strictCommands:Ge(this,sD,"f"),strictOptions:Ge(this,oD,"f"),completionCommand:Ge(this,GA,"f"),output:Ge(this,cd,"f"),exitError:Ge(this,UI,"f"),hasOutput:Ge(this,VA,"f"),parsed:this.parsed,parseFn:Ge(this,WA,"f"),parseContext:Ge(this,rD,"f")}),Ge(this,Ps,"f").freeze(),Ge(this,rp,"f").freeze(),Ge(this,Bp,"f").freeze(),Ge(this,wv,"f").freeze()}[F4e](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Ge(this,As,"f").process.argv()[0])?r=Ge(this,As,"f").process.argv().slice(1,2):r=Ge(this,As,"f").process.argv().slice(0,1),t=r.map(n=>{let o=this[Y4e](Ge(this,eD,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length<n.length?o:n}).join(" ").trim(),Ge(this,As,"f").getEnv("_")&&Ge(this,As,"f").getProcessArgvBin()===Ge(this,As,"f").getEnv("_")&&(t=Ge(this,As,"f").getEnv("_").replace(`${Ge(this,As,"f").path.dirname(Ge(this,As,"f").process.execPath())}/`,"")),t}[aD](){return Ge(this,BG,"f")}[L4e](){return Ge(this,PG,"f")}[due](){if(!Ge(this,tD,"f"))return;let t=Ge(this,As,"f").getEnv("LC_ALL")||Ge(this,As,"f").getEnv("LC_MESSAGES")||Ge(this,As,"f").getEnv("LANG")||Ge(this,As,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[j4e](){return this[hue]().version||"unknown"}[M4e](t){let r=t["--"]?t["--"]:t._;for(let n=0,o;(o=r[n])!==void 0;n++)Ge(this,As,"f").Parser.looksLikeNumber(o)&&Number.isSafeInteger(Math.floor(parseFloat(`${o}`)))&&(r[n]=Number(o));return t}[hue](t){let r=t||"*";if(Ge(this,YO,"f")[r])return Ge(this,YO,"f")[r];let n={};try{let o=t||Ge(this,As,"f").mainFilename;!t&&Ge(this,As,"f").path.extname(o)&&(o=Ge(this,As,"f").path.dirname(o));let s=Ge(this,As,"f").findUp(o,(c,u)=>{if(u.includes("package.json"))return"package.json"});eg(s,void 0,Ge(this,As,"f")),n=JSON.parse(Ge(this,As,"f").readFileSync(s,"utf8"))}catch{}return Ge(this,YO,"f")[r]=n||{},Ge(this,YO,"f")[r]}[zI](t,r){r=[].concat(r),r.forEach(n=>{n=this[Aue](n),Ge(this,_i,"f")[t].push(n)})}[JO](t,r,n,o){this[gue](t,r,n,o,(s,c,u)=>{Ge(this,_i,"f")[s][c]=u})}[mue](t,r,n,o){this[gue](t,r,n,o,(s,c,u)=>{Ge(this,_i,"f")[s][c]=(Ge(this,_i,"f")[s][c]||[]).concat(u)})}[gue](t,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{t(c,o)});else if((c=>typeof c=="object")(n))for(let c of GO(n))t(c,n[c]);else s(r,this[Aue](n),o)}[Aue](t){return t==="__proto__"?"___proto___":t}[yue](t,r){return this[JO](this[yue].bind(this),"key",t,r),this}[vue](){var t,r,n,o,s,c,u,p,f,h,g,y;let v=Ge(this,IG,"f").pop();eg(v,void 0,Ge(this,As,"f"));let A;t=this,r=this,n=this,o=this,s=this,c=this,u=this,p=this,f=this,h=this,g=this,y=this,{options:{set value(S){ii(t,_i,S,"f")}}.value,configObjects:A,exitProcess:{set value(S){ii(r,Ev,S,"f")}}.value,groups:{set value(S){ii(n,Fw,S,"f")}}.value,output:{set value(S){ii(o,cd,S,"f")}}.value,exitError:{set value(S){ii(s,UI,S,"f")}}.value,hasOutput:{set value(S){ii(c,VA,S,"f")}}.value,parsed:this.parsed,strict:{set value(S){ii(u,iD,S,"f")}}.value,strictCommands:{set value(S){ii(p,sD,S,"f")}}.value,strictOptions:{set value(S){ii(f,oD,S,"f")}}.value,completionCommand:{set value(S){ii(h,GA,S,"f")}}.value,parseFn:{set value(S){ii(g,WA,S,"f")}}.value,parseContext:{set value(S){ii(y,rD,S,"f")}}.value}=v,Ge(this,_i,"f").configObjects=A,Ge(this,Ps,"f").unfreeze(),Ge(this,rp,"f").unfreeze(),Ge(this,Bp,"f").unfreeze(),Ge(this,wv,"f").unfreeze()}[Q4e](t,r){return ZB(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[q4e].bind(this),getContext:this[U4e].bind(this),getHasOutput:this[$4e].bind(this),getLoggerInstance:this[z4e].bind(this),getParseContext:this[H4e].bind(this),getParserConfiguration:this[aD].bind(this),getUsageConfiguration:this[L4e].bind(this),getUsageInstance:this[G4e].bind(this),getValidationInstance:this[V4e].bind(this),hasParseCallback:this[RG].bind(this),isGlobalContext:this[W4e].bind(this),postProcess:this[cD].bind(this),reset:this[xue].bind(this),runValidation:this[bue].bind(this),runYargsParserAndExecuteCommands:this[i8].bind(this),setHasOutput:this[J4e].bind(this)}}[q4e](){return Ge(this,Bp,"f")}[U4e](){return Ge(this,n8,"f")}[$4e](){return Ge(this,VA,"f")}[z4e](){return Ge(this,WO,"f")}[H4e](){return Ge(this,rD,"f")||{}}[G4e](){return Ge(this,Ps,"f")}[V4e](){return Ge(this,rp,"f")}[RG](){return!!Ge(this,WA,"f")}[W4e](){return Ge(this,kG,"f")}[cD](t,r,n,o){return n||Pu(t)||(r||(t=this[P4e](t)),(this[aD]()["parse-positional-numbers"]||this[aD]()["parse-positional-numbers"]===void 0)&&(t=this[M4e](t)),o&&(t=XB(t,this,Ge(this,wv,"f").getMiddleware(),!1))),t}[xue](t={}){ii(this,_i,Ge(this,_i,"f")||{},"f");let r={};r.local=Ge(this,_i,"f").local||[],r.configObjects=Ge(this,_i,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(u=>{n[u]=!0})}),Object.assign(Ge(this,nD,"f"),Object.keys(Ge(this,Fw,"f")).reduce((c,u)=>{let p=Ge(this,Fw,"f")[u].filter(f=>!(f in n));return p.length>0&&(c[u]=p),c},{})),ii(this,Fw,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(Ge(this,_i,"f")[c]||[]).filter(u=>!n[u])}),s.forEach(c=>{r[c]=QI(Ge(this,_i,"f")[c],u=>!n[u])}),r.envPrefix=Ge(this,_i,"f").envPrefix,ii(this,_i,r,"f"),ii(this,Ps,Ge(this,Ps,"f")?Ge(this,Ps,"f").reset(n):_4e(this,Ge(this,As,"f")),"f"),ii(this,rp,Ge(this,rp,"f")?Ge(this,rp,"f").reset(n):D4e(this,Ge(this,Ps,"f"),Ge(this,As,"f")),"f"),ii(this,Bp,Ge(this,Bp,"f")?Ge(this,Bp,"f").reset():E4e(Ge(this,Ps,"f"),Ge(this,rp,"f"),Ge(this,wv,"f"),Ge(this,As,"f")),"f"),Ge(this,bv,"f")||ii(this,bv,k4e(this,Ge(this,Ps,"f"),Ge(this,Bp,"f"),Ge(this,As,"f")),"f"),Ge(this,wv,"f").reset(),ii(this,GA,null,"f"),ii(this,cd,"","f"),ii(this,UI,null,"f"),ii(this,VA,!1,"f"),this.parsed=!1,this}[Y4e](t,r){return Ge(this,As,"f").path.relative(t,r)}[i8](t,r,n,o=0,s=!1){let c=!!n||s;t=t||Ge(this,$I,"f"),Ge(this,_i,"f").__=Ge(this,As,"f").y18n.__,Ge(this,_i,"f").configuration=this[aD]();let u=!!Ge(this,_i,"f").configuration["populate--"],p=Object.assign({},Ge(this,_i,"f").configuration,{"populate--":!0}),f=Ge(this,As,"f").Parser.detailed(t,Object.assign({},Ge(this,_i,"f"),{configuration:{"parse-positional-numbers":!1,...p}})),h=Object.assign(f.argv,Ge(this,rD,"f")),g,y=f.aliases,v=!1,A=!1;Object.keys(h).forEach(S=>{S===Ge(this,Sv,"f")&&h[S]?v=!0:S===Ge(this,Lw,"f")&&h[S]&&(A=!0)}),h.$0=this.$0,this.parsed=f,o===0&&Ge(this,Ps,"f").clearCachedHelpMessage();try{if(this[due](),r)return this[cD](h,u,!!n,!1);Ge(this,Sv,"f")&&[Ge(this,Sv,"f")].concat(y[Ge(this,Sv,"f")]||[]).filter(j=>j.length>1).includes(""+h._[h._.length-1])&&(h._.pop(),v=!0),ii(this,kG,!1,"f");let S=Ge(this,Bp,"f").getCommands(),E=Ge(this,bv,"f").completionKey in h,I=v||E||s;if(h._.length){if(S.length){let D;for(let j=o||0,F;h._[j]!==void 0;j++)if(F=String(h._[j]),S.includes(F)&&F!==Ge(this,GA,"f")){let U=Ge(this,Bp,"f").runCommand(F,this,f,j+1,s,v||A||s);return this[cD](U,u,!!n,!1)}else if(!D&&F!==Ge(this,GA,"f")){D=F;break}!Ge(this,Bp,"f").hasDefaultCommand()&&Ge(this,DG,"f")&&D&&!I&&Ge(this,rp,"f").recommendCommands(D,S)}Ge(this,GA,"f")&&h._.includes(Ge(this,GA,"f"))&&!E&&(Ge(this,Ev,"f")&&qI(!0),this.showCompletionScript(),this.exit(0))}if(Ge(this,Bp,"f").hasDefaultCommand()&&!I){let D=Ge(this,Bp,"f").runCommand(null,this,f,0,s,v||A||s);return this[cD](D,u,!!n,!1)}if(E){Ge(this,Ev,"f")&&qI(!0),t=[].concat(t);let D=t.slice(t.indexOf(`--${Ge(this,bv,"f").completionKey}`)+1);return Ge(this,bv,"f").getCompletion(D,(j,F)=>{if(j)throw new Du(j.message);(F||[]).forEach(U=>{Ge(this,WO,"f").log(U)}),this.exit(0)}),this[cD](h,!u,!!n,!1)}if(Ge(this,VA,"f")||(v?(Ge(this,Ev,"f")&&qI(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(Ge(this,Ev,"f")&&qI(!0),c=!0,Ge(this,Ps,"f").showVersion("log"),this.exit(0))),!c&&Ge(this,_i,"f").skipValidation.length>0&&(c=Object.keys(h).some(D=>Ge(this,_i,"f").skipValidation.indexOf(D)>=0&&h[D]===!0)),!c){if(f.error)throw new Du(f.error.message);if(!E){let D=this[bue](y,{},f.error);n||(g=XB(h,this,Ge(this,wv,"f").getMiddleware(),!0)),g=this[Q4e](D,g!=null?g:h),Pu(g)&&!n&&(g=g.then(()=>XB(h,this,Ge(this,wv,"f").getMiddleware(),!1)))}}}catch(S){if(S instanceof Du)Ge(this,Ps,"f").fail(S.message,S);else throw S}return this[cD](g!=null?g:h,u,!!n,!0)}[bue](t,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Du(n.message);Ge(this,rp,"f").nonOptionCount(c),Ge(this,rp,"f").requiredArguments(c,s);let u=!1;Ge(this,sD,"f")&&(u=Ge(this,rp,"f").unknownCommands(c)),Ge(this,iD,"f")&&!u?Ge(this,rp,"f").unknownArguments(c,t,r,!!o):Ge(this,oD,"f")&&Ge(this,rp,"f").unknownArguments(c,t,{},!1,!1),Ge(this,rp,"f").limitedChoices(c),Ge(this,rp,"f").implications(c),Ge(this,rp,"f").conflicting(c)}}[J4e](){ii(this,VA,!0,"f")}[uD](t){if(typeof t=="string")Ge(this,_i,"f").key[t]=!0;else for(let r of t)Ge(this,_i,"f").key[r]=!0}};function w4e(e){return!!e&&typeof e.getInternalMethods=="function"}var zrr=K4e(oue),X4e=zrr;var gb={name:"edgeone",version:"1.6.29",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/config-schema.js","./edgeone-dist/edgeone.schema.json","./edgeone-dist/pages/templates","./edgeone-dist/pages/dev/runner-worker.js","./edgeone-dist/pages/observability-python/**","./edgeone-dist/libs-pages-blob-python/**","./edgeone-dist/libs-pages-agent-toolkit/**","./edgeone-dist/studio/**","./edgeone-dist/plugins/**","./libs-pages-blob-python/**","./libs-pages-agent-toolkit/**"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai ./libs-kv-client",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run build:kv-client && npm run prepare:blob-wheel && npm run prepare:agent-toolkit-wheel && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js","build:kv-client":"node ./scripts/build-kv-client.js","prepare:blob-wheel":"node ./scripts/prepare-pages-blob-wheel.js","prepare:agent-toolkit-wheel":"node ./scripts/prepare-pages-agent-toolkit-wheel.js","verify:publish-assets":"node ./scripts/verify-publish-assets.js","upload:agent-version-manifest":"node ./scripts/upload-agent-version-manifest.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build && npm run verify:publish-assets",prepublishOnly:"npm run build && npm run verify:publish-assets",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:observability":"vitest run --config src/agent/observability/node/tests/vitest.config.ts && cd src/agent/observability/python && uv run pytest tests/ -q"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/is-spa":"^0.0.3","@edgeone/nuxt-pages":"1.1.0","@edgeone/opennextjs-pages":"0.2.10","@edgeone/pages-agent-toolkit":"^0.1.34","@edgeone/pages-blob":"^0.0.16",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1",giget:"^2.0.0","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0",vitest:"^4.0.17",zod:"^3.23.8"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@edgeone/types":"^1.0.1","@opentelemetry/api":"^1.9.1","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-metrics-otlp-http":"^0.55.0","@opentelemetry/exporter-trace-otlp-http":"^0.55.0","@opentelemetry/instrumentation":"^0.55.0","@opentelemetry/otlp-transformer":"^0.55.0","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.40.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24","@vitest/coverage-v8":"^4.0.17",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",protobufjs:"^8.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}};var hD=Ct(require("fs")),mD=Ct(require("path")),pQe=require("module"),fQe=require("url");J_();sle();Mc();function dQe(e){e.command("compile","Compile edgeone.config.ts to edgeone.json",()=>{},()=>Mir()).command("validate","Validate the current config file",()=>{},()=>Qir()).command("schema","Write edgeone.schema.json for IDE validation",()=>{},()=>qir())}async function Mir(e=process.cwd()){var u;let[t,r]=m8(e);if(!r){console.error("No config file found (edgeone.config.ts / edgeone.json / edgeone.json5)."),process.exitCode=1;return}if(t.endsWith(".json")||t.endsWith(".json5")){console.log("Config is already JSON, nothing to compile.");return}let n;try{n=dD(e)}catch(p){console.error((u=p==null?void 0:p.message)!=null?u:p),process.exitCode=1;return}let[o,s]=d8(n,["root"]);if((s||[]).forEach(p=>console.log(`error in ${p.path.join(".")}: ${p.message}`)),s!=null&&s.length){process.exitCode=1;return}let c=mD.default.join(e,"edgeone.json");await lQe(e,o),console.log(`Compiled to ${c}`)}function Qir(e=process.cwd()){var u;let[t,r]=m8(e);if(!r){console.error("No config file found (edgeone.config.ts / edgeone.json / edgeone.json5)."),process.exitCode=1;return}console.log(`
|
|
574
|
+
`,"f"),ii(this,cd,Ge(this,cd,"f")+t.join(" "),"f")}}}[fue](t){GO(Ge(this,_i,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Ge(this,_i,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete Ge(this,Ps,"f").getDescriptions()[t]}[N4e](t,r,n){Ge(this,CG,"f")[n]||(Ge(this,As,"f").process.emitWarning(t,r),Ge(this,CG,"f")[n]=!0)}[O4e](){Ge(this,IG,"f").push({options:Ge(this,_i,"f"),configObjects:Ge(this,_i,"f").configObjects.slice(0),exitProcess:Ge(this,Ev,"f"),groups:Ge(this,Fw,"f"),strict:Ge(this,iD,"f"),strictCommands:Ge(this,sD,"f"),strictOptions:Ge(this,oD,"f"),completionCommand:Ge(this,GA,"f"),output:Ge(this,cd,"f"),exitError:Ge(this,UI,"f"),hasOutput:Ge(this,VA,"f"),parsed:this.parsed,parseFn:Ge(this,WA,"f"),parseContext:Ge(this,rD,"f")}),Ge(this,Ps,"f").freeze(),Ge(this,rp,"f").freeze(),Ge(this,Bp,"f").freeze(),Ge(this,wv,"f").freeze()}[F4e](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Ge(this,As,"f").process.argv()[0])?r=Ge(this,As,"f").process.argv().slice(1,2):r=Ge(this,As,"f").process.argv().slice(0,1),t=r.map(n=>{let o=this[Y4e](Ge(this,eD,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length<n.length?o:n}).join(" ").trim(),Ge(this,As,"f").getEnv("_")&&Ge(this,As,"f").getProcessArgvBin()===Ge(this,As,"f").getEnv("_")&&(t=Ge(this,As,"f").getEnv("_").replace(`${Ge(this,As,"f").path.dirname(Ge(this,As,"f").process.execPath())}/`,"")),t}[aD](){return Ge(this,BG,"f")}[L4e](){return Ge(this,PG,"f")}[due](){if(!Ge(this,tD,"f"))return;let t=Ge(this,As,"f").getEnv("LC_ALL")||Ge(this,As,"f").getEnv("LC_MESSAGES")||Ge(this,As,"f").getEnv("LANG")||Ge(this,As,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[j4e](){return this[hue]().version||"unknown"}[M4e](t){let r=t["--"]?t["--"]:t._;for(let n=0,o;(o=r[n])!==void 0;n++)Ge(this,As,"f").Parser.looksLikeNumber(o)&&Number.isSafeInteger(Math.floor(parseFloat(`${o}`)))&&(r[n]=Number(o));return t}[hue](t){let r=t||"*";if(Ge(this,YO,"f")[r])return Ge(this,YO,"f")[r];let n={};try{let o=t||Ge(this,As,"f").mainFilename;!t&&Ge(this,As,"f").path.extname(o)&&(o=Ge(this,As,"f").path.dirname(o));let s=Ge(this,As,"f").findUp(o,(c,u)=>{if(u.includes("package.json"))return"package.json"});eg(s,void 0,Ge(this,As,"f")),n=JSON.parse(Ge(this,As,"f").readFileSync(s,"utf8"))}catch{}return Ge(this,YO,"f")[r]=n||{},Ge(this,YO,"f")[r]}[zI](t,r){r=[].concat(r),r.forEach(n=>{n=this[Aue](n),Ge(this,_i,"f")[t].push(n)})}[JO](t,r,n,o){this[gue](t,r,n,o,(s,c,u)=>{Ge(this,_i,"f")[s][c]=u})}[mue](t,r,n,o){this[gue](t,r,n,o,(s,c,u)=>{Ge(this,_i,"f")[s][c]=(Ge(this,_i,"f")[s][c]||[]).concat(u)})}[gue](t,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{t(c,o)});else if((c=>typeof c=="object")(n))for(let c of GO(n))t(c,n[c]);else s(r,this[Aue](n),o)}[Aue](t){return t==="__proto__"?"___proto___":t}[yue](t,r){return this[JO](this[yue].bind(this),"key",t,r),this}[vue](){var t,r,n,o,s,c,u,p,f,h,g,y;let v=Ge(this,IG,"f").pop();eg(v,void 0,Ge(this,As,"f"));let A;t=this,r=this,n=this,o=this,s=this,c=this,u=this,p=this,f=this,h=this,g=this,y=this,{options:{set value(S){ii(t,_i,S,"f")}}.value,configObjects:A,exitProcess:{set value(S){ii(r,Ev,S,"f")}}.value,groups:{set value(S){ii(n,Fw,S,"f")}}.value,output:{set value(S){ii(o,cd,S,"f")}}.value,exitError:{set value(S){ii(s,UI,S,"f")}}.value,hasOutput:{set value(S){ii(c,VA,S,"f")}}.value,parsed:this.parsed,strict:{set value(S){ii(u,iD,S,"f")}}.value,strictCommands:{set value(S){ii(p,sD,S,"f")}}.value,strictOptions:{set value(S){ii(f,oD,S,"f")}}.value,completionCommand:{set value(S){ii(h,GA,S,"f")}}.value,parseFn:{set value(S){ii(g,WA,S,"f")}}.value,parseContext:{set value(S){ii(y,rD,S,"f")}}.value}=v,Ge(this,_i,"f").configObjects=A,Ge(this,Ps,"f").unfreeze(),Ge(this,rp,"f").unfreeze(),Ge(this,Bp,"f").unfreeze(),Ge(this,wv,"f").unfreeze()}[Q4e](t,r){return ZB(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[q4e].bind(this),getContext:this[U4e].bind(this),getHasOutput:this[$4e].bind(this),getLoggerInstance:this[z4e].bind(this),getParseContext:this[H4e].bind(this),getParserConfiguration:this[aD].bind(this),getUsageConfiguration:this[L4e].bind(this),getUsageInstance:this[G4e].bind(this),getValidationInstance:this[V4e].bind(this),hasParseCallback:this[RG].bind(this),isGlobalContext:this[W4e].bind(this),postProcess:this[cD].bind(this),reset:this[xue].bind(this),runValidation:this[bue].bind(this),runYargsParserAndExecuteCommands:this[i8].bind(this),setHasOutput:this[J4e].bind(this)}}[q4e](){return Ge(this,Bp,"f")}[U4e](){return Ge(this,n8,"f")}[$4e](){return Ge(this,VA,"f")}[z4e](){return Ge(this,WO,"f")}[H4e](){return Ge(this,rD,"f")||{}}[G4e](){return Ge(this,Ps,"f")}[V4e](){return Ge(this,rp,"f")}[RG](){return!!Ge(this,WA,"f")}[W4e](){return Ge(this,kG,"f")}[cD](t,r,n,o){return n||Pu(t)||(r||(t=this[P4e](t)),(this[aD]()["parse-positional-numbers"]||this[aD]()["parse-positional-numbers"]===void 0)&&(t=this[M4e](t)),o&&(t=XB(t,this,Ge(this,wv,"f").getMiddleware(),!1))),t}[xue](t={}){ii(this,_i,Ge(this,_i,"f")||{},"f");let r={};r.local=Ge(this,_i,"f").local||[],r.configObjects=Ge(this,_i,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(u=>{n[u]=!0})}),Object.assign(Ge(this,nD,"f"),Object.keys(Ge(this,Fw,"f")).reduce((c,u)=>{let p=Ge(this,Fw,"f")[u].filter(f=>!(f in n));return p.length>0&&(c[u]=p),c},{})),ii(this,Fw,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(Ge(this,_i,"f")[c]||[]).filter(u=>!n[u])}),s.forEach(c=>{r[c]=QI(Ge(this,_i,"f")[c],u=>!n[u])}),r.envPrefix=Ge(this,_i,"f").envPrefix,ii(this,_i,r,"f"),ii(this,Ps,Ge(this,Ps,"f")?Ge(this,Ps,"f").reset(n):_4e(this,Ge(this,As,"f")),"f"),ii(this,rp,Ge(this,rp,"f")?Ge(this,rp,"f").reset(n):D4e(this,Ge(this,Ps,"f"),Ge(this,As,"f")),"f"),ii(this,Bp,Ge(this,Bp,"f")?Ge(this,Bp,"f").reset():E4e(Ge(this,Ps,"f"),Ge(this,rp,"f"),Ge(this,wv,"f"),Ge(this,As,"f")),"f"),Ge(this,bv,"f")||ii(this,bv,k4e(this,Ge(this,Ps,"f"),Ge(this,Bp,"f"),Ge(this,As,"f")),"f"),Ge(this,wv,"f").reset(),ii(this,GA,null,"f"),ii(this,cd,"","f"),ii(this,UI,null,"f"),ii(this,VA,!1,"f"),this.parsed=!1,this}[Y4e](t,r){return Ge(this,As,"f").path.relative(t,r)}[i8](t,r,n,o=0,s=!1){let c=!!n||s;t=t||Ge(this,$I,"f"),Ge(this,_i,"f").__=Ge(this,As,"f").y18n.__,Ge(this,_i,"f").configuration=this[aD]();let u=!!Ge(this,_i,"f").configuration["populate--"],p=Object.assign({},Ge(this,_i,"f").configuration,{"populate--":!0}),f=Ge(this,As,"f").Parser.detailed(t,Object.assign({},Ge(this,_i,"f"),{configuration:{"parse-positional-numbers":!1,...p}})),h=Object.assign(f.argv,Ge(this,rD,"f")),g,y=f.aliases,v=!1,A=!1;Object.keys(h).forEach(S=>{S===Ge(this,Sv,"f")&&h[S]?v=!0:S===Ge(this,Lw,"f")&&h[S]&&(A=!0)}),h.$0=this.$0,this.parsed=f,o===0&&Ge(this,Ps,"f").clearCachedHelpMessage();try{if(this[due](),r)return this[cD](h,u,!!n,!1);Ge(this,Sv,"f")&&[Ge(this,Sv,"f")].concat(y[Ge(this,Sv,"f")]||[]).filter(j=>j.length>1).includes(""+h._[h._.length-1])&&(h._.pop(),v=!0),ii(this,kG,!1,"f");let S=Ge(this,Bp,"f").getCommands(),E=Ge(this,bv,"f").completionKey in h,I=v||E||s;if(h._.length){if(S.length){let D;for(let j=o||0,F;h._[j]!==void 0;j++)if(F=String(h._[j]),S.includes(F)&&F!==Ge(this,GA,"f")){let U=Ge(this,Bp,"f").runCommand(F,this,f,j+1,s,v||A||s);return this[cD](U,u,!!n,!1)}else if(!D&&F!==Ge(this,GA,"f")){D=F;break}!Ge(this,Bp,"f").hasDefaultCommand()&&Ge(this,DG,"f")&&D&&!I&&Ge(this,rp,"f").recommendCommands(D,S)}Ge(this,GA,"f")&&h._.includes(Ge(this,GA,"f"))&&!E&&(Ge(this,Ev,"f")&&qI(!0),this.showCompletionScript(),this.exit(0))}if(Ge(this,Bp,"f").hasDefaultCommand()&&!I){let D=Ge(this,Bp,"f").runCommand(null,this,f,0,s,v||A||s);return this[cD](D,u,!!n,!1)}if(E){Ge(this,Ev,"f")&&qI(!0),t=[].concat(t);let D=t.slice(t.indexOf(`--${Ge(this,bv,"f").completionKey}`)+1);return Ge(this,bv,"f").getCompletion(D,(j,F)=>{if(j)throw new Du(j.message);(F||[]).forEach(U=>{Ge(this,WO,"f").log(U)}),this.exit(0)}),this[cD](h,!u,!!n,!1)}if(Ge(this,VA,"f")||(v?(Ge(this,Ev,"f")&&qI(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(Ge(this,Ev,"f")&&qI(!0),c=!0,Ge(this,Ps,"f").showVersion("log"),this.exit(0))),!c&&Ge(this,_i,"f").skipValidation.length>0&&(c=Object.keys(h).some(D=>Ge(this,_i,"f").skipValidation.indexOf(D)>=0&&h[D]===!0)),!c){if(f.error)throw new Du(f.error.message);if(!E){let D=this[bue](y,{},f.error);n||(g=XB(h,this,Ge(this,wv,"f").getMiddleware(),!0)),g=this[Q4e](D,g!=null?g:h),Pu(g)&&!n&&(g=g.then(()=>XB(h,this,Ge(this,wv,"f").getMiddleware(),!1)))}}}catch(S){if(S instanceof Du)Ge(this,Ps,"f").fail(S.message,S);else throw S}return this[cD](g!=null?g:h,u,!!n,!0)}[bue](t,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Du(n.message);Ge(this,rp,"f").nonOptionCount(c),Ge(this,rp,"f").requiredArguments(c,s);let u=!1;Ge(this,sD,"f")&&(u=Ge(this,rp,"f").unknownCommands(c)),Ge(this,iD,"f")&&!u?Ge(this,rp,"f").unknownArguments(c,t,r,!!o):Ge(this,oD,"f")&&Ge(this,rp,"f").unknownArguments(c,t,{},!1,!1),Ge(this,rp,"f").limitedChoices(c),Ge(this,rp,"f").implications(c),Ge(this,rp,"f").conflicting(c)}}[J4e](){ii(this,VA,!0,"f")}[uD](t){if(typeof t=="string")Ge(this,_i,"f").key[t]=!0;else for(let r of t)Ge(this,_i,"f").key[r]=!0}};function w4e(e){return!!e&&typeof e.getInternalMethods=="function"}var zrr=K4e(oue),X4e=zrr;var gb={name:"edgeone",version:"1.6.30",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/config-schema.js","./edgeone-dist/edgeone.schema.json","./edgeone-dist/pages/templates","./edgeone-dist/pages/dev/runner-worker.js","./edgeone-dist/pages/observability-python/**","./edgeone-dist/libs-pages-blob-python/**","./edgeone-dist/libs-pages-agent-toolkit/**","./edgeone-dist/studio/**","./edgeone-dist/plugins/**","./libs-pages-blob-python/**","./libs-pages-agent-toolkit/**"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai ./libs-kv-client",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run build:kv-client && npm run prepare:blob-wheel && npm run prepare:agent-toolkit-wheel && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js","build:kv-client":"node ./scripts/build-kv-client.js","prepare:blob-wheel":"node ./scripts/prepare-pages-blob-wheel.js","prepare:agent-toolkit-wheel":"node ./scripts/prepare-pages-agent-toolkit-wheel.js","verify:publish-assets":"node ./scripts/verify-publish-assets.js","upload:agent-version-manifest":"node ./scripts/upload-agent-version-manifest.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build && npm run verify:publish-assets",prepublishOnly:"npm run build && npm run verify:publish-assets",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:observability":"vitest run --config src/agent/observability/node/tests/vitest.config.ts && cd src/agent/observability/python && uv run pytest tests/ -q"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/is-spa":"^0.0.3","@edgeone/nuxt-pages":"1.1.0","@edgeone/opennextjs-pages":"0.2.10","@edgeone/pages-agent-toolkit":"^0.1.34","@edgeone/pages-blob":"^0.0.16",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1",giget:"^2.0.0","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0",vitest:"^4.0.17",zod:"^3.23.8"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@edgeone/types":"^1.0.1","@opentelemetry/api":"^1.9.1","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-metrics-otlp-http":"^0.55.0","@opentelemetry/exporter-trace-otlp-http":"^0.55.0","@opentelemetry/instrumentation":"^0.55.0","@opentelemetry/otlp-transformer":"^0.55.0","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.40.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24","@vitest/coverage-v8":"^4.0.17",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",protobufjs:"^8.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}};var hD=Ct(require("fs")),mD=Ct(require("path")),pQe=require("module"),fQe=require("url");J_();sle();Mc();function dQe(e){e.command("compile","Compile edgeone.config.ts to edgeone.json",()=>{},()=>Mir()).command("validate","Validate the current config file",()=>{},()=>Qir()).command("schema","Write edgeone.schema.json for IDE validation",()=>{},()=>qir())}async function Mir(e=process.cwd()){var u;let[t,r]=m8(e);if(!r){console.error("No config file found (edgeone.config.ts / edgeone.json / edgeone.json5)."),process.exitCode=1;return}if(t.endsWith(".json")||t.endsWith(".json5")){console.log("Config is already JSON, nothing to compile.");return}let n;try{n=dD(e)}catch(p){console.error((u=p==null?void 0:p.message)!=null?u:p),process.exitCode=1;return}let[o,s]=d8(n,["root"]);if((s||[]).forEach(p=>console.log(`error in ${p.path.join(".")}: ${p.message}`)),s!=null&&s.length){process.exitCode=1;return}let c=mD.default.join(e,"edgeone.json");await lQe(e,o),console.log(`Compiled to ${c}`)}function Qir(e=process.cwd()){var u;let[t,r]=m8(e);if(!r){console.error("No config file found (edgeone.config.ts / edgeone.json / edgeone.json5)."),process.exitCode=1;return}console.log(`
|
|
575
575
|
> Start validating the configuration file:`);let n;try{n=dD(e)}catch(p){console.error((u=p==null?void 0:p.message)!=null?u:p),process.exitCode=1;return}let[o,s,c]=d8(n,["root"]);(c||[]).forEach(p=>console.warn(p.message)),s!=null&&s.length?(s.forEach(p=>console.log(`error in ${p.path.join(".")}: ${p.message}`)),process.exitCode=1):console.log("none error in configuration file"),console.log(`End validating!
|
|
576
|
-
`)}function qir(e=process.cwd()){let t;try{let n=(0,pQe.createRequire)("file:///Users/
|
|
576
|
+
`)}function qir(e=process.cwd()){let t;try{let n=(0,pQe.createRequire)("file:///Users/vincentlli/Documents/demo/ali-cli/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js"),o=mD.default.join(mD.default.dirname((0,fQe.fileURLToPath)("file:///Users/vincentlli/Documents/demo/ali-cli/ef-dev-tools/packages/tef-cli/edgeone-dist/cli.js")),"edgeone.schema.json");t=hD.default.existsSync(o)?JSON.parse(hD.default.readFileSync(o,"utf-8")):n("@edgeone/types/edgeone.schema.json")}catch(n){console.error(`Failed to load edgeone.schema.json: ${n==null?void 0:n.message}`),process.exitCode=1;return}let r=mD.default.join(e,cQe);GI(r,t),console.log(`Schema written to ${r}.`),Uir(e)}function Uir(e){let t=mD.default.join(e,".vscode"),r=mD.default.join(t,"settings.json"),n={fileMatch:["edgeone.json"],url:"./edgeone.schema.json"},o={};try{hD.default.existsSync(r)&&(o=JSON.parse(hD.default.readFileSync(r,"utf-8")),(typeof o!="object"||o===null||Array.isArray(o))&&(console.warn(`[schema] ${r} is not a JSON object, backing up as settings.json.bak`),hD.default.copyFileSync(r,`${r}.bak`),o={}))}catch(u){console.warn(`[schema] Failed to parse ${r}: ${u==null?void 0:u.message}; skipping VS Code association`);return}let s=Array.isArray(o["json.schemas"])?o["json.schemas"]:[],c=s.find(u=>Array.isArray(u==null?void 0:u.fileMatch)&&u.fileMatch.includes("edgeone.json"));c?c.url=n.url:s.push({...n}),o["json.schemas"]=s,hD.default.mkdirSync(t,{recursive:!0}),GI(r,o),console.log(`Registered VS Code schema association in ${r} \u2014 manual edgeone.json files will get hints without a $schema field.`)}var dme=Ct(Qc()),hme=Ct(gF()),mme=Ct(ufe());function dq(e,t){return function(){return e.apply(t,arguments)}}var{toString:Uur}=Object.prototype,{getPrototypeOf:$V}=Object,{iterator:zV,toStringTag:ZUe}=Symbol,HV=(e=>t=>{let r=Uur.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Ib=e=>(e=e.toLowerCase(),t=>HV(t)===e),GV=e=>t=>typeof t===e,{isArray:kD}=Array,vF=GV("undefined");function xF(e){return e!==null&&!vF(e)&&e.constructor!==null&&!vF(e.constructor)&&P0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var e5e=Ib("ArrayBuffer");function $ur(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&e5e(e.buffer),t}var zur=GV("string"),P0=GV("function"),t5e=GV("number"),hq=e=>e!==null&&typeof e=="object",Hur=e=>e===!0||e===!1,UV=e=>{if(HV(e)!=="object")return!1;let t=$V(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ZUe in e)&&!(zV in e)},Gur=e=>{if(!hq(e)||xF(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Vur=Ib("Date"),Wur=Ib("File"),Yur=e=>!!(e&&typeof e.uri<"u"),Jur=e=>e&&typeof e.getParts<"u",Kur=Ib("Blob"),Xur=Ib("FileList"),Zur=e=>hq(e)&&P0(e.pipe);function elr(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var KUe=elr(),XUe=typeof KUe.FormData<"u"?KUe.FormData:void 0,tlr=e=>{if(!e)return!1;if(XUe&&e instanceof XUe)return!0;let t=$V(e);if(!t||t===Object.prototype||!P0(e.append))return!1;let r=HV(e);return r==="formdata"||r==="object"&&P0(e.toString)&&e.toString()==="[object FormData]"},rlr=Ib("URLSearchParams"),[nlr,ilr,slr,olr]=["ReadableStream","Request","Response","Headers"].map(Ib),alr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mq(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),kD(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(xF(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),c=s.length,u;for(n=0;n<c;n++)u=s[n],t.call(null,e[u],u,e)}}function r5e(e,t){if(xF(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}var ID=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,n5e=e=>!vF(e)&&e!==ID;function lfe(...e){let{caseless:t,skipUndefined:r}=n5e(this)&&this||{},n={},o=(s,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;let u=t&&typeof c=="string"&&r5e(n,c)||c,p=pfe(n,u)?n[u]:void 0;UV(p)&&UV(s)?n[u]=lfe(p,s):UV(s)?n[u]=lfe({},s):kD(s)?n[u]=s.slice():(!r||!vF(s))&&(n[u]=s)};for(let s=0,c=e.length;s<c;s++){let u=e[s];if(!u||xF(u)||(mq(u,o),typeof u!="object"||kD(u)))continue;let p=Object.getOwnPropertySymbols(u);for(let f=0;f<p.length;f++){let h=p[f];vlr.call(u,h)&&o(u[h],h)}}return n}var clr=(e,t,r,{allOwnKeys:n}={})=>(mq(t,(o,s)=>{r&&P0(o)?Object.defineProperty(e,s,{__proto__:null,value:dq(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),ulr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),llr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},plr=(e,t,r,n)=>{let o,s,c,u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)c=o[s],(!n||n(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=r!==!1&&$V(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},flr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},dlr=e=>{if(!e)return null;if(kD(e))return e;let t=e.length;if(!t5e(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},hlr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$V(Uint8Array)),mlr=(e,t)=>{let n=(e&&e[zV]).call(e),o;for(;(o=n.next())&&!o.done;){let s=o.value;t.call(e,s[0],s[1])}},glr=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Alr=Ib("HTMLFormElement"),ylr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),pfe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),{propertyIsEnumerable:vlr}=Object.prototype,xlr=Ib("RegExp"),i5e=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};mq(r,(o,s)=>{let c;(c=t(o,s,e))!==!1&&(n[s]=c||o)}),Object.defineProperties(e,n)},blr=e=>{i5e(e,(t,r)=>{if(P0(e)&&["arguments","caller","callee"].includes(r))return!1;let n=e[r];if(P0(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Elr=(e,t)=>{let r={},n=o=>{o.forEach(s=>{r[s]=!0})};return kD(e)?n(e):n(String(e).split(t)),r},wlr=()=>{},Slr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function _lr(e){return!!(e&&P0(e.append)&&e[ZUe]==="FormData"&&e[zV])}var Clr=e=>{let t=new WeakSet,r=n=>{if(hq(n)){if(t.has(n))return;if(xF(n))return n;if(!("toJSON"in n)){t.add(n);let o=kD(n)?[]:{};return mq(n,(s,c)=>{let u=r(s);!vF(u)&&(o[c]=u)}),t.delete(n),o}}return n};return r(e)},Ilr=Ib("AsyncFunction"),klr=e=>e&&(hq(e)||P0(e))&&P0(e.then)&&P0(e.catch),s5e=((e,t)=>e?setImmediate:t?((r,n)=>(ID.addEventListener("message",({source:o,data:s})=>{o===ID&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ID.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",P0(ID.postMessage)),Tlr=typeof queueMicrotask<"u"?queueMicrotask.bind(ID):typeof process<"u"&&process.nextTick||s5e,Blr=e=>e!=null&&P0(e[zV]),lt={isArray:kD,isArrayBuffer:e5e,isBuffer:xF,isFormData:tlr,isArrayBufferView:$ur,isString:zur,isNumber:t5e,isBoolean:Hur,isObject:hq,isPlainObject:UV,isEmptyObject:Gur,isReadableStream:nlr,isRequest:ilr,isResponse:slr,isHeaders:olr,isUndefined:vF,isDate:Vur,isFile:Wur,isReactNativeBlob:Yur,isReactNative:Jur,isBlob:Kur,isRegExp:xlr,isFunction:P0,isStream:Zur,isURLSearchParams:rlr,isTypedArray:hlr,isFileList:Xur,forEach:mq,merge:lfe,extend:clr,trim:alr,stripBOM:ulr,inherits:llr,toFlatObject:plr,kindOf:HV,kindOfTest:Ib,endsWith:flr,toArray:dlr,forEachEntry:mlr,matchAll:glr,isHTMLForm:Alr,hasOwnProperty:pfe,hasOwnProp:pfe,reduceDescriptors:i5e,freezeMethods:blr,toObjectSet:Elr,toCamelCase:ylr,noop:wlr,toFiniteNumber:Slr,findKey:r5e,global:ID,isContextDefined:n5e,isSpecCompliantForm:_lr,toJSONObject:Clr,isAsyncFn:Ilr,isThenable:klr,setImmediate:s5e,asap:Tlr,isIterable:Blr};var Dlr=lt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),o5e=e=>{let t={},r,n,o;return e&&e.split(`
|
|
577
577
|
`).forEach(function(c){o=c.indexOf(":"),r=c.substring(0,o).trim().toLowerCase(),n=c.substring(o+1).trim(),!(!r||t[r]&&Dlr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function Plr(e){let t=0,r=e.length;for(;t<r;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){let n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}var Rlr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Nlr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ffe(e,t){return lt.isArray(e)?e.map(r=>ffe(r,t)):Plr(String(e).replace(t,""))}var a5e=e=>ffe(e,Rlr),Olr=e=>ffe(e,Nlr);function bF(e){let t=Object.create(null);return lt.forEach(e.toJSON(),(r,n)=>{t[n]=Olr(r)}),t}var c5e=Symbol("internals");function gq(e){return e&&String(e).trim().toLowerCase()}function VV(e){return e===!1||e==null?e:lt.isArray(e)?e.map(VV):a5e(String(e))}function Flr(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var Llr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function dfe(e,t,r,n,o){if(lt.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!lt.isString(t)){if(lt.isString(n))return t.indexOf(n)!==-1;if(lt.isRegExp(n))return n.test(t)}}function jlr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Mlr(e,t){let r=lt.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,s,c){return this[n].call(this,t,o,s,c)},configurable:!0})})}var EF=class{constructor(t){t&&this.set(t)}set(t,r,n){let o=this;function s(u,p,f){let h=gq(p);if(!h)return;let g=lt.findKey(o,h);(!g||o[g]===void 0||f===!0||f===void 0&&o[g]!==!1)&&(o[g||p]=VV(u))}let c=(u,p)=>lt.forEach(u,(f,h)=>s(f,h,p));if(lt.isPlainObject(t)||t instanceof this.constructor)c(t,r);else if(lt.isString(t)&&(t=t.trim())&&!Llr(t))c(o5e(t),r);else if(lt.isObject(t)&<.isIterable(t)){let u={},p,f;for(let h of t){if(!lt.isArray(h))throw new TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(p=u[f])?lt.isArray(p)?[...p,h[1]]:[p,h[1]]:h[1]}c(u,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=gq(t),t){let n=lt.findKey(this,t);if(n){let o=this[n];if(!r)return o;if(r===!0)return Flr(o);if(lt.isFunction(r))return r.call(this,o,n);if(lt.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=gq(t),t){let n=lt.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||dfe(this,this[n],n,r)))}return!1}delete(t,r){let n=this,o=!1;function s(c){if(c=gq(c),c){let u=lt.findKey(n,c);u&&(!r||dfe(n,n[u],u,r))&&(delete n[u],o=!0)}}return lt.isArray(t)?t.forEach(s):s(t),o}clear(t){let r=Object.keys(this),n=r.length,o=!1;for(;n--;){let s=r[n];(!t||dfe(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){let r=this,n={};return lt.forEach(this,(o,s)=>{let c=lt.findKey(n,s);if(c){r[c]=VV(o),delete r[s];return}let u=t?jlr(s):String(s).trim();u!==s&&delete r[s],r[u]=VV(o),n[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return lt.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&<.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
578
578
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){let n=(this[c5e]=this[c5e]={accessors:{}}).accessors,o=this.prototype;function s(c){let u=gq(c);n[u]||(Mlr(o,c),n[u]=!0)}return lt.isArray(t)?t.forEach(s):s(t),this}};EF.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);lt.reduceDescriptors(EF.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});lt.freezeMethods(EF);var Fu=EF;var Qlr="[REDACTED ****]";function qlr(e){if(lt.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lt.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Ulr(e,t){let r=new Set(t.map(s=>String(s).toLowerCase())),n=[],o=s=>{if(s===null||typeof s!="object"||lt.isBuffer(s))return s;if(n.indexOf(s)!==-1)return;s instanceof Fu&&(s=s.toJSON()),n.push(s);let c;if(lt.isArray(s))c=[],s.forEach((u,p)=>{let f=o(u);lt.isUndefined(f)||(c[p]=f)});else{if(!lt.isPlainObject(s)&&qlr(s))return n.pop(),s;c=Object.create(null);for(let[u,p]of Object.entries(s)){let f=r.has(u.toLowerCase())?Qlr:o(p);lt.isUndefined(f)||(c[u]=f)}}return n.pop(),c};return o(e)}var ah=class e extends Error{static from(t,r,n,o,s,c){let u=new e(t.message,r||t.code,n,o,s);return u.cause=t,u.name=t.name,t.status!=null&&u.status==null&&(u.status=t.status),c&&Object.assign(u,c),u}constructor(t,r,n,o,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){let t=this.config,r=t&<.hasOwnProp(t,"redact")?t.redact:void 0,n=lt.isArray(r)&&r.length>0?Ulr(t,r):lt.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};ah.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ah.ERR_BAD_OPTION="ERR_BAD_OPTION";ah.ECONNABORTED="ECONNABORTED";ah.ETIMEDOUT="ETIMEDOUT";ah.ECONNREFUSED="ECONNREFUSED";ah.ERR_NETWORK="ERR_NETWORK";ah.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ah.ERR_DEPRECATED="ERR_DEPRECATED";ah.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ah.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ah.ERR_CANCELED="ERR_CANCELED";ah.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ah.ERR_INVALID_URL="ERR_INVALID_URL";ah.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Jr=ah;var l7e=Ct(u7e(),1),sW=l7e.default;function Ofe(e){return lt.isPlainObject(e)||lt.isArray(e)}function p7e(e){return lt.endsWith(e,"[]")?e.slice(0,-2):e}function Nfe(e,t,r){return e?e.concat(t).map(function(o,s){return o=p7e(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Ifr(e){return lt.isArray(e)&&!e.some(Ofe)}var kfr=lt.toFlatObject(lt,{},null,function(t){return/^is[A-Z]/.test(t)});function Tfr(e,t,r){if(!lt.isObject(e))throw new TypeError("target must be an object");t=t||new(sW||FormData),r=lt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,I){return!lt.isUndefined(I[E])});let n=r.metaTokens,o=r.visitor||g,s=r.dots,c=r.indexes,u=r.Blob||typeof Blob<"u"&&Blob,p=r.maxDepth===void 0?100:r.maxDepth,f=u&<.isSpecCompliantForm(t);if(!lt.isFunction(o))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(lt.isDate(S))return S.toISOString();if(lt.isBoolean(S))return S.toString();if(!f&<.isBlob(S))throw new Jr("Blob is not supported. Use a Buffer instead.");return lt.isArrayBuffer(S)||lt.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function g(S,E,I){let D=S;if(lt.isReactNative(t)&<.isReactNativeBlob(S))return t.append(Nfe(I,E,s),h(S)),!1;if(S&&!I&&typeof S=="object"){if(lt.endsWith(E,"{}"))E=n?E:E.slice(0,-2),S=JSON.stringify(S);else if(lt.isArray(S)&&Ifr(S)||(lt.isFileList(S)||lt.endsWith(E,"[]"))&&(D=lt.toArray(S)))return E=p7e(E),D.forEach(function(F,U){!(lt.isUndefined(F)||F===null)&&t.append(c===!0?Nfe([E],U,s):c===null?E:E+"[]",h(F))}),!1}return Ofe(S)?!0:(t.append(Nfe(I,E,s),h(S)),!1)}let y=[],v=Object.assign(kfr,{defaultVisitor:g,convertValue:h,isVisitable:Ofe});function A(S,E,I=0){if(!lt.isUndefined(S)){if(I>p)throw new Jr("Object is too deeply nested ("+I+" levels). Max depth: "+p,Jr.ERR_FORM_DATA_DEPTH_EXCEEDED);if(y.indexOf(S)!==-1)throw new Error("Circular reference detected in "+E.join("."));y.push(S),lt.forEach(S,function(j,F){(!(lt.isUndefined(j)||j===null)&&o.call(t,j,lt.isString(F)?F.trim():F,E,v))===!0&&A(j,E?E.concat(F):[F],I+1)}),y.pop()}}if(!lt.isObject(e))throw new TypeError("data must be an object");return A(e),t}var tk=Tfr;function f7e(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function d7e(e,t){this._pairs=[],e&&tk(e,this,t)}var h7e=d7e.prototype;h7e.append=function(t,r){this._pairs.push([t,r])};h7e.toString=function(t){let r=t?function(n){return t.call(this,n,f7e)}:f7e;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var m7e=d7e;function Bfr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function BD(e,t,r){if(!t)return e;let n=r&&r.encode||Bfr,o=lt.isFunction(r)?{serialize:r}:r,s=o&&o.serialize,c;if(s?c=s(t,o):c=lt.isURLSearchParams(t)?t.toString():new m7e(t,o).toString(n),c){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+c}return e}var Ffe=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){lt.forEach(this.handlers,function(n){n!==null&&t(n)})}},Lfe=Ffe;var rk={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1};var v7e=Ct(require("crypto"),1);var g7e=Ct(require("url"),1),A7e=g7e.default.URLSearchParams;var jfe="abcdefghijklmnopqrstuvwxyz",y7e="0123456789",x7e={DIGIT:y7e,ALPHA:jfe,ALPHA_DIGIT:jfe+jfe.toUpperCase()+y7e},Dfr=(e=16,t=x7e.ALPHA_DIGIT)=>{let r="",{length:n}=t,o=new Uint32Array(e);v7e.default.randomFillSync(o);for(let s=0;s<e;s++)r+=t[o[s]%n];return r},b7e={isNode:!0,classes:{URLSearchParams:A7e,FormData:sW,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:x7e,generateString:Dfr,protocols:["http","https","file","data"]};var qfe={};fG(qfe,{hasBrowserEnv:()=>Qfe,hasStandardBrowserEnv:()=>Pfr,hasStandardBrowserWebWorkerEnv:()=>Rfr,navigator:()=>Mfe,origin:()=>Nfr});var Qfe=typeof window<"u"&&typeof document<"u",Mfe=typeof navigator=="object"&&navigator||void 0,Pfr=Qfe&&(!Mfe||["ReactNative","NativeScript","NS"].indexOf(Mfe.product)<0),Rfr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Nfr=Qfe&&window.location.href||"http://localhost";var Oa={...qfe,...b7e};function Ufe(e,t){return tk(e,new Oa.classes.URLSearchParams,{visitor:function(r,n,o,s){return Oa.isNode&<.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Ofr(e){return lt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ffr(e){let t={},r=Object.keys(e),n,o=r.length,s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Lfr(e){function t(r,n,o,s){let c=r[s++];if(c==="__proto__")return!0;let u=Number.isFinite(+c),p=s>=r.length;return c=!c&<.isArray(o)?o.length:c,p?(lt.hasOwnProp(o,c)?o[c]=lt.isArray(o[c])?o[c].concat(n):[o[c],n]:o[c]=n,!u):((!lt.hasOwnProp(o,c)||!lt.isObject(o[c]))&&(o[c]=[]),t(r,n,o[c],s)&<.isArray(o[c])&&(o[c]=Ffr(o[c])),!u)}if(lt.isFormData(e)&<.isFunction(e.entries)){let r={};return lt.forEachEntry(e,(n,o)=>{t(Ofr(n),o,r,0)}),r}return null}var oW=Lfr;var IF=(e,t)=>e!=null&<.hasOwnProp(e,t)?e[t]:void 0;function jfr(e,t,r){if(lt.isString(e))try{return(t||JSON.parse)(e),lt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var $fe={transitional:rk,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=lt.isObject(t);if(s&<.isHTMLForm(t)&&(t=new FormData(t)),lt.isFormData(t))return o?JSON.stringify(oW(t)):t;if(lt.isArrayBuffer(t)||lt.isBuffer(t)||lt.isStream(t)||lt.isFile(t)||lt.isBlob(t)||lt.isReadableStream(t))return t;if(lt.isArrayBufferView(t))return t.buffer;if(lt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(s){let p=IF(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ufe(t,p).toString();if((u=lt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=IF(this,"env"),h=f&&f.FormData;return tk(u?{"files[]":t}:t,h&&new h,p)}}return s||o?(r.setContentType("application/json",!1),jfr(t)):t}],transformResponse:[function(t){let r=IF(this,"transitional")||$fe.transitional,n=r&&r.forcedJSONParsing,o=IF(this,"responseType"),s=o==="json";if(lt.isResponse(t)||lt.isReadableStream(t))return t;if(t&<.isString(t)&&(n&&!o||s)){let u=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,IF(this,"parseReviver"))}catch(p){if(u)throw p.name==="SyntaxError"?Jr.from(p,Jr.ERR_BAD_RESPONSE,this,null,IF(this,"response")):p}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Oa.classes.FormData,Blob:Oa.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};lt.forEach(["delete","get","head","post","put","patch","query"],e=>{$fe.headers[e]={}});var kF=$fe;function bq(e,t){let r=this||kF,n=t||r,o=Fu.from(n.headers),s=n.data;return lt.forEach(e,function(u){s=u.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Eq(e){return!!(e&&e.__CANCEL__)}var zfe=class extends Jr{constructor(t,r,n){super(t==null?"canceled":t,Jr.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}},ZA=zfe;function Gw(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Jr("Request failed with status code "+r.status,r.status>=400&&r.status<500?Jr.ERR_BAD_REQUEST:Jr.ERR_BAD_RESPONSE,r.config,r.request,r))}function Hfe(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gfe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function DD(e,t,r){let n=!Hfe(t);return e&&(n||r===!1)?Gfe(e,t):t}var Mfr={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Qfr(e){try{return new URL(e)}catch{return null}}function E7e(e){var t=(typeof e=="string"?Qfr(e):e)||{},r=t.protocol,n=t.host,o=t.port;if(typeof n!="string"||!n||typeof r!="string"||(r=r.split(":",1)[0],n=n.replace(/:\d*$/,""),o=parseInt(o)||Mfr[r]||0,!qfr(n,o)))return"";var s=Vfe(r+"_proxy")||Vfe("all_proxy");return s&&s.indexOf("://")===-1&&(s=r+"://"+s),s}function qfr(e,t){var r=Vfe("no_proxy").toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(n){if(!n)return!0;var o=n.match(/^(.+):(\d+)$/),s=o?o[1]:n,c=o?parseInt(o[2]):0;return c&&c!==t?!0:/^[.*]/.test(s)?(s.charAt(0)==="*"&&(s=s.slice(1)),!e.endsWith(s)):e!==s}):!0}function Vfe(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var _de=Ct(j7e(),1),h$e=Ct(require("http"),1),m$e=Ct(require("https"),1),g$e=Ct(require("http2"),1),A$e=Ct(require("util"),1),Sde=require("path"),y$e=Ct(mde(),1),ey=Ct(require("zlib"),1);var nC="1.17.0";function Dq(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var qdr=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function gde(e,t,r){let n=r&&r.Blob||Oa.classes.Blob,o=Dq(e);if(t===void 0&&n&&(t=!0),o==="data"){e=o.length?e.slice(o.length+1):e;let s=qdr.exec(e);if(!s)throw new Jr("Invalid URL",Jr.ERR_INVALID_URL);let c=s[1],u=s[2],p=s[3]?"base64":"utf8",f=s[4],h;c?h=u?c+u:c:u&&(h="text/plain"+u);let g=Buffer.from(decodeURIComponent(f),p);if(t){if(!n)throw new Jr("Blob is not supported",Jr.ERR_NOT_SUPPORT);return new n([g],{type:h})}return g}throw new Jr("Unsupported protocol "+o,Jr.ERR_NOT_SUPPORT)}var Bv=Ct(require("stream"),1);var H7e=Ct(require("stream"),1);var Ade=Symbol("internals"),yde=class extends H7e.default.Transform{constructor(t){t=lt.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,o)=>!lt.isUndefined(o[n])),super({readableHighWaterMark:t.chunkSize});let r=this[Ade]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[Ade];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let o=this[Ade],s=o.maxRate,c=this.readableHighWaterMark,u=o.timeWindow,p=1e3/u,f=s/p,h=o.minChunkSize!==!1?Math.max(o.minChunkSize,f*.01):0,g=(v,A)=>{let S=Buffer.byteLength(v);o.bytesSeen+=S,o.bytes+=S,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(v)?process.nextTick(A):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(A)}},y=(v,A)=>{let S=Buffer.byteLength(v),E=null,I=c,D,j=0;if(s){let F=Date.now();(!o.ts||(j=F-o.ts)>=u)&&(o.ts=F,D=f-o.bytes,o.bytes=D<0?-D:0,j=0),D=f-o.bytes}if(s){if(D<=0)return setTimeout(()=>{A(null,v)},u-j);D<I&&(I=D)}I&&S>I&&S-I>h&&(E=v.subarray(I),v=v.subarray(0,I)),g(v,E?()=>{process.nextTick(A,null,E)}:A)};y(t,function v(A,S){if(A)return n(A);S?y(S,v):n(null)})}},vde=yde;var v$e=require("events");var V7e=Ct(require("util"),1),W7e=require("stream");var{asyncIterator:G7e}=Symbol,Udr=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[G7e]?yield*e[G7e]():yield e},fW=Udr;var $dr=Oa.ALPHABET.ALPHA_DIGIT+"-_",Pq=typeof TextEncoder=="function"?new TextEncoder:new V7e.default.TextEncoder,LD=`\r
|
|
579
579
|
`,zdr=Pq.encode(LD),Hdr=2,xde=class{constructor(t,r){let{escapeName:n}=this.constructor,o=lt.isString(r),s=`Content-Disposition: form-data; name="${n(t)}"${!o&&r.name?`; filename="${n(r.name)}"`:""}${LD}`;if(o)r=Pq.encode(String(r).replace(/\r?\n|\r\n?/g,LD));else{let c=String(r.type||"application/octet-stream").replace(/[\r\n]/g,"");s+=`Content-Type: ${c}${LD}`}this.headers=Pq.encode(s+LD),this.contentLength=o?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+Hdr,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;lt.isTypedArray(t)?yield t:yield*fW(t),yield zdr}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},Gdr=(e,t,r)=>{let{tag:n="form-data-boundary",size:o=25,boundary:s=n+"-"+Oa.generateString(o,$dr)}=r||{};if(!lt.isFormData(e))throw new TypeError("FormData instance required");if(s.length<1||s.length>70)throw new Error("boundary must be 1-70 characters long");let c=Pq.encode("--"+s+LD),u=Pq.encode("--"+s+"--"+LD),p=u.byteLength,f=Array.from(e.entries()).map(([g,y])=>{let v=new xde(g,y);return p+=v.size,v});p+=c.byteLength*f.length,p=lt.toFiniteNumber(p);let h={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(p)&&(h["Content-Length"]=p),t&&t(h),W7e.Readable.from(async function*(){for(let g of f)yield c,yield*g.encode();yield u}())},Y7e=Gdr;var J7e=Ct(require("stream"),1),bde=class extends J7e.default.Transform{__transform(t,r,n){this.push(t),n()}_transform(t,r,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let o=Buffer.alloc(2);o[0]=120,o[1]=156,this.push(o,r)}this.__transform(t,r,n)}},K7e=bde;var X7e=Ct(require("http2"),1),Z7e=Ct(require("util"),1),Ede=class{constructor(){this.sessions=Object.create(null)}getSession(t,r){r=Object.assign({sessionTimeout:1e3},r);let n=this.sessions[t];if(n){let g=n.length;for(let y=0;y<g;y++){let[v,A]=n[y];if(!v.destroyed&&!v.closed&&Z7e.default.isDeepStrictEqual(A,r))return v}}let o=X7e.default.connect(t,r),s,c,u=()=>{if(s)return;s=!0,c&&(clearTimeout(c),c=null);let g=n,y=g.length,v=y;for(;v--;)if(g[v][0]===o){y===1?delete this.sessions[t]:g.splice(v,1),o.closed||o.close();return}},p=o.request,{sessionTimeout:f}=r;if(f!=null){let g=0;o.request=function(){let y=p.apply(this,arguments);return g++,c&&(clearTimeout(c),c=null),y.once("close",()=>{--g||(c=setTimeout(()=>{c=null,u()},f))}),y}}o.once("close",u);let h=[o,r];return n?n.push(h):n=this.sessions[t]=[h],o}},e$e=Ede;var Vdr=(e,t)=>lt.isAsyncFn(e)?function(...r){let n=r.pop();e.apply(this,r).then(o=>{try{t?n(null,...t(o)):n(null,o)}catch(s){n(s)}},n)}:e,t$e=Vdr;var Wdr=new Set(["localhost"]),i$e=e=>{let t=e.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(r=>/^\d+$/.test(r)&&Number(r)>=0&&Number(r)<=255)},Ydr=e=>{if(e==="::1")return!0;let t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return i$e(t[1]);let r=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(r){let o=parseInt(r[1],16);return o>=32512&&o<=32767}let n=e.split(":");if(n.length===8){for(let o=0;o<7;o++)if(!/^0+$/.test(n[o]))return!1;return/^0*1$/.test(n[7])}return!1},r$e=e=>e?Wdr.has(e)||i$e(e)?!0:Ydr(e):!1,Jdr={http:80,https:443,ws:80,wss:443,ftp:21},Kdr=e=>{let t=e,r=0;if(t.charAt(0)==="["){let s=t.indexOf("]");if(s!==-1){let c=t.slice(1,s),u=t.slice(s+1);return u.charAt(0)===":"&&/^\d+$/.test(u.slice(1))&&(r=Number.parseInt(u.slice(1),10)),[c,r]}}let n=t.indexOf(":"),o=t.lastIndexOf(":");return n!==-1&&n===o&&/^\d+$/.test(t.slice(o+1))&&(r=Number.parseInt(t.slice(o+1),10),t=t.slice(0,o)),[t,r]},Xdr=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,Zdr=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,ehr=e=>{if(typeof e!="string"||e.indexOf(":")===-1)return e;let t=e.match(Xdr);if(t)return t[1];let r=e.match(Zdr);if(r){let n=parseInt(r[1],16),o=parseInt(r[2],16);return`${n>>8}.${n&255}.${o>>8}.${o&255}`}return e},n$e=e=>e&&(e.charAt(0)==="["&&e.charAt(e.length-1)==="]"&&(e=e.slice(1,-1)),ehr(e.replace(/\.+$/,"")));function wde(e){let t;try{t=new URL(e)}catch{return!1}let r=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!r)return!1;if(r==="*")return!0;let n=Number.parseInt(t.port,10)||Jdr[t.protocol.split(":",1)[0]]||0,o=n$e(t.hostname.toLowerCase());return r.split(/[\s,]+/).some(s=>{if(!s)return!1;let[c,u]=Kdr(s);return c=n$e(c),!c||u&&u!==n?!1:(c.charAt(0)==="*"&&(c=c.slice(1)),c.charAt(0)==="."?o.endsWith(c):o===c||r$e(o)&&r$e(c))})}function thr(e,t){e=e||10;let r=new Array(e),n=new Array(e),o=0,s=0,c;return t=t!==void 0?t:1e3,function(p){let f=Date.now(),h=n[s];c||(c=f),r[o]=p,n[o]=f;let g=s,y=0;for(;g!==o;)y+=r[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),f-c<t)return;let v=h&&f-h;return v?Math.round(y*1e3/v):void 0}}var s$e=thr;function rhr(e,t){let r=0,n=1e3/t,o,s,c=(f,h=Date.now())=>{r=h,o=null,s&&(clearTimeout(s),s=null),e(...f)};return[(...f)=>{let h=Date.now(),g=h-r;g>=n?c(f,h):(o=f,s||(s=setTimeout(()=>{s=null,c(o)},n-g)))},()=>o&&c(o)]}var o$e=rhr;var iC=(e,t,r=3)=>{let n=0,o=s$e(50,250);return o$e(s=>{if(!s||typeof s.loaded!="number")return;let c=s.loaded,u=s.lengthComputable?s.total:void 0,p=u!=null?Math.min(c,u):c,f=Math.max(0,p-n),h=o(f);n=Math.max(n,p);let g={loaded:p,total:u,progress:u?p/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u?(u-p)/h:void 0,event:s,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},r)},RF=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},NF=e=>(...t)=>lt.asap(()=>e(...t));function Rq(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let c=n.length,u=n.length;for(let v=0;v<u;v++)if(n.charCodeAt(v)===37&&v+2<u){let A=n.charCodeAt(v+1),S=n.charCodeAt(v+2);(A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102)&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)&&(c-=2,v+=2)}let p=0,f=u-1,h=v=>v>=2&&n.charCodeAt(v-2)===37&&n.charCodeAt(v-1)===51&&(n.charCodeAt(v)===68||n.charCodeAt(v)===100);f>=0&&(n.charCodeAt(f)===61?(p++,f--):h(f)&&(p++,f-=3)),p===1&&f>=0&&(n.charCodeAt(f)===61||h(f))&&p++;let y=Math.floor(c/4)*3-(p||0);return y>0?y:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let s=0;for(let c=0,u=n.length;c<u;c++){let p=n.charCodeAt(c);if(p<128)s+=1;else if(p<2048)s+=2;else if(p>=55296&&p<=56319&&c+1<u){let f=n.charCodeAt(c+1);f>=56320&&f<=57343?(s+=4,c++):s+=3}else s+=3}return s}var a$e={flush:ey.default.constants.Z_SYNC_FLUSH,finishFlush:ey.default.constants.Z_SYNC_FLUSH},nhr={flush:ey.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:ey.default.constants.BROTLI_OPERATION_FLUSH},ihr={flush:ey.default.constants.ZSTD_e_flush,finishFlush:ey.default.constants.ZSTD_e_flush},x$e=lt.isFunction(ey.default.createBrotliDecompress),b$e=lt.isFunction(ey.default.createZstdDecompress),E$e="gzip, compress, deflate"+(x$e?", br":""),shr=E$e+(b$e?", zstd":""),{http:ohr,https:ahr}=y$e.default,w$e=/https:?/,chr=["content-type","content-length"];function uhr(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{chr.includes(n.toLowerCase())&&e.set(n,o)})}var c$e=Symbol("axios.http.socketListener"),dW=Symbol("axios.http.currentReq"),S$e=Symbol("axios.http.installedTunnel"),lhr=new Map,u$e=new WeakMap;function phr(e,t){let r=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),n=t?u$e.get(t)||u$e.set(t,new Map).get(t):lhr,o=n.get(r);if(o)return o;let s=t&&t.options?{...t.options,...e}:e;if(o=new _de.default(s),t&&t.options){let c={...t.options},u=o.callback;o.callback=function(f,h){return u.call(this,f,{...c,...h})}}return o[S$e]=!0,n.set(r,o),o}var l$e=Oa.protocols.map(e=>e+":"),p$e=e=>{if(!lt.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},f$e=(e,[t,r])=>(e.on("end",r).on("error",r),t),fhr=new e$e;function dhr(e,t,r){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,r)}function _$e(e,t,r,n,o){let s=t;if(!s&&s!==!1){let c=E7e(r);c&&(wde(r)||(s=new URL(c)))}if(n&&e.headers)for(let c of Object.keys(e.headers))c.toLowerCase()==="proxy-authorization"&&delete e.headers[c];if(n&&e.agent&&e.agent[S$e]&&(e.agent=void 0),s){let c=s instanceof URL,u=y=>c||lt.hasOwnProp(s,y)?s[y]:void 0,p=u("username"),f=u("password"),h=lt.hasOwnProp(s,"auth")?s.auth:void 0;if(p&&(h=(p||"")+":"+(f||"")),h){let y=typeof h=="object",v=y&<.hasOwnProp(h,"username")?h.username:void 0,A=y&<.hasOwnProp(h,"password")?h.password:void 0;if(!!(v||A))h=(v||"")+":"+(A||"");else if(y)throw new Jr("Invalid proxy authorization",Jr.ERR_BAD_OPTION,{proxy:s})}if(w$e.test(e.protocol)){if(!(o instanceof _de.default)){let y=u("hostname")||u("host"),v=u("port"),A=u("protocol"),S=A?A.includes(":")?A:`${A}:`:"http:",E=y&&y.includes(":")&&!y.startsWith("[")?`[${y}]`:y,I=new URL(`${S}//${E}${v?":"+v:""}`),D={protocol:I.protocol,hostname:I.hostname.replace(/^\[|\]$/g,""),port:I.port,auth:h&&typeof h=="string"?h:void 0};I.protocol==="https:"&&(D.ALPNProtocols=["http/1.1"]);let j=phr(D,o);e.agent=j,e.agents&&(e.agents.https=j)}}else{if(h){let S=Buffer.from(h,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+S}let y=!1;for(let S of Object.keys(e.headers))if(S.toLowerCase()==="host"){y=!0;break}y||(e.headers.host=e.hostname+(e.port?":"+e.port:""));let v=u("hostname")||u("host");e.hostname=v,e.host=v,e.port=u("port"),e.path=r;let A=u("protocol");A&&(e.protocol=A.includes(":")?A:`${A}:`)}}e.beforeRedirects.proxy=function(u){_$e(u,t,u.href,!0,o)}}var hhr=typeof process<"u"&<.kindOf(process)==="process",mhr=e=>new Promise((t,r)=>{let n,o,s=(p,f)=>{o||(o=!0,n&&n(p,f))},c=p=>{s(p),t(p)},u=p=>{s(p,!0),r(p)};e(c,u,p=>n=p).catch(u)}),ghr=({address:e,family:t})=>{if(!lt.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},d$e=(e,t)=>ghr(lt.isObject(e)?e:{address:e,family:t}),Ahr={request(e,t){let r=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:n,headers:o}=e,s=fhr.getSession(r,n),{HTTP2_HEADER_SCHEME:c,HTTP2_HEADER_METHOD:u,HTTP2_HEADER_PATH:p,HTTP2_HEADER_STATUS:f}=g$e.default.constants,h={[c]:e.protocol.replace(":",""),[u]:e.method,[p]:e.path};lt.forEach(o,(y,v)=>{v.charAt(0)!==":"&&(h[v]=y)});let g=s.request(h);return g.once("response",y=>{let v=g;y=Object.assign({},y);let A=y[f];delete y[f],v.headers=y,v.statusCode=+A,t(v)}),g}},C$e=hhr&&function(t){return mhr(async function(n,o,s){let c=St=>lt.hasOwnProp(t,St)?t[St]:void 0,u=c("transitional")||rk,p=c("data"),f=c("lookup"),h=c("family"),g=c("httpVersion");g===void 0&&(g=1);let y=c("http2Options"),v=c("responseType"),A=c("responseEncoding"),S=t.method.toUpperCase(),E,I=!1,D,j;if(g=+g,Number.isNaN(g))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(g!==1&&g!==2)throw TypeError(`Unsupported protocol version '${g}'`);let F=g===2;if(f){let St=t$e(f,At=>lt.isArray(At)?At:[At]);f=(At,dt,B)=>{St(At,dt,(Je,ct,Ce)=>{if(Je)return B(Je);let we=lt.isArray(ct)?ct.map(We=>d$e(We)):[d$e(ct,Ce)];dt.all?B(Je,we):B(Je,we[0].address,we[0].family)})}}let U=new v$e.EventEmitter;function te(St){try{U.emit("abort",!St||St.type?new ZA(null,t,D):St)}catch{}}function Y(){j&&(clearTimeout(j),j=null)}function me(){let St=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";return t.timeoutErrorMessage&&(St=t.timeoutErrorMessage),new Jr(St,u.clarifyTimeoutError?Jr.ETIMEDOUT:Jr.ECONNABORTED,t,D)}U.once("abort",o);let re=()=>{Y(),t.cancelToken&&t.cancelToken.unsubscribe(te),t.signal&&t.signal.removeEventListener("abort",te),U.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(te),t.signal&&(t.signal.aborted?te():t.signal.addEventListener("abort",te))),s((St,At)=>{if(E=!0,Y(),At){I=!0,re();return}let{data:dt}=St;if(dt instanceof Bv.default.Readable||dt instanceof Bv.default.Duplex){let B=Bv.default.finished(dt,()=>{B(),re()})}else re()});let ce=DD(t.baseURL,t.url,t.allowAbsoluteUrls),Z=new URL(ce,Oa.hasBrowserEnv?Oa.origin:void 0),ge=Z.protocol||l$e[0];if(ge==="data:"){if(t.maxContentLength>-1){let At=String(t.url||ce||"");if(Rq(At)>t.maxContentLength)return o(new Jr("maxContentLength size of "+t.maxContentLength+" exceeded",Jr.ERR_BAD_RESPONSE,t))}let St;if(S!=="GET")return Gw(n,o,{status:405,statusText:"method not allowed",headers:{},config:t});try{St=gde(t.url,v==="blob",{Blob:t.env&&t.env.Blob})}catch(At){throw Jr.from(At,Jr.ERR_BAD_REQUEST,t)}return v==="text"?(St=St.toString(A),(!A||A==="utf8")&&(St=lt.stripBOM(St))):v==="stream"&&(St=Bv.default.Readable.from(St)),Gw(n,o,{data:St,status:200,statusText:"OK",headers:new Fu,config:t})}if(l$e.indexOf(ge)===-1)return o(new Jr("Unsupported protocol "+ge,Jr.ERR_BAD_REQUEST,t));let J=Fu.from(t.headers).normalize();J.set("User-Agent","axios/"+nC,!1);let{onUploadProgress:$,onDownloadProgress:de}=t,Oe=t.maxRate,ye,be;if(lt.isSpecCompliantForm(p)){let St=J.getContentType(/boundary=([-_\w\d]{10,70})/i);p=Y7e(p,At=>{J.set(At)},{tag:`axios-${nC}-boundary`,boundary:St&&St[1]||void 0})}else if(lt.isFormData(p)&<.isFunction(p.getHeaders)&&p.getHeaders!==Object.prototype.getHeaders){if(uhr(J,p.getHeaders(),c("formDataHeaderPolicy")),!J.hasContentLength())try{let St=await A$e.default.promisify(p.getLength).call(p);Number.isFinite(St)&&St>=0&&J.setContentLength(St)}catch{}}else if(lt.isBlob(p)||lt.isFile(p))p.size&&J.setContentType(p.type||"application/octet-stream"),J.setContentLength(p.size||0),p=Bv.default.Readable.from(fW(p));else if(p&&!lt.isStream(p)){if(!Buffer.isBuffer(p))if(lt.isArrayBuffer(p))p=Buffer.from(new Uint8Array(p));else if(lt.isString(p))p=Buffer.from(p,"utf-8");else return o(new Jr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Jr.ERR_BAD_REQUEST,t));if(J.setContentLength(p.length,!1),t.maxBodyLength>-1&&p.length>t.maxBodyLength)return o(new Jr("Request body larger than maxBodyLength limit",Jr.ERR_BAD_REQUEST,t))}let Ne=lt.toFiniteNumber(J.getContentLength());lt.isArray(Oe)?(ye=Oe[0],be=Oe[1]):ye=be=Oe,p&&($||ye)&&(lt.isStream(p)||(p=Bv.default.Readable.from(p,{objectMode:!1})),p=Bv.default.pipeline([p,new vde({maxRate:lt.toFiniteNumber(ye)})],lt.noop),$&&p.on("progress",f$e(p,RF(Ne,iC(NF($),!1,3)))));let He,ft=c("auth");if(ft){let St=ft.username||"",At=ft.password||"";He=St+":"+At}if(!He&&(Z.username||Z.password)){let St=p$e(Z.username),At=p$e(Z.password);He=St+":"+At}He&&J.delete("authorization");let wt;try{wt=BD(Z.pathname+Z.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(St){let At=new Error(St.message);return At.config=t,At.url=t.url,At.exists=!0,o(At)}J.set("Accept-Encoding",lt.hasOwnProp(u,"advertiseZstdAcceptEncoding")&&u.advertiseZstdAcceptEncoding===!0?shr:E$e,!1);let Ye=Object.assign(Object.create(null),{path:wt,method:S,headers:bF(J),agents:{http:t.httpAgent,https:t.httpsAgent},auth:He,protocol:ge,family:h,beforeRedirect:dhr,beforeRedirects:Object.create(null),http2Options:y});!lt.isUndefined(f)&&(Ye.lookup=f);let Ke=c("socketPath");if(Ke){if(typeof Ke!="string")return o(new Jr("socketPath must be a string",Jr.ERR_BAD_OPTION_VALUE,t));let St=c("allowedSocketPaths");if(St!=null){let At=Array.isArray(St)?St:[St],dt=(0,Sde.resolve)(Ke);if(!At.some(Je=>typeof Je=="string"&&(0,Sde.resolve)(Je)===dt))return o(new Jr(`socketPath "${Ke}" is not permitted by allowedSocketPaths`,Jr.ERR_BAD_OPTION_VALUE,t))}Ye.socketPath=Ke}else Ye.hostname=Z.hostname.startsWith("[")?Z.hostname.slice(1,-1):Z.hostname,Ye.port=Z.port,_$e(Ye,t.proxy,ge+"//"+Z.hostname+(Z.port?":"+Z.port:"")+Ye.path,!1,t.httpsAgent);let Me,et=!1,yt=w$e.test(Ye.protocol);if(Ye.agent==null&&(Ye.agent=yt?t.httpsAgent:t.httpAgent),F)Me=Ahr;else{let St=c("transport");if(St)Me=St;else if(t.maxRedirects===0)Me=yt?m$e.default:h$e.default,et=!0;else{t.maxRedirects&&(Ye.maxRedirects=t.maxRedirects);let At=c("beforeRedirect");if(At&&(Ye.beforeRedirects.config=At),He){let dt=Z.origin,B=He;Ye.beforeRedirects.auth=function(ct){try{new URL(ct.href).origin===dt&&(ct.auth=B)}catch{}}}Me=yt?ahr:ohr}}t.maxBodyLength>-1?Ye.maxBodyLength=t.maxBodyLength:Ye.maxBodyLength=1/0,Ye.insecureHTTPParser=!!c("insecureHTTPParser"),D=Me.request(Ye,function(At){if(Y(),D.destroyed)return;let dt=[At],B=lt.toFiniteNumber(At.headers["content-length"]);if(de||be){let we=new vde({maxRate:lt.toFiniteNumber(be)});de&&we.on("progress",f$e(we,RF(B,iC(NF(de),!0,3)))),dt.push(we)}let Je=At,ct=At.req||D;if(t.decompress!==!1&&At.headers["content-encoding"])switch((S==="HEAD"||At.statusCode===204)&&delete At.headers["content-encoding"],(At.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":dt.push(ey.default.createUnzip(a$e)),delete At.headers["content-encoding"];break;case"deflate":dt.push(new K7e),dt.push(ey.default.createUnzip(a$e)),delete At.headers["content-encoding"];break;case"br":x$e&&(dt.push(ey.default.createBrotliDecompress(nhr)),delete At.headers["content-encoding"]);break;case"zstd":b$e&&(dt.push(ey.default.createZstdDecompress(ihr)),delete At.headers["content-encoding"]);break}Je=dt.length>1?Bv.default.pipeline(dt,lt.noop):dt[0];let Ce={status:At.statusCode,statusText:At.statusMessage,headers:new Fu(At.headers),config:t,request:ct};if(v==="stream"){if(t.maxContentLength>-1){let we=t.maxContentLength,We=Je;async function*rt(){let pe=0;for await(let Xe of We){if(pe+=Xe.length,pe>we)throw new Jr("maxContentLength size of "+we+" exceeded",Jr.ERR_BAD_RESPONSE,t,ct);yield Xe}}Je=Bv.default.Readable.from(rt(),{objectMode:!1})}Ce.data=Je,Gw(n,o,Ce)}else{let we=[],We=0;Je.on("data",function(pe){we.push(pe),We+=pe.length,t.maxContentLength>-1&&We>t.maxContentLength&&(I=!0,Je.destroy(),te(new Jr("maxContentLength size of "+t.maxContentLength+" exceeded",Jr.ERR_BAD_RESPONSE,t,ct)))}),Je.on("aborted",function(){if(I)return;let pe=new Jr("stream has been aborted",Jr.ERR_BAD_RESPONSE,t,ct,Ce);Je.destroy(pe),o(pe)}),Je.on("error",function(pe){I||o(Jr.from(pe,null,t,ct,Ce))}),Je.on("end",function(){try{let pe=we.length===1?we[0]:Buffer.concat(we);v!=="arraybuffer"&&(pe=pe.toString(A),(!A||A==="utf8")&&(pe=lt.stripBOM(pe))),Ce.data=pe}catch(pe){return o(Jr.from(pe,null,t,Ce.request,Ce))}Gw(n,o,Ce)})}U.once("abort",we=>{Je.destroyed||(Je.emit("error",we),Je.destroy())})}),U.once("abort",St=>{D.close?D.close():D.destroy(St)}),D.on("error",function(At){o(Jr.from(At,null,t,D))});let Ot=new Set;if(D.on("socket",function(At){At.setKeepAlive(!0,1e3*60),At[c$e]||(At.on("error",function(B){let Je=At[dW];Je&&!Je.destroyed&&Je.destroy(B)}),At[c$e]=!0),At[dW]=D,Ot.add(At)}),D.once("close",function(){Y();for(let At of Ot)At[dW]===D&&(At[dW]=null);Ot.clear()}),t.timeout){let St=parseInt(t.timeout,10);if(Number.isNaN(St)){te(new Jr("error trying to parse `config.timeout` to int",Jr.ERR_BAD_OPTION_VALUE,t,D));return}let At=function(){E||te(me())};et&&St>0&&(j=setTimeout(At,St)),D.setTimeout(St,At)}else D.setTimeout(0);if(lt.isStream(p)){let St=!1,At=!1;p.on("end",()=>{St=!0}),p.once("error",B=>{At=!0,D.destroy(B)}),p.on("close",()=>{!St&&!At&&te(new ZA("Request stream has been aborted",t,D))});let dt=p;if(t.maxBodyLength>-1&&t.maxRedirects===0){let B=t.maxBodyLength,Je=0;dt=Bv.default.pipeline([p,new Bv.default.Transform({transform(ct,Ce,we){if(Je+=ct.length,Je>B)return we(new Jr("Request body larger than maxBodyLength limit",Jr.ERR_BAD_REQUEST,t,D));we(null,ct)}})],lt.noop),dt.on("error",ct=>{D.destroyed||D.destroy(ct)})}dt.pipe(D)}else p&&D.write(p),D.end()})};var I$e=Oa.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Oa.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Oa.origin),Oa.navigator&&/(msie|trident)/i.test(Oa.navigator.userAgent)):()=>!0;var k$e=Oa.hasStandardBrowserEnv?{write(e,t,r,n,o,s,c){if(typeof document>"u")return;let u=[`${e}=${encodeURIComponent(t)}`];lt.isNumber(r)&&u.push(`expires=${new Date(r).toUTCString()}`),lt.isString(n)&&u.push(`path=${n}`),lt.isString(o)&&u.push(`domain=${o}`),s===!0&&u.push("secure"),lt.isString(c)&&u.push(`SameSite=${c}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let r=0;r<t.length;r++){let n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};var T$e=e=>e instanceof Fu?{...e}:e;function Tb(e,t){t=t||{};let r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(f,h,g,y){return lt.isPlainObject(f)&<.isPlainObject(h)?lt.merge.call({caseless:y},f,h):lt.isPlainObject(h)?lt.merge({},h):lt.isArray(h)?h.slice():h}function o(f,h,g,y){if(lt.isUndefined(h)){if(!lt.isUndefined(f))return n(void 0,f,g,y)}else return n(f,h,g,y)}function s(f,h){if(!lt.isUndefined(h))return n(void 0,h)}function c(f,h){if(lt.isUndefined(h)){if(!lt.isUndefined(f))return n(void 0,f)}else return n(void 0,h)}function u(f,h,g){if(lt.hasOwnProp(t,g))return n(f,h);if(lt.hasOwnProp(e,g))return n(void 0,f)}let p={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,allowedSocketPaths:c,responseEncoding:c,validateStatus:u,headers:(f,h,g)=>o(T$e(f),T$e(h),g,!0)};return lt.forEach(Object.keys({...e,...t}),function(h){if(h==="__proto__"||h==="constructor"||h==="prototype")return;let g=lt.hasOwnProp(p,h)?p[h]:o,y=lt.hasOwnProp(e,h)?e[h]:void 0,v=lt.hasOwnProp(t,h)?t[h]:void 0,A=g(y,v,h);lt.isUndefined(A)&&g!==u||(r[h]=A)}),r}var yhr=["content-type","content-length"];function vhr(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,o])=>{yhr.includes(n.toLowerCase())&&e.set(n,o)})}var xhr=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function bhr(e){let t=Tb({},e),r=y=>lt.hasOwnProp(t,y)?t[y]:void 0,n=r("data"),o=r("withXSRFToken"),s=r("xsrfHeaderName"),c=r("xsrfCookieName"),u=r("headers"),p=r("auth"),f=r("baseURL"),h=r("allowAbsoluteUrls"),g=r("url");if(t.headers=u=Fu.from(u),t.url=BD(DD(f,g,h),r("params"),r("paramsSerializer")),p&&u.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?xhr(p.password):""))),lt.isFormData(n)&&(Oa.hasStandardBrowserEnv||Oa.hasStandardBrowserWebWorkerEnv||lt.isReactNative(n)?u.setContentType(void 0):lt.isFunction(n.getHeaders)&&vhr(u,n.getHeaders(),r("formDataHeaderPolicy"))),Oa.hasStandardBrowserEnv&&(lt.isFunction(o)&&(o=o(t)),o===!0||o==null&&I$e(t.url))){let v=s&&c&&k$e.read(c);v&&u.set(s,v)}return t}var hW=bhr;var Ehr=typeof XMLHttpRequest<"u",B$e=Ehr&&function(e){return new Promise(function(r,n){let o=hW(e),s=o.data,c=Fu.from(o.headers).normalize(),{responseType:u,onUploadProgress:p,onDownloadProgress:f}=o,h,g,y,v,A;function S(){v&&v(),A&&A(),o.cancelToken&&o.cancelToken.unsubscribe(h),o.signal&&o.signal.removeEventListener("abort",h)}let E=new XMLHttpRequest;E.open(o.method.toUpperCase(),o.url,!0),E.timeout=o.timeout;function I(){if(!E)return;let j=Fu.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),U={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:j,config:e,request:E};Gw(function(Y){r(Y),S()},function(Y){n(Y),S()},U),E=null}"onloadend"in E?E.onloadend=I:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.startsWith("file:"))||setTimeout(I)},E.onabort=function(){E&&(n(new Jr("Request aborted",Jr.ECONNABORTED,e,E)),S(),E=null)},E.onerror=function(F){let U=F&&F.message?F.message:"Network Error",te=new Jr(U,Jr.ERR_NETWORK,e,E);te.event=F||null,n(te),S(),E=null},E.ontimeout=function(){let F=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",U=o.transitional||rk;o.timeoutErrorMessage&&(F=o.timeoutErrorMessage),n(new Jr(F,U.clarifyTimeoutError?Jr.ETIMEDOUT:Jr.ECONNABORTED,e,E)),S(),E=null},s===void 0&&c.setContentType(null),"setRequestHeader"in E&<.forEach(bF(c),function(F,U){E.setRequestHeader(U,F)}),lt.isUndefined(o.withCredentials)||(E.withCredentials=!!o.withCredentials),u&&u!=="json"&&(E.responseType=o.responseType),f&&([y,A]=iC(f,!0),E.addEventListener("progress",y)),p&&E.upload&&([g,v]=iC(p),E.upload.addEventListener("progress",g),E.upload.addEventListener("loadend",v)),(o.cancelToken||o.signal)&&(h=j=>{E&&(n(!j||j.type?new ZA(null,e,E):j),E.abort(),S(),E=null)},o.cancelToken&&o.cancelToken.subscribe(h),o.signal&&(o.signal.aborted?h():o.signal.addEventListener("abort",h)));let D=Dq(o.url);if(D&&!Oa.protocols.includes(D)){n(new Jr("Unsupported protocol "+D+":",Jr.ERR_BAD_REQUEST,e));return}E.send(s||null)})};var whr=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let r=new AbortController,n=!1,o=function(p){if(!n){n=!0,c();let f=p instanceof Error?p:this.reason;r.abort(f instanceof Jr?f:new ZA(f instanceof Error?f.message:f))}},s=t&&setTimeout(()=>{s=null,o(new Jr(`timeout of ${t}ms exceeded`,Jr.ETIMEDOUT))},t),c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));let{signal:u}=r;return u.unsubscribe=()=>lt.asap(c),u},D$e=whr;var Shr=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},_hr=async function*(e,t){for await(let r of Chr(e))yield*Shr(r,t)},Chr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Cde=(e,t,r,n)=>{let o=_hr(e,t),s=0,c,u=p=>{c||(c=!0,n&&n(p))};return new ReadableStream({async pull(p){try{let{done:f,value:h}=await o.next();if(f){u(),p.close();return}let g=h.byteLength;if(r){let y=s+=g;r(y)}p.enqueue(new Uint8Array(h))}catch(f){throw u(f),f}},cancel(p){return u(p),o.return()}},{highWaterMark:2})};var P$e=64*1024,{isFunction:mW}=lt,Ihr=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),R$e=e=>{if(!lt.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},N$e=(e,...t)=>{try{return!!e(...t)}catch{return!1}},khr=e=>{let t=e.indexOf("://"),r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},Thr=e=>{let t=lt.global!==void 0&<.global!==null?lt.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=lt.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:o,Request:s,Response:c}=e,u=o?mW(o):typeof fetch=="function",p=mW(s),f=mW(c);if(!u)return!1;let h=u&&mW(r),g=u&&(typeof n=="function"?(I=>D=>I.encode(D))(new n):async I=>new Uint8Array(await new s(I).arrayBuffer())),y=p&&h&&N$e(()=>{let I=!1,D=new s(Oa.origin,{body:new r,method:"POST",get duplex(){return I=!0,"half"}}),j=D.headers.has("Content-Type");return D.body!=null&&D.body.cancel(),I&&!j}),v=f&&h&&N$e(()=>lt.isReadableStream(new c("").body)),A={stream:v&&(I=>I.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(I=>{!A[I]&&(A[I]=(D,j)=>{let F=D&&D[I];if(F)return F.call(D);throw new Jr(`Response type '${I}' is not supported`,Jr.ERR_NOT_SUPPORT,j)})});let S=async I=>{if(I==null)return 0;if(lt.isBlob(I))return I.size;if(lt.isSpecCompliantForm(I))return(await new s(Oa.origin,{method:"POST",body:I}).arrayBuffer()).byteLength;if(lt.isArrayBufferView(I)||lt.isArrayBuffer(I))return I.byteLength;if(lt.isURLSearchParams(I)&&(I=I+""),lt.isString(I))return(await g(I)).byteLength},E=async(I,D)=>{let j=lt.toFiniteNumber(I.getContentLength());return j==null?S(D):j};return async I=>{let{url:D,method:j,data:F,signal:U,cancelToken:te,timeout:Y,onDownloadProgress:me,onUploadProgress:re,responseType:ce,headers:Z,withCredentials:ge="same-origin",fetchOptions:J,maxContentLength:$,maxBodyLength:de}=hW(I),Oe=lt.isNumber($)&&$>-1,ye=lt.isNumber(de)&&de>-1,be=Ke=>lt.hasOwnProp(I,Ke)?I[Ke]:void 0,Ne=o||fetch;ce=ce?(ce+"").toLowerCase():"text";let He=D$e([U,te&&te.toAbortSignal()],Y),ft=null,wt=He&&He.unsubscribe&&(()=>{He.unsubscribe()}),Ye;try{let Ke,Me=be("auth");if(Me){let dt=Me.username||"",B=Me.password||"";Ke={username:dt,password:B}}if(khr(D)){let dt=new URL(D,Oa.origin);if(!Ke&&(dt.username||dt.password)){let B=R$e(dt.username),Je=R$e(dt.password);Ke={username:B,password:Je}}(dt.username||dt.password)&&(dt.username="",dt.password="",D=dt.href)}if(Ke&&(Z.delete("authorization"),Z.set("Authorization","Basic "+btoa(Ihr((Ke.username||"")+":"+(Ke.password||""))))),Oe&&typeof D=="string"&&D.startsWith("data:")&&Rq(D)>$)throw new Jr("maxContentLength size of "+$+" exceeded",Jr.ERR_BAD_RESPONSE,I,ft);if(ye&&j!=="get"&&j!=="head"){let dt=await E(Z,F);if(typeof dt=="number"&&isFinite(dt)&&dt>de)throw new Jr("Request body larger than maxBodyLength limit",Jr.ERR_BAD_REQUEST,I,ft)}if(re&&y&&j!=="get"&&j!=="head"&&(Ye=await E(Z,F))!==0){let dt=new s(D,{method:"POST",body:F,duplex:"half"}),B;if(lt.isFormData(F)&&(B=dt.headers.get("content-type"))&&Z.setContentType(B),dt.body){let[Je,ct]=RF(Ye,iC(NF(re)));F=Cde(dt.body,P$e,Je,ct)}}lt.isString(ge)||(ge=ge?"include":"omit");let et=p&&"credentials"in s.prototype;if(lt.isFormData(F)){let dt=Z.getContentType();dt&&/^multipart\/form-data/i.test(dt)&&!/boundary=/i.test(dt)&&Z.delete("content-type")}Z.set("User-Agent","axios/"+nC,!1);let yt={...J,signal:He,method:j.toUpperCase(),headers:bF(Z.normalize()),body:F,duplex:"half",credentials:et?ge:void 0};ft=p&&new s(D,yt);let Ot=await(p?Ne(ft,J):Ne(D,yt));if(Oe){let dt=lt.toFiniteNumber(Ot.headers.get("content-length"));if(dt!=null&&dt>$)throw new Jr("maxContentLength size of "+$+" exceeded",Jr.ERR_BAD_RESPONSE,I,ft)}let St=v&&(ce==="stream"||ce==="response");if(v&&Ot.body&&(me||Oe||St&&wt)){let dt={};["status","statusText","headers"].forEach(We=>{dt[We]=Ot[We]});let B=lt.toFiniteNumber(Ot.headers.get("content-length")),[Je,ct]=me&&RF(B,iC(NF(me),!0))||[],Ce=0,we=We=>{if(Oe&&(Ce=We,Ce>$))throw new Jr("maxContentLength size of "+$+" exceeded",Jr.ERR_BAD_RESPONSE,I,ft);Je&&Je(We)};Ot=new c(Cde(Ot.body,P$e,we,()=>{ct&&ct(),wt&&wt()}),dt)}ce=ce||"text";let At=await A[lt.findKey(A,ce)||"text"](Ot,I);if(Oe&&!v&&!St){let dt;if(At!=null&&(typeof At.byteLength=="number"?dt=At.byteLength:typeof At.size=="number"?dt=At.size:typeof At=="string"&&(dt=typeof n=="function"?new n().encode(At).byteLength:At.length)),typeof dt=="number"&&dt>$)throw new Jr("maxContentLength size of "+$+" exceeded",Jr.ERR_BAD_RESPONSE,I,ft)}return!St&&wt&&wt(),await new Promise((dt,B)=>{Gw(dt,B,{data:At,headers:Fu.from(Ot.headers),status:Ot.status,statusText:Ot.statusText,config:I,request:ft})})}catch(Ke){if(wt&&wt(),He&&He.aborted&&He.reason instanceof Jr){let Me=He.reason;throw Me.config=I,ft&&(Me.request=ft),Ke!==Me&&(Me.cause=Ke),Me}throw Ke&&Ke.name==="TypeError"&&/Load failed|fetch/i.test(Ke.message)?Object.assign(new Jr("Network Error",Jr.ERR_NETWORK,I,ft,Ke&&Ke.response),{cause:Ke.cause||Ke}):Jr.from(Ke,Ke&&Ke.code,I,ft,Ke&&Ke.response)}}},Bhr=new Map,Ide=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:o}=t,s=[n,o,r],c=s.length,u=c,p,f,h=Bhr;for(;u--;)p=s[u],f=h.get(p),f===void 0&&h.set(p,f=u?new Map:Thr(t)),h=f;return f},$gi=Ide();var kde={http:C$e,xhr:B$e,fetch:{get:Ide}};lt.forEach(kde,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var O$e=e=>`- ${e}`,Phr=e=>lt.isFunction(e)||e===null||e===!1;function Rhr(e,t){e=lt.isArray(e)?e:[e];let{length:r}=e,n,o,s={};for(let c=0;c<r;c++){n=e[c];let u;if(o=n,!Phr(n)&&(o=kde[(u=String(n)).toLowerCase()],o===void 0))throw new Jr(`Unknown adapter '${u}'`);if(o&&(lt.isFunction(o)||(o=o.get(t))))break;s[u||"#"+c]=o}if(!o){let c=Object.entries(s).map(([p,f])=>`adapter ${p} `+(f===!1?"is not supported by the environment":"is not available in the build")),u=r?c.length>1?`since :
|
|
@@ -956,7 +956,7 @@ ${A.join(`
|
|
|
956
956
|
.env
|
|
957
957
|
.edgeone/*
|
|
958
958
|
.tef_dist/*
|
|
959
|
-
`,t=`${process.cwd()}/.gitignore`;if(!f6.existsSync(t)){f6.writeFileSync(t,e.trim()),Mi(".gitignore created!");return}
|
|
959
|
+
`,t=`${process.cwd()}/.gitignore`;try{if(!f6.existsSync(t)){f6.writeFileSync(t,e.trim()),Mi(".gitignore created!");return}if(f6.readFileSync(t,"utf8").includes("# Tencent Cloud EdgeOne")){Mi(".gitignore already contains Tencent Cloud EdgeOne configuration, do nothing!");return}TMe(t,e),Mi(".gitignore updated!")}catch(r){kt(`Skip updating .gitignore (${(r==null?void 0:r.message)||"unknown error"}); login is unaffected.`)}}async function mWe(e){e.command("login","Login to Edgeone",t=>t.option("site",{alias:"s",type:"string",describe:"Login site: china, global, or sso (enterprise SSO via unified login page)",choices:["china","global","sso"]}).option("token",{alias:"t",type:"string",describe:"API Token for non-interactive login"}).option("local",{type:"boolean",describe:"Also store credentials to <cwd>/.edgeone/auth.json (for sandboxed environments without ~/.edgeone write access)",default:!1}).option("claim",{type:"boolean",describe:"Claim mode for anonymous deploys: start the login listener without opening a browser, and print a login link that lands on the claim page (requires .edgeone/anonymous.json from a prior anonymous deploy)",default:!1}).option("json",{type:"boolean",describe:"Emit machine-readable JSON lines (only meaningful with --claim)",default:!1}),async t=>{let r=t.token,n=!!t.local;if(!!t.claim){r&&(er("`--claim` starts a browser login flow and cannot be combined with `-t/--token`."),process.exit(1));try{await LAr({local:n,json:!!t.json}),HD(),nk("Login Res","Claim login success"),process.exit(0)}catch(c){er(c instanceof Error?c.message:"Claim login failed."),nk("Login Res","Claim login failed"),process.exit(1)}return}if(r){try{let c=await HAr(r,{local:n});Mi(`Login successfully. Site: ${c}.`),nk("Login Res","Token login success"),process.exit(0)}catch(c){er(c instanceof Error?c.message:"Token login failed."),process.exit(1)}return}let s=t.site;if(await yme()){Mi(`You are already logged in.
|
|
960
960
|
If you want to switch user, please run "edgeone switch".`),nk("Login Res","Already logged in ");return}try{await gme(s,{local:n}),HD(),Mi("Login successfully!"),nk("Login Res","Login success"),process.exit(0)}catch(c){er(c instanceof Error?c.message:"Login failed. Please try again."),process.exit(1)}}),e.command("whoami","Get user information.",{},async()=>{var y;await ty().catch(()=>{})||(er("You are not authenticated. Please run `edgeone login`, or set EDGEONE_PAGES_API_TOKEN."),process.exit(1));let r=await Y$e().catch(()=>{});if((r==null?void 0:r.loginType)==="dingtalk"){let v=r==null?void 0:r.openId;console.log("Your EdgeOne enterprise SSO information:"),Zc()&&(console.log(" Login Type: Enterprise SSO"),console.log(` OpenId: ${v!=null?v:"-"}`),process.exit(0));let A=[{Key:"Login Type",Value:"Enterprise SSO"},{Key:"OpenId",Value:v!=null?v:"-"}],{unmount:S}=(0,hme.render)(dme.default.createElement(mme.default,{data:A}));S();return}let s=await Lu("DescribeUserInfo",{}).catch(v=>{rg("Run whoami command failed.",{message:v.errorMessage,stack:v}),er("You are not authenticated. Please run `edgeone login`."),process.exit(1)}),c=(y=s==null?void 0:s.Data)!=null?y:s,{AppId:u,Uin:p,UserName:f}=c!=null?c:{};!u&&!p&&!f&&(er("You are not authenticated. Please run `edgeone login`."),process.exit(1)),console.log("Your Tencent Cloud account information:"),Zc()&&(console.log(` Account Name: ${f!=null?f:"-"}`),console.log(` Account ID: ${p!=null?p:"-"}`),console.log(` APPID: ${u!=null?u:"-"}`),process.exit(0));let h=[{Key:"Account Name",Value:f!=null?f:"-"},{Key:"Account ID",Value:p!=null?p:"-"},{Key:"APPID",Value:u!=null?u:"-"}],{unmount:g}=(0,hme.render)(dme.default.createElement(mme.default,{data:h}));g()}),e.command("switch","Switch user.",t=>t.option("site",{type:"string",describe:"Login site: china, global, or sso (enterprise SSO via unified login page)",choices:["china","global","sso"]}),async t=>{let r=t.site;try{await gme(r),HD(),Mi("User switch successfully."),process.exit(0)}catch(n){er(n instanceof Error?n.message:"Switch user failed."),process.exit(1)}}),e.command("logout","Logout from Edgeone.",{},async()=>{await c8("eo_token"),await c8("EDGEONE_PAGES_API_TOKEN"),await c8("login_region"),await c8("env_vars_pull_prompt");let t=BAr.join(process.cwd(),".edgeone","auth.json");if(f6.existsSync(t))try{f6.unlinkSync(t)}catch(r){er(`Failed to remove <cwd>/.edgeone/auth.json: ${r instanceof Error?r.message:String(r)}`)}Mi("Logout successfully!")})}var QWe=require("child_process"),qWe=Ct(require("net")),Cme=Ct(require("os")),YF=Ct(require("path")),UWe=Ct(AWe());var d6=require("child_process"),Nv=Ct(require("fs")),bme=Ct(require("os")),gd=Ct(require("path")),JW=require("module");var xme=[];var vWe="@deepseek-ai/dsh",xWe="TencentEdgeOne/edgeone-makers-tools",GAr="opencode",yWe="edgeone-makers-tools";function VAr(e){let t=process.platform==="win32"?"where":"which";return(0,d6.spawnSync)(t,[e],{stdio:"ignore"}).status===0}function WAr(e){return Nv.default.existsSync(gd.default.join(e,"pnpm-lock.yaml"))&&VAr("pnpm")?"pnpm":"npm"}function Eme(e){Nv.default.mkdirSync(e,{recursive:!0});let t=gd.default.join(e,"package.json");Nv.default.existsSync(t)||Nv.default.writeFileSync(t,JSON.stringify({name:"edgeone-harness-runtime",private:!0,version:"0.0.0"},null,2))}function YAr(e){return gd.default.join(e,".npm-cache")}function wme(e,t){if(t.length===0)return Promise.resolve();let r=WAr(e),n=YAr(e);Nv.default.mkdirSync(n,{recursive:!0});let o=r==="pnpm"?["add","--prefer-offline",...t]:["install","--no-audit","--no-fund","--no-save","--prefer-offline","--loglevel=error",...t];return new Promise((s,c)=>{let u=(0,d6.spawn)(r,o,{cwd:e,stdio:"inherit",env:{...process.env,npm_config_cache:n},shell:process.platform==="win32"});u.on("error",c),u.on("exit",p=>{p===0?s():c(new Error(`Package install failed (${r} ${o.join(" ")}).`))})})}async function bWe(e){let t=process.platform==="win32"?"dsh.cmd":"dsh",r=gd.default.join(e,"node_modules",".bin",t);Nv.default.existsSync(r)||await wme(e,[vWe])}function EWe(e,t){let r=(0,JW.createRequire)(gd.default.join(e,"package.json"));try{return r.resolve(t),!0}catch{return!1}}async function wWe(e){let r=xme.filter(o=>!o.local&&o.repo).filter(o=>!EWe(e,o.pkgName));if(r.length===0)return;let n=r.map(o=>o.repo);await wme(e,n)}function JAr(e,t){let r=e.localEntry;if(!r)return"";let n=[];t&&n.push(gd.default.resolve(t,r)),n.push(gd.default.resolve(__dirname,r)),n.push(gd.default.resolve(__dirname,"..",r)),n.push(gd.default.resolve(process.cwd(),"edgeone-dist",r));for(let o of n)if(Nv.default.existsSync(o))return o;return""}function KAr(e,t){var o,s,c;let r=(0,JW.createRequire)(gd.default.join(e,"package.json")),n=[vWe,"@deepseek-ai/dsh-base"];for(let u of n)try{let p=r.resolve(`${u}/package.json`),f=JSON.parse(Nv.default.readFileSync(p,"utf8")),h=(c=(o=f.dependencies)==null?void 0:o[t])!=null?c:(s=f.peerDependencies)==null?void 0:s[t];if(h)return`${t}@${h}`}catch{}}async function SWe(e){let r=["@deepseek-ai/dsh-llm-pi-ai","@deepseek-ai/dsh-agent-default-model"].filter(o=>!EWe(e,o));if(r.length===0)return;let n=r.map(o=>{var s;return(s=KAr(e,o))!=null?s:`${o}@^0.1.0-rc.6`});await wme(e,n)}function XAr(e,t){if(t.local)return JAr(t,e);let r=(0,JW.createRequire)(gd.default.join(e,"package.json"));try{return r.resolve(t.pkgName)}catch{return""}}function _We(e){return typeof e=="boolean"||typeof e=="number"?String(e):`'${String(e).replace(/'/g,"''")}'`}function ZAr(e){let t=[" config:"];for(let[r,n]of Object.entries(e))t.push(` ${r}: ${_We(n)}`);return t}function CWe(e,t){let r=[],n=[];for(let u of xme){let p=XAr(e,u),f=p||`TODO_RESOLVE_ENTRY_FOR_${u.pkgName}`;p||r.push(u.pkgName);let h=[` # ${u.id} \u2014 ${u.desc}`,` - id: ${u.id}`,` name: '${f}'`];u.config&&Object.keys(u.config).length>0&&h.push(...ZAr(u.config)),n.push(h.join(`
|
|
961
961
|
`))}let o=["# Auto-generated by `edgeone harness`. Do not edit by hand.","# Loaded via: dsh web --patch <this file>","","- insert:",n.join(`
|
|
962
962
|
`),""];if(t){let u=t.models&&t.models.length>0?t.models:[{id:t.modelId}],p=[];for(let h of u)p.push(` - id: '${h.id}'`,` name: '${h.name||h.id}'`," input: [text]");let f=t.baseUrl?` baseURL: ${_We(t.baseUrl)}`:` baseURL: !!js process.env.${t.baseUrlEnv}`;o.push("# EdgeOne AI Gateway provider (OpenAI-compatible) \u2014 auto-injected, no manual key needed.","- id: llm-pi-ai"," name: '@deepseek-ai/dsh-llm-pi-ai'"," config:"," providers:"," edgeone:"," displayName: 'EdgeOne Makers Models'"," api: openai-completions",` apiKeyEnv: ${t.apiKeyEnv}`,f," models:",...p,"- id: agent-default-model"," name: '@deepseek-ai/dsh-agent-default-model'"," config:"," provider: edgeone",` model: '${t.modelId}'`,"")}let s=o.join(`
|