@whyour/qinglong-cli 0.1.0 → 0.1.1

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/README.en.md CHANGED
@@ -18,7 +18,7 @@ ql --help
18
18
  npm exec --package=@whyour/qinglong-cli -- ql --help
19
19
  ```
20
20
 
21
- This branch has not published the package. Build with `npm ci --prefix cli` and `npm run build:cli`, then run `npm pack` in cli and install the local tgz. Global installation occupies the `ql` name. On a panel host use a separate npm prefix or `node /absolute/path/to/cli/dist/npm/ql.js`.
21
+ To build from source, use `npm ci --prefix cli` and `npm run build:cli`, then run `npm pack` in cli and install the local tgz. Global installation occupies the `ql` name. On a panel host use a separate npm prefix or `node /absolute/path/to/cli/dist/npm/ql.js`.
22
22
 
23
23
  ```sh
24
24
  ql login --url https://ql.example.com
package/README.md CHANGED
@@ -18,7 +18,7 @@ ql --help
18
18
  npm exec --package=@whyour/qinglong-cli -- ql --help
19
19
  ```
20
20
 
21
- 本分支尚未发布 npm 包。发布前从源码执行 `npm ci --prefix cli`、`npm run build:cli`,在 cli 目录执行 `npm pack`,然后安装本地 tgz。全局安装会占用 `ql` 名称;已有面板的机器建议使用独立 npm prefix 或直接执行 `node /absolute/path/to/cli/dist/npm/ql.js`。
21
+ 也可以从源码构建:执行 `npm ci --prefix cli`、`npm run build:cli`,在 cli 目录执行 `npm pack`,然后安装本地 tgz。全局安装会占用 `ql` 名称;已有面板的机器建议使用独立 npm prefix 或直接执行 `node /absolute/path/to/cli/dist/npm/ql.js`。
22
22
 
23
23
  ```sh
24
24
  ql login --url https://ql.example.com
package/dist/npm/ql.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var vt=Object.create;var se=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var g=(o,e,t)=>()=>{if(t)throw t[0];try{return o&&(e=o(o=0)),e}catch(n){throw t=[n],n}};var z=(o,e)=>{for(var t in e)se(o,t,{get:e[t],enumerable:!0})},Se=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xt(e))!St.call(o,s)&&s!==t&&se(o,s,{get:()=>e[s],enumerable:!(n=Tt(e,s))||n.enumerable});return o};var U=(o,e,t)=>(t=o!=null?vt(kt(o)):{},Se(e||!o||!o.__esModule?se(t,"default",{value:o,enumerable:!0}):t,o)),Et=o=>Se(se({},"__esModule",{value:!0}),o);var j,ie=g(()=>{"use strict";j=[{name:"task view-list",method:"GET",path:"crons/views"},{name:"task view-create",method:"POST",path:"crons/views",body:"json"},{name:"task view-update",method:"PUT",path:"crons/views",params:["id"],body:"object-id"},{name:"task view-delete",method:"DELETE",path:"crons/views",body:"ids"},{name:"task view-move",method:"PUT",path:"crons/views/move",body:"json"},{name:"task view-disable",method:"PUT",path:"crons/views/disable",body:"ids"},{name:"task view-enable",method:"PUT",path:"crons/views/enable",body:"ids"},{name:"task list",method:"GET",path:"crons",existing:!0},{name:"task detail",method:"GET",path:"crons/detail"},{name:"task create",method:"POST",path:"crons",body:"json"},{name:"task run",method:"PUT",path:"crons/run",body:"ids",existing:!0},{name:"task stop",method:"PUT",path:"crons/stop",body:"ids",existing:!0},{name:"task labels-delete",method:"DELETE",path:"crons/labels",body:"json"},{name:"task labels-create",method:"POST",path:"crons/labels",body:"json"},{name:"task disable",method:"PUT",path:"crons/disable",body:"ids"},{name:"task enable",method:"PUT",path:"crons/enable",body:"ids"},{name:"task logs",method:"GET",path:"crons/:id/log",params:["id"],existing:!0},{name:"task update",method:"PUT",path:"crons",params:["id"],body:"object-id"},{name:"task delete",method:"DELETE",path:"crons",body:"ids"},{name:"task pin",method:"PUT",path:"crons/pin",body:"ids"},{name:"task unpin",method:"PUT",path:"crons/unpin",body:"ids"},{name:"task import",method:"GET",path:"crons/import"},{name:"task get",method:"GET",path:"crons/:id",params:["id"],existing:!0},{name:"task status",method:"PUT",path:"crons/status",body:"json"},{name:"task instances",method:"GET",path:"crons/:id/instances",params:["id"]},{name:"task instance-stop",method:"POST",path:"crons/:id/instances/:instanceId/stop",params:["id","instanceId"]},{name:"task log-files",method:"GET",path:"crons/:id/logs",params:["id"]},{name:"subscription list",method:"GET",path:"subscriptions",existing:!0},{name:"subscription create",method:"POST",path:"subscriptions",body:"json"},{name:"subscription run",method:"PUT",path:"subscriptions/run",body:"ids",existing:!0},{name:"subscription stop",method:"PUT",path:"subscriptions/stop",body:"ids",existing:!0},{name:"subscription disable",method:"PUT",path:"subscriptions/disable",body:"ids",existing:!0},{name:"subscription enable",method:"PUT",path:"subscriptions/enable",body:"ids",existing:!0},{name:"subscription logs",method:"GET",path:"subscriptions/:id/log",params:["id"],existing:!0},{name:"subscription update",method:"PUT",path:"subscriptions",params:["id"],body:"object-id"},{name:"subscription delete",method:"DELETE",path:"subscriptions",body:"ids"},{name:"subscription get",method:"GET",path:"subscriptions/:id",params:["id"],existing:!0},{name:"subscription status",method:"PUT",path:"subscriptions/status",body:"json"},{name:"subscription log-files",method:"GET",path:"subscriptions/:id/logs",params:["id"]},{name:"app list",method:"GET",path:"apps"},{name:"app create",method:"POST",path:"apps",body:"json"},{name:"app update",method:"PUT",path:"apps",params:["id"],body:"object-id"},{name:"app delete",method:"DELETE",path:"apps",body:"ids"},{name:"app reset-secret",method:"PUT",path:"apps/:id/reset-secret",params:["id"]},{name:"auth login",method:"GET",path:"auth/token",existing:!0,anonymous:!0},{name:"env list",method:"GET",path:"envs"},{name:"env create",method:"POST",path:"envs",body:"json"},{name:"env update",method:"PUT",path:"envs",params:["id"],body:"object-id"},{name:"env delete",method:"DELETE",path:"envs",body:"ids"},{name:"env move",method:"PUT",path:"envs/:id/move",params:["id"],body:"json"},{name:"env disable",method:"PUT",path:"envs/disable",body:"ids"},{name:"env enable",method:"PUT",path:"envs/enable",body:"ids"},{name:"env rename",method:"PUT",path:"envs/name",body:"json"},{name:"env get",method:"GET",path:"envs/:id",params:["id"]},{name:"env pin",method:"PUT",path:"envs/pin",body:"ids"},{name:"env unpin",method:"PUT",path:"envs/unpin",body:"ids"},{name:"env labels-create",method:"POST",path:"envs/labels",body:"json"},{name:"env labels-delete",method:"DELETE",path:"envs/labels",body:"json"},{name:"env upload",method:"POST",path:"envs/upload",body:"json",upload:"env"},{name:"config samples",method:"GET",path:"configs/samples"},{name:"config list",method:"GET",path:"configs/files"},{name:"config get",method:"GET",path:"configs/detail"},{name:"config save",method:"POST",path:"configs/save",body:"json"},{name:"script list",method:"GET",path:"scripts"},{name:"script get",method:"GET",path:"scripts/detail"},{name:"script create",method:"POST",path:"scripts",body:"json",upload:"file"},{name:"script update",method:"PUT",path:"scripts",body:"json",upload:"file"},{name:"script delete",method:"DELETE",path:"scripts",body:"json"},{name:"script download",method:"POST",path:"scripts/download",body:"json",download:!0},{name:"script run",method:"PUT",path:"scripts/run",body:"json"},{name:"script stop",method:"PUT",path:"scripts/stop",body:"json"},{name:"script rename",method:"PUT",path:"scripts/rename",body:"json"},{name:"log list",method:"GET",path:"logs"},{name:"log get",method:"GET",path:"logs/detail"},{name:"log delete",method:"DELETE",path:"logs",body:"json"},{name:"log download",method:"POST",path:"logs/download",body:"json",download:!0},{name:"dependency list",method:"GET",path:"dependencies"},{name:"dependency create",method:"POST",path:"dependencies",body:"json"},{name:"dependency update",method:"PUT",path:"dependencies",params:["id"],body:"object-id"},{name:"dependency delete",method:"DELETE",path:"dependencies",body:"ids"},{name:"dependency force-delete",method:"DELETE",path:"dependencies/force",body:"ids"},{name:"dependency get",method:"GET",path:"dependencies/:id",params:["id"]},{name:"dependency reinstall",method:"PUT",path:"dependencies/reinstall",body:"ids"},{name:"dependency cancel",method:"PUT",path:"dependencies/cancel",body:"ids"},{name:"system info",method:"GET",path:"system"},{name:"system config-get",method:"GET",path:"system/config"},{name:"system config-log-remove-frequency",method:"PUT",path:"system/config/log-remove-frequency",body:"json"},{name:"system config-cron-concurrency",method:"PUT",path:"system/config/cron-concurrency",body:"json"},{name:"system config-dependence-proxy",method:"PUT",path:"system/config/dependence-proxy",body:"json"},{name:"system config-node-mirror",method:"PUT",path:"system/config/node-mirror",body:"json"},{name:"system config-python-mirror",method:"PUT",path:"system/config/python-mirror",body:"json"},{name:"system config-linux-mirror",method:"PUT",path:"system/config/linux-mirror",body:"json"},{name:"system update-check",method:"PUT",path:"system/update-check"},{name:"system update",method:"PUT",path:"system/update"},{name:"system reload",method:"PUT",path:"system/reload",body:"json"},{name:"system notify",method:"PUT",path:"system/notify",body:"json"},{name:"system command-run",method:"PUT",path:"system/command-run",body:"json",download:!0},{name:"system command-stop",method:"PUT",path:"system/command-stop",body:"json"},{name:"system data-export",method:"PUT",path:"system/data/export",body:"json",download:!0},{name:"system data-import",method:"PUT",path:"system/data/import",body:"json",upload:"data"},{name:"system logs",method:"GET",path:"system/log"},{name:"system logs-delete",method:"DELETE",path:"system/log"},{name:"system auth-reset",method:"PUT",path:"system/auth/reset",body:"json"},{name:"system config-timezone",method:"PUT",path:"system/config/timezone",body:"json"},{name:"system config-lang",method:"PUT",path:"system/config/lang",body:"json"},{name:"system config-panel-title",method:"PUT",path:"system/config/panel-title",body:"json"},{name:"system config-global-ssh-key",method:"PUT",path:"system/config/global-ssh-key",body:"json"},{name:"system config-dependence-clean",method:"PUT",path:"system/config/dependence-clean",body:"json"},{name:"dashboard record",method:"POST",path:"dashboard/record"},{name:"dashboard overview",method:"GET",path:"dashboard/overview"},{name:"dashboard trend",method:"GET",path:"dashboard/trend"},{name:"dashboard top-time",method:"GET",path:"dashboard/top-time"},{name:"dashboard top-count",method:"GET",path:"dashboard/top-count"},{name:"dashboard runtime",method:"GET",path:"dashboard/runtime"},{name:"dashboard labels",method:"GET",path:"dashboard/labels"},{name:"dashboard system",method:"GET",path:"dashboard/system"},{name:"system client-ip-get",method:"GET",path:"system/client-ip/config"},{name:"system client-ip-set",method:"PUT",path:"system/client-ip/config",body:"json"},{name:"system client-ip-diagnose",method:"GET",path:"system/client-ip/diagnose"},{name:"system retention-set",method:"PUT",path:"system/storage-retention/config",body:"json"},{name:"system retention-preview",method:"POST",path:"system/storage-retention/preview",body:"json"},{name:"system retention-cleanup",method:"POST",path:"system/storage-retention/cleanup",body:"json"},{name:"user login",method:"POST",path:"user/login",body:"json",anonymous:!0},{name:"user logout",method:"POST",path:"user/logout"},{name:"user update",method:"PUT",path:"user",body:"json"},{name:"user get",method:"GET",path:"user"},{name:"user two-factor-init",method:"GET",path:"user/two-factor/init"},{name:"user two-factor-active",method:"PUT",path:"user/two-factor/active",body:"json"},{name:"user two-factor-deactivate",method:"PUT",path:"user/two-factor/deactivate"},{name:"user two-factor-login",method:"PUT",path:"user/two-factor/login",body:"json",anonymous:!0},{name:"user login-log",method:"GET",path:"user/login-log"},{name:"user ip-blacklist",method:"GET",path:"user/ip-blacklist"},{name:"user ip-blacklist-set",method:"PUT",path:"user/ip-blacklist",body:"json"},{name:"user ip-blacklist-delete",method:"DELETE",path:"user/ip-blacklist",body:"json"},{name:"user notification-get",method:"GET",path:"user/notification"},{name:"user notification-set",method:"PUT",path:"user/notification",body:"json"},{name:"user init",method:"PUT",path:"user/init",body:"json",anonymous:!0},{name:"user notification-init",method:"PUT",path:"user/notification/init",body:"json",anonymous:!0},{name:"user avatar",method:"PUT",path:"user/avatar",body:"json",upload:"avatar"},{name:"system apply-reload",method:"PUT",path:"update/reload"},{name:"system apply-system",method:"PUT",path:"update/system"},{name:"system apply-data",method:"PUT",path:"update/data"},{name:"health get",method:"GET",path:"health"}]});var x,N,K=g(()=>{x=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},N=class extends x{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}});function oe(o){let e=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+e+">":"["+e+"]"}var Y,re=g(()=>{K();Y=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new N(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}});var Ee,X,ge=g(()=>{re();Ee=require("node:util"),X=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(s=>!s._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((s,i)=>s.name().localeCompare(i.name())),t}compareOptions(e,t){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(s=>!s.hidden),n=e._getHelpOption();if(n&&!n.hidden){let s=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!s&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!s&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);t.push(...s)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>oe(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(s)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(s)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(s)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(s)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let s=e.parent;s;s=s.parent)n=s.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let s=new Map;return e.forEach(i=>{let r=n(i);s.has(r)||s.set(r,[])}),t.forEach(i=>{let r=n(i);s.has(r)||s.set(r,[]),s.get(r).push(i)}),s}formatHelp(e,t){let n=t.padWidth(e,t),s=t.helpWidth??80;function i(d,c){return t.formatItem(d,n,c,t)}let r=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(r=r.concat([t.boxWrap(t.styleCommandDescription(a),s),""]));let p=t.visibleArguments(e).map(d=>i(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(r=r.concat(this.formatItemList("Arguments:",p,t)),this.groupItems(e.options,t.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,c)=>{let _=d.map(w=>i(t.styleOptionTerm(t.optionTerm(w)),t.styleOptionDescription(t.optionDescription(w))));r=r.concat(this.formatItemList(c,_,t))}),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(c=>i(t.styleOptionTerm(t.optionTerm(c)),t.styleOptionDescription(t.optionDescription(c))));r=r.concat(this.formatItemList("Global Options:",d,t))}return this.groupItems(e.commands,t.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,c)=>{let _=d.map(w=>i(t.styleSubcommandTerm(t.subcommandTerm(w)),t.styleSubcommandDescription(t.subcommandDescription(w))));r=r.concat(this.formatItemList(c,_,t))}),r.join(`
2
+ "use strict";var vt=Object.create;var se=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var g=(o,e,t)=>()=>{if(t)throw t[0];try{return o&&(e=o(o=0)),e}catch(n){throw t=[n],n}};var z=(o,e)=>{for(var t in e)se(o,t,{get:e[t],enumerable:!0})},Se=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xt(e))!St.call(o,s)&&s!==t&&se(o,s,{get:()=>e[s],enumerable:!(n=Tt(e,s))||n.enumerable});return o};var U=(o,e,t)=>(t=o!=null?vt(kt(o)):{},Se(e||!o||!o.__esModule?se(t,"default",{value:o,enumerable:!0}):t,o)),Et=o=>Se(se({},"__esModule",{value:!0}),o);var j,ie=g(()=>{"use strict";j=[{name:"task view-list",method:"GET",path:"crons/views"},{name:"task view-create",method:"POST",path:"crons/views",body:"json"},{name:"task view-update",method:"PUT",path:"crons/views",params:["id"],body:"object-id"},{name:"task view-delete",method:"DELETE",path:"crons/views",body:"ids"},{name:"task view-move",method:"PUT",path:"crons/views/move",body:"json"},{name:"task view-disable",method:"PUT",path:"crons/views/disable",body:"ids"},{name:"task view-enable",method:"PUT",path:"crons/views/enable",body:"ids"},{name:"task list",method:"GET",path:"crons",existing:!0},{name:"task detail",method:"GET",path:"crons/detail"},{name:"task create",method:"POST",path:"crons",body:"json"},{name:"task run",method:"PUT",path:"crons/run",body:"ids",existing:!0},{name:"task stop",method:"PUT",path:"crons/stop",body:"ids",existing:!0},{name:"task labels-delete",method:"DELETE",path:"crons/labels",body:"json"},{name:"task labels-create",method:"POST",path:"crons/labels",body:"json"},{name:"task disable",method:"PUT",path:"crons/disable",body:"ids"},{name:"task enable",method:"PUT",path:"crons/enable",body:"ids"},{name:"task logs",method:"GET",path:"crons/:id/log",params:["id"],existing:!0},{name:"task update",method:"PUT",path:"crons",params:["id"],body:"object-id"},{name:"task delete",method:"DELETE",path:"crons",body:"ids"},{name:"task pin",method:"PUT",path:"crons/pin",body:"ids"},{name:"task unpin",method:"PUT",path:"crons/unpin",body:"ids"},{name:"task import",method:"GET",path:"crons/import"},{name:"task get",method:"GET",path:"crons/:id",params:["id"],existing:!0},{name:"task status",method:"PUT",path:"crons/status",body:"json"},{name:"task instances",method:"GET",path:"crons/:id/instances",params:["id"]},{name:"task instance-stop",method:"POST",path:"crons/:id/instances/:instanceId/stop",params:["id","instanceId"]},{name:"task log-files",method:"GET",path:"crons/:id/logs",params:["id"]},{name:"subscription list",method:"GET",path:"subscriptions",existing:!0},{name:"subscription create",method:"POST",path:"subscriptions",body:"json"},{name:"subscription run",method:"PUT",path:"subscriptions/run",body:"ids",existing:!0},{name:"subscription stop",method:"PUT",path:"subscriptions/stop",body:"ids",existing:!0},{name:"subscription disable",method:"PUT",path:"subscriptions/disable",body:"ids",existing:!0},{name:"subscription enable",method:"PUT",path:"subscriptions/enable",body:"ids",existing:!0},{name:"subscription logs",method:"GET",path:"subscriptions/:id/log",params:["id"],existing:!0},{name:"subscription update",method:"PUT",path:"subscriptions",params:["id"],body:"object-id"},{name:"subscription delete",method:"DELETE",path:"subscriptions",body:"ids"},{name:"subscription get",method:"GET",path:"subscriptions/:id",params:["id"],existing:!0},{name:"subscription status",method:"PUT",path:"subscriptions/status",body:"json"},{name:"subscription log-files",method:"GET",path:"subscriptions/:id/logs",params:["id"]},{name:"app list",method:"GET",path:"apps"},{name:"app create",method:"POST",path:"apps",body:"json"},{name:"app update",method:"PUT",path:"apps",params:["id"],body:"object-id"},{name:"app delete",method:"DELETE",path:"apps",body:"ids"},{name:"app reset-secret",method:"PUT",path:"apps/:id/reset-secret",params:["id"]},{name:"auth login",method:"GET",path:"auth/token",existing:!0,anonymous:!0},{name:"env list",method:"GET",path:"envs"},{name:"env create",method:"POST",path:"envs",body:"json"},{name:"env update",method:"PUT",path:"envs",params:["id"],body:"object-id"},{name:"env delete",method:"DELETE",path:"envs",body:"ids"},{name:"env move",method:"PUT",path:"envs/:id/move",params:["id"],body:"json"},{name:"env disable",method:"PUT",path:"envs/disable",body:"ids"},{name:"env enable",method:"PUT",path:"envs/enable",body:"ids"},{name:"env rename",method:"PUT",path:"envs/name",body:"json"},{name:"env get",method:"GET",path:"envs/:id",params:["id"]},{name:"env pin",method:"PUT",path:"envs/pin",body:"ids"},{name:"env unpin",method:"PUT",path:"envs/unpin",body:"ids"},{name:"env labels-create",method:"POST",path:"envs/labels",body:"json"},{name:"env labels-delete",method:"DELETE",path:"envs/labels",body:"json"},{name:"env upload",method:"POST",path:"envs/upload",body:"json",upload:"env"},{name:"config samples",method:"GET",path:"configs/samples"},{name:"config list",method:"GET",path:"configs/files"},{name:"config get",method:"GET",path:"configs/detail"},{name:"config save",method:"POST",path:"configs/save",body:"json"},{name:"script list",method:"GET",path:"scripts"},{name:"script get",method:"GET",path:"scripts/detail"},{name:"script create",method:"POST",path:"scripts",body:"json",upload:"file"},{name:"script update",method:"PUT",path:"scripts",body:"json",upload:"file"},{name:"script delete",method:"DELETE",path:"scripts",body:"json"},{name:"script download",method:"POST",path:"scripts/download",body:"json",download:!0},{name:"script run",method:"PUT",path:"scripts/run",body:"json"},{name:"script stop",method:"PUT",path:"scripts/stop",body:"json"},{name:"script rename",method:"PUT",path:"scripts/rename",body:"json"},{name:"log list",method:"GET",path:"logs"},{name:"log get",method:"GET",path:"logs/detail"},{name:"log delete",method:"DELETE",path:"logs",body:"json"},{name:"log download",method:"POST",path:"logs/download",body:"json",download:!0},{name:"dependency list",method:"GET",path:"dependencies"},{name:"dependency create",method:"POST",path:"dependencies",body:"json"},{name:"dependency update",method:"PUT",path:"dependencies",params:["id"],body:"object-id"},{name:"dependency delete",method:"DELETE",path:"dependencies",body:"ids"},{name:"dependency force-delete",method:"DELETE",path:"dependencies/force",body:"ids"},{name:"dependency get",method:"GET",path:"dependencies/:id",params:["id"]},{name:"dependency reinstall",method:"PUT",path:"dependencies/reinstall",body:"ids"},{name:"dependency cancel",method:"PUT",path:"dependencies/cancel",body:"ids"},{name:"system info",method:"GET",path:"system"},{name:"system config-get",method:"GET",path:"system/config"},{name:"system config-log-remove-frequency",method:"PUT",path:"system/config/log-remove-frequency",body:"json"},{name:"system config-cron-concurrency",method:"PUT",path:"system/config/cron-concurrency",body:"json"},{name:"system config-dependence-proxy",method:"PUT",path:"system/config/dependence-proxy",body:"json"},{name:"system config-node-mirror",method:"PUT",path:"system/config/node-mirror",body:"json"},{name:"system config-python-mirror",method:"PUT",path:"system/config/python-mirror",body:"json"},{name:"system config-linux-mirror",method:"PUT",path:"system/config/linux-mirror",body:"json"},{name:"system update-check",method:"PUT",path:"system/update-check"},{name:"system update",method:"PUT",path:"system/update"},{name:"system reload",method:"PUT",path:"system/reload",body:"json"},{name:"system notify",method:"PUT",path:"system/notify",body:"json"},{name:"system command-run",method:"PUT",path:"system/command-run",body:"json",download:!0},{name:"system command-stop",method:"PUT",path:"system/command-stop",body:"json"},{name:"system data-export",method:"PUT",path:"system/data/export",body:"json",download:!0},{name:"system data-import",method:"PUT",path:"system/data/import",body:"json",upload:"data"},{name:"system logs",method:"GET",path:"system/log"},{name:"system logs-delete",method:"DELETE",path:"system/log"},{name:"system auth-reset",method:"PUT",path:"system/auth/reset",body:"json"},{name:"system config-timezone",method:"PUT",path:"system/config/timezone",body:"json"},{name:"system config-lang",method:"PUT",path:"system/config/lang",body:"json"},{name:"system config-panel-title",method:"PUT",path:"system/config/panel-title",body:"json"},{name:"system config-global-ssh-key",method:"PUT",path:"system/config/global-ssh-key",body:"json"},{name:"system config-dependence-clean",method:"PUT",path:"system/config/dependence-clean",body:"json"},{name:"dashboard record",method:"POST",path:"dashboard/record",body:"json"},{name:"dashboard overview",method:"GET",path:"dashboard/overview"},{name:"dashboard trend",method:"GET",path:"dashboard/trend"},{name:"dashboard top-time",method:"GET",path:"dashboard/top-time"},{name:"dashboard top-count",method:"GET",path:"dashboard/top-count"},{name:"dashboard runtime",method:"GET",path:"dashboard/runtime"},{name:"dashboard labels",method:"GET",path:"dashboard/labels"},{name:"dashboard system",method:"GET",path:"dashboard/system"},{name:"system client-ip-get",method:"GET",path:"system/client-ip/config"},{name:"system client-ip-set",method:"PUT",path:"system/client-ip/config",body:"json"},{name:"system client-ip-diagnose",method:"GET",path:"system/client-ip/diagnose"},{name:"system retention-set",method:"PUT",path:"system/storage-retention/config",body:"json"},{name:"system retention-preview",method:"POST",path:"system/storage-retention/preview",body:"json"},{name:"system retention-cleanup",method:"POST",path:"system/storage-retention/cleanup",body:"json"},{name:"user login",method:"POST",path:"user/login",body:"json",anonymous:!0},{name:"user logout",method:"POST",path:"user/logout"},{name:"user update",method:"PUT",path:"user",body:"json"},{name:"user get",method:"GET",path:"user"},{name:"user two-factor-init",method:"GET",path:"user/two-factor/init"},{name:"user two-factor-active",method:"PUT",path:"user/two-factor/active",body:"json"},{name:"user two-factor-deactivate",method:"PUT",path:"user/two-factor/deactivate"},{name:"user two-factor-login",method:"PUT",path:"user/two-factor/login",body:"json",anonymous:!0},{name:"user login-log",method:"GET",path:"user/login-log"},{name:"user ip-blacklist",method:"GET",path:"user/ip-blacklist"},{name:"user ip-blacklist-set",method:"PUT",path:"user/ip-blacklist",body:"json"},{name:"user ip-blacklist-delete",method:"DELETE",path:"user/ip-blacklist",body:"json"},{name:"user notification-get",method:"GET",path:"user/notification"},{name:"user notification-set",method:"PUT",path:"user/notification",body:"json"},{name:"user init",method:"PUT",path:"user/init",body:"json",anonymous:!0},{name:"user notification-init",method:"PUT",path:"user/notification/init",body:"json",anonymous:!0},{name:"user avatar",method:"PUT",path:"user/avatar",body:"json",upload:"avatar"},{name:"system apply-reload",method:"PUT",path:"update/reload"},{name:"system apply-system",method:"PUT",path:"update/system"},{name:"system apply-data",method:"PUT",path:"update/data"},{name:"health get",method:"GET",path:"health"}]});var x,N,K=g(()=>{x=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},N=class extends x{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}});function oe(o){let e=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+e+">":"["+e+"]"}var Y,re=g(()=>{K();Y=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new N(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}});var Ee,X,ge=g(()=>{re();Ee=require("node:util"),X=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(s=>!s._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((s,i)=>s.name().localeCompare(i.name())),t}compareOptions(e,t){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(s=>!s.hidden),n=e._getHelpOption();if(n&&!n.hidden){let s=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!s&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!s&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);t.push(...s)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>oe(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(s)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(s)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(s)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,s)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(s)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let s=e.parent;s;s=s.parent)n=s.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let s=new Map;return e.forEach(i=>{let r=n(i);s.has(r)||s.set(r,[])}),t.forEach(i=>{let r=n(i);s.has(r)||s.set(r,[]),s.get(r).push(i)}),s}formatHelp(e,t){let n=t.padWidth(e,t),s=t.helpWidth??80;function i(d,c){return t.formatItem(d,n,c,t)}let r=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(r=r.concat([t.boxWrap(t.styleCommandDescription(a),s),""]));let p=t.visibleArguments(e).map(d=>i(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(r=r.concat(this.formatItemList("Arguments:",p,t)),this.groupItems(e.options,t.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,c)=>{let _=d.map(w=>i(t.styleOptionTerm(t.optionTerm(w)),t.styleOptionDescription(t.optionDescription(w))));r=r.concat(this.formatItemList(c,_,t))}),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(c=>i(t.styleOptionTerm(t.optionTerm(c)),t.styleOptionDescription(t.optionDescription(c))));r=r.concat(this.formatItemList("Global Options:",d,t))}return this.groupItems(e.commands,t.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,c)=>{let _=d.map(w=>i(t.styleSubcommandTerm(t.subcommandTerm(w)),t.styleSubcommandDescription(t.subcommandDescription(w))));r=r.concat(this.formatItemList(c,_,t))}),r.join(`
3
3
  `)}displayWidth(e){return(0,Ee.stripVTControlCharacters)(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,s){let r=" ".repeat(2);if(!n)return r+e;let a=e.padEnd(t+e.length-s.displayWidth(e)),p=2,l=(this.helpWidth??80)-t-p-2,d;return l<this.minWidthToWrap||s.preformatted(n)?d=n:d=s.boxWrap(n,l).replace(/\n/g,`
4
4
  `+" ".repeat(t+p)),r+a+" ".repeat(p)+d.replace(/\n/g,`
5
5
  ${r}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,i=[];return n.forEach(r=>{let a=r.match(s);if(a===null){i.push("");return}let p=[a.shift()],u=this.displayWidth(p[0]);a.forEach(l=>{let d=this.displayWidth(l);if(u+d<=t){p.push(l),u+=d;return}i.push(p.join(""));let c=l.trimStart();p=[c],u=this.displayWidth(c)}),i.push(p.join(""))}),i.join(`
@@ -24,7 +24,7 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
24
24
  `),this.outputHelp({error:!0}));let n=t||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in f.default.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,f.default.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new ae(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!t(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=r=>{let a=r.attributeName(),p=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&p===!1||u.presetArg!==void 0&&p===u.presetArg)?u:l||r},s=r=>{let a=n(r),p=a.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${s(e)} cannot be used with ${s(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],i=this;do{let r=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);s=s.concat(r),i=i.parent}while(i&&!i._enablePositionalOptions);t=be(e,s)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",s=e.length,i=this.parent?` for '${this.name()}'`:"",r=e.join(", "),a=`error: too many arguments${i}. Expected ${t} argument${n} but got ${s}: ${r}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(i=>{s.push(i.name()),i.alias()&&s.push(i.alias())}),t=be(e,s)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let s=this.createOption(t,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
25
25
  `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>oe(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=P.default.basename(e,P.default.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let s=t.formatHelp(this,t);return n.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(e){e=e||{};let t=!!e.error,n,s,i;return t?(n=a=>this._outputConfiguration.writeErr(a),s=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),s=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(s||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:s,helpWidth:i}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getOutputContext(e),s={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(r=>r.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(r=>r.emit("afterAllHelp",s))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(f.default.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${n.join("', '")}'`);let s=`${e}Help`;return this.on(s,i=>{let r;typeof t=="function"?r=t({error:i.error,command:i.command}):r=t,r&&i.write(`${r}
27
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(s=>t.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}});var cn,$e=g(()=>{re();je();K();ge();ye();cn=new D});var Ne=g(()=>{"use strict";$e()});function h(o,e=1){throw new k(o,e)}var k,S=g(()=>{"use strict";k=class extends Error{constructor(t,n=1){super(t);this.exitCode=n;this.name="CliError"}exitCode}});var De,qe=g(()=>{"use strict";De={"\u9700\u8981\u53CC\u56E0\u7D20\u9A8C\u8BC1\uFF0C\u8BF7\u8C03\u7528 user two-factor-login\u3002":"Two-factor authentication required; use user two-factor-login.","QL_URL \u548C QL_ACCESS_TOKEN \u5FC5\u987B\u540C\u65F6\u63D0\u4F9B\u3002":"Provide QL_URL and QL_ACCESS_TOKEN together.","\u63A5\u53E3\u8FD4\u56DE JSON\uFF0C\u672A\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6\u3002":"The endpoint returned JSON; no download was saved.","\u5DF2\u9009\u62E9\u7684 CLI \u5B89\u88C5\u8DEF\u5F84\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"The selected CLI installation path must be absolute.","\u4FDD\u7559 CLI \u5165\u53E3\u4EC5\u652F\u6301\u5DF2\u786E\u8BA4\u7684 2.x \u5347\u7EA7\u8F7D\u8377\u3002":"Preserving CLI entries requires a verified 2.x upgrade payload.","\u65E0\u6CD5\u786E\u8BA4\u5DF2\u9009\u62E9\u7684 CLI \u547D\u4EE4\u52A0\u8F7D\u5668\uFF0C\u8BF7\u68C0\u67E5\u5B89\u88C5\u3002":"Cannot verify the selected CLI command loader. Check the installation.","\u5BB9\u5668\u5165\u53E3\u4EC5\u63A5\u53D7\u901A\u8FC7\u73AF\u5883\u53D8\u91CF\u914D\u7F6E\u3002":"Container entry accepts configuration through environment variables only.","\u4EFB\u52A1\u5EF6\u8FDF\u8FC7\u6EE4\u5DF2\u53D6\u6D88\u3002":"Task delay filtering cancelled.","\u4EFB\u52A1\u5EF6\u8FDF\u8FC7\u6EE4\u5931\u8D25\uFF08\u9000\u51FA\u7801 %s\uFF09\u3002":"Task delay filtering failed (exit %s).","\u76F4\u63A5\u8FD0\u884C\u7684\u540E\u7AEF\u5728\u542F\u52A8\u671F\u95F4\u9000\u51FA\uFF08%s\uFF09\u3002":"Direct backend exited during startup (%s).","\u65E0\u6CD5\u83B7\u53D6\u672C\u673A\u7CFB\u7EDF\u4EE4\u724C\uFF0C\u8BF7\u68C0\u67E5\u8FD0\u884C\u4E2D\u7684\u9762\u677F\u3002":"Cannot obtain a local system token. Check the running panel.","\u672C\u673A\u9762\u677F\u7AEF\u53E3\u65E0\u6548\u3002":"Invalid local panel port.","\u672C\u673A API \u62D2\u7EDD\u8BF7\u6C42\uFF08HTTP %s\uFF09\u3002":"Local API rejected request (HTTP %s).","\u672C\u673A API \u8BF7\u6C42\u5931\u8D25\uFF1B\u8BF7\u5148\u68C0\u67E5\u64CD\u4F5C\u7ED3\u679C\uFF0C\u4E0D\u8981\u76F4\u63A5\u91CD\u8BD5\u5199\u5165\u3002":"Local API request failed; do not retry a mutation without checking its result.","\u672C\u673A API \u62D2\u7EDD\u8BF7\u6C42\uFF0C\u8BF7\u68C0\u67E5\u9762\u677F\u65E5\u5FD7\u548C\u6743\u9650\u3002":"Local API rejected request. Check panel logs and permissions.","\u4EFB\u52A1\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002":"Invalid task list response.","\u4EFB\u52A1\u54CD\u5E94\u65E0\u6548\u3002":"Invalid task response.","\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002":"Invalid log response.","\u8BA2\u9605\u54CD\u5E94\u65E0\u6548\u3002":"Invalid subscription response.","\u8BA2\u9605\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002":"Invalid subscription list response.","\u8FD4\u56DE\u7684\u8BA2\u9605 ID \u4E0E\u8BF7\u6C42\u4E0D\u4E00\u81F4\u3002":"Unexpected subscription ID.","\u8BA2\u9605\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002":"Invalid subscription log response.","\u4E0D\u652F\u6301\u7684\u8BA2\u9605\u64CD\u4F5C\u3002":"Unsupported subscription operation.","\u8DEF\u5F84\u5FC5\u987B\u4F4D\u4E8E\u5176\u7BA1\u7406\u76EE\u5F55\u5185\u90E8\u3002":"Path must be a descendant of its managed directory.","\u4ED3\u5E93\u8DEF\u5F84\u65E0\u6548\u3002":"Invalid repository path.","\u5355\u6587\u4EF6\u8BA2\u9605\u9700\u8981 HTTP(S) \u5730\u5740\u3002":"Raw subscriptions require HTTP(S).","\u8BA2\u9605\u4EFB\u52A1\u540C\u6B65\u8FD4\u56DE\u4E86\u65E0\u6548\u4EFB\u52A1\u5217\u8868\u3002":"Invalid task list during subscription reconciliation.","\u65E0\u6CD5\u542F\u52A8\u5FC5\u8981\u7684\u53EF\u6267\u884C\u7A0B\u5E8F\uFF1A%s":"Cannot start required executable: %s","\u5B50\u8FDB\u7A0B\u8F93\u51FA\u5199\u5165\u5931\u8D25\u3002":"Child output sink failed.","\u5B50\u8FDB\u7A0B\u8F93\u51FA\u8D85\u8FC7\u914D\u7F6E\u7684\u6355\u83B7\u4E0A\u9650\u3002":"Child output exceeded the configured capture limit.","\u5FC5\u8981\u7684\u53EF\u6267\u884C\u7A0B\u5E8F\u5931\u8D25\uFF08%s\uFF0C\u9000\u51FA\u7801 %s\uFF09\u3002":"Required executable failed (%s, exit %s).","CLI \u5B89\u88C5\u8DEF\u5F84\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"CLI installation paths must be absolute.","CLI \u5165\u53E3\u5FC5\u987B\u4E3A\u666E\u901A\u6587\u4EF6\u3002":"CLI entry is not a regular file.","\u547D\u4EE4\u65E5\u5FD7\u76EE\u5F55\u65E0\u6548\u3002":"Invalid command log directory.","QlPort \u5FC5\u987B\u5728 1 \u5230 65535 \u4E4B\u95F4\u3002":"QlPort must be between 1 and 65535.","CLI \u8C03\u7528\u5931\u8D25\u3002":"CLI invocation failed.","\u4E0D\u652F\u6301\u6B64\u90E8\u7F72\u64CD\u4F5C\u7CFB\u7EDF\uFF1A%s\u3002":"Unsupported deployment OS: %s.","Python \u8FD4\u56DE\u4E86\u65E0\u6548\u7248\u672C\u3002":"Python returned an invalid version.","\u542F\u52A8\u9700\u8981\u4EE5 /data \u7ED3\u5C3E\u7684\u7EDD\u5BF9\u6570\u636E\u76EE\u5F55\u3002":"Startup requires an absolute data directory ending in /data.","\u5BB9\u5668\u5B89\u88C5\u76EE\u5F55\u548C\u6570\u636E\u76EE\u5F55\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Container root and data directory must be absolute paths.","\u5BB9\u5668\u76EE\u5F55\u4E0D\u53EF\u5199\u6216\u4E0D\u53EF\u8BBF\u95EE\uFF1A%s\uFF08UID %s\uFF09\u3002\u8BF7\u68C0\u67E5\u6302\u8F7D\u76EE\u5F55\u7684\u6240\u6709\u8005\u548C\u6743\u9650\u3002":"Container directory is not writable/searchable: %s (UID %s). Check the mounted directory ownership and permissions.","\u65E0\u6CD5\u521D\u59CB\u5316 %s\uFF1A%s":"Cannot initialize %s: %s","QL_SCHEDULER \u5FC5\u987B\u4E3A node \u6216 system\u3002":"QL_SCHEDULER must be node or system.","\u5BB9\u5668\u8C03\u5EA6\u5668\u610F\u5916\u9000\u51FA\uFF08%s\uFF09\u3002":"Container scheduler exited unexpectedly (%s).","Bot \u5B89\u88C5\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u7CFB\u7EDF\uFF1A%s\u3002":"Bot installation does not support OS: %s.","Bot \u4ED3\u5E93\u5305\u542B\u6307\u5411\u76EE\u5F55\u5916\u90E8\u7684\u7B26\u53F7\u94FE\u63A5\u3002":"Bot repository contains an external symlink.","Bot \u4ED3\u5E93\u5305\u542B\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B\u3002":"Bot repository contains an unsupported entry.","Bot \u6E90\u5FC5\u987B\u4E3A\u666E\u901A\u76EE\u5F55\u3002":"Bot source must be a regular directory.","Bot \u914D\u7F6E\u6A21\u677F\u5FC5\u987B\u4E3A\u666E\u901A\u6587\u4EF6\u3002":"Bot configuration template must be a regular file.","Bot \u8FDB\u7A0B\u7BA1\u7406\u9700\u8981 Linux\u3002":"Bot process management requires Linux.","Bot \u5B89\u88C5\u548C\u8FDB\u7A0B\u7BA1\u7406\u9700\u8981 Linux\u3002":"Bot installation and process management require Linux.","Bot \u5728\u542F\u52A8\u671F\u95F4\u9000\u51FA\uFF08%s\uFF09\u3002":"Bot exited during startup (%s).","\u8BA2\u9605\u8DEF\u5F84\u5305\u542B\u6362\u884C\u6216\u7A7A\u5B57\u7B26\uFF0C\u65E0\u6CD5\u5B89\u5168\u8FC7\u6EE4\u3002":"Subscription paths with line breaks cannot be filtered safely.","\u8BA2\u9605 POSIX \u6B63\u5219\u8868\u8FBE\u5F0F\u65E0\u6548\u3002":"Invalid subscription POSIX regular expression.","\u8BA2\u9605\u8FC7\u6EE4\u5931\u8D25\uFF08\u9000\u51FA\u7801 %s\uFF09\u3002":"Subscription filtering failed (exit %s).","\u8D26\u53F7\u9009\u62E9\u683C\u5F0F\u65E0\u6548\u3002":"Invalid account selection.","\u8D26\u53F7\u9009\u62E9\u8D85\u51FA\u73AF\u5883\u53D8\u91CF\u7684\u8D26\u53F7\u8303\u56F4\u3002":"Account selection is outside the environment variable range.","\u8D85\u65F6\u5FC5\u987B\u4E3A\u6B63\u65F6\u957F\uFF0C\u4F8B\u5982 30s \u6216 5m\u3002":"Timeout must be a positive duration, e.g. 30s or 5m.","\u8D85\u65F6\u65F6\u957F\u8D85\u51FA\u652F\u6301\u8303\u56F4\u3002":"Timeout is outside the supported range.","\u5FC5\u987B\u6307\u5B9A\u811A\u672C\u6216\u53EF\u6267\u884C\u7A0B\u5E8F\u3002":"A script or executable is required.","\u5FC5\u987B\u6307\u5B9A\u6709\u6548\u7684\u8D26\u53F7\u73AF\u5883\u53D8\u91CF\u540D\u3002":"A valid account environment variable is required.","cron \u73AF\u5883\u53D8\u91CF\u503C\u65E0\u6548\u3002":"Invalid cron environment value","cron \u5B89\u88C5\u8DEF\u5F84\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Cron installation paths must be absolute","\u62D2\u7EDD\u8986\u76D6\u4E0D\u5C5E\u4E8E\u6B64 CLI \u7684\u7528\u6237 crontab \u547D\u4EE4\u3002":"Refusing to replace an unrelated user crontab command","\u65E0\u6CD5\u5B89\u88C5\u6216\u8BFB\u53D6\u9762\u677F crontab\uFF0C\u8BF7\u68C0\u67E5\u73AF\u5883\u8DEF\u5F84\u548C\u7CFB\u7EDF cron \u5DE5\u5177\u3002":"Cannot install or read the selected panel crontab. Check its environment paths and system cron tool.","\u540E\u7AEF\u8FDB\u7A0B\u672A\u5728 5 \u79D2\u5185\u505C\u6B62\uFF0C\u5DF2\u53D6\u6D88\u91CD\u542F\u3002":"Direct backend did not stop within 5 seconds; restart cancelled.","\u65E0\u6CD5\u68C0\u67E5\u8FD0\u884C\u4E2D\u7684\u540E\u7AEF\u8FDB\u7A0B\u3002":"Cannot inspect running backend processes.","\u5347\u7EA7\u6587\u4EF6\u5305\u542B\u6307\u5411\u76EE\u5F55\u5916\u90E8\u7684\u7B26\u53F7\u94FE\u63A5\u3002":"Upgrade payload contains an external symlink.","\u5347\u7EA7\u6587\u4EF6\u5305\u542B\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B\u3002":"Upgrade payload contains unsupported filesystem entries.","\u5347\u7EA7\u5F52\u6863\u5305\u542B\u65E0\u6548\u8DEF\u5F84\u3002":"Upgrade archive contains an invalid path.","\u5347\u7EA7\u5F52\u6863\u5305\u542B\u7B26\u53F7\u94FE\u63A5\u3002":"Upgrade archive contains symlinks.","\u6682\u5B58\u5347\u7EA7\u6307\u9488\u65E0\u6548\u3002":"Invalid staged upgrade pointer.","\u6682\u5B58\u5347\u7EA7\u76EE\u5F55\u65E0\u6548\u3002":"Invalid staged upgrade directory.","\u6682\u5B58\u5347\u7EA7\u5C31\u7EEA\u8BB0\u5F55\u4E0E\u76EE\u5F55\u4E0D\u5339\u914D\u3002":"Staged upgrade readiness does not match its directory.","\u66FF\u6362\u6E90\u4E0E\u76EE\u6807\u76F8\u540C\u3002":"Replacement source equals destination.","\u66FF\u6362\u6E90\u4F4D\u4E8E\u76EE\u6807\u76EE\u5F55\u5185\u90E8\u3002":"Replacement source is inside its destination.","\u91CD\u8F7D\u5931\u8D25\uFF1B\u6587\u4EF6\u5DF2\u6062\u590D\uFF0C\u4F46\u539F\u670D\u52A1\u65E0\u6CD5\u91CD\u65B0\u542F\u52A8\u3002":"Reload failed; files restored, but the previous service could not restart.","\u6570\u636E\u91CD\u8F7D\u9700\u8981\u72EC\u7ACB\u7684\u6570\u636E\u76EE\u5F55\u3002":"Data reload requires a dedicated data directory.","\u6682\u5B58\u6570\u636E\u4E0E\u5DF2\u5B89\u88C5\u7684\u6570\u636E\u76EE\u5F55\u5FC5\u987B\u5206\u79BB\u3002":"Staged data must be separate from the installed data directory.","\u4E3B\u673A\u5F00\u673A\u6CE8\u518C\u9700\u8981 OpenRC \u6216 systemd\uFF1B\u4EC5\u5728\u5176\u4ED6\u7BA1\u7406\u5668\u8D1F\u8D23\u670D\u52A1\u65F6\u4F7F\u7528 --no-startup\u3002":"Host startup registration requires OpenRC or systemd. Use --no-startup only when another supervisor owns the services.","\u672C\u673A\u547D\u4EE4\u9700\u8981\u901A\u8FC7 --root \u6216 QL_DIR \u6307\u5B9A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Local commands require an absolute --root or QL_DIR.","\u9762\u677F\u5B89\u88C5\u76EE\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u662F\u76EE\u5F55\u3002":"Panel root does not exist.","\u7528\u6237\u914D\u7F6E\u52A0\u8F7D\u5DF2\u53D6\u6D88\u3002":"User configuration evaluation cancelled.","\u7528\u6237\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25\u3002":"User configuration evaluation failed.","\u7528\u6237\u914D\u7F6E\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u73AF\u5883\u6570\u636E\u3002":"User configuration returned invalid environment data.","\u7528\u6CD5\uFF1Aql-compat update [true|false]":"Usage: ql-compat update [true|false]","\u7528\u6CD5\uFF1Aql-compat reload [services|system|data]":"Usage: ql-compat reload [services|system|data]","\u672A\u77E5\u65E7\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C ql-compat --help\u3002":"Unknown legacy command. Run ql-compat --help.","\u547D\u4EE4\u5DF2\u4E2D\u65AD\u3002":"Command interrupted.","\u65E7\u547D\u4EE4\u9002\u914D\u5668\u6267\u884C\u5931\u8D25\u3002":"Legacy command adapter failed.","\u7528\u6CD5\uFF1Aql-subscription-worker repo|raw <url> [\u65E7\u8BA2\u9605\u53C2\u6570]":"Usage: ql-subscription-worker repo|raw <url> [legacy subscription arguments]","\u8BA2\u9605\u5E03\u5C14\u53C2\u6570\u65E0\u6548\uFF0C\u53EA\u80FD\u4F7F\u7528 true \u6216 false\u3002":"Invalid subscription boolean.","\u8BA2\u9605\u53C2\u6570\u8FC7\u591A\u3002":"Too many subscription arguments.","SUB_ID \u65E0\u6548\uFF0C\u5FC5\u987B\u4E3A\u6B63\u6574\u6570\u3002":"Invalid SUB_ID.","\u8BA2\u9605\u6267\u884C\u5668\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u65E5\u5FD7\u3002":"Subscription worker failed. Check local logs.","\u4EFB\u52A1\u6267\u884C\u5668\u9009\u9879\u65E0\u6548\u3002":"Invalid runner options.","\u672C\u673A\u4EFB\u52A1\u5728\u52A0\u8F7D\u914D\u7F6E\u65F6\u5DF2\u53D6\u6D88\u3002":"Local task execution cancelled during configuration.","\u672C\u673A\u4EFB\u52A1\u6267\u884C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u9762\u677F\u73AF\u5883\u548C\u4EFB\u52A1\u65E5\u5FD7\u3002":"Local task execution failed. Check the panel environment and task log.","\u5E94\u7528 ID":"Client ID",\u5E94\u7528\u5BC6\u94A5:"Client secret",\u8BA2\u9605:"subscription",\u4EFB\u52A1:"task",\u5E94\u7528\u51ED\u636E:"application credentials","\u5E94\u7528\u51ED\u636E\u548C %s \u6743\u9650":"application credentials and %s permission",\u672A\u77E5:"unknown"," \u6267\u884C\u7ED3\u679C\u53EF\u80FD\u672A\u77E5\uFF0C\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002":" Execution outcome may be unknown; check %s status before retrying.","API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08HTTP %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002%s":"API request rejected (HTTP %s). Check %s.%s","\u8BF7\u6C42\u5931\u8D25\u6216\u54CD\u5E94\u65E0\u6548\uFF0C\u6267\u884C\u7ED3\u679C\u672A\u77E5\u3002\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002":"Request failed or returned an invalid response; execution outcome is unknown. Check %s status before retrying.","\u8BF7\u6C42\u5931\u8D25\u6216\u8FD4\u56DE\u7684 JSON \u65E0\u6548\uFF0C\u8BF7\u68C0\u67E5\u5B9E\u4F8B URL\u3001\u7F51\u7EDC\u548C TLS \u8BC1\u4E66\u3002":"Request failed or returned invalid JSON. Check the instance URL, network and TLS certificate.","API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08code %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002":"API request rejected (code %s). Check %s.","CLI \u914D\u7F6E\u5FC5\u987B\u662F\u5F53\u524D\u7528\u6237\u62E5\u6709\u7684\u79C1\u6709\u666E\u901A\u6587\u4EF6\uFF080600\uFF09\u3002":"CLI config must be an owned private regular file (0600).","CLI \u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u8FD0\u884C ql-cli login\u3002":"Invalid CLI config. Run ql-cli login.","\u5C1A\u672A\u767B\u5F55\uFF0C\u8BF7\u8FD0\u884C ql-cli login\u3002":"Not logged in. Run ql-cli login.","\u65E0\u6CD5\u8BFB\u53D6 CLI \u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u6743\u9650\u5E76\u8FD0\u884C ql-cli login\u3002":"Cannot read CLI config. Check file permissions and run ql-cli login.","\u8BF7\u8F93\u5165\u6709\u6548\u7684\u9762\u677F URL\u3002":"A valid panel URL is required.","\u8BF7\u4F7F\u7528\u4E0D\u542B\u51ED\u636E\u3001\u67E5\u8BE2\u53C2\u6570\u6216\u7247\u6BB5\u7684 HTTP(S) \u9762\u677F URL\u3002":"Use an HTTP(S) panel URL without credentials, query or fragment.","\u8FDC\u7A0B\u8BA4\u8BC1\u9700\u8981 HTTPS\uFF1BHTTP \u4EC5\u5141\u8BB8\u56DE\u73AF\u5730\u5740\u3002":"Remote authentication requires HTTPS; HTTP is allowed only for loopback.","\u975E\u4EA4\u4E92\u767B\u5F55\u9700\u8981 QL_CLIENT_ID \u548C QL_CLIENT_SECRET\u3002":"Non-interactive login requires QL_CLIENT_ID and QL_CLIENT_SECRET.","\u767B\u5F55\u5DF2\u53D6\u6D88\u3002":"Login cancelled.","\u51ED\u636E\u4E0D\u80FD\u4E3A\u7A7A\u3002":"Credentials cannot be empty.","\u8BA4\u8BC1\u54CD\u5E94\u65E0\u6548\u3002":"Invalid authentication response.","\u8BF7\u8F93\u5165\u652F\u6301\u8303\u56F4\u5185\u7684\u6574\u6570\u3002":"Expected an integer within the supported range.","\u672A\u77E5\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"Unknown command. Run %s --help.","\u9009\u9879\u672A\u77E5\u6216\u7F3A\u5C11\u9009\u9879\u503C\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"Unknown or missing option. Run %s --help.","\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"Duplicate option. Run %s --help.","\u53C2\u6570\u591A\u4F59\u6216\u7F3A\u5C11\u5FC5\u8981\u53C2\u6570\u3002":"Unexpected argument or missing required argument.","\u7F3A\u5C11 --%s\u3002":"Missing --%s.","--%s \u65E0\u6548\u3002":"Invalid --%s.","CLI \u64CD\u4F5C\u5DF2\u53D6\u6D88\u3002":"CLI operation cancelled.","CLI \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u914D\u7F6E\u548C\u6743\u9650\u3002":"CLI operation failed. Check local configuration and permissions.","\u4EFB\u52A1\u72B6\u6001\u4E0A\u62A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u9762\u677F\u3002\n":`Task lifecycle reporting failed; check the local panel.
27
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(s=>t.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}});var cn,$e=g(()=>{re();je();K();ge();ye();cn=new D});var Ne=g(()=>{"use strict";$e()});function h(o,e=1){throw new k(o,e)}var k,S=g(()=>{"use strict";k=class extends Error{constructor(t,n=1){super(t);this.exitCode=n;this.name="CliError"}exitCode}});var De,qe=g(()=>{"use strict";De={"\u9700\u8981\u53CC\u56E0\u7D20\u9A8C\u8BC1\uFF0C\u8BF7\u8C03\u7528 user two-factor-login\u3002":"Two-factor authentication required; use user two-factor-login.","QL_URL \u548C QL_ACCESS_TOKEN \u5FC5\u987B\u540C\u65F6\u63D0\u4F9B\u3002":"Provide QL_URL and QL_ACCESS_TOKEN together.","\u63A5\u53E3\u8FD4\u56DE JSON\uFF0C\u672A\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6\u3002":"The endpoint returned JSON; no download was saved.","\u5DF2\u9009\u62E9\u7684 CLI \u5B89\u88C5\u8DEF\u5F84\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"The selected CLI installation path must be absolute.","\u4FDD\u7559 CLI \u5165\u53E3\u4EC5\u652F\u6301\u5DF2\u786E\u8BA4\u7684 2.x \u5347\u7EA7\u8F7D\u8377\u3002":"Preserving CLI entries requires a verified 2.x upgrade payload.","\u65E0\u6CD5\u786E\u8BA4\u5DF2\u9009\u62E9\u7684 CLI \u547D\u4EE4\u52A0\u8F7D\u5668\uFF0C\u8BF7\u68C0\u67E5\u5B89\u88C5\u3002":"Cannot verify the selected CLI command loader. Check the installation.","\u5BB9\u5668\u5165\u53E3\u4EC5\u63A5\u53D7\u901A\u8FC7\u73AF\u5883\u53D8\u91CF\u914D\u7F6E\u3002":"Container entry accepts configuration through environment variables only.","\u4EFB\u52A1\u5EF6\u8FDF\u8FC7\u6EE4\u5DF2\u53D6\u6D88\u3002":"Task delay filtering cancelled.","\u4EFB\u52A1\u5EF6\u8FDF\u8FC7\u6EE4\u5931\u8D25\uFF08\u9000\u51FA\u7801 %s\uFF09\u3002":"Task delay filtering failed (exit %s).","\u76F4\u63A5\u8FD0\u884C\u7684\u540E\u7AEF\u5728\u542F\u52A8\u671F\u95F4\u9000\u51FA\uFF08%s\uFF09\u3002":"Direct backend exited during startup (%s).","\u65E0\u6CD5\u83B7\u53D6\u672C\u673A\u7CFB\u7EDF\u4EE4\u724C\uFF0C\u8BF7\u68C0\u67E5\u8FD0\u884C\u4E2D\u7684\u9762\u677F\u3002":"Cannot obtain a local system token. Check the running panel.","\u672C\u673A\u9762\u677F\u7AEF\u53E3\u65E0\u6548\u3002":"Invalid local panel port.","\u672C\u673A API \u62D2\u7EDD\u8BF7\u6C42\uFF08HTTP %s\uFF09\u3002":"Local API rejected request (HTTP %s).","\u672C\u673A API \u8BF7\u6C42\u5931\u8D25\uFF1B\u8BF7\u5148\u68C0\u67E5\u64CD\u4F5C\u7ED3\u679C\uFF0C\u4E0D\u8981\u76F4\u63A5\u91CD\u8BD5\u5199\u5165\u3002":"Local API request failed; do not retry a mutation without checking its result.","\u672C\u673A API \u62D2\u7EDD\u8BF7\u6C42\uFF0C\u8BF7\u68C0\u67E5\u9762\u677F\u65E5\u5FD7\u548C\u6743\u9650\u3002":"Local API rejected request. Check panel logs and permissions.","\u4EFB\u52A1\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002":"Invalid task list response.","\u4EFB\u52A1\u54CD\u5E94\u65E0\u6548\u3002":"Invalid task response.","\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002":"Invalid log response.","\u8BA2\u9605\u54CD\u5E94\u65E0\u6548\u3002":"Invalid subscription response.","\u8BA2\u9605\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002":"Invalid subscription list response.","\u8FD4\u56DE\u7684\u8BA2\u9605 ID \u4E0E\u8BF7\u6C42\u4E0D\u4E00\u81F4\u3002":"Unexpected subscription ID.","\u8BA2\u9605\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002":"Invalid subscription log response.","\u4E0D\u652F\u6301\u7684\u8BA2\u9605\u64CD\u4F5C\u3002":"Unsupported subscription operation.","\u8DEF\u5F84\u5FC5\u987B\u4F4D\u4E8E\u5176\u7BA1\u7406\u76EE\u5F55\u5185\u90E8\u3002":"Path must be a descendant of its managed directory.","\u4ED3\u5E93\u8DEF\u5F84\u65E0\u6548\u3002":"Invalid repository path.","\u5355\u6587\u4EF6\u8BA2\u9605\u9700\u8981 HTTP(S) \u5730\u5740\u3002":"Raw subscriptions require HTTP(S).","\u8BA2\u9605\u4EFB\u52A1\u540C\u6B65\u8FD4\u56DE\u4E86\u65E0\u6548\u4EFB\u52A1\u5217\u8868\u3002":"Invalid task list during subscription reconciliation.","\u65E0\u6CD5\u542F\u52A8\u5FC5\u8981\u7684\u53EF\u6267\u884C\u7A0B\u5E8F\uFF1A%s":"Cannot start required executable: %s","\u5B50\u8FDB\u7A0B\u8F93\u51FA\u5199\u5165\u5931\u8D25\u3002":"Child output sink failed.","\u5B50\u8FDB\u7A0B\u8F93\u51FA\u8D85\u8FC7\u914D\u7F6E\u7684\u6355\u83B7\u4E0A\u9650\u3002":"Child output exceeded the configured capture limit.","\u5FC5\u8981\u7684\u53EF\u6267\u884C\u7A0B\u5E8F\u5931\u8D25\uFF08%s\uFF0C\u9000\u51FA\u7801 %s\uFF09\u3002":"Required executable failed (%s, exit %s).","CLI \u5B89\u88C5\u8DEF\u5F84\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"CLI installation paths must be absolute.","CLI \u5165\u53E3\u5FC5\u987B\u4E3A\u666E\u901A\u6587\u4EF6\u3002":"CLI entry is not a regular file.","\u547D\u4EE4\u65E5\u5FD7\u76EE\u5F55\u65E0\u6548\u3002":"Invalid command log directory.","QlPort \u5FC5\u987B\u5728 1 \u5230 65535 \u4E4B\u95F4\u3002":"QlPort must be between 1 and 65535.","CLI \u8C03\u7528\u5931\u8D25\u3002":"CLI invocation failed.","\u4E0D\u652F\u6301\u6B64\u90E8\u7F72\u64CD\u4F5C\u7CFB\u7EDF\uFF1A%s\u3002":"Unsupported deployment OS: %s.","Python \u8FD4\u56DE\u4E86\u65E0\u6548\u7248\u672C\u3002":"Python returned an invalid version.","\u542F\u52A8\u9700\u8981\u4EE5 /data \u7ED3\u5C3E\u7684\u7EDD\u5BF9\u6570\u636E\u76EE\u5F55\u3002":"Startup requires an absolute data directory ending in /data.","\u5BB9\u5668\u5B89\u88C5\u76EE\u5F55\u548C\u6570\u636E\u76EE\u5F55\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Container root and data directory must be absolute paths.","\u5BB9\u5668\u76EE\u5F55\u4E0D\u53EF\u5199\u6216\u4E0D\u53EF\u8BBF\u95EE\uFF1A%s\uFF08UID %s\uFF09\u3002\u8BF7\u68C0\u67E5\u6302\u8F7D\u76EE\u5F55\u7684\u6240\u6709\u8005\u548C\u6743\u9650\u3002":"Container directory is not writable/searchable: %s (UID %s). Check the mounted directory ownership and permissions.","\u65E0\u6CD5\u521D\u59CB\u5316 %s\uFF1A%s":"Cannot initialize %s: %s","QL_SCHEDULER \u5FC5\u987B\u4E3A node \u6216 system\u3002":"QL_SCHEDULER must be node or system.","\u5BB9\u5668\u8C03\u5EA6\u5668\u610F\u5916\u9000\u51FA\uFF08%s\uFF09\u3002":"Container scheduler exited unexpectedly (%s).","Bot \u5B89\u88C5\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u7CFB\u7EDF\uFF1A%s\u3002":"Bot installation does not support OS: %s.","Bot \u4ED3\u5E93\u5305\u542B\u6307\u5411\u76EE\u5F55\u5916\u90E8\u7684\u7B26\u53F7\u94FE\u63A5\u3002":"Bot repository contains an external symlink.","Bot \u4ED3\u5E93\u5305\u542B\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B\u3002":"Bot repository contains an unsupported entry.","Bot \u6E90\u5FC5\u987B\u4E3A\u666E\u901A\u76EE\u5F55\u3002":"Bot source must be a regular directory.","Bot \u914D\u7F6E\u6A21\u677F\u5FC5\u987B\u4E3A\u666E\u901A\u6587\u4EF6\u3002":"Bot configuration template must be a regular file.","Bot \u8FDB\u7A0B\u7BA1\u7406\u9700\u8981 Linux\u3002":"Bot process management requires Linux.","Bot \u5B89\u88C5\u548C\u8FDB\u7A0B\u7BA1\u7406\u9700\u8981 Linux\u3002":"Bot installation and process management require Linux.","Bot \u5728\u542F\u52A8\u671F\u95F4\u9000\u51FA\uFF08%s\uFF09\u3002":"Bot exited during startup (%s).","\u8BA2\u9605\u8DEF\u5F84\u5305\u542B\u6362\u884C\u6216\u7A7A\u5B57\u7B26\uFF0C\u65E0\u6CD5\u5B89\u5168\u8FC7\u6EE4\u3002":"Subscription paths with line breaks cannot be filtered safely.","\u8BA2\u9605 POSIX \u6B63\u5219\u8868\u8FBE\u5F0F\u65E0\u6548\u3002":"Invalid subscription POSIX regular expression.","\u8BA2\u9605\u8FC7\u6EE4\u5931\u8D25\uFF08\u9000\u51FA\u7801 %s\uFF09\u3002":"Subscription filtering failed (exit %s).","\u8D26\u53F7\u9009\u62E9\u683C\u5F0F\u65E0\u6548\u3002":"Invalid account selection.","\u8D26\u53F7\u9009\u62E9\u8D85\u51FA\u73AF\u5883\u53D8\u91CF\u7684\u8D26\u53F7\u8303\u56F4\u3002":"Account selection is outside the environment variable range.","\u8D85\u65F6\u5FC5\u987B\u4E3A\u6B63\u65F6\u957F\uFF0C\u4F8B\u5982 30s \u6216 5m\u3002":"Timeout must be a positive duration, e.g. 30s or 5m.","\u8D85\u65F6\u65F6\u957F\u8D85\u51FA\u652F\u6301\u8303\u56F4\u3002":"Timeout is outside the supported range.","\u5FC5\u987B\u6307\u5B9A\u811A\u672C\u6216\u53EF\u6267\u884C\u7A0B\u5E8F\u3002":"A script or executable is required.","\u5FC5\u987B\u6307\u5B9A\u6709\u6548\u7684\u8D26\u53F7\u73AF\u5883\u53D8\u91CF\u540D\u3002":"A valid account environment variable is required.","cron \u73AF\u5883\u53D8\u91CF\u503C\u65E0\u6548\u3002":"Invalid cron environment value","cron \u5B89\u88C5\u8DEF\u5F84\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Cron installation paths must be absolute","\u62D2\u7EDD\u8986\u76D6\u4E0D\u5C5E\u4E8E\u6B64 CLI \u7684\u7528\u6237 crontab \u547D\u4EE4\u3002":"Refusing to replace an unrelated user crontab command","\u65E0\u6CD5\u5B89\u88C5\u6216\u8BFB\u53D6\u9762\u677F crontab\uFF0C\u8BF7\u68C0\u67E5\u73AF\u5883\u8DEF\u5F84\u548C\u7CFB\u7EDF cron \u5DE5\u5177\u3002":"Cannot install or read the selected panel crontab. Check its environment paths and system cron tool.","\u540E\u7AEF\u8FDB\u7A0B\u672A\u5728 5 \u79D2\u5185\u505C\u6B62\uFF0C\u5DF2\u53D6\u6D88\u91CD\u542F\u3002":"Direct backend did not stop within 5 seconds; restart cancelled.","\u65E0\u6CD5\u68C0\u67E5\u8FD0\u884C\u4E2D\u7684\u540E\u7AEF\u8FDB\u7A0B\u3002":"Cannot inspect running backend processes.","\u5347\u7EA7\u6587\u4EF6\u5305\u542B\u6307\u5411\u76EE\u5F55\u5916\u90E8\u7684\u7B26\u53F7\u94FE\u63A5\u3002":"Upgrade payload contains an external symlink.","\u5347\u7EA7\u6587\u4EF6\u5305\u542B\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B\u3002":"Upgrade payload contains unsupported filesystem entries.","\u5347\u7EA7\u5F52\u6863\u5305\u542B\u65E0\u6548\u8DEF\u5F84\u3002":"Upgrade archive contains an invalid path.","\u5347\u7EA7\u5F52\u6863\u5305\u542B\u7B26\u53F7\u94FE\u63A5\u3002":"Upgrade archive contains symlinks.","\u6682\u5B58\u5347\u7EA7\u6307\u9488\u65E0\u6548\u3002":"Invalid staged upgrade pointer.","\u6682\u5B58\u5347\u7EA7\u76EE\u5F55\u65E0\u6548\u3002":"Invalid staged upgrade directory.","\u6682\u5B58\u5347\u7EA7\u5C31\u7EEA\u8BB0\u5F55\u4E0E\u76EE\u5F55\u4E0D\u5339\u914D\u3002":"Staged upgrade readiness does not match its directory.","\u66FF\u6362\u6E90\u4E0E\u76EE\u6807\u76F8\u540C\u3002":"Replacement source equals destination.","\u66FF\u6362\u6E90\u4F4D\u4E8E\u76EE\u6807\u76EE\u5F55\u5185\u90E8\u3002":"Replacement source is inside its destination.","\u91CD\u8F7D\u5931\u8D25\uFF1B\u6587\u4EF6\u5DF2\u6062\u590D\uFF0C\u4F46\u539F\u670D\u52A1\u65E0\u6CD5\u91CD\u65B0\u542F\u52A8\u3002":"Reload failed; files restored, but the previous service could not restart.","\u6570\u636E\u91CD\u8F7D\u9700\u8981\u72EC\u7ACB\u7684\u6570\u636E\u76EE\u5F55\u3002":"Data reload requires a dedicated data directory.","\u6682\u5B58\u6570\u636E\u4E0E\u5DF2\u5B89\u88C5\u7684\u6570\u636E\u76EE\u5F55\u5FC5\u987B\u5206\u79BB\u3002":"Staged data must be separate from the installed data directory.","\u4E3B\u673A\u5F00\u673A\u6CE8\u518C\u9700\u8981 OpenRC \u6216 systemd\uFF1B\u4EC5\u5728\u5176\u4ED6\u7BA1\u7406\u5668\u8D1F\u8D23\u670D\u52A1\u65F6\u4F7F\u7528 --no-startup\u3002":"Host startup registration requires OpenRC or systemd. Use --no-startup only when another supervisor owns the services.","\u672C\u673A\u547D\u4EE4\u9700\u8981\u901A\u8FC7 --root \u6216 QL_DIR \u6307\u5B9A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Local commands require an absolute --root or QL_DIR.","\u9762\u677F\u5B89\u88C5\u76EE\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u662F\u76EE\u5F55\u3002":"Panel root does not exist.","\u7528\u6237\u914D\u7F6E\u52A0\u8F7D\u5DF2\u53D6\u6D88\u3002":"User configuration evaluation cancelled.","\u7528\u6237\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25\u3002":"User configuration evaluation failed.","\u7528\u6237\u914D\u7F6E\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u73AF\u5883\u6570\u636E\u3002":"User configuration returned invalid environment data.","\u7528\u6CD5\uFF1Aql-compat update [true|false]":"Usage: ql-compat update [true|false]","\u7528\u6CD5\uFF1Aql-compat reload [services|system|data]":"Usage: ql-compat reload [services|system|data]","\u672A\u77E5\u65E7\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C ql-compat --help\u3002":"Unknown legacy command. Run ql-compat --help.","\u547D\u4EE4\u5DF2\u4E2D\u65AD\u3002":"Command interrupted.","\u65E7\u547D\u4EE4\u9002\u914D\u5668\u6267\u884C\u5931\u8D25\u3002":"Legacy command adapter failed.","\u7528\u6CD5\uFF1Aql-subscription-worker repo|raw <url> [\u65E7\u8BA2\u9605\u53C2\u6570]":"Usage: ql-subscription-worker repo|raw <url> [legacy subscription arguments]","\u8BA2\u9605\u5E03\u5C14\u53C2\u6570\u65E0\u6548\uFF0C\u53EA\u80FD\u4F7F\u7528 true \u6216 false\u3002":"Invalid subscription boolean.","\u8BA2\u9605\u53C2\u6570\u8FC7\u591A\u3002":"Too many subscription arguments.","SUB_ID \u65E0\u6548\uFF0C\u5FC5\u987B\u4E3A\u6B63\u6574\u6570\u3002":"Invalid SUB_ID.","\u8BA2\u9605\u6267\u884C\u5668\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u65E5\u5FD7\u3002":"Subscription worker failed. Check local logs.","\u4EFB\u52A1\u6267\u884C\u5668\u9009\u9879\u65E0\u6548\u3002":"Invalid runner options.","\u672C\u673A\u4EFB\u52A1\u5728\u52A0\u8F7D\u914D\u7F6E\u65F6\u5DF2\u53D6\u6D88\u3002":"Local task execution cancelled during configuration.","\u672C\u673A\u4EFB\u52A1\u6267\u884C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u9762\u677F\u73AF\u5883\u548C\u4EFB\u52A1\u65E5\u5FD7\u3002":"Local task execution failed. Check the panel environment and task log.","\u5E94\u7528 ID":"Client ID",\u5E94\u7528\u5BC6\u94A5:"Client secret",\u8BA2\u9605:"subscription",\u4EFB\u52A1:"task",\u5E94\u7528\u51ED\u636E:"application credentials","\u5E94\u7528\u51ED\u636E\u548C %s \u6743\u9650":"application credentials and %s permission",\u672A\u77E5:"unknown"," \u6267\u884C\u7ED3\u679C\u53EF\u80FD\u672A\u77E5\uFF0C\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002":" Execution outcome may be unknown; check %s status before retrying.","API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08HTTP %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002%s":"API request rejected (HTTP %s). Check %s.%s","\u8BF7\u6C42\u5931\u8D25\u6216\u54CD\u5E94\u65E0\u6548\uFF0C\u6267\u884C\u7ED3\u679C\u672A\u77E5\u3002\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002":"Request failed or returned an invalid response; execution outcome is unknown. Check %s status before retrying.","\u8BF7\u6C42\u5931\u8D25\u6216\u8FD4\u56DE\u7684 JSON \u65E0\u6548\uFF0C\u8BF7\u68C0\u67E5\u5B9E\u4F8B URL\u3001\u7F51\u7EDC\u548C TLS \u8BC1\u4E66\u3002":"Request failed or returned invalid JSON. Check the instance URL, network and TLS certificate.","API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08code %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002":"API request rejected (code %s). Check %s.","CLI \u914D\u7F6E\u5FC5\u987B\u662F\u5F53\u524D\u7528\u6237\u62E5\u6709\u7684\u79C1\u6709\u666E\u901A\u6587\u4EF6\uFF080600\uFF09\u3002":"CLI config must be an owned private regular file (0600).","CLI \u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u8FD0\u884C ql login\u3002":"Invalid CLI config. Run ql login.","\u5C1A\u672A\u767B\u5F55\uFF0C\u8BF7\u8FD0\u884C ql login\u3002":"Not logged in. Run ql login.","\u65E0\u6CD5\u8BFB\u53D6 CLI \u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u6743\u9650\u5E76\u8FD0\u884C ql login\u3002":"Cannot read CLI config. Check file permissions and run ql login.","\u8BF7\u8F93\u5165\u6709\u6548\u7684\u9762\u677F URL\u3002":"A valid panel URL is required.","\u8BF7\u4F7F\u7528\u4E0D\u542B\u51ED\u636E\u3001\u67E5\u8BE2\u53C2\u6570\u6216\u7247\u6BB5\u7684 HTTP(S) \u9762\u677F URL\u3002":"Use an HTTP(S) panel URL without credentials, query or fragment.","\u8FDC\u7A0B\u8BA4\u8BC1\u9700\u8981 HTTPS\uFF1BHTTP \u4EC5\u5141\u8BB8\u56DE\u73AF\u5730\u5740\u3002":"Remote authentication requires HTTPS; HTTP is allowed only for loopback.","\u975E\u4EA4\u4E92\u767B\u5F55\u9700\u8981 QL_CLIENT_ID \u548C QL_CLIENT_SECRET\u3002":"Non-interactive login requires QL_CLIENT_ID and QL_CLIENT_SECRET.","\u767B\u5F55\u5DF2\u53D6\u6D88\u3002":"Login cancelled.","\u51ED\u636E\u4E0D\u80FD\u4E3A\u7A7A\u3002":"Credentials cannot be empty.","\u8BA4\u8BC1\u54CD\u5E94\u65E0\u6548\u3002":"Invalid authentication response.","\u8BF7\u8F93\u5165\u652F\u6301\u8303\u56F4\u5185\u7684\u6574\u6570\u3002":"Expected an integer within the supported range.","\u672A\u77E5\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"Unknown command. Run %s --help.","\u9009\u9879\u672A\u77E5\u6216\u7F3A\u5C11\u9009\u9879\u503C\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"Unknown or missing option. Run %s --help.","\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"Duplicate option. Run %s --help.","\u53C2\u6570\u591A\u4F59\u6216\u7F3A\u5C11\u5FC5\u8981\u53C2\u6570\u3002":"Unexpected argument or missing required argument.","\u7F3A\u5C11 --%s\u3002":"Missing --%s.","--%s \u65E0\u6548\u3002":"Invalid --%s.","CLI \u64CD\u4F5C\u5DF2\u53D6\u6D88\u3002":"CLI operation cancelled.","CLI \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u914D\u7F6E\u548C\u6743\u9650\u3002":"CLI operation failed. Check local configuration and permissions.","\u4EFB\u52A1\u72B6\u6001\u4E0A\u62A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u9762\u677F\u3002\n":`Task lifecycle reporting failed; check the local panel.
28
28
  `,"\u4EFB\u52A1\u7EDF\u8BA1\u4E0A\u62A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u9762\u677F\u3002\n":`Task statistics reporting failed; check the local panel.
29
29
  `,"\u547D\u4EE4\u72B6\u6001\u4E0A\u62A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u9762\u677F\u3002\n":`Command lifecycle reporting failed; check the local panel.
30
30
  `,"\u8BA2\u9605\u540C\u6B65\u5DF2\u5B8C\u6210\uFF0C\u4F46\u901A\u77E5\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u9762\u677F\u901A\u77E5\u8BBE\u7F6E\u3002\n":`Subscription synchronized, but notification delivery failed. Check panel notification settings.
@@ -95,15 +95,15 @@ Python3 dependencies installed
95
95
  `,"\u67E5\u8BE2\u6587\u4EF6 %s":"Checking file: %s","\u5220\u9664\u4E2D~":"Deleting...","\u6B63\u5728\u88AB %s \u4F7F\u7528\uFF0C\u8DF3\u8FC7~":"In use by %s, skipping...","\u67E5\u627E\u65E7\u65E5\u5FD7\u6587\u4EF6\u4E2D...\n":`Looking for old log files...
96
96
  `,"\u5220\u9664\u65E7\u65E5\u5FD7\u6267\u884C\u5B8C\u6BD5\n":`Old log cleanup complete
97
97
  `,"\u672A\u627E\u5230 qinglong \u6A21\u5757\uFF0C\u8BF7\u5148\u6267\u884C npm i -g @whyour/qinglong \u5B89\u88C5":"Module not found. Run: npm i -g @whyour/qinglong","\u8BF7\u5148\u624B\u52A8\u8BBE\u7F6E export QL_DIR=%s\uFF0C\u73AF\u5883\u53D8\u91CF\uFF0C\u5E76\u624B\u52A8\u6DFB\u52A0\u5230\u7CFB\u7EDF\u73AF\u5883\u53D8\u91CF\uFF0C\u7136\u540E\u518D\u6B21\u6267\u884C\u547D\u4EE4 qinglong \u542F\u52A8\u670D\u52A1":"Set env: export QL_DIR=%s, then run qinglong to start","\u8BF7\u5148\u624B\u52A8\u8BBE\u7F6E\u6570\u636E\u5B58\u50A8\u76EE\u5F55 export QL_DATA_DIR \u73AF\u5883\u53D8\u91CF\uFF0C\u76EE\u5F55\u5FC5\u987B\u4EE5\u659C\u6760\u5F00\u5934\u7684\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u5E76\u4E14\u4EE5 /data \u7ED3\u5C3E\uFF0C\u4F8B\u5982 /ql/data \u5E76\u624B\u52A8\u6DFB\u52A0\u5230\u7CFB\u7EDF\u73AF\u5883\u53D8\u91CF":"Set QL_DATA_DIR (absolute path ending with /data, e.g. /ql/data)","QL_DATA_DIR \u5FC5\u987B\u4EE5 /data \u7ED3\u5C3E\uFF0C\u4F8B\u5982 /ql/data\uFF0C\u5982\u679C\u6709\u5386\u53F2\u6570\u636E\uFF0C\u8BF7\u65B0\u5EFA data \u76EE\u5F55\uFF0C\u628A\u5386\u53F2\u6570\u636E\u653E\u5230 data \u76EE\u5F55\u4E2D":"QL_DATA_DIR must end with /data, e.g. /ql/data","\u6682\u4E0D\u652F\u6301\u6B64\u7CFB\u7EDF\u90E8\u7F72 %s":"Unsupported system for deployment: %s","\u547D\u4EE4\u8F93\u5165\u9519\u8BEF...\n":`Invalid command...
98
- `}});function m(o,e,...t){let n=o.QL_LANG==="en"?De[e]??e:e,s=0;return n.replace(/%%|%s/g,i=>i==="%%"?"%":String(t[s++]??""))}var A=g(()=>{"use strict";qe()});function q(o){return new D(o).helpOption(!1).addHelpCommand(!1).exitOverride().configureOutput({writeOut(){},writeErr(){}})}function W(o,e,t=!0){let n=new Set;for(let[s,i]of Object.entries(e)){let r=new R(`${i.short?`-${i.short}, `:""}--${s}${i.type==="string"?" <value>":""}`,i.description);r.negate=!1,i.default!==void 0&&r.default(i.default),o.addOption(r),o.on(`option:${r.name()}`,()=>{t&&n.has(s)&&h(m(process.env,"\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002","ql"),2),n.add(s)})}}function ee(o,e){let t=o.opts(),n={};for(let s of Object.keys(e)){let i=o.options.find(r=>r.long===`--${s}`);t[i.attributeName()]!==void 0&&(n[s]=t[i.attributeName()])}return n}function He(o,e,t=!1){for(let n=0;n<o.length;n++){let s=o[n];if(s==="--")break;if(!s.startsWith("-")||s==="-"){if(t)break;continue}let i=!1;if(s.startsWith("--"))s.includes("=")||(i=e[s.slice(2)]?.type==="string");else for(let r=1;r<s.length;r++){let a=Object.values(e).find(p=>p.short===s[r]);if(!a)break;if(a.type==="string"){i=r===s.length-1;break}}if(i){let r=o[++n];if(r===void 0||r.length>1&&r.startsWith("-"))throw new x(2,"commander.optionMissingArgument","Missing option value")}}}function Ge(o){return o instanceof x}var _e=g(()=>{"use strict";Ne();S();A()});function M(o,e=process.env){return e.QL_LANG!=="en"&&/^(GET|POST|PUT|DELETE) \/open\//.test(o)?`\u8FDC\u7A0B API\uFF1A${o}`:e.QL_LANG==="en"?o:de[o]??o}var de,It,Ve=g(()=>{"use strict";de={"Query object as JSON, @file or - for stdin":"\u67E5\u8BE2\u53C2\u6570 JSON\uFF1B\u652F\u6301 @\u6587\u4EF6\u6216 - \u4ECE stdin \u8BFB\u53D6","Request body as JSON, @file or - for stdin":"\u8BF7\u6C42\u4F53 JSON\uFF1B\u652F\u6301 @\u6587\u4EF6\u6216 - \u4ECE stdin \u8BFB\u53D6","Request timeout in seconds":"\u8BF7\u6C42\u8D85\u65F6\u79D2\u6570\uFF08\u9ED8\u8BA4 30\uFF0C\u6700\u591A 3600\uFF09","Local file to upload":"\u8981\u4E0A\u4F20\u7684\u672C\u673A\u6587\u4EF6","Save response to a new local file":"\u54CD\u5E94\u4FDD\u5B58\u5230\u65B0\u6587\u4EF6\uFF08\u4E0D\u8986\u76D6\u5DF2\u6709\u6587\u4EF6\uFF09","Resource name":"\u8D44\u6E90\u540D\u79F0","Command executed by the remote panel":"\u7531\u8FDC\u7A0B\u9762\u677F\u6267\u884C\u7684\u547D\u4EE4","Cron schedule":"\u5B9A\u65F6\u89C4\u5219","Comma-separated application permissions":"\u5E94\u7528\u6743\u9650\uFF0C\u7528\u9017\u53F7\u5206\u9694","Explicitly include application credentials in output":"\u663E\u5F0F\u8F93\u51FA\u5E94\u7528\u5BC6\u94A5\uFF08\u9ED8\u8BA4\u9690\u85CF\uFF09","Call a registered OpenAPI route":"\u8C03\u7528\u5DF2\u767B\u8BB0\u7684 OpenAPI \u8DEF\u7531","List supported OpenAPI routes and commands":"\u5217\u51FA\u652F\u6301\u7684 OpenAPI \u8DEF\u7531\u548C\u5BF9\u5E94\u547D\u4EE4","Subscription type":"\u8BA2\u9605\u7C7B\u578B\uFF1Apublic-repo/private-repo/file","Subscription url":"\u8BA2\u9605\u5730\u5740","Subscription alias":"\u8BA2\u9605\u522B\u540D","Subscription schedule":"\u8BA2\u9605\u5B9A\u65F6\u89C4\u5219","Subscription schedule-type":"\u8BA2\u9605\u5B9A\u65F6\u7C7B\u578B\uFF1Acrontab/interval","Subscription branch":"\u8BA2\u9605\u5206\u652F","Subscription whitelist":"\u8BA2\u9605\u5305\u542B\u89C4\u5219","Subscription blacklist":"\u8BA2\u9605\u6392\u9664\u89C4\u5219","Skip OS boot registration (for containers)":"\u8DF3\u8FC7\u7CFB\u7EDF\u5F00\u673A\u6CE8\u518C\uFF08\u7528\u4E8E\u5BB9\u5668\uFF09","Authenticate with a remote panel application":"\u4F7F\u7528\u8FDC\u7A0B\u9762\u677F\u5E94\u7528\u51ED\u636E\u767B\u5F55","Panel URL including optional base path":"\u9762\u677F\u5730\u5740\uFF0C\u53EF\u5305\u542B\u57FA\u7840\u8DEF\u5F84","Verify authentication and resource permission":"\u68C0\u67E5\u767B\u5F55\u72B6\u6001\u548C\u8D44\u6E90\u6743\u9650","Permission to check":"\u8981\u68C0\u67E5\u7684\u6743\u9650","Remove local credentials (does not revoke the server token)":"\u6E05\u9664\u672C\u673A\u51ED\u636E\uFF08\u4E0D\u4F1A\u64A4\u9500\u670D\u52A1\u7AEF\u4EE4\u724C\uFF09","List remote tasks":"\u5217\u51FA\u8FDC\u7A0B\u4EFB\u52A1","Search task name or command":"\u6309\u4EFB\u52A1\u540D\u79F0\u6216\u547D\u4EE4\u641C\u7D22","Page number":"\u9875\u7801","Page size":"\u6BCF\u9875\u6570\u91CF","Read the latest task log":"\u8BFB\u53D6\u6700\u65B0\u4EFB\u52A1\u65E5\u5FD7","Last N lines":"\u6700\u540E N \u884C","List panel subscriptions":"\u5217\u51FA\u9762\u677F\u8BA2\u9605","Search subscriptions":"\u641C\u7D22\u8BA2\u9605","Read latest subscription log":"\u8BFB\u53D6\u6700\u65B0\u8BA2\u9605\u65E5\u5FD7","Remove expired logs not referenced by a task":"\u5220\u9664\u8FC7\u671F\u4E14\u672A\u88AB\u4EFB\u52A1\u5F15\u7528\u7684\u65E5\u5FD7","Execute the user extra.sh hook":"\u6267\u884C\u7528\u6237\u7684 extra.sh \u94A9\u5B50","Restore missing configuration templates and runtime directories":"\u6062\u590D\u7F3A\u5931\u7684\u914D\u7F6E\u6A21\u677F\u548C\u8FD0\u884C\u76EE\u5F55","Install runtime dependencies, repair files, diagnose and reload services":"\u5B89\u88C5\u8FD0\u884C\u4F9D\u8D56\u3001\u4FEE\u590D\u6587\u4EF6\u3001\u8BCA\u65AD\u5E76\u91CD\u8F7D\u670D\u52A1","Install dependencies and start the optional local Telegram bot":"\u5B89\u88C5\u4F9D\u8D56\u5E76\u542F\u52A8\u53EF\u9009\u7684\u672C\u673A Telegram \u673A\u5668\u4EBA","Install runtime prerequisites and start nginx and panel services":"\u5B89\u88C5\u8FD0\u884C\u73AF\u5883\u5E76\u542F\u52A8 nginx \u548C\u9762\u677F\u670D\u52A1","Restart services without installing packages or starting optional hooks":"\u91CD\u542F\u670D\u52A1\uFF0C\u8DF3\u8FC7\u4F9D\u8D56\u5B89\u88C5\u548C\u53EF\u9009\u94A9\u5B50","Restart local services or apply staged system/data files":"\u91CD\u542F\u672C\u673A\u670D\u52A1\u6216\u5E94\u7528\u5DF2\u51C6\u5907\u7684\u7CFB\u7EDF\uFF0F\u6570\u636E\u6587\u4EF6","Reload target":"\u91CD\u8F7D\u76EE\u6807","Stage and apply a local panel upgrade":"\u51C6\u5907\u5E76\u5E94\u7528\u672C\u673A\u9762\u677F\u5347\u7EA7","Archive source":"\u5347\u7EA7\u5305\u6765\u6E90","Prepare upgrade without replacing files or restarting services":"\u4EC5\u51C6\u5907\u5347\u7EA7\u5305\uFF0C\u4E0D\u66FF\u6362\u6587\u4EF6\u6216\u91CD\u542F\u670D\u52A1","One JSON result on stdout; diagnostics on stderr":"\u6807\u51C6\u8F93\u51FA\u8FD4\u56DE\u4E00\u4E2A JSON \u7ED3\u679C\uFF0C\u8BCA\u65AD\u5199\u5165\u6807\u51C6\u9519\u8BEF","Show help":"\u663E\u793A\u5E2E\u52A9","Installed panel root (defaults to QL_DIR)":"\u5DF2\u5B89\u88C5\u9762\u677F\u7684\u6839\u76EE\u5F55\uFF08\u9ED8\u8BA4 QL_DIR\uFF09","Panel data directory (defaults to QL_DATA_DIR)":"\u9762\u677F\u6570\u636E\u76EE\u5F55\uFF08\u9ED8\u8BA4 QL_DATA_DIR\uFF09","Usage:":"\u7528\u6CD5\uFF1A","Options:":"\u9009\u9879\uFF1A","default:":"\u9ED8\u8BA4\uFF1A","Alias: login = auth login.":"\u522B\u540D\uFF1Alogin = auth login\u3002","Local operator commands require an installed panel.":"\u672C\u673A\u8FD0\u7EF4\u547D\u4EE4\u9700\u8981\u5DF2\u5B89\u88C5\u7684\u9762\u677F\u3002"},It={get:"\u67E5\u770B",run:"\u8FD0\u884C",stop:"\u505C\u6B62",enable:"\u542F\u7528",disable:"\u7981\u7528"};for(let[o,e]of Object.entries(It))de[`${o} a remote task by ID`]=`\u6309 ID ${e}\u8FDC\u7A0B\u4EFB\u52A1`,de[`${o} a panel subscription by ID`]=`\u6309 ID ${e}\u9762\u677F\u8BA2\u9605`;for(let[o,e]of Object.entries({resetlet:"\u6E05\u9664\u767B\u5F55\u9650\u5236",resettfa:"\u5173\u95ED\u53CC\u56E0\u7D20\u8BA4\u8BC1",resetpwd:"\u91CD\u7F6E\u5BC6\u7801",resetname:"\u91CD\u7F6E\u7528\u6237\u540D"}))de[`Local panel ${o}`]=`\u672C\u673A\u9762\u677F\uFF1A${e}`});function Fe(o,e,t){let{commands:n,surface:s}=o,i=e?[e]:n.filter(u=>(s==="local"?u.local:!u.local)&&(!t||u.name.startsWith(`${t} `))),r=u=>s==="local"?u.replace(/^local /,""):u,a=q(e?`ql ${r(e.name)}`:`ql${t?" "+t:""}`);if(a.description("QingLong 2.x CLI"),e)e.arguments&&a.arguments(e.arguments),a.description(M(e.summary));else for(let u of i){let l=q(r(u.name)).description(M(u.summary));u.arguments&&l.arguments(u.arguments),a.addCommand(l)}let p={...I,...o.options,...e?.options};return W(a,Object.fromEntries(Object.entries(p).map(([u,l])=>[u,{...l,description:M(l.description)}]))),a.helpInformation().replace(/^Usage:/m,M("Usage:")).replace(/^Options:/m,M("Options:")).replace(/^Commands:/m,process.env.QL_LANG==="en"?"Commands:":"\u547D\u4EE4\uFF1A")}var I,We=g(()=>{"use strict";Ve();_e();I={json:{type:"boolean",description:"One JSON result on stdout; diagnostics on stderr"},help:{type:"boolean",short:"h",description:"Show help"}}});function H(o,e=1,t=Number.MAX_SAFE_INTEGER){return(!/^\d+$/.test(o)||!Number.isSafeInteger(Number(o))||Number(o)<e||Number(o)>t)&&h(m(process.env,"\u8BF7\u8F93\u5165\u652F\u6301\u8303\u56F4\u5185\u7684\u6574\u6570\u3002"),2),Number(o)}function Me(o,e){let{commands:t,aliases:n,surface:s,options:i}=e,r="ql",a=[...o],p=0;for(;a[p]==="--json";)p++;a[p]&&Object.hasOwn(n,a[p])&&a.splice(p,1,...n[a[p]]),a[p]==="help"&&a.splice(p,1,"--help");let u=q("ql").enablePositionalOptions();u.action(()=>{}),W(u,I);let l,d,c={},_=[],w=new Map;for(let y of t.filter(C=>s==="local"?C.local:!C.local)){let[C,fe]=y.name.split(" ");if(!w.has(C)){let L=q(C).enablePositionalOptions();W(L,I),L.action(()=>{d=C,c=ee(L,I)}),u.addCommand(L),w.set(C,L)}let ke={...I,...y.local?i:{},...y.options},B=q(fe).argument("[arguments...]");W(B,ke),B.action(()=>{l=y,d=C,c=ee(B,ke),_=B.args;let L=ee(w.get(C),I);for(let J of["json","help"])L[J]&&c[J]&&h(m(process.env,"\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002",r),2),L[J]&&(c[J]=L[J])}),w.get(C).addCommand(B)}try{He(a,Object.assign({},I,...t.map(y=>y.options))),u.parse(a,{from:"user"})}catch(y){if(!Ge(y))throw y;let C=y.code,fe=C==="commander.unknownCommand"||C==="commander.excessArguments"&&!l;h(m(process.env,fe?"\u672A\u77E5\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"\u9009\u9879\u672A\u77E5\u6216\u7F3A\u5C11\u9009\u9879\u503C\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002",r),2)}let he=ee(u,I);for(let y of["json","help"])he[y]&&c[y]&&h(m(process.env,"\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002",r),2),he[y]&&(c[y]=he[y]);let Ot=!l,wt={...I,...l?.local?i:{},...l?.options},Q={name:l?.name??"help",positionals:_,values:c,json:c.json===!0};if(Ot||c.help)return{...Q,help:Fe(e,l,d)};(Q.positionals.length<(l?.minimum??0)||Q.positionals.length>(l?.maximum??0))&&h(m(process.env,"\u53C2\u6570\u591A\u4F59\u6216\u7F3A\u5C11\u5FC5\u8981\u53C2\u6570\u3002"),2);for(let[y,C]of Object.entries(wt))C.required&&!c[y]&&h(m(process.env,"\u7F3A\u5C11 --%s\u3002",y),2),C.choices&&!C.choices.includes(c[y])&&h(m(process.env,"--%s \u65E0\u6548\u3002",y),2),C.integer&&typeof c[y]=="string"&&H(c[y],C.integer.min,C.integer.max);return e.validate?.(Q),Q}var ce=g(()=>{"use strict";_e();S();A();We()});async function Xe(o,e){let t=(0,Ye.resolve)(e),n=await(0,pe.open)(t,"wx",384);try{if(!o.body)throw new Error("Missing response body");let s=n.createWriteStream();return await(0,ze.pipeline)(Ke.Readable.fromWeb(o.body),s),{code:200,data:{path:t,bytes:s.bytesWritten}}}catch(s){throw await(0,pe.unlink)(t).catch(()=>{}),s}finally{await n.close()}}var pe,ze,Ke,Ye,Ze=g(()=>{"use strict";pe=require("node:fs/promises"),ze=require("node:stream/promises"),Ke=require("node:stream"),Ye=require("node:path")});function O(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}var Ce=g(()=>{"use strict"});async function T(o,e,t={}){let{method:n="GET",body:s,authenticated:i=!0}=t,r=e.split(/[/?]/,1)[0],a=r==="subscriptions",p=r==="crons"||a?m(process.env,a?"\u8BA2\u9605":"\u4EFB\u52A1"):r,u=i?m(process.env,"\u5E94\u7528\u51ED\u636E\u548C %s \u6743\u9650",r):m(process.env,"\u5E94\u7528\u51ED\u636E"),l,d;try{if(l=await fetch(`${o.url}/open/${e}`,{method:n,redirect:"error",signal:AbortSignal.timeout(t.timeoutMs??3e4),headers:{...i?{Authorization:`Bearer ${o.token}`}:{},...s!==void 0&&!(s instanceof FormData)?{"Content-Type":"application/json"}:{}},body:s instanceof FormData?s:s!==void 0?JSON.stringify(s):void 0}),!l.ok){await l.body?.cancel();let c=n!=="GET"&&l.status>=500?m(process.env," \u6267\u884C\u7ED3\u679C\u53EF\u80FD\u672A\u77E5\uFF0C\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002",p):"";h(m(process.env,"API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08HTTP %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002%s",l.status,u,c),[401,403].includes(l.status)?3:1)}if(t.output&&(l.headers.get("content-disposition")?.startsWith("attachment")||!l.headers.get("content-type")?.includes("application/json")))return await Xe(l,t.output);if(t.text&&!l.headers.get("content-type")?.includes("application/json"))return{code:200,data:await l.text()};d=await l.json()}catch(c){if(c instanceof k)throw c;h(n!=="GET"?m(process.env,"\u8BF7\u6C42\u5931\u8D25\u6216\u54CD\u5E94\u65E0\u6548\uFF0C\u6267\u884C\u7ED3\u679C\u672A\u77E5\u3002\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002",p):m(process.env,"\u8BF7\u6C42\u5931\u8D25\u6216\u8FD4\u56DE\u7684 JSON \u65E0\u6548\uFF0C\u8BF7\u68C0\u67E5\u5B9E\u4F8B URL\u3001\u7F51\u7EDC\u548C TLS \u8BC1\u4E66\u3002"))}if(e.split("?")[0]==="user/login"&&O(d)&&d.code===420&&h(m(process.env,"\u9700\u8981\u53CC\u56E0\u7D20\u9A8C\u8BC1\uFF0C\u8BF7\u8C03\u7528 user two-factor-login\u3002"),3),!O(d)||d.code!==200){let c=O(d)&&typeof d.code=="number"?d.code:void 0;h(m(process.env,"API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08code %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002",c??m(process.env,"\u672A\u77E5"),u),c===401||c===403?3:1)}return t.output&&h(m(process.env,"\u63A5\u53E3\u8FD4\u56DE JSON\uFF0C\u672A\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6\u3002")),d}async function Oe(o){let e=new URLSearchParams({client_id:o.clientId,client_secret:o.clientSecret}),n=(await T(o,`auth/token?${e}`,{authenticated:!1})).data;return(!O(n)||typeof n.token!="string"||!n.token||typeof n.expiration!="number"||!Number.isFinite(n.expiration)||n.expiration<=Date.now()/1e3)&&h(m(process.env,"\u8BA4\u8BC1\u54CD\u5E94\u65E0\u6548\u3002")),{...o,token:n.token,expiration:n.expiration}}var te=g(()=>{"use strict";Ze();A();S();Ce();Ce()});function G(o){let e;try{e=new URL(o)}catch{h(m(process.env,"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u9762\u677F URL\u3002"),2)}return(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash)&&h(m(process.env,"\u8BF7\u4F7F\u7528\u4E0D\u542B\u51ED\u636E\u3001\u67E5\u8BE2\u53C2\u6570\u6216\u7247\u6BB5\u7684 HTTP(S) \u9762\u677F URL\u3002"),2),e.protocol==="http:"&&!["localhost","127.0.0.1","[::1]"].includes(e.hostname)&&h(m(process.env,"\u8FDC\u7A0B\u8BA4\u8BC1\u9700\u8981 HTTPS\uFF1BHTTP \u4EC5\u5141\u8BB8\u56DE\u73AF\u5730\u5740\u3002"),2),e.href.replace(/\/+$/,"")}var ue=g(()=>{"use strict";A();S()});function we(){return me.default.resolve(process.env.QL_CLI_CONFIG||me.default.join(et.default.homedir(),".config/qinglong/cli.json"))}function nt(){let o;try{o=E.default.openSync(we(),E.default.constants.O_RDONLY|E.default.constants.O_NOFOLLOW);let e=E.default.fstatSync(o);(!e.isFile()||e.mode&63||process.getuid&&e.uid!==process.getuid())&&h(m(process.env,"CLI \u914D\u7F6E\u5FC5\u987B\u662F\u5F53\u524D\u7528\u6237\u62E5\u6709\u7684\u79C1\u6709\u666E\u901A\u6587\u4EF6\uFF080600\uFF09\u3002"));let t=JSON.parse(E.default.readFileSync(o,"utf8"));(!t||typeof t!="object")&&h(m(process.env,"CLI \u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u8FD0\u884C ql-cli login\u3002"));let n=t;return(typeof n.url!="string"||typeof n.clientId!="string"||!n.clientId.trim()||typeof n.clientSecret!="string"||!n.clientSecret.trim())&&h(m(process.env,"CLI \u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u8FD0\u884C ql-cli login\u3002")),{url:G(n.url),clientId:n.clientId,clientSecret:n.clientSecret,token:typeof n.token=="string"?n.token:void 0,expiration:typeof n.expiration=="number"?n.expiration:void 0}}catch(e){if(e.code==="ENOENT"&&h(m(process.env,"\u5C1A\u672A\u767B\u5F55\uFF0C\u8BF7\u8FD0\u884C ql-cli login\u3002"),3),e instanceof k)throw e;return h(m(process.env,"\u65E0\u6CD5\u8BFB\u53D6 CLI \u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u6743\u9650\u5E76\u8FD0\u884C ql-cli login\u3002"))}finally{o!==void 0&&E.default.closeSync(o)}}function ve(o){let e=we();E.default.mkdirSync(me.default.dirname(e),{recursive:!0,mode:448});let t=`${e}.${(0,tt.randomUUID)()}.tmp`;try{E.default.writeFileSync(t,JSON.stringify(o)+`
98
+ `}});function m(o,e,...t){let n=o.QL_LANG==="en"?De[e]??e:e,s=0;return n.replace(/%%|%s/g,i=>i==="%%"?"%":String(t[s++]??""))}var A=g(()=>{"use strict";qe()});function q(o){return new D(o).helpOption(!1).addHelpCommand(!1).exitOverride().configureOutput({writeOut(){},writeErr(){}})}function W(o,e,t=!0){let n=new Set;for(let[s,i]of Object.entries(e)){let r=new R(`${i.short?`-${i.short}, `:""}--${s}${i.type==="string"?" <value>":""}`,i.description);r.negate=!1,i.default!==void 0&&r.default(i.default),o.addOption(r),o.on(`option:${r.name()}`,()=>{t&&n.has(s)&&h(m(process.env,"\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002","ql"),2),n.add(s)})}}function ee(o,e){let t=o.opts(),n={};for(let s of Object.keys(e)){let i=o.options.find(r=>r.long===`--${s}`);t[i.attributeName()]!==void 0&&(n[s]=t[i.attributeName()])}return n}function He(o,e,t=!1){for(let n=0;n<o.length;n++){let s=o[n];if(s==="--")break;if(!s.startsWith("-")||s==="-"){if(t)break;continue}let i=!1;if(s.startsWith("--"))s.includes("=")||(i=e[s.slice(2)]?.type==="string");else for(let r=1;r<s.length;r++){let a=Object.values(e).find(p=>p.short===s[r]);if(!a)break;if(a.type==="string"){i=r===s.length-1;break}}if(i){let r=o[++n];if(r===void 0||r.length>1&&r.startsWith("-"))throw new x(2,"commander.optionMissingArgument","Missing option value")}}}function Ge(o){return o instanceof x}var _e=g(()=>{"use strict";Ne();S();A()});function M(o,e=process.env){return e.QL_LANG!=="en"&&/^(GET|POST|PUT|DELETE) \/open\//.test(o)?`\u8FDC\u7A0B API\uFF1A${o}`:e.QL_LANG==="en"?o:de[o]??o}var de,It,Ve=g(()=>{"use strict";de={"Query object as JSON, @file or - for stdin":"\u67E5\u8BE2\u53C2\u6570 JSON\uFF1B\u652F\u6301 @\u6587\u4EF6\u6216 - \u4ECE stdin \u8BFB\u53D6","Request body as JSON, @file or - for stdin":"\u8BF7\u6C42\u4F53 JSON\uFF1B\u652F\u6301 @\u6587\u4EF6\u6216 - \u4ECE stdin \u8BFB\u53D6","Request timeout in seconds":"\u8BF7\u6C42\u8D85\u65F6\u79D2\u6570\uFF08\u9ED8\u8BA4 30\uFF0C\u6700\u591A 3600\uFF09","Local file to upload":"\u8981\u4E0A\u4F20\u7684\u672C\u673A\u6587\u4EF6","Save response to a new local file":"\u54CD\u5E94\u4FDD\u5B58\u5230\u65B0\u6587\u4EF6\uFF08\u4E0D\u8986\u76D6\u5DF2\u6709\u6587\u4EF6\uFF09","Resource name":"\u8D44\u6E90\u540D\u79F0","Command executed by the remote panel":"\u7531\u8FDC\u7A0B\u9762\u677F\u6267\u884C\u7684\u547D\u4EE4","Cron schedule":"\u5B9A\u65F6\u89C4\u5219","Comma-separated application permissions":"\u5E94\u7528\u6743\u9650\uFF0C\u7528\u9017\u53F7\u5206\u9694","Explicitly include application credentials in output":"\u663E\u5F0F\u8F93\u51FA\u5E94\u7528\u5BC6\u94A5\uFF08\u9ED8\u8BA4\u9690\u85CF\uFF09","Call a registered OpenAPI route":"\u8C03\u7528\u5DF2\u767B\u8BB0\u7684 OpenAPI \u8DEF\u7531","List supported OpenAPI routes and commands":"\u5217\u51FA\u652F\u6301\u7684 OpenAPI \u8DEF\u7531\u548C\u5BF9\u5E94\u547D\u4EE4","Subscription type":"\u8BA2\u9605\u7C7B\u578B\uFF1Apublic-repo/private-repo/file","Subscription url":"\u8BA2\u9605\u5730\u5740","Subscription alias":"\u8BA2\u9605\u522B\u540D","Subscription schedule":"\u8BA2\u9605\u5B9A\u65F6\u89C4\u5219","Subscription schedule-type":"\u8BA2\u9605\u5B9A\u65F6\u7C7B\u578B\uFF1Acrontab/interval","Subscription branch":"\u8BA2\u9605\u5206\u652F","Subscription whitelist":"\u8BA2\u9605\u5305\u542B\u89C4\u5219","Subscription blacklist":"\u8BA2\u9605\u6392\u9664\u89C4\u5219","Skip OS boot registration (for containers)":"\u8DF3\u8FC7\u7CFB\u7EDF\u5F00\u673A\u6CE8\u518C\uFF08\u7528\u4E8E\u5BB9\u5668\uFF09","Authenticate with a remote panel application":"\u4F7F\u7528\u8FDC\u7A0B\u9762\u677F\u5E94\u7528\u51ED\u636E\u767B\u5F55","Panel URL including optional base path":"\u9762\u677F\u5730\u5740\uFF0C\u53EF\u5305\u542B\u57FA\u7840\u8DEF\u5F84","Verify authentication and resource permission":"\u68C0\u67E5\u767B\u5F55\u72B6\u6001\u548C\u8D44\u6E90\u6743\u9650","Permission to check":"\u8981\u68C0\u67E5\u7684\u6743\u9650","Remove local credentials (does not revoke the server token)":"\u6E05\u9664\u672C\u673A\u51ED\u636E\uFF08\u4E0D\u4F1A\u64A4\u9500\u670D\u52A1\u7AEF\u4EE4\u724C\uFF09","List remote tasks":"\u5217\u51FA\u8FDC\u7A0B\u4EFB\u52A1","Search task name or command":"\u6309\u4EFB\u52A1\u540D\u79F0\u6216\u547D\u4EE4\u641C\u7D22","Page number":"\u9875\u7801","Page size":"\u6BCF\u9875\u6570\u91CF","Read the latest task log":"\u8BFB\u53D6\u6700\u65B0\u4EFB\u52A1\u65E5\u5FD7","Last N lines":"\u6700\u540E N \u884C","List panel subscriptions":"\u5217\u51FA\u9762\u677F\u8BA2\u9605","Search subscriptions":"\u641C\u7D22\u8BA2\u9605","Read latest subscription log":"\u8BFB\u53D6\u6700\u65B0\u8BA2\u9605\u65E5\u5FD7","Remove expired logs not referenced by a task":"\u5220\u9664\u8FC7\u671F\u4E14\u672A\u88AB\u4EFB\u52A1\u5F15\u7528\u7684\u65E5\u5FD7","Execute the user extra.sh hook":"\u6267\u884C\u7528\u6237\u7684 extra.sh \u94A9\u5B50","Restore missing configuration templates and runtime directories":"\u6062\u590D\u7F3A\u5931\u7684\u914D\u7F6E\u6A21\u677F\u548C\u8FD0\u884C\u76EE\u5F55","Install runtime dependencies, repair files, diagnose and reload services":"\u5B89\u88C5\u8FD0\u884C\u4F9D\u8D56\u3001\u4FEE\u590D\u6587\u4EF6\u3001\u8BCA\u65AD\u5E76\u91CD\u8F7D\u670D\u52A1","Install dependencies and start the optional local Telegram bot":"\u5B89\u88C5\u4F9D\u8D56\u5E76\u542F\u52A8\u53EF\u9009\u7684\u672C\u673A Telegram \u673A\u5668\u4EBA","Install runtime prerequisites and start nginx and panel services":"\u5B89\u88C5\u8FD0\u884C\u73AF\u5883\u5E76\u542F\u52A8 nginx \u548C\u9762\u677F\u670D\u52A1","Restart services without installing packages or starting optional hooks":"\u91CD\u542F\u670D\u52A1\uFF0C\u8DF3\u8FC7\u4F9D\u8D56\u5B89\u88C5\u548C\u53EF\u9009\u94A9\u5B50","Restart local services or apply staged system/data files":"\u91CD\u542F\u672C\u673A\u670D\u52A1\u6216\u5E94\u7528\u5DF2\u51C6\u5907\u7684\u7CFB\u7EDF\uFF0F\u6570\u636E\u6587\u4EF6","Reload target":"\u91CD\u8F7D\u76EE\u6807","Stage and apply a local panel upgrade":"\u51C6\u5907\u5E76\u5E94\u7528\u672C\u673A\u9762\u677F\u5347\u7EA7","Archive source":"\u5347\u7EA7\u5305\u6765\u6E90","Prepare upgrade without replacing files or restarting services":"\u4EC5\u51C6\u5907\u5347\u7EA7\u5305\uFF0C\u4E0D\u66FF\u6362\u6587\u4EF6\u6216\u91CD\u542F\u670D\u52A1","One JSON result on stdout; diagnostics on stderr":"\u6807\u51C6\u8F93\u51FA\u8FD4\u56DE\u4E00\u4E2A JSON \u7ED3\u679C\uFF0C\u8BCA\u65AD\u5199\u5165\u6807\u51C6\u9519\u8BEF","Show help":"\u663E\u793A\u5E2E\u52A9","Installed panel root (defaults to QL_DIR)":"\u5DF2\u5B89\u88C5\u9762\u677F\u7684\u6839\u76EE\u5F55\uFF08\u9ED8\u8BA4 QL_DIR\uFF09","Panel data directory (defaults to QL_DATA_DIR)":"\u9762\u677F\u6570\u636E\u76EE\u5F55\uFF08\u9ED8\u8BA4 QL_DATA_DIR\uFF09","Usage:":"\u7528\u6CD5\uFF1A","Options:":"\u9009\u9879\uFF1A","default:":"\u9ED8\u8BA4\uFF1A","Alias: login = auth login.":"\u522B\u540D\uFF1Alogin = auth login\u3002","Local operator commands require an installed panel.":"\u672C\u673A\u8FD0\u7EF4\u547D\u4EE4\u9700\u8981\u5DF2\u5B89\u88C5\u7684\u9762\u677F\u3002"},It={get:"\u67E5\u770B",run:"\u8FD0\u884C",stop:"\u505C\u6B62",enable:"\u542F\u7528",disable:"\u7981\u7528"};for(let[o,e]of Object.entries(It))de[`${o} a remote task by ID`]=`\u6309 ID ${e}\u8FDC\u7A0B\u4EFB\u52A1`,de[`${o} a panel subscription by ID`]=`\u6309 ID ${e}\u9762\u677F\u8BA2\u9605`;for(let[o,e]of Object.entries({resetlet:"\u6E05\u9664\u767B\u5F55\u9650\u5236",resettfa:"\u5173\u95ED\u53CC\u56E0\u7D20\u8BA4\u8BC1",resetpwd:"\u91CD\u7F6E\u5BC6\u7801",resetname:"\u91CD\u7F6E\u7528\u6237\u540D"}))de[`Local panel ${o}`]=`\u672C\u673A\u9762\u677F\uFF1A${e}`});function Fe(o,e,t){let{commands:n,surface:s}=o,i=e?[e]:n.filter(u=>(s==="local"?u.local:!u.local)&&(!t||u.name.startsWith(`${t} `))),r=u=>s==="local"?u.replace(/^local /,""):u,a=q(e?`ql ${r(e.name)}`:`ql${t?" "+t:""}`);if(a.description("QingLong 2.x CLI"),e)e.arguments&&a.arguments(e.arguments),a.description(M(e.summary));else for(let u of i){let l=q(r(u.name)).description(M(u.summary));u.arguments&&l.arguments(u.arguments),a.addCommand(l)}let p={...I,...o.options,...e?.options};return W(a,Object.fromEntries(Object.entries(p).map(([u,l])=>[u,{...l,description:M(l.description)}]))),a.helpInformation().replace(/^Usage:/m,M("Usage:")).replace(/^Options:/m,M("Options:")).replace(/^Commands:/m,process.env.QL_LANG==="en"?"Commands:":"\u547D\u4EE4\uFF1A")}var I,We=g(()=>{"use strict";Ve();_e();I={json:{type:"boolean",description:"One JSON result on stdout; diagnostics on stderr"},help:{type:"boolean",short:"h",description:"Show help"}}});function H(o,e=1,t=Number.MAX_SAFE_INTEGER){return(!/^\d+$/.test(o)||!Number.isSafeInteger(Number(o))||Number(o)<e||Number(o)>t)&&h(m(process.env,"\u8BF7\u8F93\u5165\u652F\u6301\u8303\u56F4\u5185\u7684\u6574\u6570\u3002"),2),Number(o)}function Me(o,e){let{commands:t,aliases:n,surface:s,options:i}=e,r="ql",a=[...o],p=0;for(;a[p]==="--json";)p++;a[p]&&Object.hasOwn(n,a[p])&&a.splice(p,1,...n[a[p]]),a[p]==="help"&&a.splice(p,1,"--help");let u=q("ql").enablePositionalOptions();u.action(()=>{}),W(u,I);let l,d,c={},_=[],w=new Map;for(let y of t.filter(C=>s==="local"?C.local:!C.local)){let[C,fe]=y.name.split(" ");if(!w.has(C)){let L=q(C).enablePositionalOptions();W(L,I),L.action(()=>{d=C,c=ee(L,I)}),u.addCommand(L),w.set(C,L)}let ke={...I,...y.local?i:{},...y.options},B=q(fe).argument("[arguments...]");W(B,ke),B.action(()=>{l=y,d=C,c=ee(B,ke),_=B.args;let L=ee(w.get(C),I);for(let J of["json","help"])L[J]&&c[J]&&h(m(process.env,"\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002",r),2),L[J]&&(c[J]=L[J])}),w.get(C).addCommand(B)}try{He(a,Object.assign({},I,...t.map(y=>y.options))),u.parse(a,{from:"user"})}catch(y){if(!Ge(y))throw y;let C=y.code,fe=C==="commander.unknownCommand"||C==="commander.excessArguments"&&!l;h(m(process.env,fe?"\u672A\u77E5\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002":"\u9009\u9879\u672A\u77E5\u6216\u7F3A\u5C11\u9009\u9879\u503C\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002",r),2)}let he=ee(u,I);for(let y of["json","help"])he[y]&&c[y]&&h(m(process.env,"\u9009\u9879\u91CD\u590D\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002",r),2),he[y]&&(c[y]=he[y]);let Ot=!l,wt={...I,...l?.local?i:{},...l?.options},Q={name:l?.name??"help",positionals:_,values:c,json:c.json===!0};if(Ot||c.help)return{...Q,help:Fe(e,l,d)};(Q.positionals.length<(l?.minimum??0)||Q.positionals.length>(l?.maximum??0))&&h(m(process.env,"\u53C2\u6570\u591A\u4F59\u6216\u7F3A\u5C11\u5FC5\u8981\u53C2\u6570\u3002"),2);for(let[y,C]of Object.entries(wt))C.required&&!c[y]&&h(m(process.env,"\u7F3A\u5C11 --%s\u3002",y),2),C.choices&&!C.choices.includes(c[y])&&h(m(process.env,"--%s \u65E0\u6548\u3002",y),2),C.integer&&typeof c[y]=="string"&&H(c[y],C.integer.min,C.integer.max);return e.validate?.(Q),Q}var ce=g(()=>{"use strict";_e();S();A();We()});async function Xe(o,e){let t=(0,Ye.resolve)(e),n=await(0,pe.open)(t,"wx",384);try{if(!o.body)throw new Error("Missing response body");let s=n.createWriteStream();return await(0,ze.pipeline)(Ke.Readable.fromWeb(o.body),s),{code:200,data:{path:t,bytes:s.bytesWritten}}}catch(s){throw await(0,pe.unlink)(t).catch(()=>{}),s}finally{await n.close()}}var pe,ze,Ke,Ye,Ze=g(()=>{"use strict";pe=require("node:fs/promises"),ze=require("node:stream/promises"),Ke=require("node:stream"),Ye=require("node:path")});function O(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}var Ce=g(()=>{"use strict"});async function T(o,e,t={}){let{method:n="GET",body:s,authenticated:i=!0}=t,r=e.split(/[/?]/,1)[0],a=r==="subscriptions",p=r==="crons"||a?m(process.env,a?"\u8BA2\u9605":"\u4EFB\u52A1"):r,u=i?m(process.env,"\u5E94\u7528\u51ED\u636E\u548C %s \u6743\u9650",r):m(process.env,"\u5E94\u7528\u51ED\u636E"),l,d;try{if(l=await fetch(`${o.url}/open/${e}`,{method:n,redirect:"error",signal:AbortSignal.timeout(t.timeoutMs??3e4),headers:{...i?{Authorization:`Bearer ${o.token}`}:{},...s!==void 0&&!(s instanceof FormData)?{"Content-Type":"application/json"}:{}},body:s instanceof FormData?s:s!==void 0?JSON.stringify(s):void 0}),!l.ok){await l.body?.cancel();let c=n!=="GET"&&l.status>=500?m(process.env," \u6267\u884C\u7ED3\u679C\u53EF\u80FD\u672A\u77E5\uFF0C\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002",p):"";h(m(process.env,"API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08HTTP %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002%s",l.status,u,c),[401,403].includes(l.status)?3:1)}if(t.output&&(l.headers.get("content-disposition")?.startsWith("attachment")||!l.headers.get("content-type")?.includes("application/json")))return await Xe(l,t.output);if(t.text&&!l.headers.get("content-type")?.includes("application/json"))return{code:200,data:await l.text()};d=await l.json()}catch(c){if(c instanceof k)throw c;h(n!=="GET"?m(process.env,"\u8BF7\u6C42\u5931\u8D25\u6216\u54CD\u5E94\u65E0\u6548\uFF0C\u6267\u884C\u7ED3\u679C\u672A\u77E5\u3002\u8BF7\u5148\u68C0\u67E5%s\u72B6\u6001\u518D\u8003\u8651\u91CD\u8BD5\u3002",p):m(process.env,"\u8BF7\u6C42\u5931\u8D25\u6216\u8FD4\u56DE\u7684 JSON \u65E0\u6548\uFF0C\u8BF7\u68C0\u67E5\u5B9E\u4F8B URL\u3001\u7F51\u7EDC\u548C TLS \u8BC1\u4E66\u3002"))}if(e.split("?")[0]==="user/login"&&O(d)&&d.code===420&&h(m(process.env,"\u9700\u8981\u53CC\u56E0\u7D20\u9A8C\u8BC1\uFF0C\u8BF7\u8C03\u7528 user two-factor-login\u3002"),3),!O(d)||d.code!==200){let c=O(d)&&typeof d.code=="number"?d.code:void 0;h(m(process.env,"API \u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF08code %s\uFF09\uFF0C\u8BF7\u68C0\u67E5%s\u3002",c??m(process.env,"\u672A\u77E5"),u),c===401||c===403?3:1)}return t.output&&h(m(process.env,"\u63A5\u53E3\u8FD4\u56DE JSON\uFF0C\u672A\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6\u3002")),d}async function Oe(o){let e=new URLSearchParams({client_id:o.clientId,client_secret:o.clientSecret}),n=(await T(o,`auth/token?${e}`,{authenticated:!1})).data;return(!O(n)||typeof n.token!="string"||!n.token||typeof n.expiration!="number"||!Number.isFinite(n.expiration)||n.expiration<=Date.now()/1e3)&&h(m(process.env,"\u8BA4\u8BC1\u54CD\u5E94\u65E0\u6548\u3002")),{...o,token:n.token,expiration:n.expiration}}var te=g(()=>{"use strict";Ze();A();S();Ce();Ce()});function G(o){let e;try{e=new URL(o)}catch{h(m(process.env,"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u9762\u677F URL\u3002"),2)}return(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash)&&h(m(process.env,"\u8BF7\u4F7F\u7528\u4E0D\u542B\u51ED\u636E\u3001\u67E5\u8BE2\u53C2\u6570\u6216\u7247\u6BB5\u7684 HTTP(S) \u9762\u677F URL\u3002"),2),e.protocol==="http:"&&!["localhost","127.0.0.1","[::1]"].includes(e.hostname)&&h(m(process.env,"\u8FDC\u7A0B\u8BA4\u8BC1\u9700\u8981 HTTPS\uFF1BHTTP \u4EC5\u5141\u8BB8\u56DE\u73AF\u5730\u5740\u3002"),2),e.href.replace(/\/+$/,"")}var ue=g(()=>{"use strict";A();S()});function we(){return me.default.resolve(process.env.QL_CLI_CONFIG||me.default.join(et.default.homedir(),".config/qinglong/cli.json"))}function nt(){let o;try{o=E.default.openSync(we(),E.default.constants.O_RDONLY|E.default.constants.O_NOFOLLOW);let e=E.default.fstatSync(o);(!e.isFile()||e.mode&63||process.getuid&&e.uid!==process.getuid())&&h(m(process.env,"CLI \u914D\u7F6E\u5FC5\u987B\u662F\u5F53\u524D\u7528\u6237\u62E5\u6709\u7684\u79C1\u6709\u666E\u901A\u6587\u4EF6\uFF080600\uFF09\u3002"));let t=JSON.parse(E.default.readFileSync(o,"utf8"));(!t||typeof t!="object")&&h(m(process.env,"CLI \u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u8FD0\u884C ql login\u3002"));let n=t;return(typeof n.url!="string"||typeof n.clientId!="string"||!n.clientId.trim()||typeof n.clientSecret!="string"||!n.clientSecret.trim())&&h(m(process.env,"CLI \u914D\u7F6E\u65E0\u6548\uFF0C\u8BF7\u8FD0\u884C ql login\u3002")),{url:G(n.url),clientId:n.clientId,clientSecret:n.clientSecret,token:typeof n.token=="string"?n.token:void 0,expiration:typeof n.expiration=="number"?n.expiration:void 0}}catch(e){if(e.code==="ENOENT"&&h(m(process.env,"\u5C1A\u672A\u767B\u5F55\uFF0C\u8BF7\u8FD0\u884C ql login\u3002"),3),e instanceof k)throw e;return h(m(process.env,"\u65E0\u6CD5\u8BFB\u53D6 CLI \u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u6743\u9650\u5E76\u8FD0\u884C ql login\u3002"))}finally{o!==void 0&&E.default.closeSync(o)}}function ve(o){let e=we();E.default.mkdirSync(me.default.dirname(e),{recursive:!0,mode:448});let t=`${e}.${(0,tt.randomUUID)()}.tmp`;try{E.default.writeFileSync(t,JSON.stringify(o)+`
99
99
  `,{mode:384,flag:"wx"}),E.default.renameSync(t,e)}finally{E.default.rmSync(t,{force:!0})}}function st(){E.default.rmSync(we(),{force:!0})}var E,me,et,tt,it=g(()=>{"use strict";A();E=U(require("node:fs")),me=U(require("node:path")),et=U(require("node:os")),tt=require("node:crypto");S();ue()});var at={};z(at,{auth:()=>Rt,promptCredential:()=>Te,session:()=>$});async function Te(o,e=!1){(!process.stdin.isTTY||!process.stderr.isTTY)&&h(m(process.env,"\u975E\u4EA4\u4E92\u767B\u5F55\u9700\u8981 QL_CLIENT_ID \u548C QL_CLIENT_SECRET\u3002"),2);let t=new rt.Writable({write(s,i,r){e||process.stderr.write(s),r()}}),n=ot.default.createInterface({input:process.stdin,output:t,terminal:!0});process.stderr.write(`${o}: `);try{return await new Promise((s,i)=>{let r=()=>i(new k(m(process.env,"\u767B\u5F55\u5DF2\u53D6\u6D88\u3002"),2));n.once("SIGINT",r),n.once("close",r),n.question("",s)})}finally{n.close(),t.end(),e&&process.stderr.write(`
100
100
  `)}}async function $(){if(process.env.QL_ACCESS_TOKEN||process.env.QL_URL)return(!process.env.QL_ACCESS_TOKEN||!process.env.QL_URL)&&h(m(process.env,"QL_URL \u548C QL_ACCESS_TOKEN \u5FC5\u987B\u540C\u65F6\u63D0\u4F9B\u3002"),2),{url:G(process.env.QL_URL),token:process.env.QL_ACCESS_TOKEN,clientId:"",clientSecret:"",expiration:0};let o=nt();if(o.token&&typeof o.expiration=="number"&&Number.isFinite(o.expiration)&&o.expiration>Date.now()/1e3+60)return{...o,token:o.token,expiration:o.expiration};let e=await Oe(o);return ve(e),e}async function Rt(o){if(o.kind==="logout")return st(),{code:200,data:{authenticated:!1,localOnly:!0}};if(o.kind==="login"){let n=G(o.url),s=process.env.QL_CLIENT_ID||await Te(m(process.env,"\u5E94\u7528 ID")),i=process.env.QL_CLIENT_SECRET||await Te(m(process.env,"\u5E94\u7528\u5BC6\u94A5"),!0);(!s.trim()||!i.trim())&&h(m(process.env,"\u51ED\u636E\u4E0D\u80FD\u4E3A\u7A7A\u3002"),2);let r=await Oe({url:n,clientId:s,clientSecret:i});return ve(r),{code:200,data:{authenticated:!0,url:n}}}let e=await $(),t=o.scope??"crons";return await T(e,{crons:"crons?page=1&size=1",configs:"configs/files",dashboard:"dashboard/overview"}[t]??t),{code:200,data:{authenticated:!0,url:e.url,expiration:e.expiration,scopeChecked:t}}}var ot,rt,ne=g(()=>{"use strict";A();ot=U(require("node:readline")),rt=require("node:stream");te();it();ue();S()});var pt={};z(pt,{openCommand:()=>jt});function b(o,e){return h(process.env.QL_LANG==="en"?e:o,2)}async function lt(o){if(typeof o!="string")return;let e=o;try{if(o==="-"){process.stdin.isTTY&&b("\u8BF7\u901A\u8FC7\u7BA1\u9053\u63D0\u4F9B JSON\u3002","Pipe JSON to stdin.");let t=[],n=0;for await(let s of process.stdin){let i=Buffer.from(s);if(n+=i.length,n>50*1024*1024)throw new Error("Too large");t.push(i)}e=Buffer.concat(t).toString("utf8")}else if(o.startsWith("@")){let t=o.slice(1),n=await(0,V.stat)(t);if(!n.isFile()||n.size>50*1024*1024)throw new Error("Invalid input");e=await(0,V.readFile)(t,"utf8")}return JSON.parse(e)}catch{return b("JSON \u8F93\u5165\u65E0\u6548\u6216\u6587\u4EF6\u65E0\u6CD5\u8BFB\u53D6\u3002","Invalid JSON input or unreadable file.")}}function Ut(o,e){let t=j.find(n=>n.method===o&&new RegExp("^"+n.path.replace(/:[A-Za-z]+/g,"[1-9][0-9]*")+"$").test(e));t||b("\u65B9\u6CD5\u6216\u8DEF\u5F84\u4E0D\u5C5E\u4E8E\u5F53\u524D\u652F\u6301\u7684 OpenAPI\u3002","Method/path is not a supported OpenAPI route.");for(let[n,s]of t.path.split("/").entries())s.startsWith(":")&&H(e.split("/")[n]);return t}function xe(o){return Array.isArray(o)?o.map(xe):O(o)?Object.fromEntries(Object.entries(o).filter(([e])=>!["client_secret","tokens"].includes(e)).map(([e,t])=>[e,xe(t)])):o}async function jt(o){if(o.name==="api routes")return{code:200,data:j};let e=o.name==="api request",t=o.values;t.data==="-"&&t.query==="-"&&b("--data \u548C --query \u4E0D\u80FD\u540C\u65F6\u8BFB\u53D6 stdin\u3002","--data and --query cannot both read stdin.");let n=e?o.positionals[1].replace(/^\/open\//,"").replace(/^\//,""):"";e&&(!/^[\w/-]+$/.test(n)||n.includes("//"))&&b("\u8BF7\u4F7F\u7528\u76F8\u5BF9 OpenAPI \u8DEF\u5F84\uFF0C\u67E5\u8BE2\u53C2\u6570\u901A\u8FC7 --query \u63D0\u4F9B\u3002","Use a relative OpenAPI path; pass query parameters with --query.");let s=e?Ut(o.positionals[0].toUpperCase(),n):j.find(d=>d.name===o.name);s||b("\u672A\u77E5 OpenAPI \u547D\u4EE4\u3002","Unknown OpenAPI command.");let i=await lt(t.data),r=await lt(t.query);if(r!==void 0&&!O(r)&&b("--query \u5FC5\u987B\u4E3A JSON \u5BF9\u8C61\u3002","--query must be a JSON object."),!e){n=s.path;for(let[c,_]of(s.params??[]).entries()){let w=H(o.positionals[c]);n=n.replace(`:${_}`,String(w)),s.body==="object-id"&&(i!==void 0&&!O(i)&&b("--data \u5FC5\u987B\u4E3A JSON \u5BF9\u8C61\u3002","--data must be a JSON object."),O(i)&&i.id!==void 0&&i.id!==w&&b("\u8BF7\u6C42\u4F53 ID \u4E0E\u547D\u4EE4 ID \u4E0D\u4E00\u81F4\u3002","Body ID differs from command ID."),i={...i,id:w})}s.body==="ids"&&(i=o.positionals.map(c=>H(c)));for(let c of["name","command","schedule","type","url","alias","schedule-type","branch","whitelist","blacklist","scopes"]){if(t[c]===void 0)continue;i!==void 0&&!O(i)&&b("--data \u5FC5\u987B\u4E3A JSON \u5BF9\u8C61\u3002","--data must be a JSON object.");let _=c.replace(/-/g,"_");O(i)&&Object.hasOwn(i,_)&&b("\u5B57\u6BB5\u4E0D\u80FD\u540C\u65F6\u901A\u8FC7 --data \u548C\u9009\u9879\u63D0\u4F9B\u3002","Do not provide a field in both --data and flags."),i={...i,[_]:c==="scopes"?String(t[c]).split(",").map(w=>w.trim()).filter(Boolean):t[c]}}({"task create":["command","schedule"],"task update":["command","schedule"],"subscription create":["type","url","alias","schedule_type"],"subscription update":["type","url","alias"]}[s.name]??[]).some(c=>!O(i)||typeof i[c]!="string"||!i[c])&&b("\u7F3A\u5C11\u5FC5\u9700\u5B57\u6BB5\uFF0C\u8BF7\u67E5\u770B\u547D\u4EE4\u5E2E\u52A9\u548C OpenAPI \u53C2\u8003\u3002","Missing required fields; see command help and OpenAPI reference.")}if(s.method==="GET"&&i!==void 0&&b("GET \u4E0D\u63A5\u53D7\u8BF7\u6C42\u4F53\u3002","GET does not accept a body."),s.body&&i===void 0&&!t.file&&b("\u6B64\u547D\u4EE4\u9700\u8981 --data \u6216\u5BF9\u5E94\u5B57\u6BB5\u9009\u9879\u3002","This command needs --data or field options."),t.file){s.upload||b("\u6B64\u63A5\u53E3\u4E0D\u652F\u6301\u6587\u4EF6\u4E0A\u4F20\u3002","This route does not accept uploads."),i!==void 0&&!O(i)&&b("\u4E0A\u4F20\u5B57\u6BB5\u5FC5\u987B\u4E3A JSON \u5BF9\u8C61\u3002","Upload fields must be a JSON object.");let d=new FormData;for(let[c,_]of Object.entries(i??{}))["string","number","boolean"].includes(typeof _)||b("\u4E0A\u4F20\u5B57\u6BB5\u5FC5\u987B\u4E3A\u6807\u91CF\u3002","Upload fields must be scalars."),d.append(c,String(_));try{let c=String(t.file);if(!(await(0,V.stat)(c)).isFile())throw new Error("Not a file");d.append(s.upload,await(0,dt.openAsBlob)(c),(0,ct.basename)(c))}catch{b("\u4E0A\u4F20\u6587\u4EF6\u65E0\u6CD5\u8BFB\u53D6\u3002","Cannot read upload file.")}i=d}else s.upload&&s.path!=="scripts"&&b("\u6B64\u63A5\u53E3\u9700\u8981 --file\u3002","This route requires --file.");if(s.download&&!t.output&&b("\u6B64\u63A5\u53E3\u9700\u8981 --output \u4FDD\u5B58\u54CD\u5E94\u3002","This route requires --output."),t.output){s.download||b("\u6B64\u63A5\u53E3\u4E0D\u652F\u6301 --output\u3002","This route does not support --output.");try{await(0,V.lstat)(String(t.output)),b("\u8F93\u51FA\u6587\u4EF6\u5DF2\u5B58\u5728\u3002","Output file already exists.")}catch(d){if(d.code!=="ENOENT")throw d}}let a=new URLSearchParams;for(let[d,c]of Object.entries(r??{}))for(let _ of Array.isArray(c)?c:[c])(_===null||!["string","number","boolean"].includes(typeof _))&&b("\u67E5\u8BE2\u53C2\u6570\u5FC5\u987B\u4E3A\u6807\u91CF\u6216\u6807\u91CF\u6570\u7EC4\u3002","Query values must be scalars or arrays of scalars."),a.append(d,String(_));a.size&&(n+=`?${a}`);let p=s.anonymous?{url:G(process.env.QL_URL||""),clientId:"",clientSecret:""}:await $(),u=await T(p,n,{method:s.method,body:i,authenticated:!s.anonymous,output:t.output,text:s.path==="system/log",timeoutMs:t.timeout?Number(t.timeout)*1e3:void 0}),l=s.path.startsWith("apps")&&!t["show-secrets"]?xe(u.data):u.data;return{...u,code:200,data:l??null}}var V,dt,ct,ut=g(()=>{"use strict";V=require("node:fs/promises"),dt=require("node:fs"),ct=require("node:path");ie();te();ne();ue();ce();S()});var ht={};z(ht,{task:()=>$t});function mt(o){return O(o)&&typeof o.id=="number"&&Number.isSafeInteger(o.id)&&o.id>0}async function $t(o){let e=await $();if(o.kind==="list"){let t=new URLSearchParams({page:String(o.page),size:String(o.size)});o.search!==void 0&&t.set("searchValue",o.search);let s=(await T(e,`crons?${t}`)).data;return(!O(s)||!Array.isArray(s.data)||!s.data.every(mt)||typeof s.total!="number"||!Number.isSafeInteger(s.total)||s.total<0)&&h(m(process.env,"\u4EFB\u52A1\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002")),{code:200,data:{data:s.data,total:s.total}}}if(o.kind==="get"){let t=await T(e,`crons/${o.id}`);return(!mt(t.data)||t.data.id!==o.id)&&h(m(process.env,"\u4EFB\u52A1\u54CD\u5E94\u65E0\u6548\u3002")),{code:200,data:t.data}}if(o.kind==="logs"){let t=await T(e,`crons/${o.id}/log`);(typeof t.data!="string"||t.logStatus!==void 0&&typeof t.logStatus!="string")&&h(m(process.env,"\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002"));let n=t.data.replace(/\r\n/g,`
101
101
  `).split(`
102
102
  `);return n.at(-1)===""&&n.pop(),{code:200,data:n.slice(-o.tail).join(`
103
- `),logStatus:t.logStatus,truncated:n.length>o.tail}}return await T(e,`crons/${o.kind}`,{method:"PUT",body:[o.id]}),{code:200,data:{taskId:o.id,action:o.kind,accepted:!0}}}var ft=g(()=>{"use strict";A();te();S();ne()});var yt={};z(yt,{subscription:()=>Dt});function gt(o){return(!O(o)||typeof o.id!="number"||!Number.isSafeInteger(o.id)||o.id<=0)&&h(m(process.env,"\u8BA2\u9605\u54CD\u5E94\u65E0\u6548\u3002")),Object.fromEntries(Nt.filter(e=>o[e]!==void 0).map(e=>[e,o[e]]))}async function Dt(o){let e=await $(),t=o.name.split(" ")[1];if(t==="list"){let s=typeof o.values.search=="string"?`?${new URLSearchParams({searchValue:o.values.search})}`:"",i=await T(e,`subscriptions${s}`);return Array.isArray(i.data)||h(m(process.env,"\u8BA2\u9605\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002")),{code:200,data:i.data.map(gt)}}let n=Number(o.positionals[0]);if(t==="get"){let s=gt((await T(e,`subscriptions/${n}`)).data);return s.id!==n&&h(m(process.env,"\u8FD4\u56DE\u7684\u8BA2\u9605 ID \u4E0E\u8BF7\u6C42\u4E0D\u4E00\u81F4\u3002")),{code:200,data:s}}if(t==="logs"){let s=await T(e,`subscriptions/${n}/log`);typeof s.data!="string"&&h(m(process.env,"\u8BA2\u9605\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002"));let i=s.data.replace(/\r\n/g,`
103
+ `),logStatus:t.logStatus,truncated:t.truncated===!0||n.length>o.tail}}return await T(e,`crons/${o.kind}`,{method:"PUT",body:[o.id]}),{code:200,data:{taskId:o.id,action:o.kind,accepted:!0}}}var ft=g(()=>{"use strict";A();te();S();ne()});var yt={};z(yt,{subscription:()=>Dt});function gt(o){return(!O(o)||typeof o.id!="number"||!Number.isSafeInteger(o.id)||o.id<=0)&&h(m(process.env,"\u8BA2\u9605\u54CD\u5E94\u65E0\u6548\u3002")),Object.fromEntries(Nt.filter(e=>o[e]!==void 0).map(e=>[e,o[e]]))}async function Dt(o){let e=await $(),t=o.name.split(" ")[1];if(t==="list"){let s=typeof o.values.search=="string"?`?${new URLSearchParams({searchValue:o.values.search})}`:"",i=await T(e,`subscriptions${s}`);return Array.isArray(i.data)||h(m(process.env,"\u8BA2\u9605\u5217\u8868\u54CD\u5E94\u65E0\u6548\u3002")),{code:200,data:i.data.map(gt)}}let n=Number(o.positionals[0]);if(t==="get"){let s=gt((await T(e,`subscriptions/${n}`)).data);return s.id!==n&&h(m(process.env,"\u8FD4\u56DE\u7684\u8BA2\u9605 ID \u4E0E\u8BF7\u6C42\u4E0D\u4E00\u81F4\u3002")),{code:200,data:s}}if(t==="logs"){let s=await T(e,`subscriptions/${n}/log`);typeof s.data!="string"&&h(m(process.env,"\u8BA2\u9605\u65E5\u5FD7\u54CD\u5E94\u65E0\u6548\u3002"));let i=s.data.replace(/\r\n/g,`
104
104
  `).split(`
105
105
  `);i.at(-1)===""&&i.pop();let r=Number(o.values.tail);return{code:200,data:i.slice(-r).join(`
106
- `),truncated:i.length>r}}return["run","stop","enable","disable"].includes(t)||h(m(process.env,"\u4E0D\u652F\u6301\u7684\u8BA2\u9605\u64CD\u4F5C\u3002"),2),await T(e,`subscriptions/${t}`,{method:"PUT",body:[n]}),{code:200,data:{subscriptionId:n,action:t,accepted:!0}}}var Nt,bt=g(()=>{"use strict";A();te();ne();S();Nt=["id","name","alias","type","status","is_disabled","schedule","schedule_type","interval_schedule","branch","whitelist","blacklist","dependences","extensions","autoAddCron","autoDelCron","createdAt","updatedAt"]});var qt={};z(qt,{remoteMain:()=>Ct});module.exports=Et(qt);ie();var v=o=>({type:"string",description:o}),F=j.filter(o=>!o.existing).map(o=>{let e={query:v("Query object as JSON, @file or - for stdin"),timeout:{...v("Request timeout in seconds"),integer:{min:1,max:3600}}};if(o.body&&o.body!=="ids"&&(e.data=v("Request body as JSON, @file or - for stdin")),o.upload&&(e.file=v("Local file to upload")),o.download&&(e.output={...v("Save response to a new local file"),required:!0}),["task create","task update","subscription create","subscription update","app create","app update"].includes(o.name))if(e.name=v("Resource name"),o.name.startsWith("task "))e.command=v("Command executed by the remote panel"),e.schedule=v("Cron schedule");else if(o.name.startsWith("subscription "))for(let n of["type","url","alias","schedule","schedule-type","branch","whitelist","blacklist"])e[n]=v(`Subscription ${n}`);else e.scopes=v("Comma-separated application permissions");o.name.startsWith("app ")&&(e["show-secrets"]={type:"boolean",description:"Explicitly include application credentials in output"});let t=o.params??[];return{name:o.name,summary:`${o.method} /open/${o.path}`,arguments:o.body==="ids"?"<id...>":t.map(n=>`<${n}>`).join(" "),minimum:o.body==="ids"?1:t.length,maximum:o.body==="ids"?1e4:t.length,options:e}});F.push({name:"api request",summary:"Call a registered OpenAPI route",arguments:"<method> <path>",minimum:2,maximum:2,options:{data:v("Request body as JSON, @file or - for stdin"),query:v("Query object as JSON, @file or - for stdin"),file:v("Local file to upload"),output:v("Save response to a new local file"),timeout:{...v("Request timeout in seconds"),integer:{min:1,max:3600}},"show-secrets":{type:"boolean",description:"Explicitly include application credentials in output"}}},{name:"api routes",summary:"List supported OpenAPI routes and commands"});ie();ce();var Qe="<id>",Lt=[...F,{name:"auth login",summary:"Authenticate with a remote panel application",options:{url:{type:"string",description:"Panel URL including optional base path",required:!0}}},{name:"auth status",summary:"Verify authentication and resource permission",options:{scope:{type:"string",description:"Permission to check",default:"crons",choices:[...new Set(j.map(o=>o.path.split("/")[0]))].filter(o=>!["auth","update"].includes(o))}}},{name:"auth logout",summary:"Remove local credentials (does not revoke the server token)"},{name:"task list",summary:"List remote tasks",options:{search:{type:"string",description:"Search task name or command"},page:{type:"string",short:"p",description:"Page number",default:"1",integer:{min:1,max:Number.MAX_SAFE_INTEGER}},size:{type:"string",description:"Page size",default:"50",integer:{min:1,max:200}}}},...["get","run","stop"].map(o=>({name:`task ${o}`,summary:`${o} a remote task by ID`,arguments:Qe,minimum:1,maximum:1})),{name:"task logs",summary:"Read the latest task log",arguments:Qe,minimum:1,maximum:1,options:{tail:{type:"string",short:"n",description:"Last N lines",default:"200",integer:{min:1,max:1e4}}}},{name:"subscription list",summary:"List panel subscriptions",options:{search:{type:"string",description:"Search subscriptions"}}},...["get","run","stop","enable","disable"].map(o=>({name:`subscription ${o}`,summary:`${o} a panel subscription by ID`,arguments:"<id>",minimum:1,maximum:1})),{name:"subscription logs",summary:"Read latest subscription log",arguments:"<id>",minimum:1,maximum:1,options:{tail:{type:"string",short:"n",description:"Last N lines",default:"200",integer:{min:1,max:1e4}}}}],Be={commands:Lt,aliases:{login:["auth","login"]},options:{},surface:"public",validate(o){!F.some(e=>e.name===o.name)&&/^(task|subscription) /.test(o.name)&&!o.name.endsWith(" list")&&H(o.positionals[0])}};ce();A();S();async function Je(o,e,t,n,s){let i=o.slice(0,o.indexOf("--")<0?void 0:o.indexOf("--")).includes("--json");try{let r=Me(o,e);if(i=r.json,r.help)return process.stdout.write((i?JSON.stringify({code:200,data:{help:r.help}}):r.help)+`
106
+ `),truncated:s.truncated===!0||i.length>r}}return["run","stop","enable","disable"].includes(t)||h(m(process.env,"\u4E0D\u652F\u6301\u7684\u8BA2\u9605\u64CD\u4F5C\u3002"),2),await T(e,`subscriptions/${t}`,{method:"PUT",body:[n]}),{code:200,data:{subscriptionId:n,action:t,accepted:!0}}}var Nt,bt=g(()=>{"use strict";A();te();ne();S();Nt=["id","name","alias","type","status","is_disabled","schedule","schedule_type","interval_schedule","branch","whitelist","blacklist","dependences","extensions","autoAddCron","autoDelCron","createdAt","updatedAt"]});var qt={};z(qt,{remoteMain:()=>Ct});module.exports=Et(qt);ie();var v=o=>({type:"string",description:o}),F=j.filter(o=>!o.existing).map(o=>{let e={query:v("Query object as JSON, @file or - for stdin"),timeout:{...v("Request timeout in seconds"),integer:{min:1,max:3600}}};if(o.body&&o.body!=="ids"&&(e.data=v("Request body as JSON, @file or - for stdin")),o.upload&&(e.file=v("Local file to upload")),o.download&&(e.output={...v("Save response to a new local file"),required:!0}),["task create","task update","subscription create","subscription update","app create","app update"].includes(o.name))if(e.name=v("Resource name"),o.name.startsWith("task "))e.command=v("Command executed by the remote panel"),e.schedule=v("Cron schedule");else if(o.name.startsWith("subscription "))for(let n of["type","url","alias","schedule","schedule-type","branch","whitelist","blacklist"])e[n]=v(`Subscription ${n}`);else e.scopes=v("Comma-separated application permissions");o.name.startsWith("app ")&&(e["show-secrets"]={type:"boolean",description:"Explicitly include application credentials in output"});let t=o.params??[];return{name:o.name,summary:`${o.method} /open/${o.path}`,arguments:o.body==="ids"?"<id...>":t.map(n=>`<${n}>`).join(" "),minimum:o.body==="ids"?1:t.length,maximum:o.body==="ids"?1e4:t.length,options:e}});F.push({name:"api request",summary:"Call a registered OpenAPI route",arguments:"<method> <path>",minimum:2,maximum:2,options:{data:v("Request body as JSON, @file or - for stdin"),query:v("Query object as JSON, @file or - for stdin"),file:v("Local file to upload"),output:v("Save response to a new local file"),timeout:{...v("Request timeout in seconds"),integer:{min:1,max:3600}},"show-secrets":{type:"boolean",description:"Explicitly include application credentials in output"}}},{name:"api routes",summary:"List supported OpenAPI routes and commands"});ie();ce();var Qe="<id>",Lt=[...F,{name:"auth login",summary:"Authenticate with a remote panel application",options:{url:{type:"string",description:"Panel URL including optional base path",required:!0}}},{name:"auth status",summary:"Verify authentication and resource permission",options:{scope:{type:"string",description:"Permission to check",default:"crons",choices:[...new Set(j.map(o=>o.path.split("/")[0]))].filter(o=>!["auth","update"].includes(o))}}},{name:"auth logout",summary:"Remove local credentials (does not revoke the server token)"},{name:"task list",summary:"List remote tasks",options:{search:{type:"string",description:"Search task name or command"},page:{type:"string",short:"p",description:"Page number",default:"1",integer:{min:1,max:Number.MAX_SAFE_INTEGER}},size:{type:"string",description:"Page size",default:"50",integer:{min:1,max:200}}}},...["get","run","stop"].map(o=>({name:`task ${o}`,summary:`${o} a remote task by ID`,arguments:Qe,minimum:1,maximum:1})),{name:"task logs",summary:"Read the latest task log",arguments:Qe,minimum:1,maximum:1,options:{tail:{type:"string",short:"n",description:"Last N lines",default:"200",integer:{min:1,max:1e4}}}},{name:"subscription list",summary:"List panel subscriptions",options:{search:{type:"string",description:"Search subscriptions"}}},...["get","run","stop","enable","disable"].map(o=>({name:`subscription ${o}`,summary:`${o} a panel subscription by ID`,arguments:"<id>",minimum:1,maximum:1})),{name:"subscription logs",summary:"Read latest subscription log",arguments:"<id>",minimum:1,maximum:1,options:{tail:{type:"string",short:"n",description:"Last N lines",default:"200",integer:{min:1,max:1e4}}}}],Be={commands:Lt,aliases:{login:["auth","login"]},options:{},surface:"public",validate(o){!F.some(e=>e.name===o.name)&&/^(task|subscription) /.test(o.name)&&!o.name.endsWith(" list")&&H(o.positionals[0])}};ce();A();S();async function Je(o,e,t,n,s){let i=o.slice(0,o.indexOf("--")<0?void 0:o.indexOf("--")).includes("--json");try{let r=Me(o,e);if(i=r.json,r.help)return process.stdout.write((i?JSON.stringify({code:200,data:{help:r.help}}):r.help)+`
107
107
  `),0;let a=await t(r);return n?.throwIfAborted(),process.stdout.write(JSON.stringify(a,null,i?0:2)+`
108
108
  `),0}catch(r){let a=n?.aborted,p=a?s?.()??1:r instanceof k?r.exitCode:1,u=a?m(process.env,"CLI \u64CD\u4F5C\u5DF2\u53D6\u6D88\u3002"):r instanceof k?r.message:m(process.env,"CLI \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u914D\u7F6E\u548C\u6743\u9650\u3002");return process.stderr.write((i?JSON.stringify({code:p,message:u}):u)+`
109
109
  `),p}}S();A();async function _t(o){let{name:e,values:t,positionals:n}=o;if(F.some(s=>s.name===e)){let{openCommand:s}=await Promise.resolve().then(()=>(ut(),pt));return s(o)}if(e.startsWith("auth ")){let{auth:s}=await Promise.resolve().then(()=>(ne(),at));return s(e==="auth login"?{kind:"login",url:t.url}:e==="auth logout"?{kind:"logout"}:{kind:"status",scope:t.scope})}if(e.startsWith("task ")){let{task:s}=await Promise.resolve().then(()=>(ft(),ht));if(e==="task list")return s({kind:"list",page:Number(t.page),size:Number(t.size),search:t.search});let i=Number(n[0]);return s(e==="task logs"?{kind:"logs",id:i,tail:Number(t.tail)}:{kind:e.slice(5),id:i})}if(e.startsWith("subscription ")){let{subscription:s}=await Promise.resolve().then(()=>(bt(),yt));return s(o)}return h(m(process.env,"\u672A\u77E5\u547D\u4EE4\uFF0C\u8BF7\u8FD0\u884C %s --help\u3002","ql"),2)}function Ct(o=process.argv.slice(2)){return Je(o,Be,_t)}require.main===module&&Ct().then(o=>{process.exitCode=o});0&&(module.exports={remoteMain});