@hlix/cli 0.7.0 → 0.7.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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{R,t,n,a,d}from"./index-zbtvn1j2.js";import{createRequire as h}from"node:module";var u=h(import.meta.url);import{emitKeypressEvents as T}from"node:readline";import{createInterface as f}from"node:readline/promises";async function l(e){if(!process.stdin.isTTY||!process.stdin.setRawMode)throw Error("Interactive login requires a terminal. Set HLIX_API_KEY for CI.");return process.stderr.write(e),T(process.stdin),process.stdin.setRawMode(!0),process.stdin.resume(),new Promise((r,s)=>{let o="",p=()=>{process.stdin.off("keypress",i),process.stdin.setRawMode(!1),process.stdin.pause(),process.stderr.write(`
2
+ import{R,t,n,a,d}from"./index-e8mth7n3.js";import{createRequire as h}from"node:module";var u=h(import.meta.url);import{emitKeypressEvents as T}from"node:readline";import{createInterface as f}from"node:readline/promises";async function l(e){if(!process.stdin.isTTY||!process.stdin.setRawMode)throw Error("Interactive login requires a terminal. Set HLIX_API_KEY for CI.");return process.stderr.write(e),T(process.stdin),process.stdin.setRawMode(!0),process.stdin.resume(),new Promise((r,s)=>{let o="",p=()=>{process.stdin.off("keypress",i),process.stdin.setRawMode(!1),process.stdin.pause(),process.stderr.write(`
3
3
  `)},i=(m,c)=>{if(c.ctrl&&c.name==="c"||c.name==="escape"){p(),s(Error("Login cancelled."));return}if(c.name==="return"||c.name==="enter"){p(),r(o);return}if(c.name==="backspace"){o=o.slice(0,-1);return}if(m&&!c.ctrl)o+=m};process.stdin.on("keypress",i)})}async function w(e,r){if(!process.stdin.isTTY||!process.stderr.isTTY)throw Error("Interactive selection requires a terminal. Pass --workspace <id>.");let s=f({input:process.stdin,output:process.stderr});try{for(let o=0;o<3;o+=1){let p=(await s.question(e)).trim(),i=Number(p);if(Number.isInteger(i)&&i>=1&&i<=r)return i-1;process.stderr.write(`Enter a number between 1 and ${r}.
4
4
  `)}throw Error("No workspace selected.")}finally{s.close()}}async function g(e){if(!process.stdin.isTTY||!process.stderr.isTTY)throw Error("Interactive approval requires a terminal. Review with --dry-run, then pass --yes.");let r=f({input:process.stdin,output:process.stderr});try{let s=(await r.question(`${e}
5
- Continue? [y/N] `)).trim().toLowerCase();return s==="y"||s==="yes"}finally{r.close()}}import{readFileSync as b,realpathSync as y}from"node:fs";import{fileURLToPath as v}from"node:url";function x(){if(u.main==u.module===!0)return!0;let e=process.argv[1];if(!e)return!1;try{return y(e)===y(v(import.meta.url))}catch{return!1}}var C={"-h":"--help","-v":"--version"};function S(e){return e.map((r)=>C[r]??r)}function P(e){let r=e[0];if(r===void 0)return!1;if(r in C||r==="--help"||r==="--version")return!0;if(r==="code")return!1;return!r.startsWith("-")}function E(e,r){if(P(e))return r.cli(S(e));return r.code(e[0]==="code"?e.slice(1):e)}if(x()){let e=await E(process.argv.slice(2),{cli:(r)=>a(d,r,{stdout:(s)=>process.stdout.write(s),stderr:(s)=>process.stderr.write(s),env:process.env,readSecret:l,confirm:g,...process.stdin.isTTY&&process.stderr.isTTY?{promptChoice:w}:{},readStdin:async()=>b(0,"utf8")}),code:async(r)=>(await import("./main-bk7pvnwh.js")).runHlixCode(r)});process.exit(e)}export{d as COMMANDS,R as JSON_SCHEMA_VERSION,n as clientFor,E as dispatch,t as findProjectBinding,P as isCliInvocation,S as normalizeCliArgv,a as runCli};
5
+ Continue? [y/N] `)).trim().toLowerCase();return s==="y"||s==="yes"}finally{r.close()}}import{readFileSync as b,realpathSync as y}from"node:fs";import{fileURLToPath as v}from"node:url";function x(){if(u.main==u.module===!0)return!0;let e=process.argv[1];if(!e)return!1;try{return y(e)===y(v(import.meta.url))}catch{return!1}}var C={"-h":"--help","-v":"--version"};function S(e){return e.map((r)=>C[r]??r)}function P(e){let r=e[0];if(r===void 0)return!1;if(r in C||r==="--help"||r==="--version")return!0;if(r==="code")return!1;return!r.startsWith("-")}function E(e,r){if(P(e))return r.cli(S(e));return r.code(e[0]==="code"?e.slice(1):e)}if(x()){let e=await E(process.argv.slice(2),{cli:(r)=>a(d,r,{stdout:(s)=>process.stdout.write(s),stderr:(s)=>process.stderr.write(s),env:process.env,readSecret:l,confirm:g,...process.stdin.isTTY&&process.stderr.isTTY?{promptChoice:w}:{},readStdin:async()=>b(0,"utf8")}),code:async(r)=>(await import("./main-jffkgf23.js")).runHlixCode(r)});process.exit(e)}export{d as COMMANDS,R as JSON_SCHEMA_VERSION,n as clientFor,E as dispatch,t as findProjectBinding,P as isCliInvocation,S as normalizeCliArgv,a as runCli};