@hiperplano/aluy-cli 1.0.0-rc.83 → 1.0.0-rc.84
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-bundle/bin/aluy.js +4 -4
- package/dist-bundle/index.js +4 -4
- package/package.json +1 -1
package/dist-bundle/bin/aluy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var a8=Object.create;var iy=Object.defineProperty;var l8=Object.getOwnPropertyDescriptor;var c8=Object.getOwnPropertyNames;var u8=Object.getPrototypeOf,d8=Object.prototype.hasOwnProperty;var p=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var m8=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},pt=(t,e)=>{for(var o in e)iy(t,o,{get:e[o],enumerable:!0})},f8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c8(e))!d8.call(t,r)&&r!==o&&iy(t,r,{get:()=>e[r],enumerable:!(n=l8(e,r))||n.enumerable});return t};var p8=(t,e,o)=>(o=t!=null?a8(u8(t)):{},f8(e||!t||!t.__esModule?iy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as h8}from"node:os";import{join as g8}from"node:path";function Vl(t=h8()){return g8(t,".aluy")}var Dm=p(()=>{"use strict"});var Xl,dC=p(()=>{"use strict";Xl="1.0.0-rc.
|
|
2
|
+
var a8=Object.create;var iy=Object.defineProperty;var l8=Object.getOwnPropertyDescriptor;var c8=Object.getOwnPropertyNames;var u8=Object.getPrototypeOf,d8=Object.prototype.hasOwnProperty;var p=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var m8=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},pt=(t,e)=>{for(var o in e)iy(t,o,{get:e[o],enumerable:!0})},f8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c8(e))!d8.call(t,r)&&r!==o&&iy(t,r,{get:()=>e[r],enumerable:!(n=l8(e,r))||n.enumerable});return t};var p8=(t,e,o)=>(o=t!=null?a8(u8(t)):{},f8(e||!t||!t.__esModule?iy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as h8}from"node:os";import{join as g8}from"node:path";function Vl(t=h8()){return g8(t,".aluy")}var Dm=p(()=>{"use strict"});var Xl,dC=p(()=>{"use strict";Xl="1.0.0-rc.84"});function Dr(t,e){return t.decide(e)}var ii=p(()=>{"use strict"});var qn,Tr,_r=p(()=>{"use strict";qn="remember",Tr="recall"});var ay,y8,ma,ly=p(()=>{"use strict";ay=class{id;horizon;label;parentId;children;dependencies;pinned;closed;createdAt;lastAccessedAt;accessCount;context;constructor(e,o,n,r,s){this.id=e,this.horizon=o,this.label=n,this.parentId=r,this.children=new Set,this.dependencies=new Set,this.pinned=!1,this.closed=!1,this.createdAt=s,this.lastAccessedAt=s,this.accessCount=0,this.context=[]}touch(e){this.lastAccessedAt=e,this.accessCount+=1}snapshot(){return{id:this.id,horizon:this.horizon,label:this.label,parentId:this.parentId,children:[...this.children],dependencies:[...this.dependencies],pinned:this.pinned,closed:this.closed,createdAt:this.createdAt,lastAccessedAt:this.lastAccessedAt,accessCount:this.accessCount,contextSize:this.context.length}}},y8=200,ma=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??y8,this.now=e?.clock??Date.now}static boxId(e,o){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}-${o.toString(36)}`}openBox(e,o,n,r){let s=this.nodes.get(e);if(s)return s.touch(this.now()),{box:s.snapshot(),created:!1};if(this.nodes.size>=this.maxBoxes&&(this.evictOne(),this.nodes.size>=this.maxBoxes))return null;let i=this.now(),a=new ay(e,o,n,r??null,i);if(r){let l=this.nodes.get(r);l&&l.children.add(e)}return this.nodes.set(e,a),{box:a.snapshot(),created:!0}}closeBox(e){let o=this.nodes.get(e);return o?(o.closed=!0,o.touch(this.now()),o.snapshot()):null}isClosed(e){let o=this.nodes.get(e);return o?o.closed:!1}reopenBox(e){let o=this.nodes.get(e);return o?(o.closed=!1,o.touch(this.now()),o.snapshot()):null}setHorizon(e,o){let n=this.nodes.get(e);return n?(n.horizon=o,n.touch(this.now()),n.snapshot()):null}setParent(e,o){let n=this.nodes.get(e);return n?n.parentId===o?n.snapshot():o!==null&&this.wouldCreateCycle(e,o)?null:(n.parentId&&this.nodes.get(n.parentId)?.children.delete(e),n.parentId=o,o&&this.nodes.get(o)?.children.add(e),n.touch(this.now()),n.snapshot()):null}wouldCreateCycle(e,o){let n=new Set,r=o;for(;r!==null;){if(r===e||n.has(r))return!0;n.add(r),r=this.nodes.get(r)?.parentId??null}return!1}getBox(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),o.snapshot()):null}listBoxes(e="lastAccessedAt"){let o=[...this.nodes.values()].map(n=>n.snapshot());switch(e){case"createdAt":return o.sort((n,r)=>n.createdAt-r.createdAt);case"accessCount":return o.sort((n,r)=>r.accessCount-n.accessCount);default:return o.sort((n,r)=>r.lastAccessedAt-n.lastAccessedAt)}}get size(){return this.nodes.size}addContext(e,o){let n=this.nodes.get(e);return n?(n.context.push({ts:this.now(),text:o}),n.touch(this.now()),n.snapshot()):null}getContext(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),[...o.context]):[]}getContextChain(e){let o=[],n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let s=this.nodes.get(r);if(!s)break;s.touch(this.now()),o.push({boxId:s.id,entries:[...s.context]}),r=s.parentId}return o}addDependency(e,o){let n=this.nodes.get(e);return!n||!this.nodes.has(o)||n.id===o?!1:(n.dependencies.add(o),n.touch(this.now()),!0)}getDependencies(e){let o=this.nodes.get(e);return o?[...o.dependencies]:[]}pinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!0,o.touch(this.now()),o.snapshot()):null}unpinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!1,o.touch(this.now()),o.snapshot()):null}evictOne(){let e=[];for(let n of this.nodes.values())n.horizon==="longo"||n.pinned||e.push(n);if(e.length===0)return null;e.sort((n,r)=>{let s=n.horizon==="curto"?0:1,i=r.horizon==="curto"?0:1;if(s!==i)return s-i;let a=n.closed?0:1,l=r.closed?0:1;return a!==l?a-l:n.lastAccessedAt!==r.lastAccessedAt?n.lastAccessedAt-r.lastAccessedAt:n.accessCount-r.accessCount});let o=e[0];return this.removeNode(o)}forceEvict(e){let o=this.nodes.get(e);return!o||o.horizon==="longo"||o.pinned?null:this.removeNode(o)}removeBox(e){let o=this.nodes.get(e);return o?this.removeNode(o):null}removeNode(e){if(e.parentId){let o=this.nodes.get(e.parentId);o&&o.children.delete(e.id)}return this.nodes.delete(e.id),e.snapshot()}}});function Tm(t){let e=[];for(let o of t){e.push({step:o,depth:0});for(let n of o.substeps??[])e.push({step:n,depth:1})}return e}function pC(t,e){let o,n="pending",r;if(typeof t=="string")o=t;else if(t!==null&&typeof t=="object"){let i=t,a=i.title??i.step??i.text??i.name??i.content;if(typeof a=="string"&&(o=a),typeof i.status=="string"&&b8.has(i.status)&&(n=i.status),e){let l=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(l)&&l.length>0){let c=[];for(let u of l){let m=pC(u,!1);if(typeof m=="string")return m;c.push(m)}r=c}}}if(o===void 0||o.trim()==="")return k8;let s=o.trim().slice(0,v8);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function x8(t){let e=t.steps??t.plan??t.todos??t.items;if(!Array.isArray(e))return{error:'update_plan: passe "steps" como uma LISTA de passos (string ou {title,status}).'};if(e.length===0)return{error:"update_plan: a lista de passos est\xE1 vazia."};let o=[];for(let i of e){let a=pC(i,!0);if(typeof a=="string")return{error:a};o.push(a)}let n=new Set,r=i=>{if(!n.has(i))return n.add(i),i;for(let a=2;;a++){let l=`${i} #${a}`;if(!n.has(l))return n.add(l),l}};for(let i=0;i<o.length;i++){let a=o[i],l=r(a.title),c=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Tm(o).length;return s>mC?{error:`update_plan: no m\xE1ximo ${mC} passos (recebidos ${s}).`}:{steps:o}}function S8(t){let e=Tm(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${hC[r.step.status]} ${r.step.title}`).join(`
|
|
3
3
|
`);return`plano (${o}/${e.length}):
|
|
4
4
|
${n}`}function E8(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function A8(t,e){let o=new Map;for(let i of e.listBoxes())o.set(i.label,i.id);let n=t.findIndex(i=>i.status==="in_progress"||(i.substeps??[]).some(a=>a.status==="in_progress")),r=(i,a,l)=>{let c=i.status==="in_progress"?"curto":l,u=o.get(i.title),m=u??ma.boxId(i.title,0);return u?(i.status!=="completed"&&e.isClosed(u)&&e.reopenBox(u),e.setHorizon(u,c),e.setParent(u,a)):e.openBox(m,c,i.title,a),i.status==="completed"&&!e.isClosed(m)&&e.closeBox(m),o.set(i.title,m),m};t.forEach((i,a)=>{let l=E8(a,n),c=r(i,null,l);for(let u of i.substeps??[])r(u,c,l)});let s=new Set;for(let i of t){s.add(i.title);for(let a of i.substeps??[])s.add(a.title)}for(let i of e.listBoxes())s.has(i.label)||e.removeBox(i.id)}function C8(t,e){if(!e)return S8(t);let o=new Map;for(let c of e.listBoxes())o.set(c.label,c);let n=new Map;for(let c of e.listBoxes())n.set(c.id,c);let r=new Map,s=(c,u=new Set)=>{let m=r.get(c);if(m!==void 0)return m;let d=n.get(c);if(!d||!d.parentId||u.has(c))return r.set(c,0),0;let h=s(d.parentId,new Set(u).add(c))+1;return r.set(c,h),h},i=Tm(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:u}of i){let m=o.get(c.title),d=m?w8[m.horizon]:"",h=m?s(m.id):u,g=" ".repeat(h),b=hC[c.status];l.push(`${g}${d} ${b} ${c.title}`)}return l.join(`
|
|
5
5
|
`)}var Jl,b8,mC,v8,k8,hC,w8,fC,D8,gC,_m=p(()=>{"use strict";ly();Jl="update_plan";b8=new Set(["pending","in_progress","completed"]),mC=30,v8=120,k8="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";hC={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};w8={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};fC=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),D8=Object.freeze({type:"object",properties:{steps:{type:"array",description:"A lista COMPLETA de passos do plano (re-emita TODOS a cada atualiza\xE7\xE3o \u2014 substitui o anterior).",items:{type:"object",properties:{title:{type:"string",description:"O passo, curto e no imperativo."},status:fC,substeps:{type:"array",description:"OPCIONAL: sub-passos que detalham este passo (1 n\xEDvel). Aparecem indentados sob o passo e seguem o foco dele. Use quando um passo tem a\xE7\xF5es menores distintas.",items:{type:"object",properties:{title:{type:"string",description:"O sub-passo, curto e no imperativo."},status:fC},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),gC={name:Jl,effect:"read",description:"Declara/atualiza um PLANO vis\xEDvel (checklist de passos). Use ao iniciar uma tarefa com V\xC1RIOS passos e a cada progresso: re-emita a lista TODA marcando o status de cada passo (pending/in_progress/completed). Mantenha 1 passo in_progress por vez. N\xE3o tem efeito no sistema \u2014 \xE9 s\xF3 o seu plano, para voc\xEA e para o usu\xE1rio acompanharem.",parameters:D8,async run(t,e){let o=x8(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&A8(o.steps,e.graph),e.plan&&e.plan.set(Tm(o.steps).map(r=>({title:r.step.title,status:r.step.status}))),{ok:!0,observation:C8(o.steps,e.graph)})}}});function yC(t){let e=t.question??t.prompt??t.text??t.message;if(typeof e!="string"||e.trim()==="")return{error:'perguntar: passe "question" (a pergunta em texto). Para escolha, passe tamb\xE9m "options".'};let o=e.trim().slice(0,2e3),n=t.header??t.title,r=typeof n=="string"&&n.trim()!==""?n.trim().slice(0,200):void 0,s=t.options??t.choices,i=Array.isArray(s)?_8(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&T8.has(l))a=l;else{if(typeof l=="string"&&l.trim()!=="")return{error:`perguntar: "kind" inv\xE1lido "${l}". Use "single", "multi" ou "text".`};a=i!==void 0&&i.length>0?"single":"text"}if((a==="single"||a==="multi")&&(i===void 0||i.length===0))return{error:`perguntar: kind "${a}" requer "options" (uma lista de ao menos 1 op\xE7\xE3o).`};let c=t.allowOther!==!1;return{spec:{kind:a,question:o,...r!==void 0?{header:r}:{},...a!=="text"&&i!==void 0?{options:i}:{},...a!=="text"?{allowOther:c}:{}}}}function _8(t){if(t.length===0)return'perguntar: a lista de "options" est\xE1 vazia.';if(t.length>12)return`perguntar: no m\xE1ximo 12 op\xE7\xF5es (recebidas ${t.length}).`;let e=[];for(let o of t){let n,r;if(typeof o=="string")n=o;else if(o!==null&&typeof o=="object"){let s=o,i=s.label??s.text??s.value??s.name??s.title;typeof i=="string"&&(n=i),typeof s.description=="string"&&s.description.trim()!==""&&(r=s.description.trim().slice(0,300))}if(n===void 0||n.trim()==="")return'perguntar: cada op\xE7\xE3o precisa de um "label" (texto) n\xE3o-vazio.';e.push({label:n.trim().slice(0,200),...r!==void 0?{description:r}:{}})}return e}function R8(t){switch(t.kind){case"choice":return t.label;case"choices":return t.labels.length===0?"(nenhuma)":t.labels.join(", ");case"text":{let e=t.text.split(`
|
|
@@ -99,10 +99,10 @@ ${e.join(`
|
|
|
99
99
|
`)}var Qq,eW,tW,zc,Kc,jT=p(()=>{"use strict";Pr();Qq=4;eW=12,tW=32,zc=class{id;kind;label;parent;children=[];abortController;cascadeController=new AbortController;clock;phaseValue="thinking";stopValue;startedAt;endedAt;tokensValue=0;toolCallsValue=0;iterationsValue=0;recentActivity=[];onTerminal;constructor(e){this.id=e.id,this.kind=e.kind,this.label=e.label,this.parent=e.parent??null,this.clock=e.clock??Date.now,this.onTerminal=e.onTerminal,this.abortController=new AbortController,this.startedAt=this.clock(),e.parentSignal&&(e.parentSignal.aborted?this.abortController.abort():e.parentSignal.addEventListener("abort",()=>this.abortController.abort(),{once:!0}))}get signal(){return this.abortController.signal}get cascadeSignal(){return this.cascadeController.signal}get aborted(){return this.abortController.signal.aborted}get phase(){return this.phaseValue}get stop(){return this.stopValue}get childNodes(){return this.children}get endedAtMs(){return this.endedAt}addChild(e){this.children.push(e)}removeChild(e){let o=this.children.indexOf(e);return o<0?!1:(this.children.splice(o,1),!0)}setPhase(e){this.isTerminal()||(this.phaseValue=e)}isTerminal(){return this.phaseValue==="done"||this.phaseValue==="cancelled"||this.phaseValue==="failed"}noteToolStart(e,o){this.pushRecent({tool:e,target:ko(o),running:!0,ts:this.clock()})}noteToolEnd(e,o,n){for(let r=this.recentActivity.length-1;r>=0;r--){let s=this.recentActivity[r];if(s.tool===e&&s.running){this.recentActivity[r]=this.closeActivity(s,o,n);return}}}noteLastToolEnd(e,o){for(let n=this.recentActivity.length-1;n>=0;n--){let r=this.recentActivity[n];if(r.running){this.recentActivity[n]=this.closeActivity(r,e,o);return}}}noteToolTail(e){for(let o=this.recentActivity.length-1;o>=0;o--){let n=this.recentActivity[o];if(n.running){this.recentActivity[o]={...n,tail:Zq(e)};return}}}closeActivity(e,o,n){let r={...e,running:!1,ok:o},s=e.ts!==void 0?{...r,durationMs:Math.max(0,this.clock()-e.ts)}:r;return n?{...s,...n.summary!==void 0?{summary:Qe(n.summary)}:{},...n.added!==void 0?{added:n.added}:{},...n.removed!==void 0?{removed:n.removed}:{},...n.tokens!==void 0&&n.tokens>0?{tokens:n.tokens}:{}}:s}pushRecent(e){this.recentActivity.push(e),this.recentActivity.length>eW&&this.recentActivity.shift()}addTokens(e){Number.isFinite(e)&&e>0&&(this.tokensValue+=e)}setUsage(e){Number.isFinite(e.tokens)&&e.tokens>=0&&(this.tokensValue=e.tokens),Number.isFinite(e.toolCalls)&&e.toolCalls>=0&&(this.toolCallsValue=e.toolCalls),Number.isFinite(e.iterations)&&e.iterations>=0&&(this.iterationsValue=e.iterations)}finish(e){let o=this.isTerminal();this.endedAt===void 0&&(this.endedAt=this.clock()),this.stopValue=e,this.phaseValue=e==="final"?"done":e==="cancelled"?"cancelled":"failed",!o&&this.onTerminal&&this.onTerminal()}cancel(){this.abortController.signal.aborted||this.abortController.abort(),this.cascadeController.signal.aborted||this.cascadeController.abort(),this.isTerminal()||this.finish("cancelled");for(let e of this.children)e.cancel()}cancelOwn(){this.abortController.signal.aborted||this.abortController.abort(),this.isTerminal()||this.finish("cancelled")}accounting(){let e=this.endedAt??this.clock();return{tokens:this.tokensValue,toolCalls:this.toolCallsValue,iterations:this.iterationsValue,startedAt:this.startedAt,...this.endedAt!==void 0?{endedAt:this.endedAt}:{},durationMs:Math.max(0,e-this.startedAt)}}drillIn(){let e=this.clock();return{id:this.id,kind:this.kind,label:this.label,phase:this.phaseValue,accounting:this.accounting(),recent:this.recentActivity.map(o=>o.running&&o.ts!==void 0?{...o,durationMs:Math.max(0,e-o.ts)}:o),...this.stopValue!==void 0?{stop:this.stopValue}:{}}}},Kc=class{root;byId=new Map;clock;maxTerminalNodes;evictedTokens=0;evictedToolCalls=0;evictedIterations=0;evictedNodes=0;evicting=!1;constructor(e){this.clock=e?.clock??Date.now,this.maxTerminalNodes=e?.maxTerminalNodes!==void 0&&e.maxTerminalNodes>=0?e.maxTerminalNodes:tW,this.root=new zc({id:"root",kind:"root",label:e?.rootLabel??"aluy",clock:this.clock}),this.byId.set(this.root.id,this.root)}get rootNode(){return this.root}node(e){return this.byId.get(e)}ensureChild(e,o="subagent",n="root"){let r=this.byId.get(n)??this.root,s=`${r.id}/${e}`,i=this.byId.get(s);if(i)return i;let a=new zc({id:s,kind:o,label:e,parent:r,clock:this.clock,parentSignal:r.cascadeSignal,onTerminal:()=>this.evictTerminalNodes()});return r.addChild(a),this.byId.set(s,a),this.evictTerminalNodes(),a}evictTerminalNodes(){if(!this.evicting){this.evicting=!0;try{this.evictTerminalNodesUnsafe()}finally{this.evicting=!1}}}evictTerminalNodesUnsafe(){let e=[];for(let n of this.root.childNodes)n.isTerminal()&&e.push(n);if(e.length<=this.maxTerminalNodes)return;e.sort((n,r)=>(n.endedAtMs??1/0)-(r.endedAtMs??1/0));let o=e.slice(0,e.length-this.maxTerminalNodes);for(let n of o){let r=n.accounting();this.evictedTokens+=r.tokens,this.evictedToolCalls+=r.toolCalls,this.evictedIterations+=r.iterations,this.evictedNodes+=1,this.root.removeChild(n),this.byId.delete(n.id)}}overview(){let e=[],o=n=>{e.push({id:n.id,kind:n.kind,label:n.label,phase:n.phase,accounting:n.accounting(),...n.stop!==void 0?{stop:n.stop}:{}});for(let r of n.childNodes)o(r)};return o(this.root),e}liveChildren(){return this.root.childNodes.filter(e=>!e.isTerminal())}cancelOne(e){let o=this.byId.get(e);return o?(o.cancel(),this.evictTerminalNodes(),!0):!1}cancelAll(){this.root.cancel(),this.evictTerminalNodes()}cancelRoot(){this.root.cancelOwn()}rootAccounting(){return this.root.accounting()}totalAccounting(){let e=this.evictedTokens,o=this.evictedToolCalls,n=this.evictedIterations;for(let r of this.byId.values()){let s=r.accounting();e+=s.tokens,o+=s.toolCalls,n+=s.iterations}return{tokens:e,toolCalls:o,iterations:n}}get nodeCount(){return this.byId.size}get evictedCount(){return this.evictedNodes}drillIn(e){return this.byId.get(e)?.drillIn()}}});function nW(t){let e=ko(t).replace(/\s+/g," ").trim();return e.length>HT?`${e.slice(0,HT)}\u2026`:e}var oW,Yc,HT,qT=p(()=>{"use strict";Pr();oW=256,Yc=class{events=[];clock;constructor(e){this.clock=e?.clock??Date.now}recordCancel(e,o){return this.push({actorType:"cli",verb:"cancel",targetId:e,targetLabel:o,at:this.clock()})}recordCancelAll(){return this.push({actorType:"cli",verb:"cancel-all",targetId:"*",targetLabel:"todos",at:this.clock()})}recordInjectInput(e,o,n){return this.push({actorType:"cli",verb:"inject-input",targetId:e,targetLabel:o,at:this.clock(),inputDigest:nW(n)})}get log(){return this.events}push(e){return this.events.push(e),this.events.length>oW&&this.events.shift(),e}},HT=120});function Vc(t){return t.kind==="error"}function WT(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,rW)}function GT(t){let e=t.trim().toLowerCase().replace(/\s+/g,"_");switch(e){case"read":return"read_file";case"edit":case"multiedit":return"edit_file";case"write":return"write_file";case"bash":case"shell":return"run_command";case"glob":case"grep":return"grep";case"webfetch":case"web_fetch":return"web_fetch";case"websearch":case"web_search":return"web_search";case"task":return ki;default:return e}}function iW(t){let e=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
100
100
|
`),o=/^---\n([\s\S]*?)\n---\n?/.exec(e);if(!o)return{fm:{hasToolsKey:!1},body:e.trim()};let n={},r=!1;for(let s of o[1].split(`
|
|
101
101
|
`)){let i=/^\s*([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(s);if(!i)continue;let a=i[1].toLowerCase(),l=i[2].trim().replace(/^["']|["']$/g,"");a==="name"?n.name=l:a==="description"?n.description=l:a==="model"?n.model=l:a==="tools"?(r=!0,n.toolsRaw=l):a==="room"&&(n.roomRaw=l)}return{fm:{...n,hasToolsKey:r},body:e.slice(o[0].length).trim()}}function aW(t){let e=t.trim().replace(/^\[/,"").replace(/\]$/,"");if(e.trim()==="")return null;let o=e.split(",").map(s=>GT(s)).filter(s=>s!=="");if(o.length===0||o.length>sW)return null;let n=new Set,r=[];for(let s of o)n.has(s)||(n.add(s),r.push(s));return r}function Xc(t,e,o){let n=t,{fm:r,body:s}=iW(e),i=WT(r.name??"");if(i==="")return{kind:"error",file:n,reason:`agente "${n}": frontmatter sem "name" v\xE1lido \u2014 perfil rejeitado (fail-closed)`};if(s==="")return{kind:"error",file:n,reason:`agente "${i}" (${n}): corpo vazio \u2014 sem system prompt, perfil rejeitado`};let a;if(r.hasToolsKey){let m=aW(r.toolsRaw??"");if(m===null)return{kind:"error",file:n,reason:`agente "${i}" (${n}): "tools" presente mas ileg\xEDvel/vazio \u2014 perfil n\xE3o carregado (uma lista de tools vazia ou ileg\xEDvel \xE9 tratada como inv\xE1lida, nunca como "sem tools = herda tudo")`};a=m}let l=r.description!==void 0&&r.description!==""?r.description:void 0,c=r.model!==void 0&&r.model!==""?r.model:void 0,u=r.roomRaw!==void 0?r.roomRaw.trim().toLowerCase()!=="false":void 0;return{name:i,...l!==void 0?{description:l}:{},...a!==void 0?{tools:a}:{},...c!==void 0?{model:c}:{},...u!==void 0?{room:u}:{},systemPrompt:s,origin:o}}var rW,sW,zT=p(()=>{"use strict";Ff();rW=64,sW=64});function Kv(t,e){if(e.agent===void 0||e.agent.trim()==="")return{ok:!0,profile:e,crossLayerConflict:!1,origin:"global"};let o=t.resolveByName(e.agent);if(!o)return{ok:!1,error:`agente "${e.agent}" desconhecido (nenhum .md em ~/.aluy/agents/ nem .claude/agents/ com esse nome) \u2014 delega\xE7\xE3o RECUSADA (GS-MD7): nome expl\xEDcito exigido, sem fallback p/ perfil sem restri\xE7\xE3o.`};let n=o.profile,r=n.tools!==void 0?new Set(n.tools):void 0;return{ok:!0,profile:{...e,label:e.label,...n.systemPrompt!==""?{systemPrompt:n.systemPrompt}:{},...r!==void 0?{toolScope:r}:{},...n.room===!1?{roomOptOut:!0}:{}},...n.model!==void 0?{model:n.model}:{},crossLayerConflict:o.crossLayerConflict,origin:n.origin}}function KT(t){let e=new Set;for(let o of t.toLowerCase().split(/[^a-z0-9_]+/))o.length>=3&&e.add(o);return e}var xi,YT=p(()=>{"use strict";xi=class{globalByName=new Map;projectByName=new Map;conflicts=[];constructor(e=[],o=[]){for(let n of e)n.origin==="global"&&(this.globalByName.has(n.name)||this.globalByName.set(n.name,n));for(let n of o)n.origin==="project"&&(this.projectByName.has(n.name)||this.projectByName.set(n.name,n));for(let[n,r]of this.projectByName){let s=this.globalByName.get(n);s&&this.conflicts.push({name:n,global:s,project:r})}}list(){let e=new Map;for(let[o,n]of this.globalByName)e.set(o,n);for(let[o,n]of this.projectByName)e.set(o,n);return[...e.values()].sort((o,n)=>o.name.localeCompare(n.name))}listGlobal(){return[...this.globalByName.values()].sort((e,o)=>e.name.localeCompare(o.name))}get crossLayerConflicts(){return this.conflicts}resolveByName(e){let o=e.trim().toLowerCase(),n=this.projectByName.get(o),r=this.globalByName.get(o),s=n??r;if(s)return{profile:s,crossLayerConflict:n!==void 0&&r!==void 0}}autoSelect(e){let o=KT(e);if(o.size===0)return;let n,r=0;for(let s of this.listGlobal()){if(s.origin!=="global")continue;let i=KT(`${s.name} ${s.description??""}`),a=0;for(let l of o)i.has(l)&&(a+=1);a>r&&(r=a,n=s)}return r>0?n:void 0}}});function Fr(t,e,o={}){let n=o.indent??" ",r=t.length,s=(m,d)=>{let h=o.maxWidths?.[d];return h!==void 0&&m.length>h?m.slice(0,Math.max(1,h-1))+"\u2026":m},i=(m,d)=>s(m[d]??"",d),a=[t,...e],l=[];for(let m=0;m<r;m+=1)l[m]=Math.max(...a.map(d=>i(d,m).length));let c=(m,d,h)=>n+m+l.map(g=>"\u2500".repeat(g+2)).join(d)+h,u=m=>n+"\u2502 "+l.map((d,h)=>i(m,h).padEnd(d)).join(" \u2502 ")+" \u2502";return[c("\u250C","\u252C","\u2510"),u(t),c("\u251C","\u253C","\u2524"),...e.map(u),c("\u2514","\u2534","\u2518")]}var If=p(()=>{"use strict"});function XT(t){let o=(t.description!==void 0&&t.description.trim()!==""?t.description:t.systemPrompt.split(`
|
|
102
|
-
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=VT?o:`${o.slice(0,VT-1).trimEnd()}\u2026`}function Jc(t){let e=t.globalDir??"~/.aluy/agents",o=[],n=[...t.profiles].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.file.localeCompare(i.file));if(n.length===0&&r.length===0)return{title:"agents",lines:[`nenhum agente .md mapeado \u2014 crie um em ${e}/<nome>.md`,"frontmatter
|
|
102
|
+
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=VT?o:`${o.slice(0,VT-1).trimEnd()}\u2026`}function Jc(t){let e=t.globalDir??"~/.aluy/agents",o=[],n=[...t.profiles].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.file.localeCompare(i.file));if(n.length===0&&r.length===0)return{title:"agents",lines:[`nenhum agente .md mapeado \u2014 crie um em ${e}/<nome>.md`,"frontmatter: `name` (obrigat\xF3rio); `description` e `tools:` (lista \u2286 pai) opcionais;","o corpo do .md \xE9 a persona (system prompt) do sub-agente.","s\xE3o os perfis que o `spawn_agent` (sub-agentes) invoca por nome."]};if(n.length>0){o.push(`v\xE1lidos (${n.length}) \u2014 perfis que o spawn_agent invoca por nome:`);let s=n.map(i=>[i.name,i.origin==="global"?"global":"projeto",i.tools===void 0?"herda do pai":i.tools.length?i.tools.join(", "):"(nenhuma)",XT(i)]);o.push(...Fr(["agente","escopo","tools","sobre"],s,{maxWidths:[18,8,24,44]}))}if(r.length>0){o.length>0&&o.push(""),o.push(`rejeitados (${r.length}) \u2014 n\xE3o foram carregados por estarem inv\xE1lidos:`);let s=r.map(i=>[i.file,i.reason]);o.push(...Fr(["arquivo","motivo"],s,{maxWidths:[22,52]})),o.push(" conserto: o frontmatter precisa de `name`, corpo (persona) e \u2014 se declarar"),o.push(" `tools:` \u2014 uma LISTA leg\xEDvel (ex.: `tools: read_file, grep`).")}return o.push(""),o.push("global (~/.aluy/agents/) = config do dono \xB7 projeto (.claude/agents/) = dado do repo."),{title:"agents",lines:o}}var VT,JT=p(()=>{"use strict";If();VT=100});function Qc(t){return t.kind==="error"}function Yv(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,lW)}function cW(t){let e=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
103
103
|
`),o=/^---\n([\s\S]*?)\n---\n?/.exec(e);if(!o)return{fm:{},body:e.trim()};let n={};for(let r of o[1].split(`
|
|
104
104
|
`)){let s=/^\s*([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(r);if(!s)continue;let i=s[1].toLowerCase(),a=s[2].trim().replace(/^["']|["']$/g,"");i==="name"?n.name=a:i==="description"&&(n.description=a)}return{fm:n,body:e.slice(o[0].length).trim()}}function Zc(t,e,o){let{fm:n,body:r}=cW(e),s=Yv(n.name??""),i=s!==""?s:Yv(t);if(i==="")return{kind:"error",name:t,reason:`skill "${t}": sem "name" v\xE1lido (frontmatter nem nome do diret\xF3rio) \u2014 rejeitada (fail-closed)`};if(r==="")return{kind:"error",name:i,reason:`skill "${i}": SKILL.md com corpo vazio \u2014 sem instru\xE7\xF5es, rejeitada (fail-closed)`};let a=n.description!==void 0&&n.description!==""?n.description:void 0;return{name:i,...a!==void 0?{description:a}:{},instructions:r,origin:o}}var lW,QT=p(()=>{"use strict";lW=64});function e_(t){let o=(t.description!==void 0&&t.description.trim()!==""?t.description:t.instructions.split(`
|
|
105
|
-
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=ZT?o:`${o.slice(0,ZT-1).trimEnd()}\u2026`}function eu(t){let e=t.globalDir??"~/.aluy/skills",o=[],n=[...t.skills].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.name.localeCompare(i.name));if(n.length===0&&r.length===0)return{title:"skills",lines:[`nenhuma skill mapeada \u2014 crie uma em ${e}/<nome>/SKILL.md`,"manifesto
|
|
105
|
+
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=ZT?o:`${o.slice(0,ZT-1).trimEnd()}\u2026`}function eu(t){let e=t.globalDir??"~/.aluy/skills",o=[],n=[...t.skills].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.name.localeCompare(i.name));if(n.length===0&&r.length===0)return{title:"skills",lines:[`nenhuma skill mapeada \u2014 crie uma em ${e}/<nome>/SKILL.md`,"manifesto: frontmatter com `name` (obrigat\xF3rio); `description` opcional;","o corpo do SKILL.md s\xE3o as instru\xE7\xF5es/capacidade injetadas quando invocada.","invoque por nome: `/skill <nome>` (injeta as instru\xE7\xF5es no contexto sob demanda)."]};if(n.length>0){o.push(`v\xE1lidas (${n.length}) \u2014 invoque por nome com /skill <nome>:`);let s=n.map(i=>[i.name,i.origin==="global"?"global":"projeto",e_(i)]);o.push(...Fr(["skill","escopo","sobre"],s,{maxWidths:[20,8,50]}))}if(r.length>0){o.length>0&&o.push(""),o.push(`rejeitadas (${r.length}) \u2014 n\xE3o foram carregadas por estarem inv\xE1lidas:`);let s=r.map(i=>[i.name,i.reason]);o.push(...Fr(["skill","motivo"],s,{maxWidths:[22,50]})),o.push(" conserto: o SKILL.md precisa de `name` (ou herda o nome da pasta) e de um"),o.push(" corpo n\xE3o-vazio (as instru\xE7\xF5es da skill).")}return o.push(""),o.push("global (~/.aluy/skills/) = config do dono \xB7 projeto (.claude/skills/) = dado do repo."),{title:"skills",lines:o}}var ZT,t_=p(()=>{"use strict";If();ZT=100});function Vv(t){if(t.length===0)return;let e=[n_];for(let o of t){let n=o.description?.trim()||o.systemPrompt.split(`
|
|
106
106
|
`).find(l=>l.trim()!=="")||"",s=(o.origin==="project"?Dn(n):n).replace(/\s+/g," ").trim(),i=s.length<=o_?s:`${s.slice(0,o_-1).trimEnd()}\u2026`,a=o.origin==="project"?" [projeto]":"";e.push(`- ${o.name}${a} \u2014 ${i}`)}return e.join(`
|
|
107
107
|
`)}var n_,o_,r_=p(()=>{"use strict";_c();n_="AGENTES DISPON\xCDVEIS \u2014 voc\xEA tem um TIME de sub-agentes especializados. A CADA tarefa, AVALIE se ela se beneficia de DELEGAR (por especializa\xE7\xE3o ou paralelismo) e, se sim, USE-OS PROATIVAMENTE via a tool `spawn_agent` (campo `agent: <nome>`) \u2014 N\xC3O espere ser pedido. Ex.: feature full-stack \u21D2 dev-backend + dev-frontend (+ qa) em paralelo; revis\xE3o \u21D2 revisor; an\xE1lise de seguran\xE7a/arquitetura \u21D2 seguranca + arquiteto. Tarefa simples/trivial voc\xEA faz sozinho (n\xE3o delegue \xE0 toa). Cada agente tem persona/tools/tier pr\xF3prios. O time:",o_=80});function tu(t){return t.error===!0}function mW(t){let e=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
108
108
|
`),o=/^---\n([\s\S]*?)\n---\n?/.exec(e);if(!o)return{fm:{},body:e.trim()};let n={};for(let r of o[1].split(`
|
|
@@ -154,7 +154,7 @@ ${t.trim()}`}}function bR(t,e,o=hu){let{older:n,recent:r}=Jf(t,o);if(n.length===
|
|
|
154
154
|
`);let i=So(process.execPath,[n,"-p",o,"--yolo","--no-self-check"],{stdio:"inherit",timeout:9e5,env:{...process.env,ALUY_OVERWRITE_RENDER:"0",ALUY_SYNC_OUTPUT:"0",ALUY_NO_WEAK_YOLO_WARN:"1",ALUY_PRINT_VERBOSE:"1"}});if(t==="mem0")try{let l=ve(cn(),$r),c=ve(l,Rn);Ze(l)&&Tp(Rp(),c)}catch{}t==="ollama"&&(await BG(),UG()),process.stderr.write(`
|
|
155
155
|
verificando "${t}"\u2026 (alguns segundos; a pr\xF3xima etapa vem em seguida)
|
|
156
156
|
`);let a=await WO(t,process.platform,!0);for(let l=0;l<IG&&!a;l++)await $G(NG),a=await WO(t,process.platform,!0);return{target:t,hashOk:a,installed:a,message:a?`complemento "${t}" instalado e verificado.`:`o complemento "${t}" ainda n\xE3o respondeu como esperado. O Aluy CLI funciona sem ele; voc\xEA pode tentar de novo depois com \`aluy bootstrap\`.`}}function $G(t){return new Promise(e=>setTimeout(e,t))}async function BG(){for(let t of[_n,Op()])try{await(await fetch(`http://${an}:${Jn}/api/pull`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,stream:!1})})).text()}catch{}}function UG(){if(process.platform!=="win32")try{let t=So("sh",["-lc","command -v ollama"],{encoding:"utf8",timeout:1e4});if(t.status===0&&(t.stdout??"").trim()!=="")return;let e=_p(),n=["/usr/local/bin/ollama","/usr/bin/ollama","/opt/homebrew/bin/ollama",ve(e,".ollama","bin","ollama"),ve(cn(),xs,"bin","ollama")].find(i=>Ze(i));if(n===void 0)return;let r=ve(e,".local","bin");_x(r,{recursive:!0});let s=ve(r,"ollama");try{if(UO(s)===UO(n))return;bG(s)}catch{}try{yG(n,s)}catch{}}catch{}}function jG(){try{return So("python3",["-m","venv","--help"],{timeout:1e4}).status===0}catch{return!1}}function HG(){try{return So("python3",["-m","pip","--version"],{timeout:1e4}).status===0}catch{return!1}}function qG(t){let e=[],o=[];if(t.has("ollama")&&(zO()||(e.push("zstd (extrair o Ollama)"),o.push("zstd")),KO()||(e.push("tar (extrair o Ollama)"),o.push("tar"))),t.has("mem0")||t.has("headroom")){let r=Ox();r.ok?(jG()||(e.push("m\xF3dulo venv do Python (mem0/headroom criam um virtualenv)"),o.push("python3-venv")),HG()||(e.push("pip do Python (mem0/headroom instalam pacotes)"),o.push("python3-pip"))):(e.push(`python3 >= ${bu} para mem0/headroom (encontrado: ${r.version||"nenhum"})`),o.push("python3","python3-venv","python3-pip"))}if(e.length===0)return[];let n=[...new Set(o)];return["Faltam pr\xE9-requisitos para o modo turbo (o que conseguir, instala; o resto fica de fora):",...e.map(r=>` \u2022 ${r}`),`Instale e rode \`aluy bootstrap\` de novo: sudo apt install -y ${n.join(" ")}`,""]}async function VO(t,e,o){let n=t??"turbo",r=Br(e??{}),s=o?.useAgent!==!1,i=new Tx({...o?.platform?{platform:o.platform}:{},...s?{agentInstaller:FG}:{}});if(!s)for(let a of qG(r))process.stderr.write(a+`
|
|
157
|
-
`);return i.provisionAll(n,r)}var GO,Ka,SG,Rn,HO,Tx,qO,LG,IG,NG,Mx=p(()=>{"use strict";L();GO=".aluy",Ka=448,SG=384;Rn="aluy-mem0-server.py";HO="application/vnd.ollama.image.model";Tx=class{platform;agentInstaller;constructor(e={}){this.platform=e.platform??process.platform,this.agentInstaller=e.agentInstaller}hasPinnedArtifact(){return this.platform==="linux"}async isProvisioned(e){switch(e){case"ollama":{let o=ve(cn(),xs,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(cn(),$r,"bin","python3");return Ze(o)&&Pu(o)}case"headroom":{let o=ve(cn(),Ss,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=kG().uid;if(qk(n))return{target:e,hashOk:!1,installed:!1,message:"RECUSA ROOT (uid=0): provisionamento de sidecars \xE9 user-space. Execute como usu\xE1rio normal."};if(this.agentInstaller)return this.agentInstaller(e,o);if(!this.hasPinnedArtifact())return{target:e,hashOk:!1,installed:!1,message:`SO '${this.platform}' sem artefato pinado p/ provisionamento direto. Rode \`aluy bootstrap\` (o aluy instala via o pr\xF3prio agente, \u26A0 --yolo) ou instale manualmente.`};switch(e){case"ollama":return DG();case"mem0":return OG();case"headroom":return MG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!ku(e))return{profile:e,targets:[],anySuccess:!1,allFailed:!1};let n=[],r=[...o];for(let a=0;a<r.length;a++){let l=r[a],c={index:a+1,total:r.length,plan:r};try{n.push(await this.provision(l,c))}catch(u){let m=u instanceof Error?u.message:String(u);n.push({target:l,hashOk:!1,installed:!1,message:`falha inesperada ao provisionar \u2014 seguindo p/ os pr\xF3ximos (${m}).`})}}let s=n.some(a=>a.installed),i=n.length>0&&n.every(a=>!a.installed);return{profile:e,targets:n,anySuccess:s,allFailed:i}}},qO="na faixa 3.10\u20133.12 (N\xC3O use 3.13+/3.14 \u2014 as depend\xEAncias nativas n\xE3o t\xEAm wheels e o pip falha ao compilar; no Windows prefira `py -3.12` ou `py -3.11`). Se N\xC3O houver um Python 3.10\u20133.12 instalado, INSTALE primeiro (no Windows: `winget install -e --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements`; no Linux/macOS use o gerenciador do sistema). Se j\xE1 existir um venv nesse caminho numa vers\xE3o incompat\xEDvel (ex.: 3.14), APAGUE e recrie com a vers\xE3o certa",LG="IMPORTANTE \u2014 o usu\xE1rio quer ACOMPANHAR: antes de cada passo, diga em 1 linha o que vai fazer; rode os comandos de instala\xE7\xE3o de forma VIS\xCDVEL (N\xC3O silencie pip/apt/curl com -q; mostre a sa\xEDda/progresso). Sem modo silencioso. ";IG=24,NG=5e3});var Zn,Fu=p(()=>{"use strict";Zn="1.0.0-rc.83"});var eM={};pt(eM,{HELP_TEXT:()=>JO,parseArgs:()=>Lx,suggestFlag:()=>YG,versionText:()=>QO});function ut(t,e,o={}){let n=`--${e}=`;for(let r=0;r<t.length;r++){let s=t[r];if(s===`--${e}`){let i=t[r+1];return i===void 0||(o.allowDashValue?i.startsWith("--"):i.startsWith("-"))?void 0:i}if(s!==void 0&&s.startsWith(n))return s.slice(n.length)}}function WG(t,e){let o=`-${e}=`;for(let n=0;n<t.length;n++){let r=t[n];if(r===`-${e}`){let s=t[n+1];return s!==void 0&&!s.startsWith("-")?s:void 0}if(r!==void 0&&r.startsWith(o))return r.slice(o.length)}}function QO(){return`aluy ${Zn} (@hiperplano/aluy-cli-core ${Xl})`}function KG(t,e){let o=t.length,n=e.length,r=Array.from({length:n+1},(s,i)=>i);for(let s=1;s<=o;s++){let i=[s];for(let a=1;a<=n;a++){let l=t[s-1]===e[a-1]?0:1;i[a]=Math.min(r[a]+1,i[a-1]+1,r[a-1]+l)}r=i}return r[n]}function YG(t){let e,o=3;for(let n of ZO){let r=KG(t,n);r<o&&(o=r,e=n)}return e}function VG(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")break;if(!r.startsWith("--")||r.length===2||e.has(n))continue;let s=r.slice(2).split("=",1)[0];s===""||ZO.has(s)||o.push(`--${s}`)}return o}function Lx(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let W=t.slice(1),fe=ut(W,"token"),go=ut(W,"org"),Wt=W.includes("--device"),Oo=ut(W,"provider"),jn=W.includes("--oauth");return{kind:"login",forceDeviceFlow:Wt,...fe!==void 0?{token:fe}:{},...go!==void 0?{org:go}:{},...Oo!==void 0?{provider:Oo}:{},...jn?{oauth:!0}:{}}}if(e==="logout"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"logout"};if(e==="whoami"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"whoami"};if(e==="doctor"&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--deep")||t.includes("--test"),fe=t.includes("--json");return{kind:"doctor",deep:W,json:fe}}if(e==="config"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"config",json:t.includes("--json")};if(e==="agents"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"agents"};if(e==="bootstrap"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"bootstrap",agent:!t.includes("--no-agent")};if(e==="uninstall"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"uninstall",agent:t.includes("--agent")};if(e==="onboard"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"onboard"};if(e==="skills"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"skills"};if(e==="workflows"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"workflows"};if((e==="models"||e==="providers")&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--json"),fe=t.findIndex(Wt=>Wt==="--backend"||Wt.startsWith("--backend=")),go="both";if(fe!==-1){let Oo=(t[fe].includes("=")?t[fe].slice(10):t[fe+1]??"").trim().toLowerCase();Oo==="local"?go="local":Oo==="broker"&&(go="broker")}return{kind:"models",scope:go,json:W,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let W=t[1];if(W===void 0||!["login","logout","allow","deny","status"].includes(W))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let go=t.slice(2);if(W==="login"){let Wt=ut(go,"token");return{kind:"telegram",sub:"login",...Wt!==void 0?{token:Wt}:{}}}if(W==="allow"||W==="deny"){let Wt=go.find(jn=>!jn.startsWith("-")),Oo=Wt!==void 0&&/^-?\d+$/.test(Wt)?Number(Wt):void 0;return Oo===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Oo}}return{kind:"telegram",sub:W}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(fe=>!fe.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:QO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:JO};let o=t.includes("--plan"),n=t.includes("--unsafe"),r=t.includes("--yolo")||n,s=o?"plan":r?"unsafe":"normal",i=t.includes("--dense"),a=t.includes("--ascii"),l=t.includes("--telegram"),c=t.includes("--split")||t.includes("--view")?!0:void 0,u=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,d=ut(t,"tier"),h=ut(t,"lang"),g=ut(t,"max-tokens"),b=ut(t,"max-iterations"),y=ut(t,"max-output-tokens"),w=!(t.includes("--no-subagents")||t.includes("--no-subagent")),E=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,C=t.includes("--no-autocompact")?"off":ut(t,"autocompact-at"),O=t.includes("--quiet")?!0:void 0,U=t.includes("--cycle")?!0:void 0,q=ut(t,"cycles"),V=ut(t,"cycle-for"),z=ut(t,"backend"),I=ut(t,"local-provider"),Q=ut(t,"local-model"),ne=ut(t,"local-auth"),J=ut(t,"local-base-url"),M=ut(t,"model"),j=ut(t,"provider");if((t.includes("--provider")||t.some(W=>W.startsWith("--provider=")))&&(M===void 0||M.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((M===void 0||M.trim()==="")&&d!==void 0&&d.trim().toLowerCase()==="custom")return{kind:"usage-error",message:"aluy: --tier custom exige --model <slug> (ex.: --model deepseek-v4-pro). A via Custom precisa do slug do modelo; sem ele use um tier can\xF4nico (aluy-flux, aluy-granito, \u2026).",exitCode:2};let Y=ut(t,"effort"),pe=t.includes("--effort")||t.some(W=>W.startsWith("--effort=")),Z;if(Y!==void 0){if(Y.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(Y.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};Z=Y}else if(pe)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let ae=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec=")),F=ae?ut(t,"print",{allowDashValue:!0})??ut(t,"exec",{allowDashValue:!0})??WG(t,"p")??void 0:void 0,ge=ae?ut(t,"output-format"):void 0;if(ge!==void 0&&!["text","json","stream-json"].includes(ge.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${ge}" (use text | json | stream-json)`,exitCode:2};let te=t.includes("--new"),ue=t.includes("--continue"),we=t.indexOf("--resume"),_t=t.find(W=>W.startsWith("--resume=")),Re=we>=0||_t!==void 0,rt;if(_t!==void 0)rt=_t.slice(9);else if(we>=0){let W=t[we+1];W!==void 0&&!W.startsWith("-")&&(rt=W)}let vt=d!==void 0?t.indexOf("--tier")+1:-1,bt=h!==void 0&&!t.some(W=>W.startsWith("--lang="))?t.indexOf("--lang")+1:-1,st=rt!==void 0&&_t===void 0?we+1:-1,Rt=g!==void 0&&!t.some(W=>W.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,K=b!==void 0&&!t.some(W=>W.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,xe=q!==void 0&&!t.some(W=>W.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Pe=V!==void 0&&!t.some(W=>W.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,H=y!==void 0&&!t.some(W=>W.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,jt=C!==void 0&&!t.includes("--no-autocompact")&&!t.some(W=>W.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,Ro=z!==void 0&&!t.some(W=>W.startsWith("--backend="))?t.indexOf("--backend")+1:-1,k=(W,fe)=>fe!==void 0&&!t.some(go=>go.startsWith(`--${W}=`))?t.indexOf(`--${W}`)+1:-1,ho=k("local-provider",I),Ot=k("local-model",Q),kt=k("local-auth",ne),ss=k("local-base-url",J),is=M!==void 0&&!t.some(W=>W.startsWith("--model="))?t.indexOf("--model")+1:-1,xr=j!==void 0&&!t.some(W=>W.startsWith("--provider="))?t.indexOf("--provider")+1:-1,Sr=Z!==void 0&&!t.some(W=>W.startsWith("--effort="))?t.indexOf("--effort")+1:-1,Ht=ge!==void 0&&!t.some(W=>W.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,qt=F!==void 0&&!t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,Zo=t.find((W,fe)=>!W.startsWith("-")&&fe!==vt&&fe!==bt&&fe!==Ro&&fe!==ho&&fe!==Ot&&fe!==kt&&fe!==ss&&fe!==is&&fe!==xr&&fe!==Sr&&fe!==Ht&&fe!==qt&&fe!==st&&fe!==Rt&&fe!==K&&fe!==H&&fe!==jt&&fe!==xe&&fe!==Pe),jo=(F??Zo??"").trim();if(jo!==""&&!/\s/.test(jo)&&zG.has(jo.toLowerCase()))return{kind:"usage-error",message:`aluy: "${jo}" \xE9 um comando de SESS\xC3O, n\xE3o um objetivo. Use /${jo} DENTRO do aluy (rode \`aluy\` sem argumentos), ou veja \`aluy --help\`. Se voc\xEA quis MESMO um objetivo com essa palavra, d\xEA mais contexto (ex.: \`aluy "${jo} o arquivo X"\`).`,exitCode:2};let ls=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,xn=new Set([vt,bt,Ro,ho,Ot,kt,ss,is,xr,Sr,Ht,qt,st,Rt,K,H,jt,xe,Pe].filter(W=>W>=0));for(let W of GG){let fe=t.indexOf(W);fe>=0&&!t[fe].includes("=")&&xn.add(fe+1)}let ti=VG(t,xn);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...ti.length>0?{unknownFlags:ti}:{},dense:i,fresh:te,subAgents:w,safeGlyphs:a,telegram:l,print:ae,...c!==void 0?{split:c}:{},...u!==void 0?{fullscreen:u}:{},...m!==void 0?{budget:m}:{},...Zo!==void 0?{goal:Zo}:{},...d!==void 0?{tier:d}:{},...z!==void 0?{backend:z}:{},...I!==void 0?{localProvider:I}:{},...Q!==void 0?{localModel:Q}:{},...ne!==void 0?{localAuth:ne}:{},...J!==void 0?{localBaseUrl:J}:{},...M!==void 0?{model:M}:{},...j!==void 0?{provider:j}:{},...Z!==void 0?{effort:Z}:{},...F!==void 0?{printArg:F}:{},...ge!==void 0?{outputFormat:ge}:{},...h!==void 0?{lang:h}:{},...ls!==void 0?{resume:ls}:{},...g!==void 0?{maxTokens:g}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...E!==void 0?{selfCheck:E}:{},...C!==void 0?{autoCompactAt:C}:{},...O!==void 0?{quiet:O}:{},...U!==void 0?{cycle:U}:{},...q!==void 0?{cycles:q}:{},...V!==void 0?{cycleFor:V}:{}}}var JO,ZO,GG,zG,Px=p(()=>{"use strict";L();Fu();JO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
157
|
+
`);return i.provisionAll(n,r)}var GO,Ka,SG,Rn,HO,Tx,qO,LG,IG,NG,Mx=p(()=>{"use strict";L();GO=".aluy",Ka=448,SG=384;Rn="aluy-mem0-server.py";HO="application/vnd.ollama.image.model";Tx=class{platform;agentInstaller;constructor(e={}){this.platform=e.platform??process.platform,this.agentInstaller=e.agentInstaller}hasPinnedArtifact(){return this.platform==="linux"}async isProvisioned(e){switch(e){case"ollama":{let o=ve(cn(),xs,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(cn(),$r,"bin","python3");return Ze(o)&&Pu(o)}case"headroom":{let o=ve(cn(),Ss,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=kG().uid;if(qk(n))return{target:e,hashOk:!1,installed:!1,message:"RECUSA ROOT (uid=0): provisionamento de sidecars \xE9 user-space. Execute como usu\xE1rio normal."};if(this.agentInstaller)return this.agentInstaller(e,o);if(!this.hasPinnedArtifact())return{target:e,hashOk:!1,installed:!1,message:`SO '${this.platform}' sem artefato pinado p/ provisionamento direto. Rode \`aluy bootstrap\` (o aluy instala via o pr\xF3prio agente, \u26A0 --yolo) ou instale manualmente.`};switch(e){case"ollama":return DG();case"mem0":return OG();case"headroom":return MG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!ku(e))return{profile:e,targets:[],anySuccess:!1,allFailed:!1};let n=[],r=[...o];for(let a=0;a<r.length;a++){let l=r[a],c={index:a+1,total:r.length,plan:r};try{n.push(await this.provision(l,c))}catch(u){let m=u instanceof Error?u.message:String(u);n.push({target:l,hashOk:!1,installed:!1,message:`falha inesperada ao provisionar \u2014 seguindo p/ os pr\xF3ximos (${m}).`})}}let s=n.some(a=>a.installed),i=n.length>0&&n.every(a=>!a.installed);return{profile:e,targets:n,anySuccess:s,allFailed:i}}},qO="na faixa 3.10\u20133.12 (N\xC3O use 3.13+/3.14 \u2014 as depend\xEAncias nativas n\xE3o t\xEAm wheels e o pip falha ao compilar; no Windows prefira `py -3.12` ou `py -3.11`). Se N\xC3O houver um Python 3.10\u20133.12 instalado, INSTALE primeiro (no Windows: `winget install -e --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements`; no Linux/macOS use o gerenciador do sistema). Se j\xE1 existir um venv nesse caminho numa vers\xE3o incompat\xEDvel (ex.: 3.14), APAGUE e recrie com a vers\xE3o certa",LG="IMPORTANTE \u2014 o usu\xE1rio quer ACOMPANHAR: antes de cada passo, diga em 1 linha o que vai fazer; rode os comandos de instala\xE7\xE3o de forma VIS\xCDVEL (N\xC3O silencie pip/apt/curl com -q; mostre a sa\xEDda/progresso). Sem modo silencioso. ";IG=24,NG=5e3});var Zn,Fu=p(()=>{"use strict";Zn="1.0.0-rc.84"});var eM={};pt(eM,{HELP_TEXT:()=>JO,parseArgs:()=>Lx,suggestFlag:()=>YG,versionText:()=>QO});function ut(t,e,o={}){let n=`--${e}=`;for(let r=0;r<t.length;r++){let s=t[r];if(s===`--${e}`){let i=t[r+1];return i===void 0||(o.allowDashValue?i.startsWith("--"):i.startsWith("-"))?void 0:i}if(s!==void 0&&s.startsWith(n))return s.slice(n.length)}}function WG(t,e){let o=`-${e}=`;for(let n=0;n<t.length;n++){let r=t[n];if(r===`-${e}`){let s=t[n+1];return s!==void 0&&!s.startsWith("-")?s:void 0}if(r!==void 0&&r.startsWith(o))return r.slice(o.length)}}function QO(){return`aluy ${Zn} (@hiperplano/aluy-cli-core ${Xl})`}function KG(t,e){let o=t.length,n=e.length,r=Array.from({length:n+1},(s,i)=>i);for(let s=1;s<=o;s++){let i=[s];for(let a=1;a<=n;a++){let l=t[s-1]===e[a-1]?0:1;i[a]=Math.min(r[a]+1,i[a-1]+1,r[a-1]+l)}r=i}return r[n]}function YG(t){let e,o=3;for(let n of ZO){let r=KG(t,n);r<o&&(o=r,e=n)}return e}function VG(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")break;if(!r.startsWith("--")||r.length===2||e.has(n))continue;let s=r.slice(2).split("=",1)[0];s===""||ZO.has(s)||o.push(`--${s}`)}return o}function Lx(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let W=t.slice(1),fe=ut(W,"token"),go=ut(W,"org"),Wt=W.includes("--device"),Oo=ut(W,"provider"),jn=W.includes("--oauth");return{kind:"login",forceDeviceFlow:Wt,...fe!==void 0?{token:fe}:{},...go!==void 0?{org:go}:{},...Oo!==void 0?{provider:Oo}:{},...jn?{oauth:!0}:{}}}if(e==="logout"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"logout"};if(e==="whoami"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"whoami"};if(e==="doctor"&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--deep")||t.includes("--test"),fe=t.includes("--json");return{kind:"doctor",deep:W,json:fe}}if(e==="config"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"config",json:t.includes("--json")};if(e==="agents"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"agents"};if(e==="bootstrap"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"bootstrap",agent:!t.includes("--no-agent")};if(e==="uninstall"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"uninstall",agent:t.includes("--agent")};if(e==="onboard"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"onboard"};if(e==="skills"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"skills"};if(e==="workflows"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"workflows"};if((e==="models"||e==="providers")&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--json"),fe=t.findIndex(Wt=>Wt==="--backend"||Wt.startsWith("--backend=")),go="both";if(fe!==-1){let Oo=(t[fe].includes("=")?t[fe].slice(10):t[fe+1]??"").trim().toLowerCase();Oo==="local"?go="local":Oo==="broker"&&(go="broker")}return{kind:"models",scope:go,json:W,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let W=t[1];if(W===void 0||!["login","logout","allow","deny","status"].includes(W))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let go=t.slice(2);if(W==="login"){let Wt=ut(go,"token");return{kind:"telegram",sub:"login",...Wt!==void 0?{token:Wt}:{}}}if(W==="allow"||W==="deny"){let Wt=go.find(jn=>!jn.startsWith("-")),Oo=Wt!==void 0&&/^-?\d+$/.test(Wt)?Number(Wt):void 0;return Oo===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Oo}}return{kind:"telegram",sub:W}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(fe=>!fe.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:QO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:JO};let o=t.includes("--plan"),n=t.includes("--unsafe"),r=t.includes("--yolo")||n,s=o?"plan":r?"unsafe":"normal",i=t.includes("--dense"),a=t.includes("--ascii"),l=t.includes("--telegram"),c=t.includes("--split")||t.includes("--view")?!0:void 0,u=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,d=ut(t,"tier"),h=ut(t,"lang"),g=ut(t,"max-tokens"),b=ut(t,"max-iterations"),y=ut(t,"max-output-tokens"),w=!(t.includes("--no-subagents")||t.includes("--no-subagent")),E=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,C=t.includes("--no-autocompact")?"off":ut(t,"autocompact-at"),O=t.includes("--quiet")?!0:void 0,U=t.includes("--cycle")?!0:void 0,q=ut(t,"cycles"),V=ut(t,"cycle-for"),z=ut(t,"backend"),I=ut(t,"local-provider"),Q=ut(t,"local-model"),ne=ut(t,"local-auth"),J=ut(t,"local-base-url"),M=ut(t,"model"),j=ut(t,"provider");if((t.includes("--provider")||t.some(W=>W.startsWith("--provider=")))&&(M===void 0||M.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((M===void 0||M.trim()==="")&&d!==void 0&&d.trim().toLowerCase()==="custom")return{kind:"usage-error",message:"aluy: --tier custom exige --model <slug> (ex.: --model deepseek-v4-pro). A via Custom precisa do slug do modelo; sem ele use um tier can\xF4nico (aluy-flux, aluy-granito, \u2026).",exitCode:2};let Y=ut(t,"effort"),pe=t.includes("--effort")||t.some(W=>W.startsWith("--effort=")),Z;if(Y!==void 0){if(Y.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(Y.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};Z=Y}else if(pe)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let ae=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec=")),F=ae?ut(t,"print",{allowDashValue:!0})??ut(t,"exec",{allowDashValue:!0})??WG(t,"p")??void 0:void 0,ge=ae?ut(t,"output-format"):void 0;if(ge!==void 0&&!["text","json","stream-json"].includes(ge.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${ge}" (use text | json | stream-json)`,exitCode:2};let te=t.includes("--new"),ue=t.includes("--continue"),we=t.indexOf("--resume"),_t=t.find(W=>W.startsWith("--resume=")),Re=we>=0||_t!==void 0,rt;if(_t!==void 0)rt=_t.slice(9);else if(we>=0){let W=t[we+1];W!==void 0&&!W.startsWith("-")&&(rt=W)}let vt=d!==void 0?t.indexOf("--tier")+1:-1,bt=h!==void 0&&!t.some(W=>W.startsWith("--lang="))?t.indexOf("--lang")+1:-1,st=rt!==void 0&&_t===void 0?we+1:-1,Rt=g!==void 0&&!t.some(W=>W.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,K=b!==void 0&&!t.some(W=>W.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,xe=q!==void 0&&!t.some(W=>W.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Pe=V!==void 0&&!t.some(W=>W.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,H=y!==void 0&&!t.some(W=>W.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,jt=C!==void 0&&!t.includes("--no-autocompact")&&!t.some(W=>W.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,Ro=z!==void 0&&!t.some(W=>W.startsWith("--backend="))?t.indexOf("--backend")+1:-1,k=(W,fe)=>fe!==void 0&&!t.some(go=>go.startsWith(`--${W}=`))?t.indexOf(`--${W}`)+1:-1,ho=k("local-provider",I),Ot=k("local-model",Q),kt=k("local-auth",ne),ss=k("local-base-url",J),is=M!==void 0&&!t.some(W=>W.startsWith("--model="))?t.indexOf("--model")+1:-1,xr=j!==void 0&&!t.some(W=>W.startsWith("--provider="))?t.indexOf("--provider")+1:-1,Sr=Z!==void 0&&!t.some(W=>W.startsWith("--effort="))?t.indexOf("--effort")+1:-1,Ht=ge!==void 0&&!t.some(W=>W.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,qt=F!==void 0&&!t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,Zo=t.find((W,fe)=>!W.startsWith("-")&&fe!==vt&&fe!==bt&&fe!==Ro&&fe!==ho&&fe!==Ot&&fe!==kt&&fe!==ss&&fe!==is&&fe!==xr&&fe!==Sr&&fe!==Ht&&fe!==qt&&fe!==st&&fe!==Rt&&fe!==K&&fe!==H&&fe!==jt&&fe!==xe&&fe!==Pe),jo=(F??Zo??"").trim();if(jo!==""&&!/\s/.test(jo)&&zG.has(jo.toLowerCase()))return{kind:"usage-error",message:`aluy: "${jo}" \xE9 um comando de SESS\xC3O, n\xE3o um objetivo. Use /${jo} DENTRO do aluy (rode \`aluy\` sem argumentos), ou veja \`aluy --help\`. Se voc\xEA quis MESMO um objetivo com essa palavra, d\xEA mais contexto (ex.: \`aluy "${jo} o arquivo X"\`).`,exitCode:2};let ls=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,xn=new Set([vt,bt,Ro,ho,Ot,kt,ss,is,xr,Sr,Ht,qt,st,Rt,K,H,jt,xe,Pe].filter(W=>W>=0));for(let W of GG){let fe=t.indexOf(W);fe>=0&&!t[fe].includes("=")&&xn.add(fe+1)}let ti=VG(t,xn);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...ti.length>0?{unknownFlags:ti}:{},dense:i,fresh:te,subAgents:w,safeGlyphs:a,telegram:l,print:ae,...c!==void 0?{split:c}:{},...u!==void 0?{fullscreen:u}:{},...m!==void 0?{budget:m}:{},...Zo!==void 0?{goal:Zo}:{},...d!==void 0?{tier:d}:{},...z!==void 0?{backend:z}:{},...I!==void 0?{localProvider:I}:{},...Q!==void 0?{localModel:Q}:{},...ne!==void 0?{localAuth:ne}:{},...J!==void 0?{localBaseUrl:J}:{},...M!==void 0?{model:M}:{},...j!==void 0?{provider:j}:{},...Z!==void 0?{effort:Z}:{},...F!==void 0?{printArg:F}:{},...ge!==void 0?{outputFormat:ge}:{},...h!==void 0?{lang:h}:{},...ls!==void 0?{resume:ls}:{},...g!==void 0?{maxTokens:g}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...E!==void 0?{selfCheck:E}:{},...C!==void 0?{autoCompactAt:C}:{},...O!==void 0?{quiet:O}:{},...U!==void 0?{cycle:U}:{},...q!==void 0?{cycles:q}:{},...V!==void 0?{cycleFor:V}:{}}}var JO,ZO,GG,zG,Px=p(()=>{"use strict";L();Fu();JO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
158
158
|
|
|
159
159
|
Uso:
|
|
160
160
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
package/dist-bundle/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var UI=Object.create;var Fp=Object.defineProperty;var jI=Object.getOwnPropertyDescriptor;var HI=Object.getOwnPropertyNames;var qI=Object.getPrototypeOf,WI=Object.prototype.hasOwnProperty;var S=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var GI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Ip=(t,e)=>{for(var o in e)Fp(t,o,{get:e[o],enumerable:!0})},zI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of HI(e))!WI.call(t,r)&&r!==o&&Fp(t,r,{get:()=>e[r],enumerable:!(n=jI(e,r))||n.enumerable});return t};var KI=(t,e,o)=>(o=t!=null?UI(qI(t)):{},zI(e||!t||!t.__esModule?Fp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,UE=S(()=>{"use strict";Ua="1.0.0-rc.
|
|
1
|
+
var UI=Object.create;var Fp=Object.defineProperty;var jI=Object.getOwnPropertyDescriptor;var HI=Object.getOwnPropertyNames;var qI=Object.getPrototypeOf,WI=Object.prototype.hasOwnProperty;var S=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var GI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Ip=(t,e)=>{for(var o in e)Fp(t,o,{get:e[o],enumerable:!0})},zI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of HI(e))!WI.call(t,r)&&r!==o&&Fp(t,r,{get:()=>e[r],enumerable:!(n=jI(e,r))||n.enumerable});return t};var KI=(t,e,o)=>(o=t!=null?UI(qI(t)):{},zI(e||!t||!t.__esModule?Fp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,UE=S(()=>{"use strict";Ua="1.0.0-rc.84"});function zn(t,e){return t.decide(e)}var ds=S(()=>{"use strict"});var pn,Kn,Yn=S(()=>{"use strict";pn="remember",Kn="recall"});var Np,YI,hi,$p=S(()=>{"use strict";Np=class{id;horizon;label;parentId;children;dependencies;pinned;closed;createdAt;lastAccessedAt;accessCount;context;constructor(e,o,n,r,s){this.id=e,this.horizon=o,this.label=n,this.parentId=r,this.children=new Set,this.dependencies=new Set,this.pinned=!1,this.closed=!1,this.createdAt=s,this.lastAccessedAt=s,this.accessCount=0,this.context=[]}touch(e){this.lastAccessedAt=e,this.accessCount+=1}snapshot(){return{id:this.id,horizon:this.horizon,label:this.label,parentId:this.parentId,children:[...this.children],dependencies:[...this.dependencies],pinned:this.pinned,closed:this.closed,createdAt:this.createdAt,lastAccessedAt:this.lastAccessedAt,accessCount:this.accessCount,contextSize:this.context.length}}},YI=200,hi=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??YI,this.now=e?.clock??Date.now}static boxId(e,o){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}-${o.toString(36)}`}openBox(e,o,n,r){let s=this.nodes.get(e);if(s)return s.touch(this.now()),{box:s.snapshot(),created:!1};if(this.nodes.size>=this.maxBoxes&&(this.evictOne(),this.nodes.size>=this.maxBoxes))return null;let i=this.now(),a=new Np(e,o,n,r??null,i);if(r){let l=this.nodes.get(r);l&&l.children.add(e)}return this.nodes.set(e,a),{box:a.snapshot(),created:!0}}closeBox(e){let o=this.nodes.get(e);return o?(o.closed=!0,o.touch(this.now()),o.snapshot()):null}isClosed(e){let o=this.nodes.get(e);return o?o.closed:!1}reopenBox(e){let o=this.nodes.get(e);return o?(o.closed=!1,o.touch(this.now()),o.snapshot()):null}setHorizon(e,o){let n=this.nodes.get(e);return n?(n.horizon=o,n.touch(this.now()),n.snapshot()):null}setParent(e,o){let n=this.nodes.get(e);return n?n.parentId===o?n.snapshot():o!==null&&this.wouldCreateCycle(e,o)?null:(n.parentId&&this.nodes.get(n.parentId)?.children.delete(e),n.parentId=o,o&&this.nodes.get(o)?.children.add(e),n.touch(this.now()),n.snapshot()):null}wouldCreateCycle(e,o){let n=new Set,r=o;for(;r!==null;){if(r===e||n.has(r))return!0;n.add(r),r=this.nodes.get(r)?.parentId??null}return!1}getBox(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),o.snapshot()):null}listBoxes(e="lastAccessedAt"){let o=[...this.nodes.values()].map(n=>n.snapshot());switch(e){case"createdAt":return o.sort((n,r)=>n.createdAt-r.createdAt);case"accessCount":return o.sort((n,r)=>r.accessCount-n.accessCount);default:return o.sort((n,r)=>r.lastAccessedAt-n.lastAccessedAt)}}get size(){return this.nodes.size}addContext(e,o){let n=this.nodes.get(e);return n?(n.context.push({ts:this.now(),text:o}),n.touch(this.now()),n.snapshot()):null}getContext(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),[...o.context]):[]}getContextChain(e){let o=[],n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let s=this.nodes.get(r);if(!s)break;s.touch(this.now()),o.push({boxId:s.id,entries:[...s.context]}),r=s.parentId}return o}addDependency(e,o){let n=this.nodes.get(e);return!n||!this.nodes.has(o)||n.id===o?!1:(n.dependencies.add(o),n.touch(this.now()),!0)}getDependencies(e){let o=this.nodes.get(e);return o?[...o.dependencies]:[]}pinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!0,o.touch(this.now()),o.snapshot()):null}unpinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!1,o.touch(this.now()),o.snapshot()):null}evictOne(){let e=[];for(let n of this.nodes.values())n.horizon==="longo"||n.pinned||e.push(n);if(e.length===0)return null;e.sort((n,r)=>{let s=n.horizon==="curto"?0:1,i=r.horizon==="curto"?0:1;if(s!==i)return s-i;let a=n.closed?0:1,l=r.closed?0:1;return a!==l?a-l:n.lastAccessedAt!==r.lastAccessedAt?n.lastAccessedAt-r.lastAccessedAt:n.accessCount-r.accessCount});let o=e[0];return this.removeNode(o)}forceEvict(e){let o=this.nodes.get(e);return!o||o.horizon==="longo"||o.pinned?null:this.removeNode(o)}removeBox(e){let o=this.nodes.get(e);return o?this.removeNode(o):null}removeNode(e){if(e.parentId){let o=this.nodes.get(e.parentId);o&&o.children.delete(e.id)}return this.nodes.delete(e.id),e.snapshot()}}});function Wu(t){let e=[];for(let o of t){e.push({step:o,depth:0});for(let n of o.substeps??[])e.push({step:n,depth:1})}return e}function qE(t,e){let o,n="pending",r;if(typeof t=="string")o=t;else if(t!==null&&typeof t=="object"){let i=t,a=i.title??i.step??i.text??i.name??i.content;if(typeof a=="string"&&(o=a),typeof i.status=="string"&&VI.has(i.status)&&(n=i.status),e){let l=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(l)&&l.length>0){let c=[];for(let u of l){let f=qE(u,!1);if(typeof f=="string")return f;c.push(f)}r=c}}}if(o===void 0||o.trim()==="")return JI;let s=o.trim().slice(0,XI);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function QI(t){let e=t.steps??t.plan??t.todos??t.items;if(!Array.isArray(e))return{error:'update_plan: passe "steps" como uma LISTA de passos (string ou {title,status}).'};if(e.length===0)return{error:"update_plan: a lista de passos est\xE1 vazia."};let o=[];for(let i of e){let a=qE(i,!0);if(typeof a=="string")return{error:a};o.push(a)}let n=new Set,r=i=>{if(!n.has(i))return n.add(i),i;for(let a=2;;a++){let l=`${i} #${a}`;if(!n.has(l))return n.add(l),l}};for(let i=0;i<o.length;i++){let a=o[i],l=r(a.title),c=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Wu(o).length;return s>jE?{error:`update_plan: no m\xE1ximo ${jE} passos (recebidos ${s}).`}:{steps:o}}function ZI(t){let e=Wu(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${WE[r.step.status]} ${r.step.title}`).join(`
|
|
2
2
|
`);return`plano (${o}/${e.length}):
|
|
3
3
|
${n}`}function tN(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function oN(t,e){let o=new Map;for(let i of e.listBoxes())o.set(i.label,i.id);let n=t.findIndex(i=>i.status==="in_progress"||(i.substeps??[]).some(a=>a.status==="in_progress")),r=(i,a,l)=>{let c=i.status==="in_progress"?"curto":l,u=o.get(i.title),f=u??hi.boxId(i.title,0);return u?(i.status!=="completed"&&e.isClosed(u)&&e.reopenBox(u),e.setHorizon(u,c),e.setParent(u,a)):e.openBox(f,c,i.title,a),i.status==="completed"&&!e.isClosed(f)&&e.closeBox(f),o.set(i.title,f),f};t.forEach((i,a)=>{let l=tN(a,n),c=r(i,null,l);for(let u of i.substeps??[])r(u,c,l)});let s=new Set;for(let i of t){s.add(i.title);for(let a of i.substeps??[])s.add(a.title)}for(let i of e.listBoxes())s.has(i.label)||e.removeBox(i.id)}function nN(t,e){if(!e)return ZI(t);let o=new Map;for(let c of e.listBoxes())o.set(c.label,c);let n=new Map;for(let c of e.listBoxes())n.set(c.id,c);let r=new Map,s=(c,u=new Set)=>{let f=r.get(c);if(f!==void 0)return f;let d=n.get(c);if(!d||!d.parentId||u.has(c))return r.set(c,0),0;let p=s(d.parentId,new Set(u).add(c))+1;return r.set(c,p),p},i=Wu(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:u}of i){let f=o.get(c.title),d=f?eN[f.horizon]:"",p=f?s(f.id):u,h=" ".repeat(p),y=WE[c.status];l.push(`${h}${d} ${y} ${c.title}`)}return l.join(`
|
|
4
4
|
`)}var ja,VI,jE,XI,JI,WE,eN,HE,rN,GE,Gu=S(()=>{"use strict";$p();ja="update_plan";VI=new Set(["pending","in_progress","completed"]),jE=30,XI=120,JI="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";WE={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};eN={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};HE=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),rN=Object.freeze({type:"object",properties:{steps:{type:"array",description:"A lista COMPLETA de passos do plano (re-emita TODOS a cada atualiza\xE7\xE3o \u2014 substitui o anterior).",items:{type:"object",properties:{title:{type:"string",description:"O passo, curto e no imperativo."},status:HE,substeps:{type:"array",description:"OPCIONAL: sub-passos que detalham este passo (1 n\xEDvel). Aparecem indentados sob o passo e seguem o foco dele. Use quando um passo tem a\xE7\xF5es menores distintas.",items:{type:"object",properties:{title:{type:"string",description:"O sub-passo, curto e no imperativo."},status:HE},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),GE={name:ja,effect:"read",description:"Declara/atualiza um PLANO vis\xEDvel (checklist de passos). Use ao iniciar uma tarefa com V\xC1RIOS passos e a cada progresso: re-emita a lista TODA marcando o status de cada passo (pending/in_progress/completed). Mantenha 1 passo in_progress por vez. N\xE3o tem efeito no sistema \u2014 \xE9 s\xF3 o seu plano, para voc\xEA e para o usu\xE1rio acompanharem.",parameters:rN,async run(t,e){let o=QI(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&oN(o.steps,e.graph),e.plan&&e.plan.set(Wu(o.steps).map(r=>({title:r.step.title,status:r.step.status}))),{ok:!0,observation:nN(o.steps,e.graph)})}}});function zE(t){let e=t.question??t.prompt??t.text??t.message;if(typeof e!="string"||e.trim()==="")return{error:'perguntar: passe "question" (a pergunta em texto). Para escolha, passe tamb\xE9m "options".'};let o=e.trim().slice(0,2e3),n=t.header??t.title,r=typeof n=="string"&&n.trim()!==""?n.trim().slice(0,200):void 0,s=t.options??t.choices,i=Array.isArray(s)?iN(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&sN.has(l))a=l;else{if(typeof l=="string"&&l.trim()!=="")return{error:`perguntar: "kind" inv\xE1lido "${l}". Use "single", "multi" ou "text".`};a=i!==void 0&&i.length>0?"single":"text"}if((a==="single"||a==="multi")&&(i===void 0||i.length===0))return{error:`perguntar: kind "${a}" requer "options" (uma lista de ao menos 1 op\xE7\xE3o).`};let c=t.allowOther!==!1;return{spec:{kind:a,question:o,...r!==void 0?{header:r}:{},...a!=="text"&&i!==void 0?{options:i}:{},...a!=="text"?{allowOther:c}:{}}}}function iN(t){if(t.length===0)return'perguntar: a lista de "options" est\xE1 vazia.';if(t.length>12)return`perguntar: no m\xE1ximo 12 op\xE7\xF5es (recebidas ${t.length}).`;let e=[];for(let o of t){let n,r;if(typeof o=="string")n=o;else if(o!==null&&typeof o=="object"){let s=o,i=s.label??s.text??s.value??s.name??s.title;typeof i=="string"&&(n=i),typeof s.description=="string"&&s.description.trim()!==""&&(r=s.description.trim().slice(0,300))}if(n===void 0||n.trim()==="")return'perguntar: cada op\xE7\xE3o precisa de um "label" (texto) n\xE3o-vazio.';e.push({label:n.trim().slice(0,200),...r!==void 0?{description:r}:{}})}return e}function aN(t){switch(t.kind){case"choice":return t.label;case"choices":return t.labels.length===0?"(nenhuma)":t.labels.join(", ");case"text":{let e=t.text.split(`
|
|
@@ -98,10 +98,10 @@ ${e.join(`
|
|
|
98
98
|
`)}var AB,DB,TB,Ll,Pl,dC=S(()=>{"use strict";Zn();AB=4;DB=12,TB=32,Ll=class{id;kind;label;parent;children=[];abortController;cascadeController=new AbortController;clock;phaseValue="thinking";stopValue;startedAt;endedAt;tokensValue=0;toolCallsValue=0;iterationsValue=0;recentActivity=[];onTerminal;constructor(e){this.id=e.id,this.kind=e.kind,this.label=e.label,this.parent=e.parent??null,this.clock=e.clock??Date.now,this.onTerminal=e.onTerminal,this.abortController=new AbortController,this.startedAt=this.clock(),e.parentSignal&&(e.parentSignal.aborted?this.abortController.abort():e.parentSignal.addEventListener("abort",()=>this.abortController.abort(),{once:!0}))}get signal(){return this.abortController.signal}get cascadeSignal(){return this.cascadeController.signal}get aborted(){return this.abortController.signal.aborted}get phase(){return this.phaseValue}get stop(){return this.stopValue}get childNodes(){return this.children}get endedAtMs(){return this.endedAt}addChild(e){this.children.push(e)}removeChild(e){let o=this.children.indexOf(e);return o<0?!1:(this.children.splice(o,1),!0)}setPhase(e){this.isTerminal()||(this.phaseValue=e)}isTerminal(){return this.phaseValue==="done"||this.phaseValue==="cancelled"||this.phaseValue==="failed"}noteToolStart(e,o){this.pushRecent({tool:e,target:Qt(o),running:!0,ts:this.clock()})}noteToolEnd(e,o,n){for(let r=this.recentActivity.length-1;r>=0;r--){let s=this.recentActivity[r];if(s.tool===e&&s.running){this.recentActivity[r]=this.closeActivity(s,o,n);return}}}noteLastToolEnd(e,o){for(let n=this.recentActivity.length-1;n>=0;n--){let r=this.recentActivity[n];if(r.running){this.recentActivity[n]=this.closeActivity(r,e,o);return}}}noteToolTail(e){for(let o=this.recentActivity.length-1;o>=0;o--){let n=this.recentActivity[o];if(n.running){this.recentActivity[o]={...n,tail:CB(e)};return}}}closeActivity(e,o,n){let r={...e,running:!1,ok:o},s=e.ts!==void 0?{...r,durationMs:Math.max(0,this.clock()-e.ts)}:r;return n?{...s,...n.summary!==void 0?{summary:Ue(n.summary)}:{},...n.added!==void 0?{added:n.added}:{},...n.removed!==void 0?{removed:n.removed}:{},...n.tokens!==void 0&&n.tokens>0?{tokens:n.tokens}:{}}:s}pushRecent(e){this.recentActivity.push(e),this.recentActivity.length>DB&&this.recentActivity.shift()}addTokens(e){Number.isFinite(e)&&e>0&&(this.tokensValue+=e)}setUsage(e){Number.isFinite(e.tokens)&&e.tokens>=0&&(this.tokensValue=e.tokens),Number.isFinite(e.toolCalls)&&e.toolCalls>=0&&(this.toolCallsValue=e.toolCalls),Number.isFinite(e.iterations)&&e.iterations>=0&&(this.iterationsValue=e.iterations)}finish(e){let o=this.isTerminal();this.endedAt===void 0&&(this.endedAt=this.clock()),this.stopValue=e,this.phaseValue=e==="final"?"done":e==="cancelled"?"cancelled":"failed",!o&&this.onTerminal&&this.onTerminal()}cancel(){this.abortController.signal.aborted||this.abortController.abort(),this.cascadeController.signal.aborted||this.cascadeController.abort(),this.isTerminal()||this.finish("cancelled");for(let e of this.children)e.cancel()}cancelOwn(){this.abortController.signal.aborted||this.abortController.abort(),this.isTerminal()||this.finish("cancelled")}accounting(){let e=this.endedAt??this.clock();return{tokens:this.tokensValue,toolCalls:this.toolCallsValue,iterations:this.iterationsValue,startedAt:this.startedAt,...this.endedAt!==void 0?{endedAt:this.endedAt}:{},durationMs:Math.max(0,e-this.startedAt)}}drillIn(){let e=this.clock();return{id:this.id,kind:this.kind,label:this.label,phase:this.phaseValue,accounting:this.accounting(),recent:this.recentActivity.map(o=>o.running&&o.ts!==void 0?{...o,durationMs:Math.max(0,e-o.ts)}:o),...this.stopValue!==void 0?{stop:this.stopValue}:{}}}},Pl=class{root;byId=new Map;clock;maxTerminalNodes;evictedTokens=0;evictedToolCalls=0;evictedIterations=0;evictedNodes=0;evicting=!1;constructor(e){this.clock=e?.clock??Date.now,this.maxTerminalNodes=e?.maxTerminalNodes!==void 0&&e.maxTerminalNodes>=0?e.maxTerminalNodes:TB,this.root=new Ll({id:"root",kind:"root",label:e?.rootLabel??"aluy",clock:this.clock}),this.byId.set(this.root.id,this.root)}get rootNode(){return this.root}node(e){return this.byId.get(e)}ensureChild(e,o="subagent",n="root"){let r=this.byId.get(n)??this.root,s=`${r.id}/${e}`,i=this.byId.get(s);if(i)return i;let a=new Ll({id:s,kind:o,label:e,parent:r,clock:this.clock,parentSignal:r.cascadeSignal,onTerminal:()=>this.evictTerminalNodes()});return r.addChild(a),this.byId.set(s,a),this.evictTerminalNodes(),a}evictTerminalNodes(){if(!this.evicting){this.evicting=!0;try{this.evictTerminalNodesUnsafe()}finally{this.evicting=!1}}}evictTerminalNodesUnsafe(){let e=[];for(let n of this.root.childNodes)n.isTerminal()&&e.push(n);if(e.length<=this.maxTerminalNodes)return;e.sort((n,r)=>(n.endedAtMs??1/0)-(r.endedAtMs??1/0));let o=e.slice(0,e.length-this.maxTerminalNodes);for(let n of o){let r=n.accounting();this.evictedTokens+=r.tokens,this.evictedToolCalls+=r.toolCalls,this.evictedIterations+=r.iterations,this.evictedNodes+=1,this.root.removeChild(n),this.byId.delete(n.id)}}overview(){let e=[],o=n=>{e.push({id:n.id,kind:n.kind,label:n.label,phase:n.phase,accounting:n.accounting(),...n.stop!==void 0?{stop:n.stop}:{}});for(let r of n.childNodes)o(r)};return o(this.root),e}liveChildren(){return this.root.childNodes.filter(e=>!e.isTerminal())}cancelOne(e){let o=this.byId.get(e);return o?(o.cancel(),this.evictTerminalNodes(),!0):!1}cancelAll(){this.root.cancel(),this.evictTerminalNodes()}cancelRoot(){this.root.cancelOwn()}rootAccounting(){return this.root.accounting()}totalAccounting(){let e=this.evictedTokens,o=this.evictedToolCalls,n=this.evictedIterations;for(let r of this.byId.values()){let s=r.accounting();e+=s.tokens,o+=s.toolCalls,n+=s.iterations}return{tokens:e,toolCalls:o,iterations:n}}get nodeCount(){return this.byId.size}get evictedCount(){return this.evictedNodes}drillIn(e){return this.byId.get(e)?.drillIn()}}});function RB(t){let e=Qt(t).replace(/\s+/g," ").trim();return e.length>mC?`${e.slice(0,mC)}\u2026`:e}var _B,Fl,mC,fC=S(()=>{"use strict";Zn();_B=256,Fl=class{events=[];clock;constructor(e){this.clock=e?.clock??Date.now}recordCancel(e,o){return this.push({actorType:"cli",verb:"cancel",targetId:e,targetLabel:o,at:this.clock()})}recordCancelAll(){return this.push({actorType:"cli",verb:"cancel-all",targetId:"*",targetLabel:"todos",at:this.clock()})}recordInjectInput(e,o,n){return this.push({actorType:"cli",verb:"inject-input",targetId:e,targetLabel:o,at:this.clock(),inputDigest:RB(n)})}get log(){return this.events}push(e){return this.events.push(e),this.events.length>_B&&this.events.shift(),e}},mC=120});function Il(t){return t.kind==="error"}function pC(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,OB)}function hC(t){let e=t.trim().toLowerCase().replace(/\s+/g,"_");switch(e){case"read":return"read_file";case"edit":case"multiedit":return"edit_file";case"write":return"write_file";case"bash":case"shell":return"run_command";case"glob":case"grep":return"grep";case"webfetch":case"web_fetch":return"web_fetch";case"websearch":case"web_search":return"web_search";case"task":return As;default:return e}}function LB(t){let e=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
99
99
|
`),o=/^---\n([\s\S]*?)\n---\n?/.exec(e);if(!o)return{fm:{hasToolsKey:!1},body:e.trim()};let n={},r=!1;for(let s of o[1].split(`
|
|
100
100
|
`)){let i=/^\s*([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(s);if(!i)continue;let a=i[1].toLowerCase(),l=i[2].trim().replace(/^["']|["']$/g,"");a==="name"?n.name=l:a==="description"?n.description=l:a==="model"?n.model=l:a==="tools"?(r=!0,n.toolsRaw=l):a==="room"&&(n.roomRaw=l)}return{fm:{...n,hasToolsKey:r},body:e.slice(o[0].length).trim()}}function PB(t){let e=t.trim().replace(/^\[/,"").replace(/\]$/,"");if(e.trim()==="")return null;let o=e.split(",").map(s=>hC(s)).filter(s=>s!=="");if(o.length===0||o.length>MB)return null;let n=new Set,r=[];for(let s of o)n.has(s)||(n.add(s),r.push(s));return r}function Nl(t,e,o){let n=t,{fm:r,body:s}=LB(e),i=pC(r.name??"");if(i==="")return{kind:"error",file:n,reason:`agente "${n}": frontmatter sem "name" v\xE1lido \u2014 perfil rejeitado (fail-closed)`};if(s==="")return{kind:"error",file:n,reason:`agente "${i}" (${n}): corpo vazio \u2014 sem system prompt, perfil rejeitado`};let a;if(r.hasToolsKey){let f=PB(r.toolsRaw??"");if(f===null)return{kind:"error",file:n,reason:`agente "${i}" (${n}): "tools" presente mas ileg\xEDvel/vazio \u2014 perfil n\xE3o carregado (uma lista de tools vazia ou ileg\xEDvel \xE9 tratada como inv\xE1lida, nunca como "sem tools = herda tudo")`};a=f}let l=r.description!==void 0&&r.description!==""?r.description:void 0,c=r.model!==void 0&&r.model!==""?r.model:void 0,u=r.roomRaw!==void 0?r.roomRaw.trim().toLowerCase()!=="false":void 0;return{name:i,...l!==void 0?{description:l}:{},...a!==void 0?{tools:a}:{},...c!==void 0?{model:c}:{},...u!==void 0?{room:u}:{},systemPrompt:s,origin:o}}var OB,MB,gC=S(()=>{"use strict";Xd();OB=64,MB=64});function wy(t,e){if(e.agent===void 0||e.agent.trim()==="")return{ok:!0,profile:e,crossLayerConflict:!1,origin:"global"};let o=t.resolveByName(e.agent);if(!o)return{ok:!1,error:`agente "${e.agent}" desconhecido (nenhum .md em ~/.aluy/agents/ nem .claude/agents/ com esse nome) \u2014 delega\xE7\xE3o RECUSADA (GS-MD7): nome expl\xEDcito exigido, sem fallback p/ perfil sem restri\xE7\xE3o.`};let n=o.profile,r=n.tools!==void 0?new Set(n.tools):void 0;return{ok:!0,profile:{...e,label:e.label,...n.systemPrompt!==""?{systemPrompt:n.systemPrompt}:{},...r!==void 0?{toolScope:r}:{},...n.room===!1?{roomOptOut:!0}:{}},...n.model!==void 0?{model:n.model}:{},crossLayerConflict:o.crossLayerConflict,origin:n.origin}}function yC(t){let e=new Set;for(let o of t.toLowerCase().split(/[^a-z0-9_]+/))o.length>=3&&e.add(o);return e}var Cs,bC=S(()=>{"use strict";Cs=class{globalByName=new Map;projectByName=new Map;conflicts=[];constructor(e=[],o=[]){for(let n of e)n.origin==="global"&&(this.globalByName.has(n.name)||this.globalByName.set(n.name,n));for(let n of o)n.origin==="project"&&(this.projectByName.has(n.name)||this.projectByName.set(n.name,n));for(let[n,r]of this.projectByName){let s=this.globalByName.get(n);s&&this.conflicts.push({name:n,global:s,project:r})}}list(){let e=new Map;for(let[o,n]of this.globalByName)e.set(o,n);for(let[o,n]of this.projectByName)e.set(o,n);return[...e.values()].sort((o,n)=>o.name.localeCompare(n.name))}listGlobal(){return[...this.globalByName.values()].sort((e,o)=>e.name.localeCompare(o.name))}get crossLayerConflicts(){return this.conflicts}resolveByName(e){let o=e.trim().toLowerCase(),n=this.projectByName.get(o),r=this.globalByName.get(o),s=n??r;if(s)return{profile:s,crossLayerConflict:n!==void 0&&r!==void 0}}autoSelect(e){let o=yC(e);if(o.size===0)return;let n,r=0;for(let s of this.listGlobal()){if(s.origin!=="global")continue;let i=yC(`${s.name} ${s.description??""}`),a=0;for(let l of o)i.has(l)&&(a+=1);a>r&&(r=a,n=s)}return r>0?n:void 0}}});function er(t,e,o={}){let n=o.indent??" ",r=t.length,s=(f,d)=>{let p=o.maxWidths?.[d];return p!==void 0&&f.length>p?f.slice(0,Math.max(1,p-1))+"\u2026":f},i=(f,d)=>s(f[d]??"",d),a=[t,...e],l=[];for(let f=0;f<r;f+=1)l[f]=Math.max(...a.map(d=>i(d,f).length));let c=(f,d,p)=>n+f+l.map(h=>"\u2500".repeat(h+2)).join(d)+p,u=f=>n+"\u2502 "+l.map((d,p)=>i(f,p).padEnd(d)).join(" \u2502 ")+" \u2502";return[c("\u250C","\u252C","\u2510"),u(t),c("\u251C","\u253C","\u2524"),...e.map(u),c("\u2514","\u2534","\u2518")]}var Jd=S(()=>{"use strict"});function kC(t){let o=(t.description!==void 0&&t.description.trim()!==""?t.description:t.systemPrompt.split(`
|
|
101
|
-
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=vC?o:`${o.slice(0,vC-1).trimEnd()}\u2026`}function Ay(t){let e=t.globalDir??"~/.aluy/agents",o=[],n=[...t.profiles].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.file.localeCompare(i.file));if(n.length===0&&r.length===0)return{title:"agents",lines:[`nenhum agente .md mapeado \u2014 crie um em ${e}/<nome>.md`,"frontmatter
|
|
101
|
+
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=vC?o:`${o.slice(0,vC-1).trimEnd()}\u2026`}function Ay(t){let e=t.globalDir??"~/.aluy/agents",o=[],n=[...t.profiles].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.file.localeCompare(i.file));if(n.length===0&&r.length===0)return{title:"agents",lines:[`nenhum agente .md mapeado \u2014 crie um em ${e}/<nome>.md`,"frontmatter: `name` (obrigat\xF3rio); `description` e `tools:` (lista \u2286 pai) opcionais;","o corpo do .md \xE9 a persona (system prompt) do sub-agente.","s\xE3o os perfis que o `spawn_agent` (sub-agentes) invoca por nome."]};if(n.length>0){o.push(`v\xE1lidos (${n.length}) \u2014 perfis que o spawn_agent invoca por nome:`);let s=n.map(i=>[i.name,i.origin==="global"?"global":"projeto",i.tools===void 0?"herda do pai":i.tools.length?i.tools.join(", "):"(nenhuma)",kC(i)]);o.push(...er(["agente","escopo","tools","sobre"],s,{maxWidths:[18,8,24,44]}))}if(r.length>0){o.length>0&&o.push(""),o.push(`rejeitados (${r.length}) \u2014 n\xE3o foram carregados por estarem inv\xE1lidos:`);let s=r.map(i=>[i.file,i.reason]);o.push(...er(["arquivo","motivo"],s,{maxWidths:[22,52]})),o.push(" conserto: o frontmatter precisa de `name`, corpo (persona) e \u2014 se declarar"),o.push(" `tools:` \u2014 uma LISTA leg\xEDvel (ex.: `tools: read_file, grep`).")}return o.push(""),o.push("global (~/.aluy/agents/) = config do dono \xB7 projeto (.claude/agents/) = dado do repo."),{title:"agents",lines:o}}var vC,xC=S(()=>{"use strict";Jd();vC=100});function $l(t){return t.kind==="error"}function Cy(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,FB)}function IB(t){let e=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
102
102
|
`),o=/^---\n([\s\S]*?)\n---\n?/.exec(e);if(!o)return{fm:{},body:e.trim()};let n={};for(let r of o[1].split(`
|
|
103
103
|
`)){let s=/^\s*([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(r);if(!s)continue;let i=s[1].toLowerCase(),a=s[2].trim().replace(/^["']|["']$/g,"");i==="name"?n.name=a:i==="description"&&(n.description=a)}return{fm:n,body:e.slice(o[0].length).trim()}}function Bl(t,e,o){let{fm:n,body:r}=IB(e),s=Cy(n.name??""),i=s!==""?s:Cy(t);if(i==="")return{kind:"error",name:t,reason:`skill "${t}": sem "name" v\xE1lido (frontmatter nem nome do diret\xF3rio) \u2014 rejeitada (fail-closed)`};if(r==="")return{kind:"error",name:i,reason:`skill "${i}": SKILL.md com corpo vazio \u2014 sem instru\xE7\xF5es, rejeitada (fail-closed)`};let a=n.description!==void 0&&n.description!==""?n.description:void 0;return{name:i,...a!==void 0?{description:a}:{},instructions:r,origin:o}}var FB,EC=S(()=>{"use strict";FB=64});function wC(t){let o=(t.description!==void 0&&t.description.trim()!==""?t.description:t.instructions.split(`
|
|
104
|
-
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=SC?o:`${o.slice(0,SC-1).trimEnd()}\u2026`}function Dy(t){let e=t.globalDir??"~/.aluy/skills",o=[],n=[...t.skills].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.name.localeCompare(i.name));if(n.length===0&&r.length===0)return{title:"skills",lines:[`nenhuma skill mapeada \u2014 crie uma em ${e}/<nome>/SKILL.md`,"manifesto
|
|
104
|
+
`).find(n=>n.trim()!=="")??"").replace(/\s+/g," ").trim();return o.length<=SC?o:`${o.slice(0,SC-1).trimEnd()}\u2026`}function Dy(t){let e=t.globalDir??"~/.aluy/skills",o=[],n=[...t.skills].sort((s,i)=>s.origin!==i.origin?s.origin==="global"?-1:1:s.name.localeCompare(i.name)),r=[...t.errors].sort((s,i)=>s.name.localeCompare(i.name));if(n.length===0&&r.length===0)return{title:"skills",lines:[`nenhuma skill mapeada \u2014 crie uma em ${e}/<nome>/SKILL.md`,"manifesto: frontmatter com `name` (obrigat\xF3rio); `description` opcional;","o corpo do SKILL.md s\xE3o as instru\xE7\xF5es/capacidade injetadas quando invocada.","invoque por nome: `/skill <nome>` (injeta as instru\xE7\xF5es no contexto sob demanda)."]};if(n.length>0){o.push(`v\xE1lidas (${n.length}) \u2014 invoque por nome com /skill <nome>:`);let s=n.map(i=>[i.name,i.origin==="global"?"global":"projeto",wC(i)]);o.push(...er(["skill","escopo","sobre"],s,{maxWidths:[20,8,50]}))}if(r.length>0){o.length>0&&o.push(""),o.push(`rejeitadas (${r.length}) \u2014 n\xE3o foram carregadas por estarem inv\xE1lidas:`);let s=r.map(i=>[i.name,i.reason]);o.push(...er(["skill","motivo"],s,{maxWidths:[22,50]})),o.push(" conserto: o SKILL.md precisa de `name` (ou herda o nome da pasta) e de um"),o.push(" corpo n\xE3o-vazio (as instru\xE7\xF5es da skill).")}return o.push(""),o.push("global (~/.aluy/skills/) = config do dono \xB7 projeto (.claude/skills/) = dado do repo."),{title:"skills",lines:o}}var SC,AC=S(()=>{"use strict";Jd();SC=100});function Ty(t){if(t.length===0)return;let e=[DC];for(let o of t){let n=o.description?.trim()||o.systemPrompt.split(`
|
|
105
105
|
`).find(l=>l.trim()!=="")||"",s=(o.origin==="project"?Qo(n):n).replace(/\s+/g," ").trim(),i=s.length<=CC?s:`${s.slice(0,CC-1).trimEnd()}\u2026`,a=o.origin==="project"?" [projeto]":"";e.push(`- ${o.name}${a} \u2014 ${i}`)}return e.join(`
|
|
106
106
|
`)}var DC,CC,TC=S(()=>{"use strict";gl();DC="AGENTES DISPON\xCDVEIS \u2014 voc\xEA tem um TIME de sub-agentes especializados. A CADA tarefa, AVALIE se ela se beneficia de DELEGAR (por especializa\xE7\xE3o ou paralelismo) e, se sim, USE-OS PROATIVAMENTE via a tool `spawn_agent` (campo `agent: <nome>`) \u2014 N\xC3O espere ser pedido. Ex.: feature full-stack \u21D2 dev-backend + dev-frontend (+ qa) em paralelo; revis\xE3o \u21D2 revisor; an\xE1lise de seguran\xE7a/arquitetura \u21D2 seguranca + arquiteto. Tarefa simples/trivial voc\xEA faz sozinho (n\xE3o delegue \xE0 toa). Cada agente tem persona/tools/tier pr\xF3prios. O time:",CC=80});function Ul(t){return t.error===!0}function BB(t){let e=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
107
107
|
`),o=/^---\n([\s\S]*?)\n---\n?/.exec(e);if(!o)return{fm:{},body:e.trim()};let n={};for(let r of o[1].split(`
|
|
@@ -137,7 +137,7 @@ ${t.trim()}`}}function HD(t,e,o=ec){let{older:n,recent:r}=mm(t,o);if(n.length===
|
|
|
137
137
|
\u2026[truncado: ${t.length-Fb} chars omitidos]`}function YU(t){return t.length<=Nb?t:`${t.slice(0,Nb)}\u2026`}function C0(t){let e=A0(t.server,t.descriptor.name),o=YU(t.descriptor.description.trim()),n=`[tool de um SERVER MCP de terceiro "${t.server}" \u2014 efeito n\xE3o-confi\xE1vel, passa pela catraca] ${o||"(sem descri\xE7\xE3o)"}`,r=t.descriptor.inputSchema,s=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:void 0;return{name:e,effect:"mcp",description:n,...s?{parameters:s}:{},async run(i,a,l){try{let c=await t.transport.callTool(t.descriptor.name,i,l?.signal),u=Ue(c.content);return c.ok?{ok:!0,observation:w0(u),display:`${e}(${VU(i)})`}:{ok:!1,observation:w0(`MCP "${e}" erro: ${u}`)}}catch(c){return{ok:!1,observation:`MCP "${e}" falhou: ${c instanceof Error?c.message:String(c)}`}}}}}function $b(t,e){let o=[],n=new Set,r=new Map,s=new Map,i=new Set;for(let a of t){let l=C0(a);if(n.has(l.name))continue;n.add(l.name);let c=a.server;s.set(c,(s.get(c)??0)+1);let u=r.get(c)??0;if(u>=Ib){i.add(c);continue}r.set(c,u+1),o.push(l)}if(e)for(let a of i){let l=s.get(a)??0;e(`server MCP "${a}" exp\xF4s ${l} tools; usando as primeiras ${Ib} (teto por server, anti-estouro de contexto). As demais foram ignoradas \u2014 revise o server ou reduza as tools que ele exp\xF5e.`)}return o}function VU(t){if(Object.keys(t).length===0)return"";let o=JSON.stringify(t);return o.length<=200?o:`${o.slice(0,200)}\u2026`}var Fb,Ib,Nb,D0=S(()=>{"use strict";Yu();Zn();Fb=2e4;Ib=128,Nb=1024});function R0(t,e){let o=new URL(_0);return t.trim().length>0&&o.searchParams.set("search",t.trim()),o.searchParams.set("limit",String(JU)),e!==void 0&&e.length>0&&o.searchParams.set("cursor",e),o.toString()}async function Ub(t,e,o){let n=t.trim(),r=[],s;for(let i=0;i<XU;i++){let a=R0(n,s),l;try{l=await e(a,o)}catch(f){return{ok:!1,query:n,reason:xm(n2(f))}}if(!l.ok)return{ok:!1,query:n,reason:xm(l.reason)};if(l.status<200||l.status>=300)return{ok:!1,query:n,reason:xm(`HTTP ${l.status}`)};let c;try{c=JSON.parse(l.body)}catch{return{ok:!1,query:n,reason:xm("resposta n\xE3o \xE9 JSON v\xE1lido")}}let u=M0(c);for(let f of u.servers)if(O0(f,n)&&r.push(f),r.length>=Bb)break;if(r.length>=Bb||(s=u.nextCursor,s===void 0||s.length===0))break}return{ok:!0,query:n,results:r}}function xm(t){return`registro MCP indispon\xEDvel (${Wi}): ${t}`}function O0(t,e){if(e.length===0)return!0;let o=e.toLowerCase();return[t.name,t.title??"",t.description,t.run.command??"",t.run.args.join(" ")].join(" ").toLowerCase().includes(o)}function M0(t){if(!nr(t))return{servers:[]};let e=Array.isArray(t.servers)?t.servers:[],o=[];for(let s of e){let i=QU(s);i!==void 0&&o.push(i)}let n=nr(t.metadata)?t.metadata:void 0,r=n!==void 0&&typeof n.nextCursor=="string"?n.nextCursor:void 0;return{servers:o,...r!==void 0?{nextCursor:r}:{}}}function QU(t){if(!nr(t))return;let e=nr(t.server)?t.server:t,o=typeof e.name=="string"?e.name.trim():"";if(o.length===0)return;let n=typeof e.description=="string"?e.description.trim():"",r=typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():void 0,s=typeof e.version=="string"?e.version.trim():void 0,i=ZU(e);return{name:o,description:n,run:i,...r!==void 0?{title:r}:{},...s!==void 0?{version:s}:{}}}function ZU(t){let e=[],o=Array.isArray(t.remotes)?t.remotes:[];for(let r of o)nr(r)&&typeof r.url=="string"&&e.push(r.url);let n=Array.isArray(t.packages)?t.packages:[];for(let r of n){if(!nr(r))continue;let s=e2(r);if(s!==void 0)return{...s,remoteUrls:e}}return{args:[],env:[],remoteUrls:e}}function e2(t){let e=Os(t.registryType)??Os(t.registry_name),o=Os(t.identifier)??Os(t.name);if(o===void 0)return;let n=Os(t.version),r=Os(t.runtimeHint),s=nr(t.transport)?Os(t.transport.type):void 0,i=o2(t.environmentVariables),a=T0(t.runtimeArguments),l=T0(t.packageArguments),c=n!==void 0?`${o}@${n}`:o;return e==="npm"||r==="npx"?{command:"npx",args:t2(["-y",...a,c,...l]),env:i,...s!==void 0?{transport:s}:{}}:e==="pypi"||r==="uvx"||r==="uv"?{command:"uvx",args:[...a,o,...l],env:i,...s!==void 0?{transport:s}:{}}:e==="oci"||r==="docker"?{command:"docker",args:["run","-i","--rm",...a,c,...l],env:i,...s!==void 0?{transport:s}:{}}:{args:[c],env:i,...s!==void 0?{transport:s}:{}}}function t2(t){let e=[],o=!1;for(let n of t){if(n==="-y"||n==="--yes"){if(o)continue;o=!0}e.push(n)}return e}function T0(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)nr(o)&&typeof o.value=="string"&&e.push(o.value);return e}function o2(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)nr(o)&&typeof o.name=="string"&&o.name.length>0&&e.push({name:o.name,required:o.isRequired===!0});return e}function Os(t){return typeof t=="string"&&t.trim().length>0?t.trim():void 0}function nr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function n2(t){return t instanceof Error?t.message:String(t)}var Wi,_0,XU,JU,Bb,L0=S(()=>{"use strict";Wi="registry.modelcontextprotocol.io",_0=`https://${Wi}/v0/servers`,XU=5,JU=100,Bb=25});function F0(t){let{command:e,args:o}=t.run;if(e===void 0)return;let n=I0(t.name);return["aluy","mcp","add",P0(n),"--",e,...o.map(P0)].join(" ")}function I0(t){let o=(t.split("/").pop()??t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");return o.length>0?o:"server"}function P0(t){return/^[A-Za-z0-9_./@:+=-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function jb(t){if(!t.ok)return`\u26A0 ${t.reason}
|
|
138
138
|
Tente de novo em instantes; a busca no registro n\xE3o bloqueia o resto do aluy.`;if(t.results.length===0)return`nenhum server encontrado para "${t.query}" no registro oficial MCP.`;let e=[],o=t.results.length;e.push(`${o} server${o===1?"":"s"} para "${t.query}" (registro oficial MCP):`),e.push("");for(let n of t.results)e.push(r2(n)),e.push("");return e.push('Para instalar, copie a linha "\u2192 aluy mcp add \u2026" do server desejado.'),e.push("A sa\xEDda do registro \xE9 apenas informativa \u2014 nada \xE9 executado pela busca."),e.join(`
|
|
139
139
|
`)}function r2(t){let o=[`\u2022 ${t.version!==void 0?`${t.name} (v${t.version})`:t.name}`],n=t.title!==void 0&&t.title!==t.name?t.title:void 0;n!==void 0&&o.push(` ${n}`),t.description.length>0&&o.push(` ${s2(t.description,200)}`);let r=F0(t);if(r!==void 0){o.push(` \u2192 ${r}`),t.run.transport!==void 0&&t.run.transport!=="stdio"&&o.push(` (transporte "${t.run.transport}" \u2014 v1 do aluy s\xF3 pluga servers stdio LOCAIS)`);let s=t.run.env.filter(i=>i.required).map(i=>i.name);s.length>0&&o.push(` requer env: ${s.join(", ")} (defina por-server no mcp.json)`)}else t.run.remoteUrls.length>0?o.push(` (server REMOTO: ${t.run.remoteUrls.join(", ")} \u2014 fora do v1 de \`aluy mcp add\`)`):o.push(" (sem pacote local conhecido \u2014 nada a instalar pelo aluy)");return o.join(`
|
|
140
|
-
`)}function s2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var N0=S(()=>{"use strict"});var $0=S(()=>{"use strict";km();b0();v0();k0();x0();S0();D0();Yu();L0();N0()});function Hb(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(t.trim());if(!e)return null;let o=e[4]?e[4].split(".").map(n=>/^\d+$/.test(n)?Number(n):n):[];return{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),pre:o}}function B0(t,e){let o=Hb(t),n=Hb(e);if(!o||!n)return null;for(let s of["major","minor","patch"])if(o[s]!==n[s])return o[s]<n[s]?-1:1;if(o.pre.length===0&&n.pre.length===0)return 0;if(o.pre.length===0)return 1;if(n.pre.length===0)return-1;let r=Math.max(o.pre.length,n.pre.length);for(let s=0;s<r;s++){let i=o.pre[s],a=n.pre[s];if(i===void 0)return-1;if(a===void 0)return 1;if(i===a)continue;let l=typeof i=="number",c=typeof a=="number";return l&&c?i<a?-1:1:l?-1:c?1:i<a?-1:1}return 0}function qb(t,e){return B0(t,e)===1}var U0=S(()=>{"use strict"});function Em(t,e,o){if(e.size===0)return{kind:"discard",reason:"allowlist vazia (default fechado)"};if(!e.has(t.conversation))return{kind:"discard",reason:`canal ${t.conversation} n\xE3o-allowlistado`};if(t.senderIsBot===!0)return{kind:"discard",reason:"remetente \xE9 bot (anti-loop, TC-6)"};let n=t.content.trim();if(n==="")return{kind:"discard",reason:"mensagem sem conte\xFAdo"};if(o.authIsForgeable)return{kind:"data",text:n};if(t.provenance.kind==="third-party-relayed")return{kind:"data",text:n};let r=t.provenance.embeddedThirdParty?.trim();return r?{kind:"instruction",text:n,forwardedData:r}:{kind:"instruction",text:n}}var Wb=S(()=>{"use strict"});function Gb(t){let e;if(t.forwarded===!0)e={kind:"third-party-relayed"};else{let o=(t.quotedText??"").trim();e=o?{kind:"author-direct",embeddedThirdParty:o}:{kind:"author-direct"}}return{content:t.text,sender:String(t.fromId),conversation:String(t.chatId),provenance:e,...t.isBot===!0?{senderIsBot:!0}:{}}}function zb(t){let e=new Set;for(let o of t)typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&e.add(o);return e}var lc,j0=S(()=>{"use strict";Wb();lc={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function Kb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Yb(t,e){let o=Gi(t);if(!o||o.ok!==!0||!Array.isArray(o.result))return{updates:[],nextOffset:e};let n=[],r=e-1;for(let s of o.result){let i=Gi(s);if(!i)continue;let a=Kb(i.update_id);a!==void 0&&a>r&&(r=a);let l=Gi(i.message);if(!l)continue;let c=Gi(l.chat),u=Kb(c?.id);if(u===void 0||c?.type!=="private")continue;let f=Gi(l.from),d=Kb(f?.id)??u,p=f?.is_bot===!0,h=typeof l.text=="string"?l.text:"",y=l.forward_origin!==void 0||l.forward_from!==void 0||l.forward_from_chat!==void 0||l.forward_sender_name!==void 0||l.forward_date!==void 0,g=(()=>{let E=Gi(l.quote)?.text;return typeof E=="string"&&E.trim()!==""?E:void 0})();n.push({chatId:u,fromId:d,text:h,...y?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var H0=S(()=>{"use strict"});var cc,q0=S(()=>{"use strict";cc=class{maxPerWindow;windowMs;stamps=[];constructor(e,o){this.maxPerWindow=e,this.windowMs=o}tryConsume(e){let o=e-this.windowMs;for(;this.stamps.length>0&&this.stamps[0]<=o;)this.stamps.shift();return this.stamps.length>=this.maxPerWindow?!1:(this.stamps.push(e),!0)}get used(){return this.stamps.length}}});function Vb(t){return`connector-${t}-token`}function uc(t){let e=t.trim(),o=e.indexOf(":");return o<=0?`\u2026(${e.length} chars)`:`${e.slice(0,o)}:\u2026(${e.length-o-1} chars)`}function Xb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var W0=S(()=>{"use strict"});var B=S(()=>{"use strict";UE();cS();xS();Uw();a0();Gy();h0();$0();Eb();Jd();U0();Wb();j0();H0();q0();W0()});import{posix as A8}from"node:path";function C8(t){return A8.normalize(t)}function po(t){let e=C8(t);for(let o of D8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function pv(t){return po(t).kind==="allow"}var D8,$r=S(()=>{"use strict";D8=[{re:/(?:^|\/|~\/)\.ssh(?:\/|$)/,why:"chaves SSH (~/.ssh)",deny:!0},{re:/(?:^|\/|~\/)\.aws(?:\/|$)/,why:"credenciais AWS (~/.aws)",deny:!0},{re:/(?:^|\/|~\/)\.gnupg(?:\/|$)/,why:"chaves GPG (~/.gnupg)",deny:!0},{re:/(?:~\/|\$\{?HOME\}?\/|\/(?:home|Users)\/[^/]+\/)\.aluy\/rooms(?:\/|$)/,why:"arquivos de sala do Aluy (~/.aluy/rooms)",deny:!0},{re:/~\/\.aluy(?:\/|$)/,why:"estado/credencial do Aluy (~/.aluy)",deny:!0},{re:/(?:^|\/)\.aluy(?:\/(?!agents\/|workflows\/|commands\/)|$)/,why:"estado/credencial do Aluy (.aluy/)",deny:!0},{re:/(?:^|\/|~\/)\.config\/gh\/hosts\.yml$/,why:"token do gh CLI",deny:!0},{re:/(?:^|\/|~\/)\.docker\/config\.json$/,why:"credenciais Docker",deny:!0},{re:/(?:^|\/|~\/)\.kube\/config$/,why:"kubeconfig",deny:!0},{re:/(?:^|\/)id_(?:rsa|ed25519|ecdsa|dsa)\b/,why:"chave privada",deny:!0},{re:/\.pem$|\.p12$|\.pfx$|\.key$/i,why:"material de chave privada",deny:!0},{re:/(?:^|[/\w.-])\.env(?:\.(?!example$|sample$|template$|dist$)[\w.-]+)?$/,why:"arquivo .env (segredos)",deny:!1},{re:/(?:^|\/)[^/]*(?:secret|credential|token|apikey|api_key|password|passwd)[^/]*$/i,why:"arquivo com nome sens\xEDvel (token/secret)",deny:!1}]});var Iv={};Ip(Iv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Fv});import{homedir as m3}from"node:os";import{join as Pv}from"node:path";import{readdirSync as f3,readFileSync as p3,mkdirSync as h3,statSync as g3}from"node:fs";var y3,Fv,b3,v3,Hr,Hm=S(()=>{"use strict";B();y3=448,Fv="workflows",b3=64*1024,v3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Pv(m3(),".aluy");this.dir=Pv(o,Fv)}get workflowsDir(){return this.dir}ensureDir(){try{h3(this.dir,{mode:y3,recursive:!0})}catch{}}load(){let e;try{e=f3(this.dir,{withFileTypes:!0})}catch{return{workflows:[],errors:[]}}let o=e.filter(i=>(i.isFile()||i.isSymbolicLink())&&i.name.toLowerCase().endsWith(".md")).map(i=>i.name).sort((i,a)=>i.localeCompare(a)),n=new Set,r=[],s=[];for(let i of o){if(r.length>=v3)break;let a=this.readOne(i);if(a!==null){if(Ul(a)){s.push(a);continue}n.has(a.name)||(n.add(a.name),r.push(a))}}return{workflows:r,errors:s}}readOne(e){let o=Pv(this.dir,e);try{let n=g3(o);if(!n.isFile()||n.size>b3)return null;let r=p3(o,"utf8");return jl(e,r,"global")}catch{return null}}}});var $v={};Ip($v,{PROJECT_WORKFLOWS_DIRNAMES:()=>Nv,ProjectWorkflowsLoader:()=>qr});import{join as k3}from"node:path";import{readdirSync as x3,readFileSync as E3,statSync as S3}from"node:fs";var Nv,w3,A3,qr,qm=S(()=>{"use strict";B();$r();Nv=[".claude/workflows",".aluy/workflows"],w3=64*1024,A3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Nv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=x3(s,{withFileTypes:!0})}catch{continue}let a=i.filter(l=>(l.isFile()||l.isSymbolicLink())&&l.name.toLowerCase().endsWith(".md")).map(l=>l.name).sort((l,c)=>l.localeCompare(c));for(let l of a){if(o.length>=A3)break;let c=this.readOne(r,s,l);if(c!==null){if(Ul(c)){n.push(c);continue}e.has(c.name)||(e.add(c.name),o.push(c))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(po(r).kind!=="allow")return null;let s=k3(o,n);try{this.workspace.resolveInside(r);let i=S3(s);if(!i.isFile()||i.size>w3)return null;let a=E3(s,"utf8");return jl(n,a,"project")}catch{return null}}}});var _M=GI((Xge,TM)=>{TM.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Gn="1.0.0-rc.83";B();var G0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
140
|
+
`)}function s2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var N0=S(()=>{"use strict"});var $0=S(()=>{"use strict";km();b0();v0();k0();x0();S0();D0();Yu();L0();N0()});function Hb(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(t.trim());if(!e)return null;let o=e[4]?e[4].split(".").map(n=>/^\d+$/.test(n)?Number(n):n):[];return{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),pre:o}}function B0(t,e){let o=Hb(t),n=Hb(e);if(!o||!n)return null;for(let s of["major","minor","patch"])if(o[s]!==n[s])return o[s]<n[s]?-1:1;if(o.pre.length===0&&n.pre.length===0)return 0;if(o.pre.length===0)return 1;if(n.pre.length===0)return-1;let r=Math.max(o.pre.length,n.pre.length);for(let s=0;s<r;s++){let i=o.pre[s],a=n.pre[s];if(i===void 0)return-1;if(a===void 0)return 1;if(i===a)continue;let l=typeof i=="number",c=typeof a=="number";return l&&c?i<a?-1:1:l?-1:c?1:i<a?-1:1}return 0}function qb(t,e){return B0(t,e)===1}var U0=S(()=>{"use strict"});function Em(t,e,o){if(e.size===0)return{kind:"discard",reason:"allowlist vazia (default fechado)"};if(!e.has(t.conversation))return{kind:"discard",reason:`canal ${t.conversation} n\xE3o-allowlistado`};if(t.senderIsBot===!0)return{kind:"discard",reason:"remetente \xE9 bot (anti-loop, TC-6)"};let n=t.content.trim();if(n==="")return{kind:"discard",reason:"mensagem sem conte\xFAdo"};if(o.authIsForgeable)return{kind:"data",text:n};if(t.provenance.kind==="third-party-relayed")return{kind:"data",text:n};let r=t.provenance.embeddedThirdParty?.trim();return r?{kind:"instruction",text:n,forwardedData:r}:{kind:"instruction",text:n}}var Wb=S(()=>{"use strict"});function Gb(t){let e;if(t.forwarded===!0)e={kind:"third-party-relayed"};else{let o=(t.quotedText??"").trim();e=o?{kind:"author-direct",embeddedThirdParty:o}:{kind:"author-direct"}}return{content:t.text,sender:String(t.fromId),conversation:String(t.chatId),provenance:e,...t.isBot===!0?{senderIsBot:!0}:{}}}function zb(t){let e=new Set;for(let o of t)typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&e.add(o);return e}var lc,j0=S(()=>{"use strict";Wb();lc={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function Kb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Yb(t,e){let o=Gi(t);if(!o||o.ok!==!0||!Array.isArray(o.result))return{updates:[],nextOffset:e};let n=[],r=e-1;for(let s of o.result){let i=Gi(s);if(!i)continue;let a=Kb(i.update_id);a!==void 0&&a>r&&(r=a);let l=Gi(i.message);if(!l)continue;let c=Gi(l.chat),u=Kb(c?.id);if(u===void 0||c?.type!=="private")continue;let f=Gi(l.from),d=Kb(f?.id)??u,p=f?.is_bot===!0,h=typeof l.text=="string"?l.text:"",y=l.forward_origin!==void 0||l.forward_from!==void 0||l.forward_from_chat!==void 0||l.forward_sender_name!==void 0||l.forward_date!==void 0,g=(()=>{let E=Gi(l.quote)?.text;return typeof E=="string"&&E.trim()!==""?E:void 0})();n.push({chatId:u,fromId:d,text:h,...y?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var H0=S(()=>{"use strict"});var cc,q0=S(()=>{"use strict";cc=class{maxPerWindow;windowMs;stamps=[];constructor(e,o){this.maxPerWindow=e,this.windowMs=o}tryConsume(e){let o=e-this.windowMs;for(;this.stamps.length>0&&this.stamps[0]<=o;)this.stamps.shift();return this.stamps.length>=this.maxPerWindow?!1:(this.stamps.push(e),!0)}get used(){return this.stamps.length}}});function Vb(t){return`connector-${t}-token`}function uc(t){let e=t.trim(),o=e.indexOf(":");return o<=0?`\u2026(${e.length} chars)`:`${e.slice(0,o)}:\u2026(${e.length-o-1} chars)`}function Xb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var W0=S(()=>{"use strict"});var B=S(()=>{"use strict";UE();cS();xS();Uw();a0();Gy();h0();$0();Eb();Jd();U0();Wb();j0();H0();q0();W0()});import{posix as A8}from"node:path";function C8(t){return A8.normalize(t)}function po(t){let e=C8(t);for(let o of D8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function pv(t){return po(t).kind==="allow"}var D8,$r=S(()=>{"use strict";D8=[{re:/(?:^|\/|~\/)\.ssh(?:\/|$)/,why:"chaves SSH (~/.ssh)",deny:!0},{re:/(?:^|\/|~\/)\.aws(?:\/|$)/,why:"credenciais AWS (~/.aws)",deny:!0},{re:/(?:^|\/|~\/)\.gnupg(?:\/|$)/,why:"chaves GPG (~/.gnupg)",deny:!0},{re:/(?:~\/|\$\{?HOME\}?\/|\/(?:home|Users)\/[^/]+\/)\.aluy\/rooms(?:\/|$)/,why:"arquivos de sala do Aluy (~/.aluy/rooms)",deny:!0},{re:/~\/\.aluy(?:\/|$)/,why:"estado/credencial do Aluy (~/.aluy)",deny:!0},{re:/(?:^|\/)\.aluy(?:\/(?!agents\/|workflows\/|commands\/)|$)/,why:"estado/credencial do Aluy (.aluy/)",deny:!0},{re:/(?:^|\/|~\/)\.config\/gh\/hosts\.yml$/,why:"token do gh CLI",deny:!0},{re:/(?:^|\/|~\/)\.docker\/config\.json$/,why:"credenciais Docker",deny:!0},{re:/(?:^|\/|~\/)\.kube\/config$/,why:"kubeconfig",deny:!0},{re:/(?:^|\/)id_(?:rsa|ed25519|ecdsa|dsa)\b/,why:"chave privada",deny:!0},{re:/\.pem$|\.p12$|\.pfx$|\.key$/i,why:"material de chave privada",deny:!0},{re:/(?:^|[/\w.-])\.env(?:\.(?!example$|sample$|template$|dist$)[\w.-]+)?$/,why:"arquivo .env (segredos)",deny:!1},{re:/(?:^|\/)[^/]*(?:secret|credential|token|apikey|api_key|password|passwd)[^/]*$/i,why:"arquivo com nome sens\xEDvel (token/secret)",deny:!1}]});var Iv={};Ip(Iv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Fv});import{homedir as m3}from"node:os";import{join as Pv}from"node:path";import{readdirSync as f3,readFileSync as p3,mkdirSync as h3,statSync as g3}from"node:fs";var y3,Fv,b3,v3,Hr,Hm=S(()=>{"use strict";B();y3=448,Fv="workflows",b3=64*1024,v3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Pv(m3(),".aluy");this.dir=Pv(o,Fv)}get workflowsDir(){return this.dir}ensureDir(){try{h3(this.dir,{mode:y3,recursive:!0})}catch{}}load(){let e;try{e=f3(this.dir,{withFileTypes:!0})}catch{return{workflows:[],errors:[]}}let o=e.filter(i=>(i.isFile()||i.isSymbolicLink())&&i.name.toLowerCase().endsWith(".md")).map(i=>i.name).sort((i,a)=>i.localeCompare(a)),n=new Set,r=[],s=[];for(let i of o){if(r.length>=v3)break;let a=this.readOne(i);if(a!==null){if(Ul(a)){s.push(a);continue}n.has(a.name)||(n.add(a.name),r.push(a))}}return{workflows:r,errors:s}}readOne(e){let o=Pv(this.dir,e);try{let n=g3(o);if(!n.isFile()||n.size>b3)return null;let r=p3(o,"utf8");return jl(e,r,"global")}catch{return null}}}});var $v={};Ip($v,{PROJECT_WORKFLOWS_DIRNAMES:()=>Nv,ProjectWorkflowsLoader:()=>qr});import{join as k3}from"node:path";import{readdirSync as x3,readFileSync as E3,statSync as S3}from"node:fs";var Nv,w3,A3,qr,qm=S(()=>{"use strict";B();$r();Nv=[".claude/workflows",".aluy/workflows"],w3=64*1024,A3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Nv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=x3(s,{withFileTypes:!0})}catch{continue}let a=i.filter(l=>(l.isFile()||l.isSymbolicLink())&&l.name.toLowerCase().endsWith(".md")).map(l=>l.name).sort((l,c)=>l.localeCompare(c));for(let l of a){if(o.length>=A3)break;let c=this.readOne(r,s,l);if(c!==null){if(Ul(c)){n.push(c);continue}e.has(c.name)||(e.add(c.name),o.push(c))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(po(r).kind!=="allow")return null;let s=k3(o,n);try{this.workspace.resolveInside(r);let i=S3(s);if(!i.isFile()||i.size>w3)return null;let a=E3(s,"utf8");return jl(n,a,"project")}catch{return null}}}});var _M=GI((Xge,TM)=>{TM.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Gn="1.0.0-rc.84";B();var G0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
141
141
|
|
|
142
142
|
Uso:
|
|
143
143
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hiperplano/aluy-cli",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.84",
|
|
4
4
|
"description": "Aluy CLI — TUI (Ink) + binário `aluy` + wiring. Consome @hiperplano/aluy-cli-core (engine portável). Credenciais só no keychain do SO.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|