Lines 11-56javascript
12${n(` message: "Who are you?"`)}
13${n(` system: "You are a concise assistant."`)}
16${n(` ${this.cliName} pipeline validate workflow.yaml`)}
17${n(` ${this.cliName} pipeline run workflow.yaml --dry-run --output json`)}
18`)}printRootHelp(e){let t=[`██████╗ █████╗ ██╗██╗ ██╗ █████╗ ███╗ ██╗`,`██╔══██╗██╔══██╗██║██║ ██║██╔══██╗████╗ ██║`,`██████╔╝███████║██║██║ ██║███████║██╔██╗ ██║`,`██╔══██╗██╔══██║██║██║ ██║██╔══██║██║╚██╗██║`,`██████╔╝██║ ██║██║███████╗██║██║ ██║██║ ╚████║`,`╚═════╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝`];e.write(`
19`);for(let n of t)e.isTTY?e.write(`[38;2;97;92;237m${n}[0m\n`):e.write(n+`
20`);let n=t=>this.bold(t,e),r=t=>this.accent(t,e),i=t=>this.dim(t,e),a=this.buildResourceLines(r,i),o=this.buildGlobalFlagLines(r,i);e.write(`
21${n(`Usage:`)} ${this.cliName} <resource> <command> [flags]
30 ${i(`Add --help after any command to see its full list of options, defaults,`)}
31 ${i(`and usage examples. For example:`)} ${this.cliName} ${this.helpExample()} --help
32`)}printCommandHelp(e,t,n){let r=e=>this.bold(e,n),i=e=>this.accent(e,n),a=e=>this.dim(e,n),o=[this.cliName,...t].join(` `);if(n.write(`\n${e.description}\n`),n.write(
33`).map((e,t)=>t===0?e:` `.repeat(13)+e).join(`
34`)}function Be(e){return e.exitCode===i.AUTH?e.message===r||e.hint?.includes(`auth login --console`)?e.hint:[e.hint,``,`${P} auth login --api-key <your-key>`,`${P} auth status`,`Get API Key: ${Ie}`].filter(e=>e!==void 0).join(`
35`):e.hint}function Ve(e=process.argv.slice(2),t=process.env.DASHSCOPE_OUTPUT){for(let n=0;n<e.length;n++){let r=e[n];if(r===`--output`)return s(e[n+1]||t);if(r?.startsWith(`--output=`))return s(r.slice(9))}return s(t)}function He(e){let t=e.cause,r=t?.code,a=t?.message,o=[];return r&&o.push(r),a&&a!==r&&o.push(a),new n(`Network request failed: ${o.length>0?o.join(`: `):`unknown cause`}`,i.NETWORK,Ue(r),{cause:e})}function Ue(e){switch(e){case`ENOTFOUND`:case`EAI_AGAIN`:return`DNS resolution failed. Check DNS / network. ${Re()}`;case`ECONNREFUSED`:return`Connection refused. Check the target hos ...
36If you are behind a VPN or corporate proxy, route ${P} through it:\nexport HTTPS_PROXY=http://127.0.0.1:<proxy-port>`;case`ETIMEDOUT`:return`Connection timed out. Check your network. ${Re()}`;case`CERT_HAS_EXPIRED`:case`UNABLE_TO_VERIFY_LEAF_SIGNATURE`:case`DEPTH_ZERO_SELF_SIGNED_CERT`:return`TLS certificate error. Check system clock and CA bundle.`;default:return`Check network and proxy (HTTP_PROXY / HTTPS_PROXY). ${Re()}`}}function We(e){let t=e.code,r=`Check the file path and permissions.`;return t===`ENOENT`?r=`File or directory not found.`:t===`EACCES`||t===`EPERM`?r=`Permission denied — ...
37`):Ke(e),process.exit(e.exitCode)),e instanceof Error){if(e.name===`AbortError`||e.name===`TimeoutError`||e.message.includes(`timed out`))return I(new n(`Request timed out.`,i.TIMEOUT,`Try increasing --timeout (e.g. --timeout 60).
38${Re()}\nRun: ${P} auth status — to check credentials.`,{cause:e}),P);if(e instanceof TypeError&&e.message===`fetch failed`)return I(He(e),P);let t=e.code;if(typeof t==`string`&&t.startsWith(`E`))return I(We(e),P);process.stderr.write(`\n${F(`Error:`)}${e.message}\n`),Ge(e),process.env.DASHSCOPE_VERBOSE===`1`&&process.stderr.write(`${e.stack}\n`)}else process.stderr.write(`\n${F(`Error:`)}${String(e)}\n`);process.exit(i.GENERAL)}const qe=`https://registry.npmjs.org`,Je=`bailian-cli`,Ye=()=>M(u(),`update-state.json`),Xe=3e3;function L(e){let t=String(e).split(`+`)[0].split(`-`)[0].trim().split( ...
39`),process.stderr.write(` ${a}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${c}\n`),d?process.stderr.write(` ${a}⚡ Major update detected: ${e} → ${t}${c}\n`):process.stderr.write(` ${a}⚡ Significant update detected: ${e} → ${t}${c}\n`),process.stderr.write(` ${s}Auto-updating to keep your CLI up to date...${c}\n`),process.stderr.write(` ${a}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${c}\n\n`);let f=`npm install -g ${n}@latest`;try{let{execSync:r}=await import(`child_process`);r(f,{stdio:`inherit`});let l=null;try{let e=N(M(r(`npm root -g`,{encoding:`utf-8`}).trim(),n,`package.json`), ...
40`),process.stderr.write(` 1. Get your API Key: ${Ie}\n`),process.stderr.write(` 2. Login: ${e} auth login --api-key <your-key>\n\n`)}function yt(){let{dim:e,reset:t}=_t();process.stderr.write(`
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.mjsView on unpkg · L31 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.mjsView on unpkg · L31 HighChild Process
Package source references child process execution.
dist/index.mjsView on unpkg · L38 41🎯 Try these with your AI coding assistant:
43`),gt.forEach((n,r)=>{process.stderr.write(`${e}${r+1}${t} ${n}\n`)}),process.stderr.write(`
44`)}function bt(e,t){let n=new ve(e,t.binName),r=t.clientName??t.binName,i=t.npmPackage,o=t.version;try{Ne()}catch(e){I(e,t.binName)}Ce((e,t)=>{n.printHelp(e,t)}),process.on(`SIGINT`,()=>{process.stderr.write(`
46`),c(500).finally(()=>process.exit(130))}),process.stdout.on(`error`,e=>{if(e.code===`EPIPE`)process.exit(0);else throw e});async function s(){let e=process.argv.slice(2);e[0]===
47`)}function Ct(e){process.stdout.write(e+`
48`)}function wt(e,t,{gap:n=2}={}){let r=e.map((e,n)=>{let r=e.length;for(let e of t){let t=e[n]??``;t.length>r&&(r=t.length)}return r}),i=` `.repeat(n),a=e=>e.map((e,t)=>(e??``).padEnd(r[t])).join(i),o=[];o.push(a(e));for(let e of t)o.push(a(e));return o}const Tt=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function Et(e){let t=process.stderr.isTTY,n=0,r=null,i=e;return{start(){t&&(r=setInterval(()=>{process.stderr.write(`\r${Tt[n%Tt.length]} ${i}`),n++},80))},update(e){i=e},stop(e){r&&=(clearInterval(r),null),t&&(process.stderr.write(`\r\x1B[K`),e&&process.stderr.write(`${e}\n`))}}}function Dt(e, ...
49`)}}}function Ot(e){return e>=11904&&e<=40959||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072
50`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._lea ...
51 || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
52 || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a
53 || ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n
54 missingProperty: ${i},
56 deps: ${r}}`};let i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===
Long lines were clipped for display.