@hlix/cli 0.2.0 → 0.3.0

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.
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import{a as w,d as B,e as x,f as _,g as H,h as g,i as S,j as ae,k as y}from"./index-619ayaee.js";import{l as Ze}from"./index-vfqh17y6.js";import{resolve as es}from"node:path";import{parseArgs as ss}from"node:util";import{createMastraCode as ts}from"mastracode";import{hasHeadlessFlag as rs,parseHeadlessArgs as os,runMC as ns}from"mastracode/headless";import{MastraTUI as as}from"mastracode/tui";import{mkdirSync as ge,writeFileSync as fe}from"node:fs";import{join as A}from"node:path";import{createTool as de}from"@mastra/core/tools";import{z as d}from"zod";var k=(e)=>`hlix_${e.split(" ").join("_")}`,ue=d.object({args:d.array(d.string()).optional().describe("Positional arguments that follow the command name."),flags:d.record(d.string(),d.union([d.string(),d.boolean()])).optional().describe('Options without the leading dashes, e.g. { "yes": true, "name": "api" }.')}),me=d.object({exitCode:d.number(),stdout:d.string(),stderr:d.string()});function he(e,s,t){let r=e.name.split(" ").concat(s.args??[]);for(let[o,a]of Object.entries(s.flags??{})){if(a===!1)continue;if(r.push(`--${o}`),typeof a==="string")r.push(a)}if(!s.flags?.cwd)r.push("--cwd",t);if(e.supportsJson&&!s.flags?.json)r.push("--json");return r}async function pe(e,s,t,r=process.env){let o="",a="";return{exitCode:await _([e],he(e,s,t),{stdout:(i)=>{o+=i},stderr:(i)=>{a+=i},env:r}),stdout:o,stderr:a}}function R(e){let s={};for(let t of e.commands??y){let r=k(t.name);s[r]=de({id:r,description:`${t.summary}
3
+
4
+ ${t.usage}`,inputSchema:ue,outputSchema:me,execute:async(o)=>pe(t,o,e.cwd,e.env)})}return s}var xe=(e)=>`${e.split(" ").join("-")}.md`;function we(e){return["---",`description: ${e.summary}`,"---","",`Call the tool \`${k(e.name)}\` with the user's arguments: $ARGUMENTS.`,"Show the result.",""].join(`
5
+ `)}var be={"follow.md":["---","description: Watch a cloud task being coded, live","---","","Call the tool `hlix_tasks_follow` with `taskId` set to $ARGUMENTS. It streams the","coder's text and tool calls into this session. Summarise what it did.",""].join(`
6
+ `),"harness.md":["---","description: Show or change the harness — which coder does the work","---","","Call the tool `hlix_harness` with `harness` set to $ARGUMENTS when the user","named one, and with no argument when they did not. Show `message` verbatim.",""].join(`
7
+ `)};function O(e,s=y){let t=A(e,".hlix","commands");ge(t,{recursive:!0});let r=[],o=[...s.map((a)=>[xe(a.name),we(a)]),...Object.entries(be)];for(let[a,n]of o){let i=A(t,a);try{fe(i,n,{flag:"wx"}),r.push(i)}catch(u){if(u.code!=="EEXIST")throw u}}return r}import{execFileSync as ye}from"node:child_process";import{createACPTool as ke}from"@mastra/acp";import{createTool as ve}from"@mastra/core/tools";import{z as h}from"zod";var f={"claude-code":{harness:"claude-code",label:"Claude Code",command:"claude-agent-acp",args:[],authEnvVars:["ANTHROPIC_API_KEY"],install:"npm i -g @agentclientprotocol/claude-agent-acp"},codex:{harness:"codex",label:"Codex",command:"codex-acp",args:[],authEnvVars:["OPENAI_API_KEY"],env:{NO_BROWSER:"1"},install:"npm i -g @agentclientprotocol/codex-acp"},"cursor-agent":{harness:"cursor-agent",label:"Cursor Agent",command:"cursor-agent",args:["acp"],authEnvVars:["CURSOR_API_KEY"],install:"curl https://cursor.com/install -fsS | bash"}};function N(e){if(e.flag)return{harness:Se(e.flag,"--harness"),source:"flag"};if(e.configured)return{harness:e.configured,source:e.configSource??"project"};return{harness:S,source:"default"}}function Se(e,s){if(g.includes(e))return e;throw Error(`${s} must be one of ${g.join(", ")}; got "${e}".`)}var v="hlix_tasks_follow",Ce=(e)=>`hlix_coder_${e.split("-").join("_")}`;function E(e,s){let t=s.source==="default"?"":` (${s.source==="flag"?"--harness":s.source})`;return`${e} · harness: ${s.harness}${t}`}function F(e,s=3000){try{return ye("which",[e],{timeout:s,stdio:"ignore"}),!0}catch{return!1}}var C=(e)=>`harness ${e.harness} needs \`${e.command}\` on PATH. Install it with: ${e.install}`;function He(e){let s=e.options??[],t=s.find((r)=>r.kind==="allow_once")??s.find((r)=>r.kind==="reject_once");if(!t)return{outcome:{outcome:"cancelled"}};return{outcome:{outcome:"selected",optionId:t.optionId}}}var T=["view","search_content","find_files","file_stat","lsp_inspect"],M=["ask_user","task_write","task_update","task_complete","task_check"],je=(e)=>[`harness ${e} runs in the project's Coding Workspace, not on this machine.`,"This session can follow and stream that work, but cannot start it:","which coder the platform uses comes from the project's harness preference,","and this CLI has no command that creates a task."].join(" "),W=(e)=>[e==="unknown"?"This project's harness could not be read from the server. Do NOT guess which coder it runs — say so, and offer to check with the `hlix_harness` tool.":`This project's harness is ${e}: the platform runs ${e} for the coding work it executes, in the project's Coding Workspace.`,"Change it with the `hlix_harness` tool, which writes the project's setting.","","To do coding work here, dispatch it and then watch it:","1. `hlix_cycles_create` with the project id, a title and a description. That"," is what STARTS work — it enters the project's loop, which plans the cycle,"," creates its tasks and starts the coder. It returns no cycle id.","2. `hlix_tasks_list` with that project to find the tasks planning produced.",`3. \`${v}\` with a task id, which streams that coder's own text and`," tool calls into this session live. Report what it did.","","`hlix_tasks_create` only adds a board row; it does not start anything, and","there is no way to start a single task. Never claim otherwise."].join(`
8
+ `),Ie=(e,s)=>[`The user chose the ${e.label} harness. Do not edit files or run commands`,`yourself. Hand the whole task to \`${s}\` as one natural-language brief,`,`then report what it did. ${e.label} reads and writes the same working`,"directory you are in.","",`It authenticates from ${e.authEnvVars.join(" or ")} in this shell's`,"environment. If it reports a credential problem, say so — do not retry."].join(`
9
+ `);function L(e){if(e.sandbox==="cloud"||e.active==="hlix")return[];let s=new Set(e.unavailable??[]),t=e.model?{defaultModelId:e.model}:{},r=[{id:"hlix",name:"Hlix",description:"The hlix agent codes here, with the full toolset.",...t}];for(let o of Object.values(f)){let a=e.active===o.harness,n=Ce(o.harness);r.push({id:o.harness,name:o.label,description:`${o.label} runs on this machine over ACP and edits ${e.cwd}.`,instructions:Ie(o,n),availableTools:s.has(o.harness)?[...T,...M,v]:[n,...T,...M,v],...s.has(o.harness)?{}:{additionalTools:{[n]:ke({id:n,description:`Run a coding task with ${o.label}. Give it one natural-language brief; it reads and writes the working directory and returns its final output.`,command:o.command,args:o.args,cwd:e.cwd,...o.env?{env:o.env}:{},...e.workspace?{workspace:e.workspace}:{},onPermissionRequest:async(i)=>He(i)})}},...t,...a?{metadata:{default:!0}}:{}})}return r}function Pe(e){let s=[...e.available],t=(o,a="none")=>({harness:e.current,available:s,action:a,message:o});if(!e.requested)return t(`harness: ${e.current}. Available here: ${s.join(", ")}.`);if(!g.includes(e.requested))return t(`/harness must name one of ${g.join(", ")}; got "${e.requested}".`);let r=e.requested;if(e.sandbox==="cloud"){let o=`${e.sandboxLine} · harness: ${r} (project preference)`;return{harness:r,available:s,action:"preference",message:r==="hlix"?o:`${o}. ${je(r)}`}}if(!s.includes(r))return t(C(f[r]));if(!e.modesBuilt)return t(`This session runs the hlix coder, so there is no ${r} mode to switch to. Restart with \`hlix --harness ${r}\`, or make it the default with \`hlix config set harness ${r}\`.`,"restart");return{harness:r,available:s,action:"mode",message:`${e.sandboxLine} · harness: ${r}`}}function D(e){return ve({id:"hlix_harness",description:"Show or change the harness — which coder does the work. In a local or docker sandbox it switches this session's coder; in a cloud sandbox it writes the project's harness preference, which is what the platform runs. With no argument it reports the current harness.",inputSchema:h.object({harness:h.string().optional().describe(`One of ${g.join(", ")}. Omit to report the current one.`)}),outputSchema:h.object({harness:h.string(),available:h.array(h.string()),message:h.string()}),execute:async(s)=>{let t=e.session(),r=Pe({...s.harness?{requested:s.harness}:{},current:t?.mode.get()??S,available:e.available,sandbox:e.sandbox,sandboxLine:e.sandboxLine,modesBuilt:e.modesBuilt}),o={harness:r.harness,available:r.available,message:r.message};if(r.action==="mode"&&t)return await t.mode.switch({modeId:r.harness}),o;if(r.action==="preference"){if(!e.setProjectHarness)return{...o,message:"This folder is not bound to a hlix project, so there is no project preference to write. Run `hlix init` or pass --project <id>."};await e.setProjectHarness(r.harness)}return o}})}import{createTool as _e}from"@mastra/core/tools";import{writeToolProgress as Re}from"mastracode/plugin";import{z as m}from"zod";function Ae(e){switch(e.type){case"on_chat_model_stream":return e.delta?{event:"text",text:e.delta}:null;case"reasoning":return e.delta?{event:"text",text:e.delta}:null;case"on_tool_start":return{event:"tool_start",toolName:e.name,args:e.input};case"on_tool_end":return{event:"tool_end",toolName:e.name,result:e.output,isError:$e(e.output)};case"error":return{event:"finish",isError:!0,result:e.message};case"done":return{event:"finish",isError:!1};default:return null}}function $e(e){return typeof e==="object"&&e!==null&&e.status==="failed"}async function Oe(e,s){let t=[],r=[],o="streamed",a="The coder's turn ended.";for await(let n of e){if(n.type==="idle"){o="idle",a="Nothing is being coded right now. The task is not in build or test.";break}if(n.type==="error")o="error",a=n.message;if(n.type==="on_chat_model_stream")t.push(n.delta);if(n.type==="on_tool_start")r.push(n.name);let i=Ae(n);if(i)await s(i)}return{status:o,text:t.join(""),tools:r,message:a}}function U(e){return _e({id:"hlix_tasks_follow",description:"Watch a hlix task being coded in the cloud, live. Streams the coder's text and tool calls into this session as they happen, and returns what it did. Use it after a task starts building.",inputSchema:m.object({taskId:m.string().describe("The task to follow.")}),outputSchema:m.object({status:m.enum(["streamed","idle","error","unassigned"]),text:m.string(),tools:m.array(m.string()),message:m.string()}),execute:async(s,t)=>{let r=x(e.env??process.env,{cwd:e.cwd,flags:{}}),o=await r.tasks.get(s.taskId);if(!o.agentId)return{status:"unassigned",text:"",tools:[],message:"No agent has picked this task up yet, so there is no coder to watch. Check `hlix_tasks_get` again once it is building."};return Oe(r.projects.observeAgent(o.projectId,o.agentId),(a)=>Re(t,a))}})}import{buildMode as Te}from"@mastra/code-sdk/agents/modes/build";import{fastMode as Me}from"@mastra/code-sdk/agents/modes/explore";import{planMode as Ne}from"@mastra/code-sdk/agents/modes/plan";import{setCustomProvidersSource as Ee}from"@mastra/code-sdk/agents/model";import{getCustomProviderId as q,loadSettings as Fe}from"@mastra/code-sdk/onboarding/settings";var K="hlix",J="default",We=(e)=>`${K}/${e}`;function Le(e){return{name:K,url:`${e.baseUrl.replace(/\/+$/,"")}/v1/api/ai/w/${e.workspaceId}`,apiKey:e.apiKey,models:[...new Set([J,...e.models??[]])]}}function De(e){let s=[Te,Ne,Me];return e?s.map((t)=>({...t,defaultModelId:e})):s}function V(e){let s=B({env:e.env,flags:{},cwd:e.cwd});if(s.conflict||!s.credential||!s.workspaceId)return null;let t=Le({baseUrl:s.baseUrl,workspaceId:s.workspaceId,apiKey:s.credential.apiKey,...e.models?{models:e.models}:{}}),r=q(t.name);return Ee(()=>[...Fe().customProviders.filter((o)=>q(o.name)!==r),t]),{provider:t,modelId:We(J)}}var X=(e,s)=>e.length>0?[...e]:De(s);function Y(e){if(e.configured)return{id:e.configured,source:e.configuredSource??"config"};return e.wired?{id:e.wired.modelId,source:"workspace"}:null}var z=(e,s)=>s?`${e} · model: ${s.id} (${s.source})`:e;import{execFileSync as Xe}from"node:child_process";import{DockerSandbox as Ye}from"@mastra/docker";import{LocalFilesystem as ze,Workspace as Ge}from"@mastra/core/workspace";import{posix as G}from"node:path";import{MastraFilesystem as Ue,MastraSandbox as qe,Workspace as Be}from"@mastra/core/workspace";var Ke=600000,Je=["recursive","overwrite","force","maxDepth","extension"];function p(e){let s=e??{},t={};for(let r of Je)if(s[r]!==void 0)t[r]=s[r];return Object.keys(t).length>0?{options:t}:{}}var Q=(e)=>e instanceof Date?e:new Date(typeof e==="string"||typeof e==="number"?e:0);class Z extends Ue{id;name="RemoteFilesystem";provider="hlix-coding-workspace";basePath;status="ready";client;constructor(e,s){super({name:"RemoteFilesystem"});this.client=e,this.basePath=s.root,this.id=s.id??`hlix-remote-fs:${s.root}`}getInfo(){return{id:this.id,name:this.name,provider:this.provider,status:this.status,metadata:{root:this.basePath}}}resolveAbsolutePath(e){return G.isAbsolute(e)?e:G.join(this.basePath,e)}async call(e){let{result:s}=await this.client.fs({...e,encoding:e.encoding??"utf8",path:this.resolveAbsolutePath(e.path)});return s}async readFile(e,s){let r=await this.call({op:"read",path:e,encoding:"base64"}),o=Buffer.from(r.content,r.encoding);return s?.encoding?o.toString(s.encoding):o}async writeFile(e,s,t){await this.call({op:"write",path:e,content:Buffer.from(s).toString("base64"),encoding:"base64",...p(t)})}async appendFile(e,s){await this.call({op:"append",path:e,content:Buffer.from(s).toString("base64"),encoding:"base64"})}async deleteFile(e,s){await this.call({op:"delete",path:e,...p(s)})}async copyFile(e,s,t){await this.call({op:"copy",path:e,dest:this.resolveAbsolutePath(s),...p(t)})}async moveFile(e,s,t){await this.call({op:"move",path:e,dest:this.resolveAbsolutePath(s),...p(t)})}async mkdir(e,s){await this.call({op:"mkdir",path:e,...p(s)})}async rmdir(e,s){await this.call({op:"rmdir",path:e,...p(s)})}async readdir(e,s){return await this.call({op:"readdir",path:e,...p(s)})??[]}async exists(e){return await this.call({op:"exists",path:e})===!0}async stat(e){let s=await this.call({op:"stat",path:e});return{...s,createdAt:Q(s.createdAt),modifiedAt:Q(s.modifiedAt)}}}var Ve=(e)=>`'${e.split("'").join("'\\''")}'`;class ee extends qe{id;name="RemoteSandbox";provider="hlix-coding-workspace";status="ready";client;constructor(e,s){super({name:"RemoteSandbox"});if(this.client=e,this.id=`hlix-remote-sandbox:${s.projectId}`,s.root)this.setWorkingDirectory(s.root)}async start(){}getInfo(){return{id:this.id,name:this.name,provider:this.provider,status:this.status,createdAt:new Date(0)}}async executeCommand(e,s=[],t){let r=[e,...s.map(Ve)].join(" "),o=Date.now(),a=t?.cwd??this.workingDirectory,n=await this.client.exec({command:r,...a?{cwd:a}:{},timeoutMs:t?.timeout??Ke});return{success:n.exitCode===0,exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr,executionTimeMs:Date.now()-o,command:e,args:s}}}function se(e,s){let t=s.root??"/workspace";return new Be({id:`hlix-project:${s.projectId}`,name:"Hlix Coding Workspace",filesystem:new Z(e,{root:t}),sandbox:new ee(e,{projectId:s.projectId,root:t})})}function Qe(e,s){if(H.includes(e))return e;throw new w("invalid_usage",`${s==="flag"?"--sandbox":"sandbox in .hlix/config.json"} must be one of ${H.join(", ")}; got "${e}".`)}function te(e){if(e.flag){let s=e.flagSource??"flag";return{choice:Qe(e.flag,s),reason:s==="flag"?`--sandbox ${e.flag}`:"config"}}if(e.projectId)return{choice:"cloud",reason:`project ${e.projectId}`};if(e.dockerAvailable())return{choice:"docker",reason:"auto"};return{choice:"local",reason:"auto"}}var re=(e)=>`sandbox: ${e.choice} (${e.reason})`;function oe(e=3000){try{return Xe("docker",["info"],{timeout:e,stdio:"ignore"}),!0}catch{return!1}}function j(e,s){if(e.choice==="local")return;if(e.choice==="cloud"){if(!s.remote||!s.projectId)throw new w("invalid_usage","The cloud sandbox needs a hlix project. Run `hlix init`, pass --project <id>, or choose --sandbox docker|local.");return se(s.remote,{projectId:s.projectId})}let t="/workspace";return new Ge({id:"hlix-code-docker",name:"Hlix Code (Docker)",filesystem:new ze({basePath:s.cwd}),sandbox:new Ye({id:"hlix-code",volumes:{[s.cwd]:t},workingDirectory:t})})}var ne=["You are running inside Hlix Code, the terminal harness for the hlix control plane.","Every `hlix` CLI command is available to you as a tool named `hlix_<command>`,","with spaces replaced by underscores — `hlix_status`, `hlix_tasks_list`, `hlix_push`.","Use those tools instead of running `hlix` through the shell: they resolve the","folder's workspace binding and credential the same way the CLI does, and they","return the CLI's machine-readable output.","Report a non-zero exit code and its stderr to the user verbatim. Never invent a","project, task or workspace id — read one with a tool first."].join(`
10
+ `);function is(e){let{values:s}=ss({args:e,allowPositionals:!0,strict:!1,options:{local:{type:"boolean"},sandbox:{type:"string"},harness:{type:"string"},project:{type:"string"},cwd:{type:"string"}}}),t=typeof s.sandbox==="string"?s.sandbox:s.local===!0?"local":void 0;return{...t?{sandbox:t,sandboxSource:"flag"}:{},...typeof s.harness==="string"?{harness:s.harness}:{},...typeof s.project==="string"?{project:s.project}:{},cwd:es(typeof s.cwd==="string"?s.cwd:".")}}function cs(e){let s=Object.keys(f),r=e.sandbox==="cloud"?s:s.filter((u)=>e.installed(u)),o=["hlix",...r],a=s.filter((u)=>!r.includes(u)),n=e.requested.harness;if(n==="hlix"||r.includes(n))return{harness:e.requested,available:o,unavailable:a,refusal:null,warning:null};let i=C(f[n]);if(e.requested.source==="flag")return{harness:e.requested,available:o,unavailable:a,refusal:i,warning:null};return{harness:{harness:"hlix",source:"default"},available:o,unavailable:a,refusal:null,warning:`${i} Falling back to harness hlix.`}}async function ls(e,s){try{let r=await x(process.env,{cwd:e,flags:{}}).modelConfig.resolvedProjectHarness(s);return{harness:r.harness,source:r.source}}catch{return null}}function ds(e,s){if(e.choice!=="cloud")return j(e,{cwd:s.cwd});if(!s.projectId)throw new w("invalid_usage","The cloud sandbox needs a hlix project. Run `hlix init`, pass --project <id>, or choose --sandbox docker|local.");let r=x(process.env,{cwd:s.cwd,flags:{}}).projects.workspace(s.projectId);return j(e,{cwd:s.cwd,projectId:s.projectId,remote:r})}async function lt(e){let s=is(e),t=ae(s.cwd,process.env),r=s.project??t.merged.projectId,o,a,n;try{if(a=te({flag:s.sandbox??t.merged.sandbox,flagSource:s.sandbox?"flag":"config",projectId:r,dockerAvailable:()=>oe()}),n=cs({requested:N({...s.harness?{flag:s.harness}:{},...t.merged.harness?{configured:t.merged.harness}:{},...t.sources.harness?{configSource:t.sources.harness}:{}}),sandbox:a.choice,installed:(c)=>F(f[c].command)}),n.refusal)throw new w("invalid_usage",n.refusal);o=ds(a,{cwd:s.cwd,projectId:r})}catch(c){return process.stderr.write(`error: ${c instanceof Error?c.message:String(c)}
11
+ `),2}if(n.warning)process.stderr.write(`warning: ${n.warning}
12
+ `);if(a.choice==="cloud"){let c=r?await ls(s.cwd,r):null;if(c&&s.harness&&s.harness!==c.harness)process.stderr.write(`warning: this project runs ${c.harness}. Run \`/harness ${s.harness}\` to make ${s.harness} the project's setting.
13
+ `);n={...n,harness:c??{harness:"unknown",source:r?"the project's setting could not be read":"no project bound"}}}let i=Y({wired:V({cwd:s.cwd,env:process.env}),...t.merged.model?{configured:t.merged.model}:{},...t.sources.model?{configuredSource:t.sources.model}:{}}),u=re(a);process.stdout.write(`${z(E(u,n.harness),i)}
14
+ `),O(s.cwd);let I=null,ie=n.harness.harness==="unknown"?"hlix":n.harness.harness,P=L({sandbox:a.choice,cwd:s.cwd,active:ie,unavailable:n.unavailable,...o?{workspace:o}:{},...i?{model:i.id}:{}}),{version:ce}=await import("./package-12m4e2y1.js"),l=await ts({configDir:".hlix",cwd:s.cwd,hostInstructions:a.choice==="cloud"?`${ne}
15
+
16
+ ${W(n.harness.harness)}`:ne,extraTools:{...R({cwd:s.cwd}),hlix_tasks_follow:U({cwd:s.cwd}),hlix_harness:D({sandbox:a.choice,sandboxLine:u,available:n.available,modesBuilt:P.length>0,session:()=>I,...r?{setProjectHarness:async(c)=>{await x(process.env,{cwd:s.cwd,flags:{}}).modelConfig.setProjectHarness(r,c)}}:{}})},modes:X(P,i?.id),...o?{workspace:o}:{}});if(I=l.session,rs(e)){let c=os(e),b=await ns({controller:l.controller,session:l.session,prompt:c.prompt??"",...c.model?{model:c.model}:{},...c.maxTurns?{maxTurns:c.maxTurns}:{}}).result;if(process.stdout.write(`${b.text}
17
+ `),b.error)process.stderr.write(`${b.error.message}
18
+ `);return b.exitCode}return await new as({controller:l.controller,session:l.session,...l.hookManager?{hookManager:l.hookManager}:{},...l.mcpManager?{mcpManager:l.mcpManager}:{},...l.pluginManager?{pluginManager:l.pluginManager}:{},...l.knowledgeInspector?{knowledgeInspector:l.knowledgeInspector}:{},authStorage:l.authStorage,storageMaintenance:l.storageMaintenance,appName:"Hlix Code",version:ce}).run(),0}export{is as parseHlixCodeArgs,cs as planHarness,lt as runHlixCode};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import"./index-vfqh17y6.js";var s="@hlix/cli",i="0.3.0",n="SEE LICENSE IN LICENSE",a="Hlix Code and the hlix control-plane CLI.",r=["hlix","cli","agents"],d="https://hlix.ai",p="module",c="./dist/index.js",o={hlix:"./dist/index.js"},l=["dist","skills","LICENSE","THIRD_PARTY_NOTICES"],u={node:">=22.19.0"},b={access:"public"},h={build:"rm -rf dist && bun build src/index.ts --outdir dist --target node --format esm --splitting --packages external --minify --banner '#!/usr/bin/env node'",test:'bun test --isolate src --path-ignore-patterns "**/*.integration.test.ts" --timeout 20000',typecheck:"tsc --noEmit",prepublishOnly:"bun run typecheck && bun run build && bun run test","test:integration":"NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 .integration.test.ts"},m={"@mastra/acp":"^0.4.1","@mastra/code-sdk":"1.7.0","@mastra/core":"^1.65.0","@mastra/docker":"^0.7.0",ignore:"7.0.8",mastracode:"0.39.0","openapi-fetch":"^0.17.0",zod:"4.5.4"},g={"@hlix/sdk":"^0.2.0","@types/bun":"latest",typescript:"^7.0.2"},k={name:s,version:i,license:n,description:a,keywords:r,homepage:d,type:p,main:c,bin:o,files:l,engines:u,publishConfig:b,scripts:h,dependencies:m,devDependencies:g};export{o as bin,k as default,m as dependencies,a as description,g as devDependencies,u as engines,l as files,d as homepage,r as keywords,n as license,c as main,s as name,b as publishConfig,h as scripts,p as type,i as version};
package/package.json CHANGED
@@ -1,22 +1,14 @@
1
1
  {
2
2
  "name": "@hlix/cli",
3
- "version": "0.2.0",
4
- "license": "Apache-2.0",
5
- "description": "Command-line interface for the hlix control plane, built on @hlix/sdk.",
3
+ "version": "0.3.0",
4
+ "license": "SEE LICENSE IN LICENSE",
5
+ "description": "Hlix Code and the hlix control-plane CLI.",
6
6
  "keywords": [
7
7
  "hlix",
8
8
  "cli",
9
9
  "agents"
10
10
  ],
11
- "homepage": "https://github.com/hlix-ai/hlix#readme",
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/hlix-ai/hlix.git",
15
- "directory": "packages/cli"
16
- },
17
- "bugs": {
18
- "url": "https://github.com/hlix-ai/hlix/issues"
19
- },
11
+ "homepage": "https://hlix.ai",
20
12
  "type": "module",
21
13
  "main": "./dist/index.js",
22
14
  "bin": {
@@ -25,25 +17,35 @@
25
17
  "files": [
26
18
  "dist",
27
19
  "skills",
20
+ "LICENSE",
28
21
  "THIRD_PARTY_NOTICES"
29
22
  ],
30
23
  "engines": {
31
- "node": ">=20"
24
+ "node": ">=22.19.0"
32
25
  },
33
26
  "publishConfig": {
34
27
  "access": "public"
35
28
  },
36
29
  "scripts": {
37
- "build": "tsup",
38
- "test": "bun test --isolate --timeout 20000",
30
+ "build": "rm -rf dist && bun build src/index.ts --outdir dist --target node --format esm --splitting --packages external --minify --banner '#!/usr/bin/env node'",
31
+ "test": "bun test --isolate src --path-ignore-patterns \"**/*.integration.test.ts\" --timeout 20000",
39
32
  "typecheck": "tsc --noEmit",
40
- "prepublishOnly": "bun run typecheck && bun run build && bun test src/boundary.test.ts src/skill.test.ts src/binary.test.ts src/readme.test.ts"
33
+ "prepublishOnly": "bun run typecheck && bun run build && bun run test",
34
+ "test:integration": "NODE_ENV=test bun run ../../apps/backend/scripts/with-aimock.ts -- bun run ../../apps/backend/scripts/with-test-db.ts -- bun test --isolate --preload ../../apps/backend/test/helpers/pool-lifecycle.ts --timeout 60000 .integration.test.ts"
35
+ },
36
+ "dependencies": {
37
+ "@mastra/acp": "^0.4.1",
38
+ "@mastra/code-sdk": "1.7.0",
39
+ "@mastra/core": "^1.65.0",
40
+ "@mastra/docker": "^0.7.0",
41
+ "ignore": "7.0.8",
42
+ "mastracode": "0.39.0",
43
+ "openapi-fetch": "^0.17.0",
44
+ "zod": "4.5.4"
41
45
  },
42
46
  "devDependencies": {
43
47
  "@hlix/sdk": "^0.2.0",
44
- "ignore": "7.0.5",
45
- "tsup": "^8.5.0",
46
- "typescript": "^5.7.2",
47
- "@types/bun": "latest"
48
+ "@types/bun": "latest",
49
+ "typescript": "^7.0.2"
48
50
  }
49
51
  }
@@ -59,19 +59,67 @@ to a second workspace from inside a bound folder still works.
59
59
  binding lookup. `hlix status` prints the resolved answer and the source that
60
60
  decided it.
61
61
 
62
+ ## Settings
63
+
64
+ ```bash
65
+ hlix config list [--json] # every setting in effect, and which file set it
66
+ hlix config get <harness|model|sandbox> [--json]
67
+ hlix config set <harness|model|sandbox> <value> [--global] [--json]
68
+ ```
69
+
70
+ Two files, one shape, and the folder wins per key: the machine-wide
71
+ `~/.hlix/config.json` and this folder's `.hlix/config.json`. `config list`
72
+ names the source of every value — `project`, `global`, or `default` when no
73
+ file sets it — and where it applies. The stored credential stays at
74
+ `~/.config/hlix/credentials.json` and is not part of this cascade.
75
+
76
+ `harness` names the coder Hlix Code runs (`hlix`, `claude-code`, `codex`,
77
+ `cursor-agent`) and applies to the `local` and `docker` sandboxes only — a
78
+ cloud project's coder is the project's own harness setting on the server.
79
+ `model` is the model the hlix agent starts on; `sandbox` is where its files and
80
+ shell live (`cloud`, `docker`, `local`). `config set` writes this folder unless
81
+ `--global` is given, and leaves every other key in the file untouched. It
82
+ refuses `projectId`, `workspaceId` and `apiUrl` — those bind a folder to a
83
+ tenant and are written by `init` and `import`.
84
+
85
+ ## Dispatching work
86
+
87
+ ```bash
88
+ hlix cycles create <project-id> --title <t> --description <d> [--json]
89
+ hlix tasks create <project-id> --description <d> [--title <t>] [--json]
90
+ hlix harness get [project-id] [--json]
91
+ hlix harness set <hlix|claude-code|codex|cursor-agent> [project-id] [--org] [--json]
92
+ ```
93
+
94
+ `cycles create` is the command that STARTS work. The proposal enters the
95
+ project's own loop, which plans the cycle, creates its tasks and starts the
96
+ coders. `adopted` is true when the loop took it on this call and false when it
97
+ was recorded for the next pass; neither is an error. It returns no cycle id —
98
+ the roadmap owns cycles — so find the resulting tasks with `hlix tasks list
99
+ --project <id>`.
100
+
101
+ `tasks create` adds a board row and does NOT start it. Standalone task
102
+ execution is not implemented server-side and answers `501` by design, so there
103
+ is no flag here that would call it.
104
+
105
+ `harness get`/`harness set` are the coder the PLATFORM runs, stored on the
106
+ server and audited: a project preference with a project id, the workspace-wide
107
+ one with `--org`. That is a different setting from the local `harness` config
108
+ key, which only picks the coder Hlix Code spawns on this machine.
109
+
62
110
  ## Commands
63
111
 
64
112
  ```bash
65
113
  hlix status [--json] # workspace, binding, local and cloud drift
66
114
  hlix projects list [--json] # projects in the workspace
67
115
  hlix projects get [project-id] [--json]
68
- hlix init [folder] [--json] # create committed project configuration
116
+ hlix init [folder] [--project <id>] [--json] # create committed project configuration; --project binds an existing cloud project
69
117
  hlix import [folder] [--dry-run] [--env-file <path>] [--history preserve] [--yes] [--json]
70
118
  hlix sync [--dry-run] [--json] # push or pull when only one side changed
71
119
  hlix pull [--force] [--yes] [--dry-run] [--json]
72
120
  hlix push [--dry-run] [--json] # compare-and-swap a new immutable revision
73
121
  hlix skill import <SKILL.md|folder> [--name <slug>] [--json]
74
- hlix agent import <markdown-file> [--name <name>] [--runtime <runtime>] [--profile <profile>] [--json]
122
+ hlix agent import <markdown-file> [--name <name>] [--runtime <runtime>] [--duty <duty>] [--json]
75
123
  hlix mcp import <.mcp.json> [--server <name>] [--allow-stdio] [--json]
76
124
  hlix tasks list [--project <id>] [--status <status>] [--json]
77
125
  hlix tasks get <task-id> [--json] # one task
@@ -187,8 +235,10 @@ document. Read it line by line.
187
235
 
188
236
  ## Not available
189
237
 
190
- - **No execution commands.** There is deliberately no way to start a run,
191
- execute a cycle or dispatch a task from this CLI.
238
+ - **No execution commands** beyond `cycles create`. Starting a single task is
239
+ not offered because the API does not implement it: `POST
240
+ /v1/api/tasks/{id}/execute` publishes no success response and answers `501`
241
+ by design. Work is dispatched by its cycle.
192
242
  - **No `tasks logs`.** The log endpoint is not part of the published API
193
243
  contract, and there is no log stream to follow. `tasks watch` streams task
194
244
  *status*, which is a different thing and is named accordingly.
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env node
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
-
28
- export {
29
- __commonJS,
30
- __toESM
31
- };
@@ -1,88 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./chunk-FYS2JH42.js";
3
-
4
- // package.json
5
- var name = "@hlix/cli";
6
- var version = "0.2.0";
7
- var license = "Apache-2.0";
8
- var description = "Command-line interface for the hlix control plane, built on @hlix/sdk.";
9
- var keywords = [
10
- "hlix",
11
- "cli",
12
- "agents"
13
- ];
14
- var homepage = "https://github.com/hlix-ai/hlix#readme";
15
- var repository = {
16
- type: "git",
17
- url: "git+https://github.com/hlix-ai/hlix.git",
18
- directory: "packages/cli"
19
- };
20
- var bugs = {
21
- url: "https://github.com/hlix-ai/hlix/issues"
22
- };
23
- var type = "module";
24
- var main = "./dist/index.js";
25
- var bin = {
26
- hlix: "./dist/index.js"
27
- };
28
- var files = [
29
- "dist",
30
- "skills",
31
- "THIRD_PARTY_NOTICES"
32
- ];
33
- var engines = {
34
- node: ">=20"
35
- };
36
- var publishConfig = {
37
- access: "public"
38
- };
39
- var scripts = {
40
- build: "tsup",
41
- test: "bun test --isolate --timeout 20000",
42
- typecheck: "tsc --noEmit",
43
- prepublishOnly: "bun run typecheck && bun run build && bun test src/boundary.test.ts src/skill.test.ts src/binary.test.ts src/readme.test.ts"
44
- };
45
- var devDependencies = {
46
- "@hlix/sdk": "^0.2.0",
47
- ignore: "7.0.5",
48
- tsup: "^8.5.0",
49
- typescript: "^5.7.2",
50
- "@types/bun": "latest"
51
- };
52
- var package_default = {
53
- name,
54
- version,
55
- license,
56
- description,
57
- keywords,
58
- homepage,
59
- repository,
60
- bugs,
61
- type,
62
- main,
63
- bin,
64
- files,
65
- engines,
66
- publishConfig,
67
- scripts,
68
- devDependencies
69
- };
70
- export {
71
- bin,
72
- bugs,
73
- package_default as default,
74
- description,
75
- devDependencies,
76
- engines,
77
- files,
78
- homepage,
79
- keywords,
80
- license,
81
- main,
82
- name,
83
- publishConfig,
84
- repository,
85
- scripts,
86
- type,
87
- version
88
- };