@hiperplano/aluy-cli 1.0.0-rc.76 → 1.0.0-rc.77
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 +3 -3
- package/dist-bundle/index.js +3 -3
- package/package.json +1 -1
package/dist-bundle/bin/aluy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var s8=Object.create;var sy=Object.defineProperty;var i8=Object.getOwnPropertyDescriptor;var a8=Object.getOwnPropertyNames;var l8=Object.getPrototypeOf,c8=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 u8=(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)sy(t,o,{get:e[o],enumerable:!0})},d8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of a8(e))!c8.call(t,r)&&r!==o&&sy(t,r,{get:()=>e[r],enumerable:!(n=i8(e,r))||n.enumerable});return t};var m8=(t,e,o)=>(o=t!=null?s8(l8(t)):{},d8(e||!t||!t.__esModule?sy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as f8}from"node:os";import{join as p8}from"node:path";function Yl(t=f8()){return p8(t,".aluy")}var Dm=p(()=>{"use strict"});var Vl,cC=p(()=>{"use strict";Vl="1.0.0-rc.
|
|
2
|
+
var s8=Object.create;var sy=Object.defineProperty;var i8=Object.getOwnPropertyDescriptor;var a8=Object.getOwnPropertyNames;var l8=Object.getPrototypeOf,c8=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 u8=(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)sy(t,o,{get:e[o],enumerable:!0})},d8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of a8(e))!c8.call(t,r)&&r!==o&&sy(t,r,{get:()=>e[r],enumerable:!(n=i8(e,r))||n.enumerable});return t};var m8=(t,e,o)=>(o=t!=null?s8(l8(t)):{},d8(e||!t||!t.__esModule?sy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as f8}from"node:os";import{join as p8}from"node:path";function Yl(t=f8()){return p8(t,".aluy")}var Dm=p(()=>{"use strict"});var Vl,cC=p(()=>{"use strict";Vl="1.0.0-rc.77"});function Dr(t,e){return t.decide(e)}var ri=p(()=>{"use strict"});var qn,Tr,_r=p(()=>{"use strict";qn="remember",Tr="recall"});var iy,h8,da,ay=p(()=>{"use strict";iy=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}}},h8=200,da=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??h8,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 iy(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 mC(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"&&g8.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=mC(u,!1);if(typeof m=="string")return m;c.push(m)}r=c}}}if(o===void 0||o.trim()==="")return b8;let s=o.trim().slice(0,y8);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function v8(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=mC(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>uC?{error:`update_plan: no m\xE1ximo ${uC} passos (recebidos ${s}).`}:{steps:o}}function k8(t){let e=Tm(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${fC[r.step.status]} ${r.step.title}`).join(`
|
|
3
3
|
`);return`plano (${o}/${e.length}):
|
|
4
4
|
${n}`}function S8(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function w8(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??da.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=S8(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 E8(t,e){if(!e)return k8(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?x8[m.horizon]:"",h=m?s(m.id):u,g=" ".repeat(h),b=fC[c.status];l.push(`${g}${d} ${b} ${c.title}`)}return l.join(`
|
|
5
5
|
`)}var Xl,g8,uC,y8,b8,fC,x8,dC,A8,pC,_m=p(()=>{"use strict";ay();Xl="update_plan";g8=new Set(["pending","in_progress","completed"]),uC=30,y8=120,b8="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";fC={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};x8={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};dC=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),A8=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:dC,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:dC},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),pC={name:Xl,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:A8,async run(t,e){let o=v8(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&w8(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:E8(o.steps,e.graph)})}}});function hC(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)?D8(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&C8.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 D8(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 T8(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(`
|
|
@@ -154,7 +154,7 @@ ${t.trim()}`}}function gR(t,e,o=pu){let{older:n,recent:r}=Jf(t,o);if(n.length===
|
|
|
154
154
|
`);let i=xo(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(),Nr),c=ve(l,Rn);Ze(l)&&Tp(Rp(),c)}catch{}t==="ollama"&&(await NG(),$G()),process.stderr.write(`
|
|
155
155
|
verificando "${t}"\u2026 (alguns segundos; a pr\xF3xima etapa vem em seguida)
|
|
156
156
|
`);let a=await HO(t,process.platform,!0);for(let l=0;l<PG&&!a;l++)await IG(FG),a=await HO(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 IG(t){return new Promise(e=>setTimeout(e,t))}async function NG(){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 $G(){if(process.platform!=="win32")try{let t=xo("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(),ks,"bin","ollama")].find(i=>Ze(i));if(n===void 0)return;let r=ve(e,".local","bin");Tx(r,{recursive:!0});let s=ve(r,"ollama");try{if($O(s)===$O(n))return;gG(s)}catch{}try{hG(n,s)}catch{}}catch{}}function BG(){try{return xo("python3",["-m","venv","--help"],{timeout:1e4}).status===0}catch{return!1}}function UG(){try{return xo("python3",["-m","pip","--version"],{timeout:1e4}).status===0}catch{return!1}}function jG(t){let e=[],o=[];if(t.has("ollama")&&(WO()||(e.push("zstd (extrair o Ollama)"),o.push("zstd")),GO()||(e.push("tar (extrair o Ollama)"),o.push("tar"))),t.has("mem0")||t.has("headroom")){let r=Rx();r.ok?(BG()||(e.push("m\xF3dulo venv do Python (mem0/headroom criam um virtualenv)"),o.push("python3-venv")),UG()||(e.push("pip do Python (mem0/headroom instalam pacotes)"),o.push("python3-pip"))):(e.push(`python3 >= ${yu} 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 KO(t,e,o){let n=t??"turbo",r=$r(e??{}),s=o?.useAgent!==!1,i=new Dx({...o?.platform?{platform:o.platform}:{},...s?{agentInstaller:LG}:{}});if(!s)for(let a of jG(r))process.stderr.write(a+`
|
|
157
|
-
`);return i.provisionAll(n,r)}var qO,za,kG,Rn,UO,Dx,jO,OG,PG,FG,Ox=p(()=>{"use strict";L();qO=".aluy",za=448,kG=384;Rn="aluy-mem0-server.py";UO="application/vnd.ollama.image.model";Dx=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(),ks,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(cn(),Nr,"bin","python3");return Ze(o)&&Lu(o)}case"headroom":{let o=ve(cn(),xs,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=bG().uid;if(Hk(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 AG();case"mem0":return _G();case"headroom":return RG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!vu(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}}},jO="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",OG="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. ";PG=24,FG=5e3});var Zn,Pu=p(()=>{"use strict";Zn="1.0.0-rc.76"});var QO={};pt(QO,{HELP_TEXT:()=>VO,parseArgs:()=>Mx,suggestFlag:()=>zG,versionText:()=>XO});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 HG(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 XO(){return`aluy ${Zn} (@hiperplano/aluy-cli-core ${Vl})`}function GG(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 zG(t){let e,o=3;for(let n of JO){let r=GG(t,n);r<o&&(o=r,e=n)}return e}function KG(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===""||JO.has(s)||o.push(`--${s}`)}return o}function Mx(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"),Ro=ut(W,"provider"),jn=W.includes("--oauth");return{kind:"login",forceDeviceFlow:Wt,...fe!==void 0?{token:fe}:{},...go!==void 0?{org:go}:{},...Ro!==void 0?{provider:Ro}:{},...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 Ro=(t[fe].includes("=")?t[fe].slice(10):t[fe+1]??"").trim().toLowerCase();Ro==="local"?go="local":Ro==="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("-")),Ro=Wt!==void 0&&/^-?\d+$/.test(Wt)?Number(Wt):void 0;return Ro===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Ro}}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:XO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:VO};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})??HG(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,_o=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),rs=k("local-base-url",J),ss=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!==_o&&fe!==ho&&fe!==Ot&&fe!==kt&&fe!==rs&&fe!==ss&&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)&&WG.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 as=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,xn=new Set([vt,bt,_o,ho,Ot,kt,rs,ss,xr,Sr,Ht,qt,st,Rt,K,H,jt,xe,Pe].filter(W=>W>=0));for(let W of qG){let fe=t.indexOf(W);fe>=0&&!t[fe].includes("=")&&xn.add(fe+1)}let Zs=KG(t,xn);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...Zs.length>0?{unknownFlags:Zs}:{},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}:{},...as!==void 0?{resume:as}:{},...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 VO,JO,qG,WG,Lx=p(()=>{"use strict";L();Pu();VO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
157
|
+
`);return i.provisionAll(n,r)}var qO,za,kG,Rn,UO,Dx,jO,OG,PG,FG,Ox=p(()=>{"use strict";L();qO=".aluy",za=448,kG=384;Rn="aluy-mem0-server.py";UO="application/vnd.ollama.image.model";Dx=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(),ks,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(cn(),Nr,"bin","python3");return Ze(o)&&Lu(o)}case"headroom":{let o=ve(cn(),xs,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=bG().uid;if(Hk(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 AG();case"mem0":return _G();case"headroom":return RG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!vu(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}}},jO="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",OG="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. ";PG=24,FG=5e3});var Zn,Pu=p(()=>{"use strict";Zn="1.0.0-rc.77"});var QO={};pt(QO,{HELP_TEXT:()=>VO,parseArgs:()=>Mx,suggestFlag:()=>zG,versionText:()=>XO});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 HG(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 XO(){return`aluy ${Zn} (@hiperplano/aluy-cli-core ${Vl})`}function GG(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 zG(t){let e,o=3;for(let n of JO){let r=GG(t,n);r<o&&(o=r,e=n)}return e}function KG(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===""||JO.has(s)||o.push(`--${s}`)}return o}function Mx(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"),Ro=ut(W,"provider"),jn=W.includes("--oauth");return{kind:"login",forceDeviceFlow:Wt,...fe!==void 0?{token:fe}:{},...go!==void 0?{org:go}:{},...Ro!==void 0?{provider:Ro}:{},...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 Ro=(t[fe].includes("=")?t[fe].slice(10):t[fe+1]??"").trim().toLowerCase();Ro==="local"?go="local":Ro==="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("-")),Ro=Wt!==void 0&&/^-?\d+$/.test(Wt)?Number(Wt):void 0;return Ro===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Ro}}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:XO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:VO};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})??HG(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,_o=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),rs=k("local-base-url",J),ss=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!==_o&&fe!==ho&&fe!==Ot&&fe!==kt&&fe!==rs&&fe!==ss&&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)&&WG.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 as=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,xn=new Set([vt,bt,_o,ho,Ot,kt,rs,ss,xr,Sr,Ht,qt,st,Rt,K,H,jt,xe,Pe].filter(W=>W>=0));for(let W of qG){let fe=t.indexOf(W);fe>=0&&!t[fe].includes("=")&&xn.add(fe+1)}let Zs=KG(t,xn);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...Zs.length>0?{unknownFlags:Zs}:{},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}:{},...as!==void 0?{resume:as}:{},...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 VO,JO,qG,WG,Lx=p(()=>{"use strict";L();Pu();VO=`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>]
|
|
@@ -695,7 +695,7 @@ ${t.output}`:"";return`[shell] $ ${t.command} \u2014 ${e}${o}`}case"subagents":{
|
|
|
695
695
|
${o[s]}`).join(`
|
|
696
696
|
|
|
697
697
|
`);return[`${n} Conserte SOZINHO, agindo na m\xE1quina (voc\xEA est\xE1 em modo turbo, com consentimento, e em --yolo).`,"","Passos:","1. Rode `aluy doctor` e veja exatamente quais sidecars est\xE3o \u2717.","2. Para cada um fora, leia `~/.aluy/logs/<nome>.log` (nomes: ollama, mem0, headroom) p/ a causa.","3. (Re)provisione pelo caminho DIRETO: `aluy bootstrap --no-agent`. N\xC3O use o modo agente"," (voc\xEA J\xC1 \xE9 o agente \u2014 chamar `aluy bootstrap` sem `--no-agent` recursaria).","4. Se faltar pr\xE9-requisito (python3.10+/pip/venv, zstd/tar, etc.), instale com o gerenciador"," da distro (apt/dnf/pacman/zypper; brew no macOS), com sudo se preciso.",'5. Casos comuns: mem0 \u2717 "No such file" \u21D2 falta o aluy-mem0-server.py no venv (o bootstrap'," o copia); mem0 crash de store \u21D2 `mv ~/.aluy/memory{,.bak}; mv ~/.mem0/history.db{,.bak}`;",' ollama "command not found" mas servi\xE7o up \u21D2 bin\xE1rio fora do PATH; headroom \u21D2 deps do venv.',"6. Repita at\xE9 `aluy doctor` mostrar ollama \u2713 \xB7 mem0 \u2713 \xB7 headroom \u2713 (ou explique, com a linha"," do log, por que um n\xE3o sobe nesta m\xE1quina). Seja conciso no relato.",...r!==""?["","Logs que j\xE1 capturei:",r]:[]].join(`
|
|
698
|
-
`)}var $A,M2=p(()=>{"use strict";$A=["ollama","mem0","headroom"]});import{homedir as P2}from"node:os";import{join as UA}from"node:path";function Ite(t){return{title:"mcp",lines:[`uso: /mcp ${t} <nome>`]}}function F2(t){let e=t.trim().split(/\s+/).filter(m=>m.length>0),o=e[0]?.toLowerCase();if(o===void 0)return null;if(o==="remove"||o==="rm"||o==="disable"||o==="enable"){let m=o==="rm"?"remove":o,d=e[1];return d===void 0||e.length>2?{kind:"usage",note:Ite(m)}:{kind:m,name:d}}if(o!=="add")return null;let n=e.slice(1),r=[],s=[],i=!1,a=null;for(let m=0;m<n.length;m++){let d=n[m];if(d==="--"){a=n.slice(m+1);break}if(d==="--force"){i=!0;continue}if(d==="--env"||d.startsWith("--env=")){let h=d==="--env"?n[++m]:d.slice(6),g=h===void 0?void 0:Nte(h);if(g===void 0)return{kind:"usage",note:BA};r.push(g);continue}s.push(d)}let l=s[0];if(l===void 0)return{kind:"usage",note:BA};let c=a??s.slice(1),u=c[0];return u===void 0||u.trim().length===0?{kind:"usage",note:BA}:{kind:"add",name:l,command:u,args:c.slice(1),env:r,force:i}}function Nte(t){let e=t.indexOf("=");if(!(e<=0))return[t.slice(0,e),t.slice(e+1)]}function I2(t,e={}){if(t.kind==="usage")return t.note;let o=e.aluyHome??UA(P2(),".aluy"),n=new ir({file:UA(o,Qa)});try{switch(t.kind){case"add":return $te(t,n);case"remove":return Bte(t.name,n,e);case"disable":return L2(t.name,!0,n,e);case"enable":return L2(t.name,!1,n,e)}}catch(r){return{title:"mcp",lines:[`\u26A0 ${r instanceof Jt?r.message:String(r)}`]}}}function $te(t,e){let o=[],n={};for(let[i,a]of t.env)wu(i,a).looksLikeSecret&&o.push(`\u26A0 --env ${i} parece um SEGREDO literal \u2014 o mcp.json \xE9 leg\xEDvel e N\xC3O deve carregar credencial. Prefira refer\xEAncia (--env ${i}=$NOME_DA_VAR). Gravando assim mesmo.`),n[i]=a;let r={name:t.name,command:t.command,args:t.args,env:n},{replaced:s}=e.add(r,{force:t.force});return o.push(`${s?"atualizado":"adicionado"} "${t.name}" em ~/.aluy/mcp.json: ${t.command}${t.args.length?" "+t.args.join(" "):""}`),o.push(jA),o.push("o server passa pela catraca no runtime (conectar = confirma\xE7\xE3o)."),{title:"mcp",lines:o}}function Bte(t,e,o){let{removed:n}=e.remove(t);return n?{title:"mcp",lines:[`removido "${t}" de ~/.aluy/mcp.json.`,jA]}:{title:"mcp",lines:N2(t,o)}}function L2(t,e,o,n){let{found:r}=o.setDisabled(t,e);return r?e?{title:"mcp",lines:[`desativado "${t}" (disabled: true em ~/.aluy/mcp.json) \u2014 instalado, mas a`,"descoberta o PULA. se est\xE1 conectado nesta sess\xE3o, desconecta no pr\xF3ximo boot.","reative com /mcp enable "+t+"."]}:{title:"mcp",lines:[`reativado "${t}" em ~/.aluy/mcp.json.`,jA]}:{title:"mcp",lines:N2(t,n)}}function N2(t,e){let o=[`server "${t}" n\xE3o est\xE1 em ~/.aluy/mcp.json (onde o aluy escreve).`],n=e.codexHome??UA(P2(),".codex");try{new dn({baseDir:n}).load().config.servers.some(s=>s.name===t)&&o.push(`"${t}" vem do Codex (~/.codex/config.toml) \u2014 o aluy N\xC3O o gerencia; edite o config.toml \xE0 m\xE3o.`)}catch{}return o}var BA,jA,$2=p(()=>{"use strict";L();Td();Mi();qu();BA={title:"mcp",lines:["uso: /mcp add <nome> [--env K=V]... [--force] -- <command> [args...]","ex.: /mcp add pw -- npx -y @playwright/mcp","use REFER\xCANCIA no --env (--env TOKEN=$MEU_TOKEN) \u2014 nunca segredo literal."]};jA="reinicie a sess\xE3o (ou use /mcp reload quando existir) p/ carregar as tools \u2014 a descoberta \xE9 no boot."});function HA(t){return t==="thinking"||t==="streaming"||t==="asking"}function B2(t){return t==="boot"||t==="idle"||t==="done"||t==="error"}function U2(t,e){let o=e.port,n=e.longTurnMs??Ute,r=e.now??Date.now,s=null,i=null;return t(l=>{let c=l.phase;if(s===null){s=c,HA(c)&&(i=r());return}if(c!==s){if(HA(c)&&B2(s)&&(i=r()),c==="asking"&&s!=="asking"&&o.notify("attention"),(c==="done"||c==="budget")&&HA(s)){let u=i;u!==null&&r()-u>=n&&o.notify("done")}B2(c)&&(i=null),s=c}})}var Ute,j2=p(()=>{"use strict";Ute=5e3});function Qs(t,e){return{kind:"note",note:{title:t,lines:e}}}var km,H2=p(()=>{"use strict";L();km=class{journal;redoStack=[];cursor=null;constructor(e){this.journal=e.journal}syncCursor(){let e=[...this.journal.list()];return this.cursor===null?this.cursor=e.length:this.cursor>e.length&&(this.cursor=e.length),e}async undo(e=!1){let o=this.syncCursor(),n=this.cursor??o.length;if(n<=0)return Qs("undo",["nada para desfazer \u2014 a pilha de edi\xE7\xF5es est\xE1 vazia."]);let r=[];for(;n>0;){let s=o[n-1];if(s.kind==="barrier"){r.push(`\u26A0 aqui rodou \`${ko(s.command)}\` \u2014 efeito de shell N\xC3O \xE9 revers\xEDvel (n\xE3o desfeito).`),n-=1,this.cursor=n;continue}let i=s.targets[0];if(!i){n-=1,this.cursor=n;continue}if(!e&&(await this.journal.checkConcurrency(s)).diverged)return{kind:"confirm",note:{title:"undo \u2014 confirmar",lines:[...r,`o arquivo \`${i.path}\` mudou desde a edi\xE7\xE3o do agente (hash divergiu).`,"desfazer agora SOBRESCREVE essas mudan\xE7as externas com o conte\xFAdo anterior.","rode /undo de novo p/ confirmar a revers\xE3o, ou deixe como est\xE1."]},proceed:()=>this.undo(!0)};let a;try{a=await this.journal.restore(s)}catch(u){let m=u instanceof Error?u.message:"falha desconhecida";return Qs("undo \u2014 falhou",[...r,`n\xE3o foi poss\xEDvel reverter \`${i.path}\`: ${m}`,"nada foi escrito (a revers\xE3o \xE9 confinada e fail-safe)."])}this.pushRedo(s,i.path,i.createdByEdit),n-=1,this.cursor=n;let l=a.action==="removed"?`revertido (arquivo removido \u2014 era novo): \`${i.path}\``:`revertido: \`${i.path}\``,c=this.undoDepth(o,n);return Qs("undo",[...r,l,`pilha: ${c} edi\xE7\xE3o(\xF5es) ainda revers\xEDvel(eis) \xB7 ${this.redoStack.length} para refazer.`])}return Qs("undo",[...r,r.length>0?"n\xE3o h\xE1 mais edi\xE7\xF5es de arquivo para reverter abaixo das barreiras.":"nada para desfazer."])}async redo(){let e=this.redoStack.pop();if(!e)return Qs("redo",["nada para refazer \u2014 n\xE3o h\xE1 undo recente."]);let o=this.journal.appliedContent(e.entry.seq);if(!o)return this.redoStack.push(e),Qs("redo",["n\xE3o foi poss\xEDvel refazer: o conte\xFAdo aplicado n\xE3o est\xE1 dispon\xEDvel nesta sess\xE3o."]);let n;try{n=await this.journal.reapply(e.path,o.after)}catch(r){let s=r instanceof Error?r.message:"falha desconhecida";return this.redoStack.push(e),Qs("redo \u2014 falhou",[`n\xE3o foi poss\xEDvel reaplicar \`${e.path}\`: ${s}`,"nada foi escrito (reaplica\xE7\xE3o confinada e fail-safe)."])}return this.cursor!==null&&(this.cursor+=1),Qs("redo",[`reaplicado: \`${e.path}\` (${n?"reaplicado":"ok"})`,`pilha: ${this.redoStack.length} ainda para refazer.`])}undoDepth(e,o){let n=0;for(let r=0;r<o;r++)e[r].kind==="edit"&&(n+=1);return n}pushRedo(e,o,n){this.redoStack.push({entry:e,path:o,createdByEdit:n})}}});function jte(t){return t==="thinking"||t==="streaming"||t==="asking"}function Vg(t,e){let o=Lt(e.config,"turn-end"),n=Lt(e.config,"notification");if(o.length===0&&n.length===0)return()=>{};let r=null;return t(i=>{let a=i.phase;if(r===null){r=a;return}a!==r&&(o.length>0&&(a==="done"||a==="budget")&&jte(r)&&e.runner.runAll(o),n.length>0&&a==="asking"&&r!=="asking"&&e.runner.runAll(n),r=a)})}var q2=p(()=>{"use strict";L()});function W2(t){let e=Lt(t.config,"pre-tool").length>0,o=Lt(t.config,"post-tool").length>0;if(!e&&!o)return;let n={};return e&&(n.onToolStart=r=>{let s=Lt(t.config,"pre-tool",r.name);s.length>0&&t.runner.runAll(s)}),o&&(n.onToolEnd=r=>{let s=Lt(t.config,"post-tool",r.name);s.length>0&&t.runner.runAll(s)}),n}var G2=p(()=>{"use strict";L()});function z2(t){if(t===null||typeof t!="object")return!1;let e=t,o=typeof e.code=="string"?e.code:"",n=typeof e.name=="string"?e.name:"",r=typeof e.message=="string"?e.message:"";return o==="ECONNRESET"||o==="EPIPE"||n==="AbortError"||/socket hang up|ECONNRESET|EPIPE|\baborted\b/i.test(r)?!0:e.cause!==void 0&&e.cause!==t?z2(e.cause):!1}function qA(t){try{t.write(`${Hte}${Wte}`)}catch{}}function K2(t,e){let o=!1,n=!1,r=()=>{if(!o){o=!0;try{let b=e.stdin??globalThis.process?.stdin;b?.isTTY===!0&&(b.setRawMode?.(!1),b.pause?.())}catch{}try{t.isTTY===!0&&t.setRawMode?.(!1)}catch{}try{t.isTTY===!0&&t.write(`${qte}${Gte}`)}catch{}}},s=()=>r(),i=b=>()=>{r(),h();try{e.kill?.(e.pid??0,b)}catch{}},a=b=>{if(z2(b))return;r(),h();let y=()=>{throw b instanceof Error?b:new Error(String(b))},w=e.nextTick??globalThis.process?.nextTick;typeof w=="function"?w(y):y()},l=i("SIGINT"),c=i("SIGTERM"),u={exit:s,SIGINT:l,SIGTERM:c,uncaughtException:a,unhandledRejection:a},m=zte.map(b=>[b,u[b]]),d=!0,h=()=>{if(d){d=!1;for(let[b,y]of m)try{e.removeListener(b,y)}catch{}}};for(let[b,y]of m)e.on(b,y);return{restoreScreen:r,dispose:()=>{n||(n=!0,h(),r())}}}var Hte,qte,Wte,Gte,zte,Y2=p(()=>{"use strict";Hte="\x1B[?1049h",qte="\x1B[?1049l",Wte="\x1B[?25l",Gte="\x1B[?25h";zte=["exit","SIGINT","SIGTERM","uncaughtException","unhandledRejection"]});function V2(t,e){t.on("SIGINT",e),t.on("SIGTERM",e);let o=!1;return{dispose(){o||(o=!0,t.removeListener("SIGINT",e),t.removeListener("SIGTERM",e))}}}var X2=p(()=>{"use strict"});function $t(t){return Qe(t)}function Kte(t){switch(t.kind){case"testrun":{let e=t.score;return e.unknownFormat?["## testes","","placar indispon\xEDvel (formato n\xE3o reconhecido)",""]:["## testes","",`${e.passed} \u2713 \xB7 ${e.failed} \u2717 \xB7 ${e.total} total`,""]}case"you":return["## voc\xEA","",$t(t.text),""];case"aluy":return t.selfCheck?[]:["## aluy","",$t(sn(t.text)),""];case"tool":{let e=`- \`${$t(t.verb)} ${$t(t.target)}\` \u2192 ${$t(t.result)} (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",$t(o),"```"]:[];return[e,...n,""]}case"bang":{let e=`- \`! ${$t(t.command)}\` (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",$t(o),"```"]:[];return[e,...n,""]}case"deny":return[`- (negado) \`${$t(t.verb)} ${$t(t.exact)}\``,""];case"subagents":return[`- sub-agentes: ${t.children.map(e=>`${$t(e.label)} (${e.status})`).join(", ")}`,""];case"broker-error":return[`> erro de broker: ${$t(t.headline??t.message)}`,""];case"note":return[`> ${$t(t.title)}`,...t.lines.map(e=>`> ${$t(e)}`),""];case"inject":return[`> (encaixado) ${$t(t.text)}`,""];case"doctor":return[`> doctor: ${t.checks.map(e=>`${$t(e.label)} ${e.status}`).join(" \xB7 ")}`,""]}}function J2(t,e={}){let o=e.exportedAt??new Date().toISOString(),n=["# Aluy Cli \u2014 transcript",""],r=[];e.label!==void 0&&e.label!==""&&r.push(`sess\xE3o: ${$t(e.label)}`),e.sessionId!==void 0&&e.sessionId!==""&&r.push(`id: ${e.sessionId}`),e.tier!==void 0&&e.tier!==""&&r.push(`tier: ${$t(e.tier)}`),r.push(`exportado: ${o}`),n.push(`> ${r.join(" \xB7 ")}`,""),n.push("> por seguran\xE7a, eventuais segredos foram substitu\xEDdos por \u2039redigido\u203A.","","---","");for(let i of t)for(let a of Kte(i))n.push(a);let s=n.join(`
|
|
698
|
+
`)}var $A,M2=p(()=>{"use strict";$A=["ollama","mem0","headroom"]});import{homedir as P2}from"node:os";import{join as UA}from"node:path";function Ite(t){return{title:"mcp",lines:[`uso: /mcp ${t} <nome>`]}}function F2(t){let e=t.trim().split(/\s+/).filter(m=>m.length>0),o=e[0]?.toLowerCase();if(o===void 0)return null;if(o==="remove"||o==="rm"||o==="disable"||o==="enable"){let m=o==="rm"?"remove":o,d=e[1];return d===void 0||e.length>2?{kind:"usage",note:Ite(m)}:{kind:m,name:d}}if(o!=="add")return null;let n=e.slice(1),r=[],s=[],i=!1,a=null;for(let m=0;m<n.length;m++){let d=n[m];if(d==="--"){a=n.slice(m+1);break}if(d==="--force"){i=!0;continue}if(d==="--env"||d.startsWith("--env=")){let h=d==="--env"?n[++m]:d.slice(6),g=h===void 0?void 0:Nte(h);if(g===void 0)return{kind:"usage",note:BA};r.push(g);continue}s.push(d)}let l=s[0];if(l===void 0)return{kind:"usage",note:BA};let c=a??s.slice(1),u=c[0];return u===void 0||u.trim().length===0?{kind:"usage",note:BA}:{kind:"add",name:l,command:u,args:c.slice(1),env:r,force:i}}function Nte(t){let e=t.indexOf("=");if(!(e<=0))return[t.slice(0,e),t.slice(e+1)]}function I2(t,e={}){if(t.kind==="usage")return t.note;let o=e.aluyHome??UA(P2(),".aluy"),n=new ir({file:UA(o,Qa)});try{switch(t.kind){case"add":return $te(t,n);case"remove":return Bte(t.name,n,e);case"disable":return L2(t.name,!0,n,e);case"enable":return L2(t.name,!1,n,e)}}catch(r){return{title:"mcp",lines:[`\u26A0 ${r instanceof Jt?r.message:String(r)}`]}}}function $te(t,e){let o=[],n={};for(let[i,a]of t.env)wu(i,a).looksLikeSecret&&o.push(`\u26A0 --env ${i} parece um SEGREDO literal \u2014 o mcp.json \xE9 leg\xEDvel e N\xC3O deve carregar credencial. Prefira refer\xEAncia (--env ${i}=$NOME_DA_VAR). Gravando assim mesmo.`),n[i]=a;let r={name:t.name,command:t.command,args:t.args,env:n},{replaced:s}=e.add(r,{force:t.force});return o.push(`${s?"atualizado":"adicionado"} "${t.name}" em ~/.aluy/mcp.json: ${t.command}${t.args.length?" "+t.args.join(" "):""}`),o.push(jA),o.push("o server passa pela catraca no runtime (conectar = confirma\xE7\xE3o)."),{title:"mcp",lines:o}}function Bte(t,e,o){let{removed:n}=e.remove(t);return n?{title:"mcp",lines:[`removido "${t}" de ~/.aluy/mcp.json.`,jA]}:{title:"mcp",lines:N2(t,o)}}function L2(t,e,o,n){let{found:r}=o.setDisabled(t,e);return r?e?{title:"mcp",lines:[`desativado "${t}" (disabled: true em ~/.aluy/mcp.json) \u2014 instalado, mas a`,"descoberta o PULA. se est\xE1 conectado nesta sess\xE3o, desconecta no pr\xF3ximo boot.","reative com /mcp enable "+t+"."]}:{title:"mcp",lines:[`reativado "${t}" em ~/.aluy/mcp.json.`,jA]}:{title:"mcp",lines:N2(t,n)}}function N2(t,e){let o=[`server "${t}" n\xE3o est\xE1 em ~/.aluy/mcp.json (onde o aluy escreve).`],n=e.codexHome??UA(P2(),".codex");try{new dn({baseDir:n}).load().config.servers.some(s=>s.name===t)&&o.push(`"${t}" vem do Codex (~/.codex/config.toml) \u2014 o aluy N\xC3O o gerencia; edite o config.toml \xE0 m\xE3o.`)}catch{}return o}var BA,jA,$2=p(()=>{"use strict";L();Td();Mi();qu();BA={title:"mcp",lines:["uso: /mcp add <nome> [--env K=V]... [--force] -- <command> [args...]","ex.: /mcp add pw -- npx -y @playwright/mcp","use REFER\xCANCIA no --env (--env TOKEN=$MEU_TOKEN) \u2014 nunca segredo literal."]};jA="reinicie a sess\xE3o (ou use /mcp reload quando existir) p/ carregar as tools \u2014 a descoberta \xE9 no boot."});function HA(t){return t==="thinking"||t==="streaming"||t==="asking"}function B2(t){return t==="boot"||t==="idle"||t==="done"||t==="error"}function U2(t,e){let o=e.port,n=e.longTurnMs??Ute,r=e.now??Date.now,s=null,i=null;return t(l=>{let c=l.phase;if(s===null){s=c,HA(c)&&(i=r());return}if(c!==s){if(HA(c)&&B2(s)&&(i=r()),c==="asking"&&s!=="asking"&&o.notify("attention"),(c==="done"||c==="budget")&&HA(s)){let u=i;u!==null&&r()-u>=n&&o.notify("done")}B2(c)&&(i=null),s=c}})}var Ute,j2=p(()=>{"use strict";Ute=5e3});function Qs(t,e){return{kind:"note",note:{title:t,lines:e}}}var km,H2=p(()=>{"use strict";L();km=class{journal;redoStack=[];cursor=null;constructor(e){this.journal=e.journal}syncCursor(){let e=[...this.journal.list()];return this.cursor===null?this.cursor=e.length:this.cursor>e.length&&(this.cursor=e.length),e}async undo(e=!1){let o=this.syncCursor(),n=this.cursor??o.length;if(n<=0)return Qs("undo",["nada para desfazer \u2014 a pilha de edi\xE7\xF5es est\xE1 vazia."]);let r=[];for(;n>0;){let s=o[n-1];if(s.kind==="barrier"){r.push(`\u26A0 aqui rodou \`${ko(s.command)}\` \u2014 efeito de shell N\xC3O \xE9 revers\xEDvel (n\xE3o desfeito).`),n-=1,this.cursor=n;continue}let i=s.targets[0];if(!i){n-=1,this.cursor=n;continue}if(!e&&(await this.journal.checkConcurrency(s)).diverged)return{kind:"confirm",note:{title:"undo \u2014 confirmar",lines:[...r,`o arquivo \`${i.path}\` mudou desde a edi\xE7\xE3o do agente (hash divergiu).`,"desfazer agora SOBRESCREVE essas mudan\xE7as externas com o conte\xFAdo anterior.","rode /undo de novo p/ confirmar a revers\xE3o, ou deixe como est\xE1."]},proceed:()=>this.undo(!0)};let a;try{a=await this.journal.restore(s)}catch(u){let m=u instanceof Error?u.message:"falha desconhecida";return Qs("undo \u2014 falhou",[...r,`n\xE3o foi poss\xEDvel reverter \`${i.path}\`: ${m}`,"nada foi escrito (a revers\xE3o \xE9 confinada e fail-safe)."])}this.pushRedo(s,i.path,i.createdByEdit),n-=1,this.cursor=n;let l=a.action==="removed"?`revertido (arquivo removido \u2014 era novo): \`${i.path}\``:`revertido: \`${i.path}\``,c=this.undoDepth(o,n);return Qs("undo",[...r,l,`pilha: ${c} edi\xE7\xE3o(\xF5es) ainda revers\xEDvel(eis) \xB7 ${this.redoStack.length} para refazer.`])}return Qs("undo",[...r,r.length>0?"n\xE3o h\xE1 mais edi\xE7\xF5es de arquivo para reverter abaixo das barreiras.":"nada para desfazer."])}async redo(){let e=this.redoStack.pop();if(!e)return Qs("redo",["nada para refazer \u2014 n\xE3o h\xE1 undo recente."]);let o=this.journal.appliedContent(e.entry.seq);if(!o)return this.redoStack.push(e),Qs("redo",["n\xE3o foi poss\xEDvel refazer: o conte\xFAdo aplicado n\xE3o est\xE1 dispon\xEDvel nesta sess\xE3o."]);let n;try{n=await this.journal.reapply(e.path,o.after)}catch(r){let s=r instanceof Error?r.message:"falha desconhecida";return this.redoStack.push(e),Qs("redo \u2014 falhou",[`n\xE3o foi poss\xEDvel reaplicar \`${e.path}\`: ${s}`,"nada foi escrito (reaplica\xE7\xE3o confinada e fail-safe)."])}return this.cursor!==null&&(this.cursor+=1),Qs("redo",[`reaplicado: \`${e.path}\` (${n?"reaplicado":"ok"})`,`pilha: ${this.redoStack.length} ainda para refazer.`])}undoDepth(e,o){let n=0;for(let r=0;r<o;r++)e[r].kind==="edit"&&(n+=1);return n}pushRedo(e,o,n){this.redoStack.push({entry:e,path:o,createdByEdit:n})}}});function jte(t){return t==="thinking"||t==="streaming"||t==="asking"}function Vg(t,e){let o=Lt(e.config,"turn-end"),n=Lt(e.config,"notification");if(o.length===0&&n.length===0)return()=>{};let r=null;return t(i=>{let a=i.phase;if(r===null){r=a;return}a!==r&&(o.length>0&&(a==="done"||a==="budget")&&jte(r)&&e.runner.runAll(o),n.length>0&&a==="asking"&&r!=="asking"&&e.runner.runAll(n),r=a)})}var q2=p(()=>{"use strict";L()});function W2(t){let e=Lt(t.config,"pre-tool").length>0,o=Lt(t.config,"post-tool").length>0;if(!e&&!o)return;let n={};return e&&(n.onToolStart=r=>{let s=Lt(t.config,"pre-tool",r.name);s.length>0&&t.runner.runAll(s)}),o&&(n.onToolEnd=r=>{let s=Lt(t.config,"post-tool",r.name);s.length>0&&t.runner.runAll(s)}),n}var G2=p(()=>{"use strict";L()});function z2(t){if(t===null||typeof t!="object")return!1;let e=t,o=typeof e.code=="string"?e.code:"",n=typeof e.name=="string"?e.name:"",r=typeof e.message=="string"?e.message:"";return o==="ECONNRESET"||o==="EPIPE"||n==="AbortError"||/socket hang up|ECONNRESET|EPIPE|\baborted\b/i.test(r)?!0:e.cause!==void 0&&e.cause!==t?z2(e.cause):!1}function qA(t){try{t.write(`${Hte}${Wte}`)}catch{}}function K2(t,e){let o=!1,n=!1,r=()=>{if(!o){o=!0;try{let b=e.stdin??globalThis.process?.stdin;b?.isTTY===!0&&(b.setRawMode?.(!1),b.pause?.())}catch{}try{t.isTTY===!0&&t.setRawMode?.(!1)}catch{}try{t.isTTY===!0&&t.write(`${qte}${Gte}`)}catch{}}},s=()=>r(),i=b=>()=>{r(),h();let y=b==="SIGINT"?130:143,w=e.exit,E=e.nextTick??globalThis.process?.nextTick,C=()=>{if(typeof w=="function"){w(y);return}try{e.kill?.(e.pid??0,b)}catch{}};typeof E=="function"?E(C):C()},a=b=>{if(z2(b))return;r(),h();let y=()=>{throw b instanceof Error?b:new Error(String(b))},w=e.nextTick??globalThis.process?.nextTick;typeof w=="function"?w(y):y()},l=i("SIGINT"),c=i("SIGTERM"),u={exit:s,SIGINT:l,SIGTERM:c,uncaughtException:a,unhandledRejection:a},m=zte.map(b=>[b,u[b]]),d=!0,h=()=>{if(d){d=!1;for(let[b,y]of m)try{e.removeListener(b,y)}catch{}}};for(let[b,y]of m)e.on(b,y);return{restoreScreen:r,dispose:()=>{n||(n=!0,h(),r())}}}var Hte,qte,Wte,Gte,zte,Y2=p(()=>{"use strict";Hte="\x1B[?1049h",qte="\x1B[?1049l",Wte="\x1B[?25l",Gte="\x1B[?25h";zte=["exit","SIGINT","SIGTERM","uncaughtException","unhandledRejection"]});function V2(t,e){t.on("SIGINT",e),t.on("SIGTERM",e);let o=!1;return{dispose(){o||(o=!0,t.removeListener("SIGINT",e),t.removeListener("SIGTERM",e))}}}var X2=p(()=>{"use strict"});function $t(t){return Qe(t)}function Kte(t){switch(t.kind){case"testrun":{let e=t.score;return e.unknownFormat?["## testes","","placar indispon\xEDvel (formato n\xE3o reconhecido)",""]:["## testes","",`${e.passed} \u2713 \xB7 ${e.failed} \u2717 \xB7 ${e.total} total`,""]}case"you":return["## voc\xEA","",$t(t.text),""];case"aluy":return t.selfCheck?[]:["## aluy","",$t(sn(t.text)),""];case"tool":{let e=`- \`${$t(t.verb)} ${$t(t.target)}\` \u2192 ${$t(t.result)} (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",$t(o),"```"]:[];return[e,...n,""]}case"bang":{let e=`- \`! ${$t(t.command)}\` (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",$t(o),"```"]:[];return[e,...n,""]}case"deny":return[`- (negado) \`${$t(t.verb)} ${$t(t.exact)}\``,""];case"subagents":return[`- sub-agentes: ${t.children.map(e=>`${$t(e.label)} (${e.status})`).join(", ")}`,""];case"broker-error":return[`> erro de broker: ${$t(t.headline??t.message)}`,""];case"note":return[`> ${$t(t.title)}`,...t.lines.map(e=>`> ${$t(e)}`),""];case"inject":return[`> (encaixado) ${$t(t.text)}`,""];case"doctor":return[`> doctor: ${t.checks.map(e=>`${$t(e.label)} ${e.status}`).join(" \xB7 ")}`,""]}}function J2(t,e={}){let o=e.exportedAt??new Date().toISOString(),n=["# Aluy Cli \u2014 transcript",""],r=[];e.label!==void 0&&e.label!==""&&r.push(`sess\xE3o: ${$t(e.label)}`),e.sessionId!==void 0&&e.sessionId!==""&&r.push(`id: ${e.sessionId}`),e.tier!==void 0&&e.tier!==""&&r.push(`tier: ${$t(e.tier)}`),r.push(`exportado: ${o}`),n.push(`> ${r.join(" \xB7 ")}`,""),n.push("> por seguran\xE7a, eventuais segredos foram substitu\xEDdos por \u2039redigido\u203A.","","---","");for(let i of t)for(let a of Kte(i))n.push(a);let s=n.join(`
|
|
699
699
|
`);return s=s.replace(/\n{3,}/g,`
|
|
700
700
|
|
|
701
701
|
`).replace(/\n+$/,"")+`
|
package/dist-bundle/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $I=Object.create;var Pp=Object.defineProperty;var BI=Object.getOwnPropertyDescriptor;var UI=Object.getOwnPropertyNames;var jI=Object.getPrototypeOf,HI=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 qI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Fp=(t,e)=>{for(var o in e)Pp(t,o,{get:e[o],enumerable:!0})},WI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of UI(e))!HI.call(t,r)&&r!==o&&Pp(t,r,{get:()=>e[r],enumerable:!(n=BI(e,r))||n.enumerable});return t};var GI=(t,e,o)=>(o=t!=null?$I(jI(t)):{},WI(e||!t||!t.__esModule?Pp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,$E=S(()=>{"use strict";Ua="1.0.0-rc.
|
|
1
|
+
var $I=Object.create;var Pp=Object.defineProperty;var BI=Object.getOwnPropertyDescriptor;var UI=Object.getOwnPropertyNames;var jI=Object.getPrototypeOf,HI=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 qI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Fp=(t,e)=>{for(var o in e)Pp(t,o,{get:e[o],enumerable:!0})},WI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of UI(e))!HI.call(t,r)&&r!==o&&Pp(t,r,{get:()=>e[r],enumerable:!(n=BI(e,r))||n.enumerable});return t};var GI=(t,e,o)=>(o=t!=null?$I(jI(t)):{},WI(e||!t||!t.__esModule?Pp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,$E=S(()=>{"use strict";Ua="1.0.0-rc.77"});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 Ip,zI,hi,Np=S(()=>{"use strict";Ip=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}}},zI=200,hi=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??zI,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 Ip(e,o,n,r??null,i);if(r){let c=this.nodes.get(r);c&&c.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,c=r.closed?0:1;return a!==c?a-c: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 jE(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"&&KI.has(i.status)&&(n=i.status),e){let c=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(c)&&c.length>0){let l=[];for(let u of c){let f=jE(u,!1);if(typeof f=="string")return f;l.push(f)}r=l}}}if(o===void 0||o.trim()==="")return VI;let s=o.trim().slice(0,YI);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function XI(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=jE(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 c=`${i} #${a}`;if(!n.has(c))return n.add(c),c}};for(let i=0;i<o.length;i++){let a=o[i],c=r(a.title),l=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=l!==void 0?{...a,title:c,substeps:l}:{...a,title:c}}let s=Wu(o).length;return s>BE?{error:`update_plan: no m\xE1ximo ${BE} passos (recebidos ${s}).`}:{steps:o}}function JI(t){let e=Wu(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${HE[r.step.status]} ${r.step.title}`).join(`
|
|
2
2
|
`);return`plano (${o}/${e.length}):
|
|
3
3
|
${n}`}function ZI(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function eN(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,c)=>{let l=i.status==="in_progress"?"curto":c,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,l),e.setParent(u,a)):e.openBox(f,l,i.title,a),i.status==="completed"&&!e.isClosed(f)&&e.closeBox(f),o.set(i.title,f),f};t.forEach((i,a)=>{let c=ZI(a,n),l=r(i,null,c);for(let u of i.substeps??[])r(u,l,c)});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 tN(t,e){if(!e)return JI(t);let o=new Map;for(let l of e.listBoxes())o.set(l.label,l);let n=new Map;for(let l of e.listBoxes())n.set(l.id,l);let r=new Map,s=(l,u=new Set)=>{let f=r.get(l);if(f!==void 0)return f;let d=n.get(l);if(!d||!d.parentId||u.has(l))return r.set(l,0),0;let p=s(d.parentId,new Set(u).add(l))+1;return r.set(l,p),p},i=Wu(t),c=[`plano (${i.filter(l=>l.step.status==="completed").length}/${i.length}):`];for(let{step:l,depth:u}of i){let f=o.get(l.title),d=f?QI[f.horizon]:"",p=f?s(f.id):u,h=" ".repeat(p),y=HE[l.status];c.push(`${h}${d} ${y} ${l.title}`)}return c.join(`
|
|
4
4
|
`)}var ja,KI,BE,YI,VI,HE,QI,UE,oN,qE,Gu=S(()=>{"use strict";Np();ja="update_plan";KI=new Set(["pending","in_progress","completed"]),BE=30,YI=120,VI="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";HE={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};QI={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};UE=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),oN=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:UE,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:UE},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),qE={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:oN,async run(t,e){let o=XI(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&eN(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:tN(o.steps,e.graph)})}}});function WE(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)?rN(s):void 0;if(typeof i=="string")return{error:i};let a,c=t.kind??t.type;if(typeof c=="string"&&nN.has(c))a=c;else{if(typeof c=="string"&&c.trim()!=="")return{error:`perguntar: "kind" inv\xE1lido "${c}". 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 l=t.allowOther!==!1;return{spec:{kind:a,question:o,...r!==void 0?{header:r}:{},...a!=="text"&&i!==void 0?{options:i}:{},...a!=="text"?{allowOther:l}:{}}}}function rN(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 sN(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(`
|
|
@@ -137,7 +137,7 @@ ${t.trim()}`}}function UD(t,e,o=el){let{older:n,recent:r}=mm(t,o);if(n.length===
|
|
|
137
137
|
\u2026[truncado: ${t.length-Pb} chars omitidos]`}function zU(t){return t.length<=Ib?t:`${t.slice(0,Ib)}\u2026`}function w0(t){let e=S0(t.server,t.descriptor.name),o=zU(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,c){try{let l=await t.transport.callTool(t.descriptor.name,i,c?.signal),u=Ue(l.content);return l.ok?{ok:!0,observation:E0(u),display:`${e}(${KU(i)})`}:{ok:!1,observation:E0(`MCP "${e}" erro: ${u}`)}}catch(l){return{ok:!1,observation:`MCP "${e}" falhou: ${l instanceof Error?l.message:String(l)}`}}}}}function Nb(t,e){let o=[],n=new Set,r=new Map,s=new Map,i=new Set;for(let a of t){let c=w0(a);if(n.has(c.name))continue;n.add(c.name);let l=a.server;s.set(l,(s.get(l)??0)+1);let u=r.get(l)??0;if(u>=Fb){i.add(l);continue}r.set(l,u+1),o.push(c)}if(e)for(let a of i){let c=s.get(a)??0;e(`server MCP "${a}" exp\xF4s ${c} tools; usando as primeiras ${Fb} (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 KU(t){if(Object.keys(t).length===0)return"";let o=JSON.stringify(t);return o.length<=200?o:`${o.slice(0,200)}\u2026`}var Pb,Fb,Ib,A0=S(()=>{"use strict";Yu();Zn();Pb=2e4;Fb=128,Ib=1024});function T0(t,e){let o=new URL(D0);return t.trim().length>0&&o.searchParams.set("search",t.trim()),o.searchParams.set("limit",String(VU)),e!==void 0&&e.length>0&&o.searchParams.set("cursor",e),o.toString()}async function Bb(t,e,o){let n=t.trim(),r=[],s;for(let i=0;i<YU;i++){let a=T0(n,s),c;try{c=await e(a,o)}catch(f){return{ok:!1,query:n,reason:xm(t2(f))}}if(!c.ok)return{ok:!1,query:n,reason:xm(c.reason)};if(c.status<200||c.status>=300)return{ok:!1,query:n,reason:xm(`HTTP ${c.status}`)};let l;try{l=JSON.parse(c.body)}catch{return{ok:!1,query:n,reason:xm("resposta n\xE3o \xE9 JSON v\xE1lido")}}let u=R0(l);for(let f of u.servers)if(_0(f,n)&&r.push(f),r.length>=$b)break;if(r.length>=$b||(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 _0(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 R0(t){if(!nr(t))return{servers:[]};let e=Array.isArray(t.servers)?t.servers:[],o=[];for(let s of e){let i=XU(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 XU(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=JU(e);return{name:o,description:n,run:i,...r!==void 0?{title:r}:{},...s!==void 0?{version:s}:{}}}function JU(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=QU(r);if(s!==void 0)return{...s,remoteUrls:e}}return{args:[],env:[],remoteUrls:e}}function QU(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=e2(t.environmentVariables),a=C0(t.runtimeArguments),c=C0(t.packageArguments),l=n!==void 0?`${o}@${n}`:o;return e==="npm"||r==="npx"?{command:"npx",args:ZU(["-y",...a,l,...c]),env:i,...s!==void 0?{transport:s}:{}}:e==="pypi"||r==="uvx"||r==="uv"?{command:"uvx",args:[...a,o,...c],env:i,...s!==void 0?{transport:s}:{}}:e==="oci"||r==="docker"?{command:"docker",args:["run","-i","--rm",...a,l,...c],env:i,...s!==void 0?{transport:s}:{}}:{args:[l],env:i,...s!==void 0?{transport:s}:{}}}function ZU(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 C0(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 e2(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 t2(t){return t instanceof Error?t.message:String(t)}var Wi,D0,YU,VU,$b,O0=S(()=>{"use strict";Wi="registry.modelcontextprotocol.io",D0=`https://${Wi}/v0/servers`,YU=5,VU=100,$b=25});function L0(t){let{command:e,args:o}=t.run;if(e===void 0)return;let n=P0(t.name);return["aluy","mcp","add",M0(n),"--",e,...o.map(M0)].join(" ")}function P0(t){let o=(t.split("/").pop()??t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");return o.length>0?o:"server"}function M0(t){return/^[A-Za-z0-9_./@:+=-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function Ub(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(o2(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 o2(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(` ${n2(t.description,200)}`);let r=L0(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 n2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var F0=S(()=>{"use strict"});var I0=S(()=>{"use strict";km();g0();y0();b0();v0();x0();A0();Yu();O0();F0()});function jb(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 N0(t,e){let o=jb(t),n=jb(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 c=typeof i=="number",l=typeof a=="number";return c&&l?i<a?-1:1:c?-1:l?1:i<a?-1:1}return 0}function Hb(t,e){return N0(t,e)===1}var $0=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 qb=S(()=>{"use strict"});function Wb(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 Gb(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 cl,B0=S(()=>{"use strict";qb();cl={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function zb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Kb(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=zb(i.update_id);a!==void 0&&a>r&&(r=a);let c=Gi(i.message);if(!c)continue;let l=Gi(c.chat),u=zb(l?.id);if(u===void 0||l?.type!=="private")continue;let f=Gi(c.from),d=zb(f?.id)??u,p=f?.is_bot===!0,h=typeof c.text=="string"?c.text:"",y=c.forward_origin!==void 0||c.forward_from!==void 0||c.forward_from_chat!==void 0||c.forward_sender_name!==void 0||c.forward_date!==void 0,g=(()=>{let E=Gi(c.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 U0=S(()=>{"use strict"});var ll,j0=S(()=>{"use strict";ll=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 Yb(t){return`connector-${t}-token`}function ul(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 Vb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var H0=S(()=>{"use strict"});var B=S(()=>{"use strict";$E();aS();vS();$w();s0();Wy();f0();I0();xb();Jd();$0();qb();B0();U0();j0();H0()});import{posix as S8}from"node:path";function w8(t){return S8.normalize(t)}function po(t){let e=w8(t);for(let o of A8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function fv(t){return po(t).kind==="allow"}var A8,$r=S(()=>{"use strict";A8=[{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 Fv={};Fp(Fv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Pv});import{homedir as u3}from"node:os";import{join as Lv}from"node:path";import{readdirSync as d3,readFileSync as m3,mkdirSync as f3,statSync as p3}from"node:fs";var h3,Pv,g3,y3,Hr,Hm=S(()=>{"use strict";B();h3=448,Pv="workflows",g3=64*1024,y3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Lv(u3(),".aluy");this.dir=Lv(o,Pv)}get workflowsDir(){return this.dir}ensureDir(){try{f3(this.dir,{mode:h3,recursive:!0})}catch{}}load(){let e;try{e=d3(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>=y3)break;let a=this.readOne(i);if(a!==null){if(Uc(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=Lv(this.dir,e);try{let n=p3(o);if(!n.isFile()||n.size>g3)return null;let r=m3(o,"utf8");return jc(e,r,"global")}catch{return null}}}});var Nv={};Fp(Nv,{PROJECT_WORKFLOWS_DIRNAMES:()=>Iv,ProjectWorkflowsLoader:()=>qr});import{join as b3}from"node:path";import{readdirSync as v3,readFileSync as k3,statSync as x3}from"node:fs";var Iv,E3,S3,qr,qm=S(()=>{"use strict";B();$r();Iv=[".claude/workflows",".aluy/workflows"],E3=64*1024,S3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Iv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=v3(s,{withFileTypes:!0})}catch{continue}let a=i.filter(c=>(c.isFile()||c.isSymbolicLink())&&c.name.toLowerCase().endsWith(".md")).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of a){if(o.length>=S3)break;let l=this.readOne(r,s,c);if(l!==null){if(Uc(l)){n.push(l);continue}e.has(l.name)||(e.add(l.name),o.push(l))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(po(r).kind!=="allow")return null;let s=b3(o,n);try{this.workspace.resolveInside(r);let i=x3(s);if(!i.isFile()||i.size>E3)return null;let a=k3(s,"utf8");return jc(n,a,"project")}catch{return null}}}});var DM=qI((Yge,CM)=>{CM.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.76";B();var q0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
140
|
+
`)}function n2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var F0=S(()=>{"use strict"});var I0=S(()=>{"use strict";km();g0();y0();b0();v0();x0();A0();Yu();O0();F0()});function jb(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 N0(t,e){let o=jb(t),n=jb(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 c=typeof i=="number",l=typeof a=="number";return c&&l?i<a?-1:1:c?-1:l?1:i<a?-1:1}return 0}function Hb(t,e){return N0(t,e)===1}var $0=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 qb=S(()=>{"use strict"});function Wb(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 Gb(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 cl,B0=S(()=>{"use strict";qb();cl={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function zb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Kb(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=zb(i.update_id);a!==void 0&&a>r&&(r=a);let c=Gi(i.message);if(!c)continue;let l=Gi(c.chat),u=zb(l?.id);if(u===void 0||l?.type!=="private")continue;let f=Gi(c.from),d=zb(f?.id)??u,p=f?.is_bot===!0,h=typeof c.text=="string"?c.text:"",y=c.forward_origin!==void 0||c.forward_from!==void 0||c.forward_from_chat!==void 0||c.forward_sender_name!==void 0||c.forward_date!==void 0,g=(()=>{let E=Gi(c.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 U0=S(()=>{"use strict"});var ll,j0=S(()=>{"use strict";ll=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 Yb(t){return`connector-${t}-token`}function ul(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 Vb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var H0=S(()=>{"use strict"});var B=S(()=>{"use strict";$E();aS();vS();$w();s0();Wy();f0();I0();xb();Jd();$0();qb();B0();U0();j0();H0()});import{posix as S8}from"node:path";function w8(t){return S8.normalize(t)}function po(t){let e=w8(t);for(let o of A8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function fv(t){return po(t).kind==="allow"}var A8,$r=S(()=>{"use strict";A8=[{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 Fv={};Fp(Fv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Pv});import{homedir as u3}from"node:os";import{join as Lv}from"node:path";import{readdirSync as d3,readFileSync as m3,mkdirSync as f3,statSync as p3}from"node:fs";var h3,Pv,g3,y3,Hr,Hm=S(()=>{"use strict";B();h3=448,Pv="workflows",g3=64*1024,y3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Lv(u3(),".aluy");this.dir=Lv(o,Pv)}get workflowsDir(){return this.dir}ensureDir(){try{f3(this.dir,{mode:h3,recursive:!0})}catch{}}load(){let e;try{e=d3(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>=y3)break;let a=this.readOne(i);if(a!==null){if(Uc(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=Lv(this.dir,e);try{let n=p3(o);if(!n.isFile()||n.size>g3)return null;let r=m3(o,"utf8");return jc(e,r,"global")}catch{return null}}}});var Nv={};Fp(Nv,{PROJECT_WORKFLOWS_DIRNAMES:()=>Iv,ProjectWorkflowsLoader:()=>qr});import{join as b3}from"node:path";import{readdirSync as v3,readFileSync as k3,statSync as x3}from"node:fs";var Iv,E3,S3,qr,qm=S(()=>{"use strict";B();$r();Iv=[".claude/workflows",".aluy/workflows"],E3=64*1024,S3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Iv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=v3(s,{withFileTypes:!0})}catch{continue}let a=i.filter(c=>(c.isFile()||c.isSymbolicLink())&&c.name.toLowerCase().endsWith(".md")).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of a){if(o.length>=S3)break;let l=this.readOne(r,s,c);if(l!==null){if(Uc(l)){n.push(l);continue}e.has(l.name)||(e.add(l.name),o.push(l))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(po(r).kind!=="allow")return null;let s=b3(o,n);try{this.workspace.resolveInside(r);let i=x3(s);if(!i.isFile()||i.size>E3)return null;let a=k3(s,"utf8");return jc(n,a,"project")}catch{return null}}}});var DM=qI((Yge,CM)=>{CM.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.77";B();var q0=`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>]
|
|
@@ -607,7 +607,7 @@ ${t.output}`:"";return`[shell] $ ${t.command} \u2014 ${e}${o}`}case"subagents":{
|
|
|
607
607
|
${o[s]}`).join(`
|
|
608
608
|
|
|
609
609
|
`);return[`${n} Conserte SOZINHO, agindo na m\xE1quina (voc\xEA est\xE1 em modo turbo, com consentimento, e em --yolo).`,"","Passos:","1. Rode `aluy doctor` e veja exatamente quais sidecars est\xE3o \u2717.","2. Para cada um fora, leia `~/.aluy/logs/<nome>.log` (nomes: ollama, mem0, headroom) p/ a causa.","3. (Re)provisione pelo caminho DIRETO: `aluy bootstrap --no-agent`. N\xC3O use o modo agente"," (voc\xEA J\xC1 \xE9 o agente \u2014 chamar `aluy bootstrap` sem `--no-agent` recursaria).","4. Se faltar pr\xE9-requisito (python3.10+/pip/venv, zstd/tar, etc.), instale com o gerenciador"," da distro (apt/dnf/pacman/zypper; brew no macOS), com sudo se preciso.",'5. Casos comuns: mem0 \u2717 "No such file" \u21D2 falta o aluy-mem0-server.py no venv (o bootstrap'," o copia); mem0 crash de store \u21D2 `mv ~/.aluy/memory{,.bak}; mv ~/.mem0/history.db{,.bak}`;",' ollama "command not found" mas servi\xE7o up \u21D2 bin\xE1rio fora do PATH; headroom \u21D2 deps do venv.',"6. Repita at\xE9 `aluy doctor` mostrar ollama \u2713 \xB7 mem0 \u2713 \xB7 headroom \u2713 (ou explique, com a linha"," do log, por que um n\xE3o sobe nesta m\xE1quina). Seja conciso no relato.",...r!==""?["","Logs que j\xE1 capturei:",r]:[]].join(`
|
|
610
|
-
`)}B();var Y7='Responda apenas com a palavra "ok".',V7=8;async function SF(t){let e=t.env??process.env,{brokerBaseUrl:o}=rr(e),n=pc({brokerBaseUrl:o,login:t.login,...t.fetch?{fetch:t.fetch}:{}}),r=new yn({client:n,tier:t.tier,...t.tier==="custom"&&t.model!==void 0?{model:t.model}:{},maxTokens:V7}),s=new AbortController,i=setTimeout(()=>s.abort(),t.timeoutMs??2e4);try{return typeof(await r.call({messages:[{role:"user",content:Y7}],idempotencyKey:`doctor-deep-${Date.now()}`,signal:s.signal})).content=="string"?{tier:t.tier,responded:!0}:{tier:t.tier,responded:!1,error:"resposta vazia do broker"}}catch(a){return{tier:t.tier,responded:!1,error:X7(a)}}finally{clearTimeout(i)}}function X7(t){return t instanceof Error?t.message:String(t)}B();import{homedir as AF}from"node:os";import{join as gE}from"node:path";var hE={title:"mcp",lines:["uso: /mcp add <nome> [--env K=V]... [--force] -- <command> [args...]","ex.: /mcp add pw -- npx -y @playwright/mcp","use REFER\xCANCIA no --env (--env TOKEN=$MEU_TOKEN) \u2014 nunca segredo literal."]};function J7(t){return{title:"mcp",lines:[`uso: /mcp ${t} <nome>`]}}function CF(t){let e=t.trim().split(/\s+/).filter(f=>f.length>0),o=e[0]?.toLowerCase();if(o===void 0)return null;if(o==="remove"||o==="rm"||o==="disable"||o==="enable"){let f=o==="rm"?"remove":o,d=e[1];return d===void 0||e.length>2?{kind:"usage",note:J7(f)}:{kind:f,name:d}}if(o!=="add")return null;let n=e.slice(1),r=[],s=[],i=!1,a=null;for(let f=0;f<n.length;f++){let d=n[f];if(d==="--"){a=n.slice(f+1);break}if(d==="--force"){i=!0;continue}if(d==="--env"||d.startsWith("--env=")){let p=d==="--env"?n[++f]:d.slice(6),h=p===void 0?void 0:Q7(p);if(h===void 0)return{kind:"usage",note:hE};r.push(h);continue}s.push(d)}let c=s[0];if(c===void 0)return{kind:"usage",note:hE};let l=a??s.slice(1),u=l[0];return u===void 0||u.trim().length===0?{kind:"usage",note:hE}:{kind:"add",name:c,command:u,args:l.slice(1),env:r,force:i}}function Q7(t){let e=t.indexOf("=");if(!(e<=0))return[t.slice(0,e),t.slice(e+1)]}var yE="reinicie a sess\xE3o (ou use /mcp reload quando existir) p/ carregar as tools \u2014 a descoberta \xE9 no boot.";function DF(t,e={}){if(t.kind==="usage")return t.note;let o=e.aluyHome??gE(AF(),".aluy"),n=new Lu({file:gE(o,hp)});try{switch(t.kind){case"add":return Z7(t,n);case"remove":return eK(t.name,n,e);case"disable":return wF(t.name,!0,n,e);case"enable":return wF(t.name,!1,n,e)}}catch(r){return{title:"mcp",lines:[`\u26A0 ${r instanceof bo?r.message:String(r)}`]}}}function Z7(t,e){let o=[],n={};for(let[i,a]of t.env)Ob(i,a).looksLikeSecret&&o.push(`\u26A0 --env ${i} parece um SEGREDO literal \u2014 o mcp.json \xE9 leg\xEDvel e N\xC3O deve carregar credencial. Prefira refer\xEAncia (--env ${i}=$NOME_DA_VAR). Gravando assim mesmo.`),n[i]=a;let r={name:t.name,command:t.command,args:t.args,env:n},{replaced:s}=e.add(r,{force:t.force});return o.push(`${s?"atualizado":"adicionado"} "${t.name}" em ~/.aluy/mcp.json: ${t.command}${t.args.length?" "+t.args.join(" "):""}`),o.push(yE),o.push("o server passa pela catraca no runtime (conectar = confirma\xE7\xE3o)."),{title:"mcp",lines:o}}function eK(t,e,o){let{removed:n}=e.remove(t);return n?{title:"mcp",lines:[`removido "${t}" de ~/.aluy/mcp.json.`,yE]}:{title:"mcp",lines:TF(t,o)}}function wF(t,e,o,n){let{found:r}=o.setDisabled(t,e);return r?e?{title:"mcp",lines:[`desativado "${t}" (disabled: true em ~/.aluy/mcp.json) \u2014 instalado, mas a`,"descoberta o PULA. se est\xE1 conectado nesta sess\xE3o, desconecta no pr\xF3ximo boot.","reative com /mcp enable "+t+"."]}:{title:"mcp",lines:[`reativado "${t}" em ~/.aluy/mcp.json.`,yE]}:{title:"mcp",lines:TF(t,n)}}function TF(t,e){let o=[`server "${t}" n\xE3o est\xE1 em ~/.aluy/mcp.json (onde o aluy escreve).`],n=e.codexHome??gE(AF(),".codex");try{new yr({baseDir:n}).load().config.servers.some(s=>s.name===t)&&o.push(`"${t}" vem do Codex (~/.codex/config.toml) \u2014 o aluy N\xC3O o gerencia; edite o config.toml \xE0 m\xE3o.`)}catch{}return o}B();function bE(t){return t==="thinking"||t==="streaming"||t==="asking"}function _F(t){return t==="boot"||t==="idle"||t==="done"||t==="error"}var tK=5e3;function RF(t,e){let o=e.port,n=e.longTurnMs??tK,r=e.now??Date.now,s=null,i=null;return t(c=>{let l=c.phase;if(s===null){s=l,bE(l)&&(i=r());return}if(l!==s){if(bE(l)&&_F(s)&&(i=r()),l==="asking"&&s!=="asking"&&o.notify("attention"),(l==="done"||l==="budget")&&bE(s)){let u=i;u!==null&&r()-u>=n&&o.notify("done")}_F(l)&&(i=null),s=l}})}B();var Iu=class{journal;redoStack=[];cursor=null;constructor(e){this.journal=e.journal}syncCursor(){let e=[...this.journal.list()];return this.cursor===null?this.cursor=e.length:this.cursor>e.length&&(this.cursor=e.length),e}async undo(e=!1){let o=this.syncCursor(),n=this.cursor??o.length;if(n<=0)return ss("undo",["nada para desfazer \u2014 a pilha de edi\xE7\xF5es est\xE1 vazia."]);let r=[];for(;n>0;){let s=o[n-1];if(s.kind==="barrier"){r.push(`\u26A0 aqui rodou \`${Qt(s.command)}\` \u2014 efeito de shell N\xC3O \xE9 revers\xEDvel (n\xE3o desfeito).`),n-=1,this.cursor=n;continue}let i=s.targets[0];if(!i){n-=1,this.cursor=n;continue}if(!e&&(await this.journal.checkConcurrency(s)).diverged)return{kind:"confirm",note:{title:"undo \u2014 confirmar",lines:[...r,`o arquivo \`${i.path}\` mudou desde a edi\xE7\xE3o do agente (hash divergiu).`,"desfazer agora SOBRESCREVE essas mudan\xE7as externas com o conte\xFAdo anterior.","rode /undo de novo p/ confirmar a revers\xE3o, ou deixe como est\xE1."]},proceed:()=>this.undo(!0)};let a;try{a=await this.journal.restore(s)}catch(u){let f=u instanceof Error?u.message:"falha desconhecida";return ss("undo \u2014 falhou",[...r,`n\xE3o foi poss\xEDvel reverter \`${i.path}\`: ${f}`,"nada foi escrito (a revers\xE3o \xE9 confinada e fail-safe)."])}this.pushRedo(s,i.path,i.createdByEdit),n-=1,this.cursor=n;let c=a.action==="removed"?`revertido (arquivo removido \u2014 era novo): \`${i.path}\``:`revertido: \`${i.path}\``,l=this.undoDepth(o,n);return ss("undo",[...r,c,`pilha: ${l} edi\xE7\xE3o(\xF5es) ainda revers\xEDvel(eis) \xB7 ${this.redoStack.length} para refazer.`])}return ss("undo",[...r,r.length>0?"n\xE3o h\xE1 mais edi\xE7\xF5es de arquivo para reverter abaixo das barreiras.":"nada para desfazer."])}async redo(){let e=this.redoStack.pop();if(!e)return ss("redo",["nada para refazer \u2014 n\xE3o h\xE1 undo recente."]);let o=this.journal.appliedContent(e.entry.seq);if(!o)return this.redoStack.push(e),ss("redo",["n\xE3o foi poss\xEDvel refazer: o conte\xFAdo aplicado n\xE3o est\xE1 dispon\xEDvel nesta sess\xE3o."]);let n;try{n=await this.journal.reapply(e.path,o.after)}catch(r){let s=r instanceof Error?r.message:"falha desconhecida";return this.redoStack.push(e),ss("redo \u2014 falhou",[`n\xE3o foi poss\xEDvel reaplicar \`${e.path}\`: ${s}`,"nada foi escrito (reaplica\xE7\xE3o confinada e fail-safe)."])}return this.cursor!==null&&(this.cursor+=1),ss("redo",[`reaplicado: \`${e.path}\` (${n?"reaplicado":"ok"})`,`pilha: ${this.redoStack.length} ainda para refazer.`])}undoDepth(e,o){let n=0;for(let r=0;r<o;r++)e[r].kind==="edit"&&(n+=1);return n}pushRedo(e,o,n){this.redoStack.push({entry:e,path:o,createdByEdit:n})}};function ss(t,e){return{kind:"note",note:{title:t,lines:e}}}B();function oK(t){return t==="thinking"||t==="streaming"||t==="asking"}function Ep(t,e){let o=ht(e.config,"turn-end"),n=ht(e.config,"notification");if(o.length===0&&n.length===0)return()=>{};let r=null;return t(i=>{let a=i.phase;if(r===null){r=a;return}a!==r&&(o.length>0&&(a==="done"||a==="budget")&&oK(r)&&e.runner.runAll(o),n.length>0&&a==="asking"&&r!=="asking"&&e.runner.runAll(n),r=a)})}B();function OF(t){let e=ht(t.config,"pre-tool").length>0,o=ht(t.config,"post-tool").length>0;if(!e&&!o)return;let n={};return e&&(n.onToolStart=r=>{let s=ht(t.config,"pre-tool",r.name);s.length>0&&t.runner.runAll(s)}),o&&(n.onToolEnd=r=>{let s=ht(t.config,"post-tool",r.name);s.length>0&&t.runner.runAll(s)}),n}var nK="\x1B[?1049h",rK="\x1B[?1049l",sK="\x1B[?25l",iK="\x1B[?25h";function MF(t){if(t===null||typeof t!="object")return!1;let e=t,o=typeof e.code=="string"?e.code:"",n=typeof e.name=="string"?e.name:"",r=typeof e.message=="string"?e.message:"";return o==="ECONNRESET"||o==="EPIPE"||n==="AbortError"||/socket hang up|ECONNRESET|EPIPE|\baborted\b/i.test(r)?!0:e.cause!==void 0&&e.cause!==t?MF(e.cause):!1}var aK=["exit","SIGINT","SIGTERM","uncaughtException","unhandledRejection"];function vE(t){try{t.write(`${nK}${sK}`)}catch{}}function LF(t,e){let o=!1,n=!1,r=()=>{if(!o){o=!0;try{let y=e.stdin??globalThis.process?.stdin;y?.isTTY===!0&&(y.setRawMode?.(!1),y.pause?.())}catch{}try{t.isTTY===!0&&t.setRawMode?.(!1)}catch{}try{t.isTTY===!0&&t.write(`${rK}${iK}`)}catch{}}},s=()=>r(),i=y=>()=>{r(),p();try{e.kill?.(e.pid??0,y)}catch{}},a=y=>{if(MF(y))return;r(),p();let g=()=>{throw y instanceof Error?y:new Error(String(y))},E=e.nextTick??globalThis.process?.nextTick;typeof E=="function"?E(g):g()},c=i("SIGINT"),l=i("SIGTERM"),u={exit:s,SIGINT:c,SIGTERM:l,uncaughtException:a,unhandledRejection:a},f=aK.map(y=>[y,u[y]]),d=!0,p=()=>{if(d){d=!1;for(let[y,g]of f)try{e.removeListener(y,g)}catch{}}};for(let[y,g]of f)e.on(y,g);return{restoreScreen:r,dispose:()=>{n||(n=!0,p(),r())}}}function PF(t,e){t.on("SIGINT",e),t.on("SIGTERM",e);let o=!1;return{dispose(){o||(o=!0,t.removeListener("SIGINT",e),t.removeListener("SIGTERM",e))}}}B();function vt(t){return Ue(t)}function cK(t){switch(t.kind){case"testrun":{let e=t.score;return e.unknownFormat?["## testes","","placar indispon\xEDvel (formato n\xE3o reconhecido)",""]:["## testes","",`${e.passed} \u2713 \xB7 ${e.failed} \u2717 \xB7 ${e.total} total`,""]}case"you":return["## voc\xEA","",vt(t.text),""];case"aluy":return t.selfCheck?[]:["## aluy","",vt(Fo(t.text)),""];case"tool":{let e=`- \`${vt(t.verb)} ${vt(t.target)}\` \u2192 ${vt(t.result)} (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",vt(o),"```"]:[];return[e,...n,""]}case"bang":{let e=`- \`! ${vt(t.command)}\` (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",vt(o),"```"]:[];return[e,...n,""]}case"deny":return[`- (negado) \`${vt(t.verb)} ${vt(t.exact)}\``,""];case"subagents":return[`- sub-agentes: ${t.children.map(e=>`${vt(e.label)} (${e.status})`).join(", ")}`,""];case"broker-error":return[`> erro de broker: ${vt(t.headline??t.message)}`,""];case"note":return[`> ${vt(t.title)}`,...t.lines.map(e=>`> ${vt(e)}`),""];case"inject":return[`> (encaixado) ${vt(t.text)}`,""];case"doctor":return[`> doctor: ${t.checks.map(e=>`${vt(e.label)} ${e.status}`).join(" \xB7 ")}`,""]}}function FF(t,e={}){let o=e.exportedAt??new Date().toISOString(),n=["# Aluy Cli \u2014 transcript",""],r=[];e.label!==void 0&&e.label!==""&&r.push(`sess\xE3o: ${vt(e.label)}`),e.sessionId!==void 0&&e.sessionId!==""&&r.push(`id: ${e.sessionId}`),e.tier!==void 0&&e.tier!==""&&r.push(`tier: ${vt(e.tier)}`),r.push(`exportado: ${o}`),n.push(`> ${r.join(" \xB7 ")}`,""),n.push("> por seguran\xE7a, eventuais segredos foram substitu\xEDdos por \u2039redigido\u203A.","","---","");for(let i of t)for(let a of cK(i))n.push(a);let s=n.join(`
|
|
610
|
+
`)}B();var Y7='Responda apenas com a palavra "ok".',V7=8;async function SF(t){let e=t.env??process.env,{brokerBaseUrl:o}=rr(e),n=pc({brokerBaseUrl:o,login:t.login,...t.fetch?{fetch:t.fetch}:{}}),r=new yn({client:n,tier:t.tier,...t.tier==="custom"&&t.model!==void 0?{model:t.model}:{},maxTokens:V7}),s=new AbortController,i=setTimeout(()=>s.abort(),t.timeoutMs??2e4);try{return typeof(await r.call({messages:[{role:"user",content:Y7}],idempotencyKey:`doctor-deep-${Date.now()}`,signal:s.signal})).content=="string"?{tier:t.tier,responded:!0}:{tier:t.tier,responded:!1,error:"resposta vazia do broker"}}catch(a){return{tier:t.tier,responded:!1,error:X7(a)}}finally{clearTimeout(i)}}function X7(t){return t instanceof Error?t.message:String(t)}B();import{homedir as AF}from"node:os";import{join as gE}from"node:path";var hE={title:"mcp",lines:["uso: /mcp add <nome> [--env K=V]... [--force] -- <command> [args...]","ex.: /mcp add pw -- npx -y @playwright/mcp","use REFER\xCANCIA no --env (--env TOKEN=$MEU_TOKEN) \u2014 nunca segredo literal."]};function J7(t){return{title:"mcp",lines:[`uso: /mcp ${t} <nome>`]}}function CF(t){let e=t.trim().split(/\s+/).filter(f=>f.length>0),o=e[0]?.toLowerCase();if(o===void 0)return null;if(o==="remove"||o==="rm"||o==="disable"||o==="enable"){let f=o==="rm"?"remove":o,d=e[1];return d===void 0||e.length>2?{kind:"usage",note:J7(f)}:{kind:f,name:d}}if(o!=="add")return null;let n=e.slice(1),r=[],s=[],i=!1,a=null;for(let f=0;f<n.length;f++){let d=n[f];if(d==="--"){a=n.slice(f+1);break}if(d==="--force"){i=!0;continue}if(d==="--env"||d.startsWith("--env=")){let p=d==="--env"?n[++f]:d.slice(6),h=p===void 0?void 0:Q7(p);if(h===void 0)return{kind:"usage",note:hE};r.push(h);continue}s.push(d)}let c=s[0];if(c===void 0)return{kind:"usage",note:hE};let l=a??s.slice(1),u=l[0];return u===void 0||u.trim().length===0?{kind:"usage",note:hE}:{kind:"add",name:c,command:u,args:l.slice(1),env:r,force:i}}function Q7(t){let e=t.indexOf("=");if(!(e<=0))return[t.slice(0,e),t.slice(e+1)]}var yE="reinicie a sess\xE3o (ou use /mcp reload quando existir) p/ carregar as tools \u2014 a descoberta \xE9 no boot.";function DF(t,e={}){if(t.kind==="usage")return t.note;let o=e.aluyHome??gE(AF(),".aluy"),n=new Lu({file:gE(o,hp)});try{switch(t.kind){case"add":return Z7(t,n);case"remove":return eK(t.name,n,e);case"disable":return wF(t.name,!0,n,e);case"enable":return wF(t.name,!1,n,e)}}catch(r){return{title:"mcp",lines:[`\u26A0 ${r instanceof bo?r.message:String(r)}`]}}}function Z7(t,e){let o=[],n={};for(let[i,a]of t.env)Ob(i,a).looksLikeSecret&&o.push(`\u26A0 --env ${i} parece um SEGREDO literal \u2014 o mcp.json \xE9 leg\xEDvel e N\xC3O deve carregar credencial. Prefira refer\xEAncia (--env ${i}=$NOME_DA_VAR). Gravando assim mesmo.`),n[i]=a;let r={name:t.name,command:t.command,args:t.args,env:n},{replaced:s}=e.add(r,{force:t.force});return o.push(`${s?"atualizado":"adicionado"} "${t.name}" em ~/.aluy/mcp.json: ${t.command}${t.args.length?" "+t.args.join(" "):""}`),o.push(yE),o.push("o server passa pela catraca no runtime (conectar = confirma\xE7\xE3o)."),{title:"mcp",lines:o}}function eK(t,e,o){let{removed:n}=e.remove(t);return n?{title:"mcp",lines:[`removido "${t}" de ~/.aluy/mcp.json.`,yE]}:{title:"mcp",lines:TF(t,o)}}function wF(t,e,o,n){let{found:r}=o.setDisabled(t,e);return r?e?{title:"mcp",lines:[`desativado "${t}" (disabled: true em ~/.aluy/mcp.json) \u2014 instalado, mas a`,"descoberta o PULA. se est\xE1 conectado nesta sess\xE3o, desconecta no pr\xF3ximo boot.","reative com /mcp enable "+t+"."]}:{title:"mcp",lines:[`reativado "${t}" em ~/.aluy/mcp.json.`,yE]}:{title:"mcp",lines:TF(t,n)}}function TF(t,e){let o=[`server "${t}" n\xE3o est\xE1 em ~/.aluy/mcp.json (onde o aluy escreve).`],n=e.codexHome??gE(AF(),".codex");try{new yr({baseDir:n}).load().config.servers.some(s=>s.name===t)&&o.push(`"${t}" vem do Codex (~/.codex/config.toml) \u2014 o aluy N\xC3O o gerencia; edite o config.toml \xE0 m\xE3o.`)}catch{}return o}B();function bE(t){return t==="thinking"||t==="streaming"||t==="asking"}function _F(t){return t==="boot"||t==="idle"||t==="done"||t==="error"}var tK=5e3;function RF(t,e){let o=e.port,n=e.longTurnMs??tK,r=e.now??Date.now,s=null,i=null;return t(c=>{let l=c.phase;if(s===null){s=l,bE(l)&&(i=r());return}if(l!==s){if(bE(l)&&_F(s)&&(i=r()),l==="asking"&&s!=="asking"&&o.notify("attention"),(l==="done"||l==="budget")&&bE(s)){let u=i;u!==null&&r()-u>=n&&o.notify("done")}_F(l)&&(i=null),s=l}})}B();var Iu=class{journal;redoStack=[];cursor=null;constructor(e){this.journal=e.journal}syncCursor(){let e=[...this.journal.list()];return this.cursor===null?this.cursor=e.length:this.cursor>e.length&&(this.cursor=e.length),e}async undo(e=!1){let o=this.syncCursor(),n=this.cursor??o.length;if(n<=0)return ss("undo",["nada para desfazer \u2014 a pilha de edi\xE7\xF5es est\xE1 vazia."]);let r=[];for(;n>0;){let s=o[n-1];if(s.kind==="barrier"){r.push(`\u26A0 aqui rodou \`${Qt(s.command)}\` \u2014 efeito de shell N\xC3O \xE9 revers\xEDvel (n\xE3o desfeito).`),n-=1,this.cursor=n;continue}let i=s.targets[0];if(!i){n-=1,this.cursor=n;continue}if(!e&&(await this.journal.checkConcurrency(s)).diverged)return{kind:"confirm",note:{title:"undo \u2014 confirmar",lines:[...r,`o arquivo \`${i.path}\` mudou desde a edi\xE7\xE3o do agente (hash divergiu).`,"desfazer agora SOBRESCREVE essas mudan\xE7as externas com o conte\xFAdo anterior.","rode /undo de novo p/ confirmar a revers\xE3o, ou deixe como est\xE1."]},proceed:()=>this.undo(!0)};let a;try{a=await this.journal.restore(s)}catch(u){let f=u instanceof Error?u.message:"falha desconhecida";return ss("undo \u2014 falhou",[...r,`n\xE3o foi poss\xEDvel reverter \`${i.path}\`: ${f}`,"nada foi escrito (a revers\xE3o \xE9 confinada e fail-safe)."])}this.pushRedo(s,i.path,i.createdByEdit),n-=1,this.cursor=n;let c=a.action==="removed"?`revertido (arquivo removido \u2014 era novo): \`${i.path}\``:`revertido: \`${i.path}\``,l=this.undoDepth(o,n);return ss("undo",[...r,c,`pilha: ${l} edi\xE7\xE3o(\xF5es) ainda revers\xEDvel(eis) \xB7 ${this.redoStack.length} para refazer.`])}return ss("undo",[...r,r.length>0?"n\xE3o h\xE1 mais edi\xE7\xF5es de arquivo para reverter abaixo das barreiras.":"nada para desfazer."])}async redo(){let e=this.redoStack.pop();if(!e)return ss("redo",["nada para refazer \u2014 n\xE3o h\xE1 undo recente."]);let o=this.journal.appliedContent(e.entry.seq);if(!o)return this.redoStack.push(e),ss("redo",["n\xE3o foi poss\xEDvel refazer: o conte\xFAdo aplicado n\xE3o est\xE1 dispon\xEDvel nesta sess\xE3o."]);let n;try{n=await this.journal.reapply(e.path,o.after)}catch(r){let s=r instanceof Error?r.message:"falha desconhecida";return this.redoStack.push(e),ss("redo \u2014 falhou",[`n\xE3o foi poss\xEDvel reaplicar \`${e.path}\`: ${s}`,"nada foi escrito (reaplica\xE7\xE3o confinada e fail-safe)."])}return this.cursor!==null&&(this.cursor+=1),ss("redo",[`reaplicado: \`${e.path}\` (${n?"reaplicado":"ok"})`,`pilha: ${this.redoStack.length} ainda para refazer.`])}undoDepth(e,o){let n=0;for(let r=0;r<o;r++)e[r].kind==="edit"&&(n+=1);return n}pushRedo(e,o,n){this.redoStack.push({entry:e,path:o,createdByEdit:n})}};function ss(t,e){return{kind:"note",note:{title:t,lines:e}}}B();function oK(t){return t==="thinking"||t==="streaming"||t==="asking"}function Ep(t,e){let o=ht(e.config,"turn-end"),n=ht(e.config,"notification");if(o.length===0&&n.length===0)return()=>{};let r=null;return t(i=>{let a=i.phase;if(r===null){r=a;return}a!==r&&(o.length>0&&(a==="done"||a==="budget")&&oK(r)&&e.runner.runAll(o),n.length>0&&a==="asking"&&r!=="asking"&&e.runner.runAll(n),r=a)})}B();function OF(t){let e=ht(t.config,"pre-tool").length>0,o=ht(t.config,"post-tool").length>0;if(!e&&!o)return;let n={};return e&&(n.onToolStart=r=>{let s=ht(t.config,"pre-tool",r.name);s.length>0&&t.runner.runAll(s)}),o&&(n.onToolEnd=r=>{let s=ht(t.config,"post-tool",r.name);s.length>0&&t.runner.runAll(s)}),n}var nK="\x1B[?1049h",rK="\x1B[?1049l",sK="\x1B[?25l",iK="\x1B[?25h";function MF(t){if(t===null||typeof t!="object")return!1;let e=t,o=typeof e.code=="string"?e.code:"",n=typeof e.name=="string"?e.name:"",r=typeof e.message=="string"?e.message:"";return o==="ECONNRESET"||o==="EPIPE"||n==="AbortError"||/socket hang up|ECONNRESET|EPIPE|\baborted\b/i.test(r)?!0:e.cause!==void 0&&e.cause!==t?MF(e.cause):!1}var aK=["exit","SIGINT","SIGTERM","uncaughtException","unhandledRejection"];function vE(t){try{t.write(`${nK}${sK}`)}catch{}}function LF(t,e){let o=!1,n=!1,r=()=>{if(!o){o=!0;try{let y=e.stdin??globalThis.process?.stdin;y?.isTTY===!0&&(y.setRawMode?.(!1),y.pause?.())}catch{}try{t.isTTY===!0&&t.setRawMode?.(!1)}catch{}try{t.isTTY===!0&&t.write(`${rK}${iK}`)}catch{}}},s=()=>r(),i=y=>()=>{r(),p();let g=y==="SIGINT"?130:143,E=e.exit,w=e.nextTick??globalThis.process?.nextTick,D=()=>{if(typeof E=="function"){E(g);return}try{e.kill?.(e.pid??0,y)}catch{}};typeof w=="function"?w(D):D()},a=y=>{if(MF(y))return;r(),p();let g=()=>{throw y instanceof Error?y:new Error(String(y))},E=e.nextTick??globalThis.process?.nextTick;typeof E=="function"?E(g):g()},c=i("SIGINT"),l=i("SIGTERM"),u={exit:s,SIGINT:c,SIGTERM:l,uncaughtException:a,unhandledRejection:a},f=aK.map(y=>[y,u[y]]),d=!0,p=()=>{if(d){d=!1;for(let[y,g]of f)try{e.removeListener(y,g)}catch{}}};for(let[y,g]of f)e.on(y,g);return{restoreScreen:r,dispose:()=>{n||(n=!0,p(),r())}}}function PF(t,e){t.on("SIGINT",e),t.on("SIGTERM",e);let o=!1;return{dispose(){o||(o=!0,t.removeListener("SIGINT",e),t.removeListener("SIGTERM",e))}}}B();function vt(t){return Ue(t)}function cK(t){switch(t.kind){case"testrun":{let e=t.score;return e.unknownFormat?["## testes","","placar indispon\xEDvel (formato n\xE3o reconhecido)",""]:["## testes","",`${e.passed} \u2713 \xB7 ${e.failed} \u2717 \xB7 ${e.total} total`,""]}case"you":return["## voc\xEA","",vt(t.text),""];case"aluy":return t.selfCheck?[]:["## aluy","",vt(Fo(t.text)),""];case"tool":{let e=`- \`${vt(t.verb)} ${vt(t.target)}\` \u2192 ${vt(t.result)} (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",vt(o),"```"]:[];return[e,...n,""]}case"bang":{let e=`- \`! ${vt(t.command)}\` (${t.status})`,o=t.output??t.liveOutput,n=o?["","```",vt(o),"```"]:[];return[e,...n,""]}case"deny":return[`- (negado) \`${vt(t.verb)} ${vt(t.exact)}\``,""];case"subagents":return[`- sub-agentes: ${t.children.map(e=>`${vt(e.label)} (${e.status})`).join(", ")}`,""];case"broker-error":return[`> erro de broker: ${vt(t.headline??t.message)}`,""];case"note":return[`> ${vt(t.title)}`,...t.lines.map(e=>`> ${vt(e)}`),""];case"inject":return[`> (encaixado) ${vt(t.text)}`,""];case"doctor":return[`> doctor: ${t.checks.map(e=>`${vt(e.label)} ${e.status}`).join(" \xB7 ")}`,""]}}function FF(t,e={}){let o=e.exportedAt??new Date().toISOString(),n=["# Aluy Cli \u2014 transcript",""],r=[];e.label!==void 0&&e.label!==""&&r.push(`sess\xE3o: ${vt(e.label)}`),e.sessionId!==void 0&&e.sessionId!==""&&r.push(`id: ${e.sessionId}`),e.tier!==void 0&&e.tier!==""&&r.push(`tier: ${vt(e.tier)}`),r.push(`exportado: ${o}`),n.push(`> ${r.join(" \xB7 ")}`,""),n.push("> por seguran\xE7a, eventuais segredos foram substitu\xEDdos por \u2039redigido\u203A.","","---","");for(let i of t)for(let a of cK(i))n.push(a);let s=n.join(`
|
|
611
611
|
`);return s=s.replace(/\n{3,}/g,`
|
|
612
612
|
|
|
613
613
|
`).replace(/\n+$/,"")+`
|
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.77",
|
|
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",
|