hablas-ai 1.3.12 → 1.3.13

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1087,7 +1087,7 @@ ${t.content}`).join(`
1087
1087
  ${t}
1088
1088
  `);this.write("CONTEXT.md",r)}ensureDir(){re.existsSync(this.contextDir)||re.mkdirSync(this.contextDir,{recursive:!0})}}});function Bl(n){return xe.find(e=>e.role===n)?.name||n}var xs,yg=L(()=>{"use strict";Ns();Hl();xs=class{channel;runner;chat;constructor(e,t,s,r){this.channel=e,this.runner=t,this.chat=s,this.runner.setChannel(e),this.chat.resetBudget()}async run(e,t,s,r={}){this.chat.setAbortSignal(r.abortSignal);let i=r.peerReview!==!1,o=r.centralizedToLeader===!0,a=new Dn(process.cwd());this.runner.setSharedContext(a),this.channel.emitEvent({type:"phase",agent:"System",content:"Delegating to the team"});let l=t.tasks.filter(m=>m.role!=="hablas").map(m=>({role:m.role,task:`${m.description}
1089
1089
 
1090
- Original request: ${e}`})),u=[],d="hablas",f=null;for(let m of l){if(r.abortSignal?.aborted)break;let p=xe.find(w=>w.role===m.role);if(!p)continue;if(this.channel.emitEvent({type:"handoff",agent:Bl(d),to:p.name}),!o){let w=await this.chat.generateHandoffLine(d,m.role,m.task);this.channel.emitEvent({type:"speak",agent:Bl(d),to:p.name,content:w});let $=await this.chat.generateAckLine(m.role,d);this.channel.emitEvent({type:"speak",agent:p.name,to:Bl(d),content:$})}let g=Date.now(),x=await this.runner.runAgent(m.role,m.task,void 0,s,{abortSignal:r.abortSignal});u.push(x),x.success&&x.output?(this.channel.emitEvent({type:"summary",agent:p.name,durationMs:Date.now()-g}),m.role==="alex"&&(f=x.output),i&&m.role==="alex"&&t.tasks.some(w=>w.role==="bob")&&f&&await this.runPeerReview("bob","alex",f,r.abortSignal,o)):x.error&&this.channel.emitEvent({type:"error",agent:p.name,content:x.error}),d=m.role}this.channel.emitEvent({type:"phase",agent:"System",content:"Hablas compiling final report"});let h=await this.synthesize(e,u,s,r.abortSignal);return this.channel.emitEvent({type:"done",agent:"Hablas"}),h}async runPeerReview(e,t,s,r,i=!1){let o=xe.find(l=>l.role===e),a=xe.find(l=>l.role===t);if(!(!o||!a)){if(!i){let l=await this.chat.generateReviewLine(e,t,s);this.channel.emitEvent({type:"review",agent:o.name,to:a.name,content:l});let u=await this.chat.generateReviewAck(t,e);this.channel.emitEvent({type:"speak",agent:a.name,to:o.name,content:u})}r?.aborted}}async synthesize(e,t,s,r){let i=t.filter(d=>d.success&&d.output);if(i.length===0)return{results:t,finalSynthesis:"The team encountered errors and could not complete the task. Please review the logs and try again.",synthesisOk:!1};let o=i.map(d=>{let f=xe.find(h=>h.role===d.agent);return`### Report from @${d.agentName} (${f?.title??d.agent}):
1090
+ Original request: ${e}`})),u=[],d="hablas",f=null;for(let m of l){if(r.abortSignal?.aborted)break;let p=xe.find(w=>w.role===m.role);if(!p)continue;if(!o){this.channel.emitEvent({type:"handoff",agent:Bl(d),to:p.name});let w=await this.chat.generateHandoffLine(d,m.role,m.task);this.channel.emitEvent({type:"speak",agent:Bl(d),to:p.name,content:w});let $=await this.chat.generateAckLine(m.role,d);this.channel.emitEvent({type:"speak",agent:p.name,to:Bl(d),content:$})}let g=Date.now(),x=await this.runner.runAgent(m.role,m.task,void 0,s,{abortSignal:r.abortSignal});u.push(x),x.success&&x.output?(this.channel.emitEvent({type:"summary",agent:p.name,durationMs:Date.now()-g}),m.role==="alex"&&(f=x.output),i&&m.role==="alex"&&t.tasks.some(w=>w.role==="bob")&&f&&await this.runPeerReview("bob","alex",f,r.abortSignal,o)):x.error&&this.channel.emitEvent({type:"error",agent:p.name,content:x.error}),d=m.role}this.channel.emitEvent({type:"phase",agent:"System",content:"Hablas compiling final report"});let h=await this.synthesize(e,u,s,r.abortSignal);return this.channel.emitEvent({type:"done",agent:"Hablas"}),h}async runPeerReview(e,t,s,r,i=!1){let o=xe.find(l=>l.role===e),a=xe.find(l=>l.role===t);if(!(!o||!a)){if(!i){let l=await this.chat.generateReviewLine(e,t,s);this.channel.emitEvent({type:"review",agent:o.name,to:a.name,content:l});let u=await this.chat.generateReviewAck(t,e);this.channel.emitEvent({type:"speak",agent:a.name,to:o.name,content:u})}r?.aborted}}async synthesize(e,t,s,r){let i=t.filter(d=>d.success&&d.output);if(i.length===0)return{results:t,finalSynthesis:"The team encountered errors and could not complete the task. Please review the logs and try again.",synthesisOk:!1};let o=i.map(d=>{let f=xe.find(h=>h.role===d.agent);return`### Report from @${d.agentName} (${f?.title??d.agent}):
1091
1091
  ${d.output}`}).join(`
1092
1092
 
1093
1093
  `),a=`You are Hablas, the Team Leader. Your team has completed a multi-agent workflow for the user's request: "${e}".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hablas-ai",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
4
4
  "description": "Premium multi-agent AI coding agent for your terminal — local-first via Ollama, NVIDIA NIM, or any OpenAI-compatible API. Watch the team work in front of you.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {