@hlix/cli 1.0.2 → 1.0.3

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.md CHANGED
@@ -54,8 +54,8 @@ For CI, and for anything else that must not change underneath you, pin the
54
54
  version instead of floating to `latest`:
55
55
 
56
56
  ```bash
57
- npm install --global @hlix/cli@1.0.2
58
- npx @hlix/cli@1.0.2 status --json
57
+ npm install --global @hlix/cli@1.0.3
58
+ npx @hlix/cli@1.0.3 status --json
59
59
  ```
60
60
 
61
61
  ## Authenticate
@@ -137,6 +137,17 @@ hlix -p "fix the build" --yolo # …and let that turn change files
137
137
  hlix -p "what does this repo do" --json # JSONL events instead of prose
138
138
  ```
139
139
 
140
+ Local and Docker command tools wait up to 10 seconds, then return a tracked
141
+ process ID while the command continues. Long builds have no implicit command
142
+ deadline. The agent can inspect or stop the same process; required results reach
143
+ it before a headless or ACP task finishes. If a command remains running, the
144
+ agent receives a status check after a minute. Explicit command timeouts still
145
+ terminate the command. Cancellation stops the session's command processes;
146
+ headless task completion also cleans up its background servers. Full output is
147
+ stored under `.hlix/tool-output/`. The Hlix agent inside a hosted Cloudflare box
148
+ uses this local process path. The remote Coding Workspace CLI transport retains
149
+ its own command limits.
150
+
140
151
  Inside the shell:
141
152
 
142
153
  | | |
@@ -46,7 +46,7 @@ Run \`hlix status\` to see which one applied.
46
46
  Did you mean --${D.name}?`:N}function jo(j,O){let N=new Set;for(let H of j)N.add(H.name),N.add(H.name.split(" ")[0]);let L=null;for(let H of N){let M=Eo(O,H);if(M<=2&&(!L||M<L.distance))L={name:H,distance:M}}if(!L)return null;if(j.some((H)=>H.name===L.name))return L.name;let F=j.filter((H)=>H.name.startsWith(`${L.name} `)).sort((H,M)=>H.name.length-M.name.length)[0];return F?F.name:L.name}function Tn(j,O){for(let N of[...j].sort((L,F)=>F.name.length-L.name.length)){let L=N.name.split(" ");if(L.every((F,H)=>O[H]===F))return{command:N,rest:O.slice(L.length)}}return null}function rc(j,O,N){let L=nc(j,O,N);if(!/^Unknown option '/.test(N))return L;let F=L.replace(/\. To specify a positional argument[\s\S]*?after '--'[^\n]*/,"."),H=Tn(j,O.filter((M)=>!M.startsWith("-")));return H?`${F}
47
47
 
48
48
  ${H.command.usage}`:F}async function c(j,O,N){if(O.some((X)=>X==="--api-key"||X.startsWith("--api-key=")))return N.stderr("error: API keys are never accepted as command-line arguments. Run `hlix auth login` and use the hidden prompt.\n"),2;let L;try{L=tc({args:O,allowPositionals:!0,strict:!0,options:{json:{type:"boolean"},help:{type:"boolean"},version:{type:"boolean"},cwd:{type:"string"},"base-url":{type:"string"},workspace:{type:"string"},"dry-run":{type:"boolean"},"no-connect-origin":{type:"boolean"},attach:{type:"boolean"},print:{type:"boolean"},web:{type:"boolean"},"env-file":{type:"string"},include:{type:"string"},history:{type:"string"},name:{type:"string"},stack:{type:"string"},status:{type:"string"},project:{type:"string"},yes:{type:"boolean"},global:{type:"boolean"},org:{type:"boolean"},title:{type:"string"},description:{type:"string"},force:{type:"boolean"},runtime:{type:"string"},duty:{type:"string"},profile:{type:"string"},server:{type:"string"},"allow-stdio":{type:"boolean"},source:{type:"string"},format:{type:"string"},out:{type:"string"},"from-stdin":{type:"boolean"},once:{type:"boolean"}}})}catch(X){let se=O.includes("--json"),ce=rc(j,O,In(X));if(N.onFailure?.({code:"invalid_usage",message:ce,status:null}),se)N.stdout(re(Jt("cli",{code:"invalid_usage",message:ce,status:null})));else N.stderr(`${ce}
49
- `);return 2}let F=L.values.json===!0,H=L.positionals;if(L.values.version===!0){let{version:X}=await import("./package-0e5rh922.js");return N.stdout(`${X}
49
+ `);return 2}let F=L.values.json===!0,H=L.positionals;if(L.values.version===!0){let{version:X}=await import("./package-3dm3bbn9.js");return N.stdout(`${X}
50
50
  `),0}if(H.length===0||L.values.help===!0){let X=Tn(j,H);return N.stdout(X?`${X.command.usage}
51
51
  `:So(j)),H.length===0&&L.values.help!==!0?1:0}let M=Tn(j,H);if(!M){let X=H.join(" "),se=jo(j,X)??jo(j,H[0]),ce=se?`Unknown command: ${X}
52
52
  Did you mean \`hlix ${se}\`?`:`Unknown command: ${X}`;if(N.onFailure?.({code:"unknown_command",message:ce,status:null}),F)N.stdout(re(Jt(X,{code:"unknown_command",message:ce,status:null})));else N.stderr(`${ce}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{P,t,n,c,T,u}from"./index-prve49qz.js";import{createRequire as C}from"node:module";var d=C(import.meta.url);import{emitKeypressEvents as v}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),v(process.stdin),process.stdin.setRawMode(!0),process.stdin.resume(),new Promise((r,s)=>{let o="",a=()=>{process.stdin.off("keypress",i),process.stdin.setRawMode(!1),process.stdin.pause(),process.stderr.write(`
2
+ import{P,t,n,c,T,u}from"./index-4376x4k9.js";import{createRequire as C}from"node:module";var d=C(import.meta.url);import{emitKeypressEvents as v}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),v(process.stdin),process.stdin.setRawMode(!0),process.stdin.resume(),new Promise((r,s)=>{let o="",a=()=>{process.stdin.off("keypress",i),process.stdin.setRawMode(!1),process.stdin.pause(),process.stderr.write(`
3
3
  `)},i=(m,p)=>{if(p.ctrl&&p.name==="c"||p.name==="escape"){a(),s(Error("Login cancelled."));return}if(p.name==="return"||p.name==="enter"){a(),r(o);return}if(p.name==="backspace"){o=o.slice(0,-1);return}if(m&&!p.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 a=(await s.question(e)).trim(),i=Number(a);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 y(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
5
  Continue? [y/N] `)).trim().toLowerCase();return s==="y"||s==="yes"}finally{r.close()}}import{readFileSync as x,realpathSync as h}from"node:fs";import{fileURLToPath as b}from"node:url";function S(){if(d.main==d.module===!0)return!0;let e=process.argv[1];if(!e)return!1;try{return h(e)===h(b(import.meta.url))}catch{return!1}}var g={"-h":"--help","-v":"--version"};function E(e){return e.map((r)=>g[r]??r)}function I(e){let r=e[0];if(r===void 0)return!1;if(r in g||r==="--help"||r==="--version")return!0;if(r==="code"||r==="acp")return!1;return!r.startsWith("-")}function M(e,r){if(I(e))return r.cli(E(e));return r.code(e[0]==="code"?e.slice(1):e)}if(S()){if(process.stderr.isTTY)try{let r=T(process.env);if(r)process.stderr.write(`hlix: ${r}
6
- `)}catch{}let e=await M(process.argv.slice(2),{cli:(r)=>c(u,r,{stdout:(s)=>process.stdout.write(s),stderr:(s)=>process.stderr.write(s),env:process.env,readSecret:l,confirm:y,...process.stdin.isTTY&&process.stderr.isTTY?{promptChoice:w}:{},readStdin:async()=>x(0,"utf8")}),code:async(r)=>(await import("./main-r8tdnspm.js")).runHlixCode(r)});process.exit(e)}export{u as COMMANDS,P as JSON_SCHEMA_VERSION,n as clientFor,M as dispatch,t as findProjectBinding,I as isCliInvocation,E as normalizeCliArgv,c as runCli};
6
+ `)}catch{}let e=await M(process.argv.slice(2),{cli:(r)=>c(u,r,{stdout:(s)=>process.stdout.write(s),stderr:(s)=>process.stderr.write(s),env:process.env,readSecret:l,confirm:y,...process.stdin.isTTY&&process.stderr.isTTY?{promptChoice:w}:{},readStdin:async()=>x(0,"utf8")}),code:async(r)=>(await import("./main-7r18kc5y.js")).runHlixCode(r)});process.exit(e)}export{u as COMMANDS,P as JSON_SCHEMA_VERSION,n as clientFor,M as dispatch,t as findProjectBinding,I as isCliInvocation,E as normalizeCliArgv,c as runCli};