@hiperplano/aluy-cli 1.0.0-rc.81 → 1.0.0-rc.82
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 +2 -2
- package/package.json +1 -1
package/dist-bundle/bin/aluy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var i8=Object.create;var iy=Object.defineProperty;var a8=Object.getOwnPropertyDescriptor;var l8=Object.getOwnPropertyNames;var c8=Object.getPrototypeOf,u8=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 d8=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},pt=(t,e)=>{for(var o in e)iy(t,o,{get:e[o],enumerable:!0})},m8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l8(e))!u8.call(t,r)&&r!==o&&iy(t,r,{get:()=>e[r],enumerable:!(n=a8(e,r))||n.enumerable});return t};var f8=(t,e,o)=>(o=t!=null?i8(c8(t)):{},m8(e||!t||!t.__esModule?iy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as p8}from"node:os";import{join as h8}from"node:path";function Vl(t=p8()){return h8(t,".aluy")}var Dm=p(()=>{"use strict"});var Xl,dC=p(()=>{"use strict";Xl="1.0.0-rc.
|
|
2
|
+
var i8=Object.create;var iy=Object.defineProperty;var a8=Object.getOwnPropertyDescriptor;var l8=Object.getOwnPropertyNames;var c8=Object.getPrototypeOf,u8=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 d8=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},pt=(t,e)=>{for(var o in e)iy(t,o,{get:e[o],enumerable:!0})},m8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l8(e))!u8.call(t,r)&&r!==o&&iy(t,r,{get:()=>e[r],enumerable:!(n=a8(e,r))||n.enumerable});return t};var f8=(t,e,o)=>(o=t!=null?i8(c8(t)):{},m8(e||!t||!t.__esModule?iy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as p8}from"node:os";import{join as h8}from"node:path";function Vl(t=p8()){return h8(t,".aluy")}var Dm=p(()=>{"use strict"});var Xl,dC=p(()=>{"use strict";Xl="1.0.0-rc.82"});function Dr(t,e){return t.decide(e)}var ii=p(()=>{"use strict"});var qn,Tr,_r=p(()=>{"use strict";qn="remember",Tr="recall"});var ay,g8,ma,ly=p(()=>{"use strict";ay=class{id;horizon;label;parentId;children;dependencies;pinned;closed;createdAt;lastAccessedAt;accessCount;context;constructor(e,o,n,r,s){this.id=e,this.horizon=o,this.label=n,this.parentId=r,this.children=new Set,this.dependencies=new Set,this.pinned=!1,this.closed=!1,this.createdAt=s,this.lastAccessedAt=s,this.accessCount=0,this.context=[]}touch(e){this.lastAccessedAt=e,this.accessCount+=1}snapshot(){return{id:this.id,horizon:this.horizon,label:this.label,parentId:this.parentId,children:[...this.children],dependencies:[...this.dependencies],pinned:this.pinned,closed:this.closed,createdAt:this.createdAt,lastAccessedAt:this.lastAccessedAt,accessCount:this.accessCount,contextSize:this.context.length}}},g8=200,ma=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??g8,this.now=e?.clock??Date.now}static boxId(e,o){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}-${o.toString(36)}`}openBox(e,o,n,r){let s=this.nodes.get(e);if(s)return s.touch(this.now()),{box:s.snapshot(),created:!1};if(this.nodes.size>=this.maxBoxes&&(this.evictOne(),this.nodes.size>=this.maxBoxes))return null;let i=this.now(),a=new ay(e,o,n,r??null,i);if(r){let l=this.nodes.get(r);l&&l.children.add(e)}return this.nodes.set(e,a),{box:a.snapshot(),created:!0}}closeBox(e){let o=this.nodes.get(e);return o?(o.closed=!0,o.touch(this.now()),o.snapshot()):null}isClosed(e){let o=this.nodes.get(e);return o?o.closed:!1}reopenBox(e){let o=this.nodes.get(e);return o?(o.closed=!1,o.touch(this.now()),o.snapshot()):null}setHorizon(e,o){let n=this.nodes.get(e);return n?(n.horizon=o,n.touch(this.now()),n.snapshot()):null}setParent(e,o){let n=this.nodes.get(e);return n?n.parentId===o?n.snapshot():o!==null&&this.wouldCreateCycle(e,o)?null:(n.parentId&&this.nodes.get(n.parentId)?.children.delete(e),n.parentId=o,o&&this.nodes.get(o)?.children.add(e),n.touch(this.now()),n.snapshot()):null}wouldCreateCycle(e,o){let n=new Set,r=o;for(;r!==null;){if(r===e||n.has(r))return!0;n.add(r),r=this.nodes.get(r)?.parentId??null}return!1}getBox(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),o.snapshot()):null}listBoxes(e="lastAccessedAt"){let o=[...this.nodes.values()].map(n=>n.snapshot());switch(e){case"createdAt":return o.sort((n,r)=>n.createdAt-r.createdAt);case"accessCount":return o.sort((n,r)=>r.accessCount-n.accessCount);default:return o.sort((n,r)=>r.lastAccessedAt-n.lastAccessedAt)}}get size(){return this.nodes.size}addContext(e,o){let n=this.nodes.get(e);return n?(n.context.push({ts:this.now(),text:o}),n.touch(this.now()),n.snapshot()):null}getContext(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),[...o.context]):[]}getContextChain(e){let o=[],n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let s=this.nodes.get(r);if(!s)break;s.touch(this.now()),o.push({boxId:s.id,entries:[...s.context]}),r=s.parentId}return o}addDependency(e,o){let n=this.nodes.get(e);return!n||!this.nodes.has(o)||n.id===o?!1:(n.dependencies.add(o),n.touch(this.now()),!0)}getDependencies(e){let o=this.nodes.get(e);return o?[...o.dependencies]:[]}pinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!0,o.touch(this.now()),o.snapshot()):null}unpinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!1,o.touch(this.now()),o.snapshot()):null}evictOne(){let e=[];for(let n of this.nodes.values())n.horizon==="longo"||n.pinned||e.push(n);if(e.length===0)return null;e.sort((n,r)=>{let s=n.horizon==="curto"?0:1,i=r.horizon==="curto"?0:1;if(s!==i)return s-i;let a=n.closed?0:1,l=r.closed?0:1;return a!==l?a-l:n.lastAccessedAt!==r.lastAccessedAt?n.lastAccessedAt-r.lastAccessedAt:n.accessCount-r.accessCount});let o=e[0];return this.removeNode(o)}forceEvict(e){let o=this.nodes.get(e);return!o||o.horizon==="longo"||o.pinned?null:this.removeNode(o)}removeBox(e){let o=this.nodes.get(e);return o?this.removeNode(o):null}removeNode(e){if(e.parentId){let o=this.nodes.get(e.parentId);o&&o.children.delete(e.id)}return this.nodes.delete(e.id),e.snapshot()}}});function Tm(t){let e=[];for(let o of t){e.push({step:o,depth:0});for(let n of o.substeps??[])e.push({step:n,depth:1})}return e}function pC(t,e){let o,n="pending",r;if(typeof t=="string")o=t;else if(t!==null&&typeof t=="object"){let i=t,a=i.title??i.step??i.text??i.name??i.content;if(typeof a=="string"&&(o=a),typeof i.status=="string"&&y8.has(i.status)&&(n=i.status),e){let l=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(l)&&l.length>0){let c=[];for(let u of l){let m=pC(u,!1);if(typeof m=="string")return m;c.push(m)}r=c}}}if(o===void 0||o.trim()==="")return v8;let s=o.trim().slice(0,b8);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function k8(t){let e=t.steps??t.plan??t.todos??t.items;if(!Array.isArray(e))return{error:'update_plan: passe "steps" como uma LISTA de passos (string ou {title,status}).'};if(e.length===0)return{error:"update_plan: a lista de passos est\xE1 vazia."};let o=[];for(let i of e){let a=pC(i,!0);if(typeof a=="string")return{error:a};o.push(a)}let n=new Set,r=i=>{if(!n.has(i))return n.add(i),i;for(let a=2;;a++){let l=`${i} #${a}`;if(!n.has(l))return n.add(l),l}};for(let i=0;i<o.length;i++){let a=o[i],l=r(a.title),c=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Tm(o).length;return s>mC?{error:`update_plan: no m\xE1ximo ${mC} passos (recebidos ${s}).`}:{steps:o}}function x8(t){let e=Tm(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${hC[r.step.status]} ${r.step.title}`).join(`
|
|
3
3
|
`);return`plano (${o}/${e.length}):
|
|
4
4
|
${n}`}function w8(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function E8(t,e){let o=new Map;for(let i of e.listBoxes())o.set(i.label,i.id);let n=t.findIndex(i=>i.status==="in_progress"||(i.substeps??[]).some(a=>a.status==="in_progress")),r=(i,a,l)=>{let c=i.status==="in_progress"?"curto":l,u=o.get(i.title),m=u??ma.boxId(i.title,0);return u?(i.status!=="completed"&&e.isClosed(u)&&e.reopenBox(u),e.setHorizon(u,c),e.setParent(u,a)):e.openBox(m,c,i.title,a),i.status==="completed"&&!e.isClosed(m)&&e.closeBox(m),o.set(i.title,m),m};t.forEach((i,a)=>{let l=w8(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 A8(t,e){if(!e)return x8(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?S8[m.horizon]:"",h=m?s(m.id):u,g=" ".repeat(h),b=hC[c.status];l.push(`${g}${d} ${b} ${c.title}`)}return l.join(`
|
|
5
5
|
`)}var Jl,y8,mC,b8,v8,hC,S8,fC,C8,gC,_m=p(()=>{"use strict";ly();Jl="update_plan";y8=new Set(["pending","in_progress","completed"]),mC=30,b8=120,v8="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";hC={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};S8={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};fC=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),C8=Object.freeze({type:"object",properties:{steps:{type:"array",description:"A lista COMPLETA de passos do plano (re-emita TODOS a cada atualiza\xE7\xE3o \u2014 substitui o anterior).",items:{type:"object",properties:{title:{type:"string",description:"O passo, curto e no imperativo."},status:fC,substeps:{type:"array",description:"OPCIONAL: sub-passos que detalham este passo (1 n\xEDvel). Aparecem indentados sob o passo e seguem o foco dele. Use quando um passo tem a\xE7\xF5es menores distintas.",items:{type:"object",properties:{title:{type:"string",description:"O sub-passo, curto e no imperativo."},status:fC},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),gC={name:Jl,effect:"read",description:"Declara/atualiza um PLANO vis\xEDvel (checklist de passos). Use ao iniciar uma tarefa com V\xC1RIOS passos e a cada progresso: re-emita a lista TODA marcando o status de cada passo (pending/in_progress/completed). Mantenha 1 passo in_progress por vez. N\xE3o tem efeito no sistema \u2014 \xE9 s\xF3 o seu plano, para voc\xEA e para o usu\xE1rio acompanharem.",parameters:C8,async run(t,e){let o=k8(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&E8(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:A8(o.steps,e.graph)})}}});function yC(t){let e=t.question??t.prompt??t.text??t.message;if(typeof e!="string"||e.trim()==="")return{error:'perguntar: passe "question" (a pergunta em texto). Para escolha, passe tamb\xE9m "options".'};let o=e.trim().slice(0,2e3),n=t.header??t.title,r=typeof n=="string"&&n.trim()!==""?n.trim().slice(0,200):void 0,s=t.options??t.choices,i=Array.isArray(s)?T8(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&D8.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 T8(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 _8(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 bR(t,e,o=hu){let{older:n,recent:r}=Jf(t,o);if(n.length===
|
|
|
154
154
|
`);let i=So(process.execPath,[n,"-p",o,"--yolo","--no-self-check"],{stdio:"inherit",timeout:9e5,env:{...process.env,ALUY_OVERWRITE_RENDER:"0",ALUY_SYNC_OUTPUT:"0",ALUY_NO_WEAK_YOLO_WARN:"1",ALUY_PRINT_VERBOSE:"1"}});if(t==="mem0")try{let l=ve(cn(),$r),c=ve(l,Rn);Ze(l)&&Tp(Rp(),c)}catch{}t==="ollama"&&(await $G(),BG()),process.stderr.write(`
|
|
155
155
|
verificando "${t}"\u2026 (alguns segundos; a pr\xF3xima etapa vem em seguida)
|
|
156
156
|
`);let a=await WO(t,process.platform,!0);for(let l=0;l<FG&&!a;l++)await NG(IG),a=await WO(t,process.platform,!0);return{target:t,hashOk:a,installed:a,message:a?`complemento "${t}" instalado e verificado.`:`o complemento "${t}" ainda n\xE3o respondeu como esperado. O Aluy CLI funciona sem ele; voc\xEA pode tentar de novo depois com \`aluy bootstrap\`.`}}function NG(t){return new Promise(e=>setTimeout(e,t))}async function $G(){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 BG(){if(process.platform!=="win32")try{let t=So("sh",["-lc","command -v ollama"],{encoding:"utf8",timeout:1e4});if(t.status===0&&(t.stdout??"").trim()!=="")return;let e=_p(),n=["/usr/local/bin/ollama","/usr/bin/ollama","/opt/homebrew/bin/ollama",ve(e,".ollama","bin","ollama"),ve(cn(),xs,"bin","ollama")].find(i=>Ze(i));if(n===void 0)return;let r=ve(e,".local","bin");_x(r,{recursive:!0});let s=ve(r,"ollama");try{if(UO(s)===UO(n))return;yG(s)}catch{}try{gG(n,s)}catch{}}catch{}}function UG(){try{return So("python3",["-m","venv","--help"],{timeout:1e4}).status===0}catch{return!1}}function jG(){try{return So("python3",["-m","pip","--version"],{timeout:1e4}).status===0}catch{return!1}}function HG(t){let e=[],o=[];if(t.has("ollama")&&(zO()||(e.push("zstd (extrair o Ollama)"),o.push("zstd")),KO()||(e.push("tar (extrair o Ollama)"),o.push("tar"))),t.has("mem0")||t.has("headroom")){let r=Ox();r.ok?(UG()||(e.push("m\xF3dulo venv do Python (mem0/headroom criam um virtualenv)"),o.push("python3-venv")),jG()||(e.push("pip do Python (mem0/headroom instalam pacotes)"),o.push("python3-pip"))):(e.push(`python3 >= ${bu} para mem0/headroom (encontrado: ${r.version||"nenhum"})`),o.push("python3","python3-venv","python3-pip"))}if(e.length===0)return[];let n=[...new Set(o)];return["Faltam pr\xE9-requisitos para o modo turbo (o que conseguir, instala; o resto fica de fora):",...e.map(r=>` \u2022 ${r}`),`Instale e rode \`aluy bootstrap\` de novo: sudo apt install -y ${n.join(" ")}`,""]}async function VO(t,e,o){let n=t??"turbo",r=Br(e??{}),s=o?.useAgent!==!1,i=new Tx({...o?.platform?{platform:o.platform}:{},...s?{agentInstaller:PG}:{}});if(!s)for(let a of HG(r))process.stderr.write(a+`
|
|
157
|
-
`);return i.provisionAll(n,r)}var GO,Ka,xG,Rn,HO,Tx,qO,MG,FG,IG,Mx=p(()=>{"use strict";L();GO=".aluy",Ka=448,xG=384;Rn="aluy-mem0-server.py";HO="application/vnd.ollama.image.model";Tx=class{platform;agentInstaller;constructor(e={}){this.platform=e.platform??process.platform,this.agentInstaller=e.agentInstaller}hasPinnedArtifact(){return this.platform==="linux"}async isProvisioned(e){switch(e){case"ollama":{let o=ve(cn(),xs,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(cn(),$r,"bin","python3");return Ze(o)&&Pu(o)}case"headroom":{let o=ve(cn(),Ss,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=vG().uid;if(qk(n))return{target:e,hashOk:!1,installed:!1,message:"RECUSA ROOT (uid=0): provisionamento de sidecars \xE9 user-space. Execute como usu\xE1rio normal."};if(this.agentInstaller)return this.agentInstaller(e,o);if(!this.hasPinnedArtifact())return{target:e,hashOk:!1,installed:!1,message:`SO '${this.platform}' sem artefato pinado p/ provisionamento direto. Rode \`aluy bootstrap\` (o aluy instala via o pr\xF3prio agente, \u26A0 --yolo) ou instale manualmente.`};switch(e){case"ollama":return CG();case"mem0":return RG();case"headroom":return OG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!ku(e))return{profile:e,targets:[],anySuccess:!1,allFailed:!1};let n=[],r=[...o];for(let a=0;a<r.length;a++){let l=r[a],c={index:a+1,total:r.length,plan:r};try{n.push(await this.provision(l,c))}catch(u){let m=u instanceof Error?u.message:String(u);n.push({target:l,hashOk:!1,installed:!1,message:`falha inesperada ao provisionar \u2014 seguindo p/ os pr\xF3ximos (${m}).`})}}let s=n.some(a=>a.installed),i=n.length>0&&n.every(a=>!a.installed);return{profile:e,targets:n,anySuccess:s,allFailed:i}}},qO="na faixa 3.10\u20133.12 (N\xC3O use 3.13+/3.14 \u2014 as depend\xEAncias nativas n\xE3o t\xEAm wheels e o pip falha ao compilar; no Windows prefira `py -3.12` ou `py -3.11`). Se N\xC3O houver um Python 3.10\u20133.12 instalado, INSTALE primeiro (no Windows: `winget install -e --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements`; no Linux/macOS use o gerenciador do sistema). Se j\xE1 existir um venv nesse caminho numa vers\xE3o incompat\xEDvel (ex.: 3.14), APAGUE e recrie com a vers\xE3o certa",MG="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. ";FG=24,IG=5e3});var Zn,Fu=p(()=>{"use strict";Zn="1.0.0-rc.81"});var eM={};pt(eM,{HELP_TEXT:()=>JO,parseArgs:()=>Lx,suggestFlag:()=>KG,versionText:()=>QO});function ut(t,e,o={}){let n=`--${e}=`;for(let r=0;r<t.length;r++){let s=t[r];if(s===`--${e}`){let i=t[r+1];return i===void 0||(o.allowDashValue?i.startsWith("--"):i.startsWith("-"))?void 0:i}if(s!==void 0&&s.startsWith(n))return s.slice(n.length)}}function qG(t,e){let o=`-${e}=`;for(let n=0;n<t.length;n++){let r=t[n];if(r===`-${e}`){let s=t[n+1];return s!==void 0&&!s.startsWith("-")?s:void 0}if(r!==void 0&&r.startsWith(o))return r.slice(o.length)}}function QO(){return`aluy ${Zn} (@hiperplano/aluy-cli-core ${Xl})`}function zG(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 KG(t){let e,o=3;for(let n of ZO){let r=zG(t,n);r<o&&(o=r,e=n)}return e}function YG(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")break;if(!r.startsWith("--")||r.length===2||e.has(n))continue;let s=r.slice(2).split("=",1)[0];s===""||ZO.has(s)||o.push(`--${s}`)}return o}function Lx(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let W=t.slice(1),fe=ut(W,"token"),go=ut(W,"org"),Wt=W.includes("--device"),Oo=ut(W,"provider"),jn=W.includes("--oauth");return{kind:"login",forceDeviceFlow:Wt,...fe!==void 0?{token:fe}:{},...go!==void 0?{org:go}:{},...Oo!==void 0?{provider:Oo}:{},...jn?{oauth:!0}:{}}}if(e==="logout"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"logout"};if(e==="whoami"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"whoami"};if(e==="doctor"&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--deep")||t.includes("--test"),fe=t.includes("--json");return{kind:"doctor",deep:W,json:fe}}if(e==="config"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"config",json:t.includes("--json")};if(e==="agents"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"agents"};if(e==="bootstrap"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"bootstrap",agent:!t.includes("--no-agent")};if(e==="uninstall"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"uninstall",agent:t.includes("--agent")};if(e==="onboard"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"onboard"};if(e==="skills"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"skills"};if(e==="workflows"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"workflows"};if((e==="models"||e==="providers")&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--json"),fe=t.findIndex(Wt=>Wt==="--backend"||Wt.startsWith("--backend=")),go="both";if(fe!==-1){let Oo=(t[fe].includes("=")?t[fe].slice(10):t[fe+1]??"").trim().toLowerCase();Oo==="local"?go="local":Oo==="broker"&&(go="broker")}return{kind:"models",scope:go,json:W,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let W=t[1];if(W===void 0||!["login","logout","allow","deny","status"].includes(W))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let go=t.slice(2);if(W==="login"){let Wt=ut(go,"token");return{kind:"telegram",sub:"login",...Wt!==void 0?{token:Wt}:{}}}if(W==="allow"||W==="deny"){let Wt=go.find(jn=>!jn.startsWith("-")),Oo=Wt!==void 0&&/^-?\d+$/.test(Wt)?Number(Wt):void 0;return Oo===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Oo}}return{kind:"telegram",sub:W}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(fe=>!fe.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:QO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:JO};let o=t.includes("--plan"),n=t.includes("--unsafe"),r=t.includes("--yolo")||n,s=o?"plan":r?"unsafe":"normal",i=t.includes("--dense"),a=t.includes("--ascii"),l=t.includes("--telegram"),c=t.includes("--split")||t.includes("--view")?!0:void 0,u=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,d=ut(t,"tier"),h=ut(t,"lang"),g=ut(t,"max-tokens"),b=ut(t,"max-iterations"),y=ut(t,"max-output-tokens"),w=!(t.includes("--no-subagents")||t.includes("--no-subagent")),E=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,C=t.includes("--no-autocompact")?"off":ut(t,"autocompact-at"),O=t.includes("--quiet")?!0:void 0,U=t.includes("--cycle")?!0:void 0,q=ut(t,"cycles"),V=ut(t,"cycle-for"),z=ut(t,"backend"),I=ut(t,"local-provider"),Q=ut(t,"local-model"),ne=ut(t,"local-auth"),J=ut(t,"local-base-url"),M=ut(t,"model"),j=ut(t,"provider");if((t.includes("--provider")||t.some(W=>W.startsWith("--provider=")))&&(M===void 0||M.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((M===void 0||M.trim()==="")&&d!==void 0&&d.trim().toLowerCase()==="custom")return{kind:"usage-error",message:"aluy: --tier custom exige --model <slug> (ex.: --model deepseek-v4-pro). A via Custom precisa do slug do modelo; sem ele use um tier can\xF4nico (aluy-flux, aluy-granito, \u2026).",exitCode:2};let Y=ut(t,"effort"),pe=t.includes("--effort")||t.some(W=>W.startsWith("--effort=")),Z;if(Y!==void 0){if(Y.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(Y.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};Z=Y}else if(pe)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let ae=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec=")),F=ae?ut(t,"print",{allowDashValue:!0})??ut(t,"exec",{allowDashValue:!0})??qG(t,"p")??void 0:void 0,ge=ae?ut(t,"output-format"):void 0;if(ge!==void 0&&!["text","json","stream-json"].includes(ge.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${ge}" (use text | json | stream-json)`,exitCode:2};let te=t.includes("--new"),ue=t.includes("--continue"),we=t.indexOf("--resume"),_t=t.find(W=>W.startsWith("--resume=")),Re=we>=0||_t!==void 0,rt;if(_t!==void 0)rt=_t.slice(9);else if(we>=0){let W=t[we+1];W!==void 0&&!W.startsWith("-")&&(rt=W)}let vt=d!==void 0?t.indexOf("--tier")+1:-1,bt=h!==void 0&&!t.some(W=>W.startsWith("--lang="))?t.indexOf("--lang")+1:-1,st=rt!==void 0&&_t===void 0?we+1:-1,Rt=g!==void 0&&!t.some(W=>W.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,K=b!==void 0&&!t.some(W=>W.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,xe=q!==void 0&&!t.some(W=>W.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Pe=V!==void 0&&!t.some(W=>W.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,H=y!==void 0&&!t.some(W=>W.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,jt=C!==void 0&&!t.includes("--no-autocompact")&&!t.some(W=>W.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,Ro=z!==void 0&&!t.some(W=>W.startsWith("--backend="))?t.indexOf("--backend")+1:-1,k=(W,fe)=>fe!==void 0&&!t.some(go=>go.startsWith(`--${W}=`))?t.indexOf(`--${W}`)+1:-1,ho=k("local-provider",I),Ot=k("local-model",Q),kt=k("local-auth",ne),ss=k("local-base-url",J),is=M!==void 0&&!t.some(W=>W.startsWith("--model="))?t.indexOf("--model")+1:-1,xr=j!==void 0&&!t.some(W=>W.startsWith("--provider="))?t.indexOf("--provider")+1:-1,Sr=Z!==void 0&&!t.some(W=>W.startsWith("--effort="))?t.indexOf("--effort")+1:-1,Ht=ge!==void 0&&!t.some(W=>W.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,qt=F!==void 0&&!t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,Zo=t.find((W,fe)=>!W.startsWith("-")&&fe!==vt&&fe!==bt&&fe!==Ro&&fe!==ho&&fe!==Ot&&fe!==kt&&fe!==ss&&fe!==is&&fe!==xr&&fe!==Sr&&fe!==Ht&&fe!==qt&&fe!==st&&fe!==Rt&&fe!==K&&fe!==H&&fe!==jt&&fe!==xe&&fe!==Pe),jo=(F??Zo??"").trim();if(jo!==""&&!/\s/.test(jo)&&GG.has(jo.toLowerCase()))return{kind:"usage-error",message:`aluy: "${jo}" \xE9 um comando de SESS\xC3O, n\xE3o um objetivo. Use /${jo} DENTRO do aluy (rode \`aluy\` sem argumentos), ou veja \`aluy --help\`. Se voc\xEA quis MESMO um objetivo com essa palavra, d\xEA mais contexto (ex.: \`aluy "${jo} o arquivo X"\`).`,exitCode:2};let ls=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,xn=new Set([vt,bt,Ro,ho,Ot,kt,ss,is,xr,Sr,Ht,qt,st,Rt,K,H,jt,xe,Pe].filter(W=>W>=0));for(let W of WG){let fe=t.indexOf(W);fe>=0&&!t[fe].includes("=")&&xn.add(fe+1)}let ti=YG(t,xn);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...ti.length>0?{unknownFlags:ti}:{},dense:i,fresh:te,subAgents:w,safeGlyphs:a,telegram:l,print:ae,...c!==void 0?{split:c}:{},...u!==void 0?{fullscreen:u}:{},...m!==void 0?{budget:m}:{},...Zo!==void 0?{goal:Zo}:{},...d!==void 0?{tier:d}:{},...z!==void 0?{backend:z}:{},...I!==void 0?{localProvider:I}:{},...Q!==void 0?{localModel:Q}:{},...ne!==void 0?{localAuth:ne}:{},...J!==void 0?{localBaseUrl:J}:{},...M!==void 0?{model:M}:{},...j!==void 0?{provider:j}:{},...Z!==void 0?{effort:Z}:{},...F!==void 0?{printArg:F}:{},...ge!==void 0?{outputFormat:ge}:{},...h!==void 0?{lang:h}:{},...ls!==void 0?{resume:ls}:{},...g!==void 0?{maxTokens:g}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...E!==void 0?{selfCheck:E}:{},...C!==void 0?{autoCompactAt:C}:{},...O!==void 0?{quiet:O}:{},...U!==void 0?{cycle:U}:{},...q!==void 0?{cycles:q}:{},...V!==void 0?{cycleFor:V}:{}}}var JO,ZO,WG,GG,Px=p(()=>{"use strict";L();Fu();JO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
157
|
+
`);return i.provisionAll(n,r)}var GO,Ka,xG,Rn,HO,Tx,qO,MG,FG,IG,Mx=p(()=>{"use strict";L();GO=".aluy",Ka=448,xG=384;Rn="aluy-mem0-server.py";HO="application/vnd.ollama.image.model";Tx=class{platform;agentInstaller;constructor(e={}){this.platform=e.platform??process.platform,this.agentInstaller=e.agentInstaller}hasPinnedArtifact(){return this.platform==="linux"}async isProvisioned(e){switch(e){case"ollama":{let o=ve(cn(),xs,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(cn(),$r,"bin","python3");return Ze(o)&&Pu(o)}case"headroom":{let o=ve(cn(),Ss,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=vG().uid;if(qk(n))return{target:e,hashOk:!1,installed:!1,message:"RECUSA ROOT (uid=0): provisionamento de sidecars \xE9 user-space. Execute como usu\xE1rio normal."};if(this.agentInstaller)return this.agentInstaller(e,o);if(!this.hasPinnedArtifact())return{target:e,hashOk:!1,installed:!1,message:`SO '${this.platform}' sem artefato pinado p/ provisionamento direto. Rode \`aluy bootstrap\` (o aluy instala via o pr\xF3prio agente, \u26A0 --yolo) ou instale manualmente.`};switch(e){case"ollama":return CG();case"mem0":return RG();case"headroom":return OG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!ku(e))return{profile:e,targets:[],anySuccess:!1,allFailed:!1};let n=[],r=[...o];for(let a=0;a<r.length;a++){let l=r[a],c={index:a+1,total:r.length,plan:r};try{n.push(await this.provision(l,c))}catch(u){let m=u instanceof Error?u.message:String(u);n.push({target:l,hashOk:!1,installed:!1,message:`falha inesperada ao provisionar \u2014 seguindo p/ os pr\xF3ximos (${m}).`})}}let s=n.some(a=>a.installed),i=n.length>0&&n.every(a=>!a.installed);return{profile:e,targets:n,anySuccess:s,allFailed:i}}},qO="na faixa 3.10\u20133.12 (N\xC3O use 3.13+/3.14 \u2014 as depend\xEAncias nativas n\xE3o t\xEAm wheels e o pip falha ao compilar; no Windows prefira `py -3.12` ou `py -3.11`). Se N\xC3O houver um Python 3.10\u20133.12 instalado, INSTALE primeiro (no Windows: `winget install -e --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements`; no Linux/macOS use o gerenciador do sistema). Se j\xE1 existir um venv nesse caminho numa vers\xE3o incompat\xEDvel (ex.: 3.14), APAGUE e recrie com a vers\xE3o certa",MG="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. ";FG=24,IG=5e3});var Zn,Fu=p(()=>{"use strict";Zn="1.0.0-rc.82"});var eM={};pt(eM,{HELP_TEXT:()=>JO,parseArgs:()=>Lx,suggestFlag:()=>KG,versionText:()=>QO});function ut(t,e,o={}){let n=`--${e}=`;for(let r=0;r<t.length;r++){let s=t[r];if(s===`--${e}`){let i=t[r+1];return i===void 0||(o.allowDashValue?i.startsWith("--"):i.startsWith("-"))?void 0:i}if(s!==void 0&&s.startsWith(n))return s.slice(n.length)}}function qG(t,e){let o=`-${e}=`;for(let n=0;n<t.length;n++){let r=t[n];if(r===`-${e}`){let s=t[n+1];return s!==void 0&&!s.startsWith("-")?s:void 0}if(r!==void 0&&r.startsWith(o))return r.slice(o.length)}}function QO(){return`aluy ${Zn} (@hiperplano/aluy-cli-core ${Xl})`}function zG(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 KG(t){let e,o=3;for(let n of ZO){let r=zG(t,n);r<o&&(o=r,e=n)}return e}function YG(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")break;if(!r.startsWith("--")||r.length===2||e.has(n))continue;let s=r.slice(2).split("=",1)[0];s===""||ZO.has(s)||o.push(`--${s}`)}return o}function Lx(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let W=t.slice(1),fe=ut(W,"token"),go=ut(W,"org"),Wt=W.includes("--device"),Oo=ut(W,"provider"),jn=W.includes("--oauth");return{kind:"login",forceDeviceFlow:Wt,...fe!==void 0?{token:fe}:{},...go!==void 0?{org:go}:{},...Oo!==void 0?{provider:Oo}:{},...jn?{oauth:!0}:{}}}if(e==="logout"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"logout"};if(e==="whoami"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"whoami"};if(e==="doctor"&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--deep")||t.includes("--test"),fe=t.includes("--json");return{kind:"doctor",deep:W,json:fe}}if(e==="config"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"config",json:t.includes("--json")};if(e==="agents"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"agents"};if(e==="bootstrap"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"bootstrap",agent:!t.includes("--no-agent")};if(e==="uninstall"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"uninstall",agent:t.includes("--agent")};if(e==="onboard"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"onboard"};if(e==="skills"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"skills"};if(e==="workflows"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"workflows"};if((e==="models"||e==="providers")&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--json"),fe=t.findIndex(Wt=>Wt==="--backend"||Wt.startsWith("--backend=")),go="both";if(fe!==-1){let Oo=(t[fe].includes("=")?t[fe].slice(10):t[fe+1]??"").trim().toLowerCase();Oo==="local"?go="local":Oo==="broker"&&(go="broker")}return{kind:"models",scope:go,json:W,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let W=t[1];if(W===void 0||!["login","logout","allow","deny","status"].includes(W))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let go=t.slice(2);if(W==="login"){let Wt=ut(go,"token");return{kind:"telegram",sub:"login",...Wt!==void 0?{token:Wt}:{}}}if(W==="allow"||W==="deny"){let Wt=go.find(jn=>!jn.startsWith("-")),Oo=Wt!==void 0&&/^-?\d+$/.test(Wt)?Number(Wt):void 0;return Oo===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Oo}}return{kind:"telegram",sub:W}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(fe=>!fe.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:QO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:JO};let o=t.includes("--plan"),n=t.includes("--unsafe"),r=t.includes("--yolo")||n,s=o?"plan":r?"unsafe":"normal",i=t.includes("--dense"),a=t.includes("--ascii"),l=t.includes("--telegram"),c=t.includes("--split")||t.includes("--view")?!0:void 0,u=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,d=ut(t,"tier"),h=ut(t,"lang"),g=ut(t,"max-tokens"),b=ut(t,"max-iterations"),y=ut(t,"max-output-tokens"),w=!(t.includes("--no-subagents")||t.includes("--no-subagent")),E=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,C=t.includes("--no-autocompact")?"off":ut(t,"autocompact-at"),O=t.includes("--quiet")?!0:void 0,U=t.includes("--cycle")?!0:void 0,q=ut(t,"cycles"),V=ut(t,"cycle-for"),z=ut(t,"backend"),I=ut(t,"local-provider"),Q=ut(t,"local-model"),ne=ut(t,"local-auth"),J=ut(t,"local-base-url"),M=ut(t,"model"),j=ut(t,"provider");if((t.includes("--provider")||t.some(W=>W.startsWith("--provider=")))&&(M===void 0||M.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((M===void 0||M.trim()==="")&&d!==void 0&&d.trim().toLowerCase()==="custom")return{kind:"usage-error",message:"aluy: --tier custom exige --model <slug> (ex.: --model deepseek-v4-pro). A via Custom precisa do slug do modelo; sem ele use um tier can\xF4nico (aluy-flux, aluy-granito, \u2026).",exitCode:2};let Y=ut(t,"effort"),pe=t.includes("--effort")||t.some(W=>W.startsWith("--effort=")),Z;if(Y!==void 0){if(Y.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(Y.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};Z=Y}else if(pe)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let ae=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec=")),F=ae?ut(t,"print",{allowDashValue:!0})??ut(t,"exec",{allowDashValue:!0})??qG(t,"p")??void 0:void 0,ge=ae?ut(t,"output-format"):void 0;if(ge!==void 0&&!["text","json","stream-json"].includes(ge.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${ge}" (use text | json | stream-json)`,exitCode:2};let te=t.includes("--new"),ue=t.includes("--continue"),we=t.indexOf("--resume"),_t=t.find(W=>W.startsWith("--resume=")),Re=we>=0||_t!==void 0,rt;if(_t!==void 0)rt=_t.slice(9);else if(we>=0){let W=t[we+1];W!==void 0&&!W.startsWith("-")&&(rt=W)}let vt=d!==void 0?t.indexOf("--tier")+1:-1,bt=h!==void 0&&!t.some(W=>W.startsWith("--lang="))?t.indexOf("--lang")+1:-1,st=rt!==void 0&&_t===void 0?we+1:-1,Rt=g!==void 0&&!t.some(W=>W.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,K=b!==void 0&&!t.some(W=>W.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,xe=q!==void 0&&!t.some(W=>W.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Pe=V!==void 0&&!t.some(W=>W.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,H=y!==void 0&&!t.some(W=>W.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,jt=C!==void 0&&!t.includes("--no-autocompact")&&!t.some(W=>W.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,Ro=z!==void 0&&!t.some(W=>W.startsWith("--backend="))?t.indexOf("--backend")+1:-1,k=(W,fe)=>fe!==void 0&&!t.some(go=>go.startsWith(`--${W}=`))?t.indexOf(`--${W}`)+1:-1,ho=k("local-provider",I),Ot=k("local-model",Q),kt=k("local-auth",ne),ss=k("local-base-url",J),is=M!==void 0&&!t.some(W=>W.startsWith("--model="))?t.indexOf("--model")+1:-1,xr=j!==void 0&&!t.some(W=>W.startsWith("--provider="))?t.indexOf("--provider")+1:-1,Sr=Z!==void 0&&!t.some(W=>W.startsWith("--effort="))?t.indexOf("--effort")+1:-1,Ht=ge!==void 0&&!t.some(W=>W.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,qt=F!==void 0&&!t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,Zo=t.find((W,fe)=>!W.startsWith("-")&&fe!==vt&&fe!==bt&&fe!==Ro&&fe!==ho&&fe!==Ot&&fe!==kt&&fe!==ss&&fe!==is&&fe!==xr&&fe!==Sr&&fe!==Ht&&fe!==qt&&fe!==st&&fe!==Rt&&fe!==K&&fe!==H&&fe!==jt&&fe!==xe&&fe!==Pe),jo=(F??Zo??"").trim();if(jo!==""&&!/\s/.test(jo)&&GG.has(jo.toLowerCase()))return{kind:"usage-error",message:`aluy: "${jo}" \xE9 um comando de SESS\xC3O, n\xE3o um objetivo. Use /${jo} DENTRO do aluy (rode \`aluy\` sem argumentos), ou veja \`aluy --help\`. Se voc\xEA quis MESMO um objetivo com essa palavra, d\xEA mais contexto (ex.: \`aluy "${jo} o arquivo X"\`).`,exitCode:2};let ls=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,xn=new Set([vt,bt,Ro,ho,Ot,kt,ss,is,xr,Sr,Ht,qt,st,Rt,K,H,jt,xe,Pe].filter(W=>W>=0));for(let W of WG){let fe=t.indexOf(W);fe>=0&&!t[fe].includes("=")&&xn.add(fe+1)}let ti=YG(t,xn);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...ti.length>0?{unknownFlags:ti}:{},dense:i,fresh:te,subAgents:w,safeGlyphs:a,telegram:l,print:ae,...c!==void 0?{split:c}:{},...u!==void 0?{fullscreen:u}:{},...m!==void 0?{budget:m}:{},...Zo!==void 0?{goal:Zo}:{},...d!==void 0?{tier:d}:{},...z!==void 0?{backend:z}:{},...I!==void 0?{localProvider:I}:{},...Q!==void 0?{localModel:Q}:{},...ne!==void 0?{localAuth:ne}:{},...J!==void 0?{localBaseUrl:J}:{},...M!==void 0?{model:M}:{},...j!==void 0?{provider:j}:{},...Z!==void 0?{effort:Z}:{},...F!==void 0?{printArg:F}:{},...ge!==void 0?{outputFormat:ge}:{},...h!==void 0?{lang:h}:{},...ls!==void 0?{resume:ls}:{},...g!==void 0?{maxTokens:g}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...E!==void 0?{selfCheck:E}:{},...C!==void 0?{autoCompactAt:C}:{},...O!==void 0?{quiet:O}:{},...U!==void 0?{cycle:U}:{},...q!==void 0?{cycles:q}:{},...V!==void 0?{cycleFor:V}:{}}}var JO,ZO,WG,GG,Px=p(()=>{"use strict";L();Fu();JO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
158
158
|
|
|
159
159
|
Uso:
|
|
160
160
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
|
@@ -524,7 +524,7 @@ ${r.join(`
|
|
|
524
524
|
`,{mode:384});return}let s=new Set(r.messages.map(c=>c.msg_id)),i=o.messages.filter(c=>!s.has(c.msg_id)),a=r.revoked!==o.revoked||r.ttlMs!==o.ttlMs,l=!await this.fileEndsWithNewline(this.filePath(e));if(a||l){let c=[...r.messages,...i],u=[aw(o)];for(let d=0;d<c.length;d++)u.push(lw(c[d],d+2));let m=u.join(`
|
|
525
525
|
`)+`
|
|
526
526
|
`;if(this.maxBytes>0&&Buffer.byteLength(m,"utf-8")>this.maxBytes)throw new Error(`limite de tamanho da sala excedido (${this.maxBytes} bytes). Evicte salas expiradas ou reduza o volume de mensagens.`);await Ue.writeFile(this.filePath(e),m,{mode:384})}else if(i.length>0){let c=r.messages.length+1,u="";for(let m=0;m<i.length;m++){let d=c+m+1;u+=lw(i[m],d)+`
|
|
527
|
-
`}if(this.maxBytes>0&&(await Ue.stat(this.filePath(e))).size+Buffer.byteLength(u,"utf-8")>this.maxBytes)throw new Error(`limite de tamanho da sala excedido (${this.maxBytes} bytes). Evicte salas expiradas ou reduza o volume de mensagens.`);await Ue.appendFile(this.filePath(e),u)}}finally{await this.releaseLock(e,n)}}async remove(e){try{return await Ue.unlink(this.filePath(e)),!0}catch(o){if(o.code==="ENOENT")return!1;throw o}}async evictDead(e){let o=e??Date.now(),n;try{n=await Ue.readdir(this.baseDir,{withFileTypes:!0})}catch(s){if(s.code==="ENOENT")return 0;throw s}let r=0;for(let s of n){if(!s.isFile()||!s.name.endsWith(".jsonl"))continue;let i=s.name.slice(0,-6);if(!/^[a-f0-9]{32}$/.test(i))continue;let a=al.join(this.baseDir,s.name);try{let l=await Ah(a,i);(l.revoked||us(l,o))&&(await Ue.unlink(a),r+=1)}catch{try{await Ue.unlink(a),r+=1}catch{}}}return r}}});function DF(t){if(t.config.hooks.some(o=>o.event==="pre-tool"&&o.gate===!0))return async(o,n)=>{let r=Zv(t.config,o.name);if(r.length===0)return{blocked:!1};let s=await t.runner.runGate(r,n);return s.blocked?{blocked:!0,observation:`A tool "${o.name}" foi VETADA por um hook de pre-tool (gate) \u2014 isto N\xC3O \xE9 um erro t\xE9cnico nem um bloqueio da catraca: a pol\xEDtica do dono (hook \`${s.command}\`) decidiu barrar esta chamada (o hook terminou com c\xF3digo de sa\xEDda \u2260 0). N\xC3O repita a mesma chamada \u2014 siga por outro caminho. Sa\xEDda do hook (DADO): ${q5(s.observation)}`}:{blocked:!1}}}function q5(t){return typeof t.text=="string"?t.text:""}var TF=p(()=>{"use strict";L()});function RF(t={}){let e=t.env??process.env,o=Fo(e),n=t.store??new no,r=new to({baseUrl:o.identityBaseUrl,clientId:Hx,store:n,...t.identityFetch?{fetch:t.identityFetch}:{}},{envToken:()=>e.ALUY_TOKEN}),s=un(e),i=t.brokerClient??Ec({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),a=t.catalogClient??Ac({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),l=t.customModelClient??Cc({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),c=t.providersClient??Dc({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),u=t.quotaClient??Db({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),m=t.mode??(t.unsafe?"unsafe":"normal"),d=m==="unsafe",h=new ro({...t.workspaceRoot!==void 0?{root:t.workspaceRoot}:{},...d?{unconfined:!0}:{}}),g=t.sessionId??Aa(),b=new id({sessionId:g,...t.journalBaseDir!==void 0?{baseDir:t.journalBaseDir}:{}});b.gcOrphans();let y=new mu({store:b,workspace:h,restoreWriter:new ld({workspace:h}),currentReader:new cd({workspace:h})}),w=new fu({journal:y}),E=new Is({workspace:h}),C=new Fi(t.egressAllow!==void 0?{allow:t.egressAllow}:{}),O=xk(e.ALUY_WEB_FETCH_MAX_CHARS),U=tS({egress:C,policy:{maxObservationChars:O,...d?{allowInternalHosts:!0}:{}}}),q=new Wr({workspace:h,...t.memoryBaseDir!==void 0?{baseDir:t.memoryBaseDir}:{}}),V=new Ei({store:q}),z=new ad({...t.todoBaseDir!==void 0?{baseDir:t.todoBaseDir}:{},sessionId:g}),I=process.env.ALUY_SANDBOX_BASH?rh():void 0,Q=new vh,ne=new ma,J={fs:E,shell:new ed({workspace:h,timeoutMs:W5,...I?{sandboxLauncher:I}:{},egressAllows:H=>{let de=C.inspect(H);return de.hasNetwork&&!de.outsideAllowlist}}),search:new td({workspace:h}),journal:y.toolPort,web:U,cwd:h,memory:{remember:(H,de,jt)=>V.remember(H,de,jt),searchFacts:(H,de)=>V.searchFacts(H,de)},todo:z,question:Q,graph:ne},M=new od({workspace:h}),j=new Sd({workspace:h,fs:E}),Oe=new vo({mode:m,diffPreview:(H,de,jt)=>jt!==void 0?Ra(H,jt,de,!0):Ra(H,"",de,!1),...t.maxMemoryWritesPerSession!==void 0?{maxMemoryWritesPerSession:t.maxMemoryWritesPerSession}:{}}),Y=new bh(t.askTimeoutMs!==void 0?{timeoutMs:t.askTimeoutMs}:{}),pe=(t.hooksConfigStore??new vd({workspaceRoot:t.workspaceRoot??process.cwd()})).load(),Z=new au({permission:Oe,ports:J,askResolver:Y}),ae=DF({runner:Z,config:pe}),F=t.tier??pn,ge=jp(F,e,void 0,t.context?.window),te=F==="custom"?t.model:void 0,ue=te!==void 0?t.provider:void 0,we=t.effort,Re=(t.effectiveBackend!=="local"?(t.localBudget===!1&&t.onConfigWarn?.("aluy: budget OFF n\xE3o se aplica ao backend broker \u2014 o or\xE7amento de sess\xE3o est\xE1 SEMPRE ativo no broker. Use --backend local para deslig\xE1-lo (BYO)."),!0):t.localBudget!==!1)?{...Lo,maxIterations:$m(t.maxIterations,e.ALUY_MAX_ITERATIONS,t.limits?.maxIterations),maxTokens:Nm(t.maxTokens,e.ALUY_MAX_TOKENS,t.limits?.maxTokens)}:{maxIterations:1e4,maxToolCalls:1e4*2},rt=EC(t.maxOutputTokens,e.ALUY_MAX_OUTPUT_TOKENS,t.limits?.maxOutputTokens,t.onConfigWarn),vt=Wb({flag:t.selfCheck,env:e.ALUY_SELF_CHECK,tier:F,everyKEnv:e.ALUY_SELF_CHECK_EVERY,maxVerificationsEnv:e.ALUY_SELF_CHECK_MAX}),Bt={cwd:h.cwd,tier:F,...te!==void 0?{model:te}:{},...t.effectiveBackend!==void 0?{backend:t.effectiveBackend}:{},tokens:0,windowPct:0},bt=null,st=new kh({client:i,tier:F,...t.headroomUrl!==void 0?{headroomUrl:t.headroomUrl}:{},...te!==void 0?{model:te}:{},...ue!==void 0?{provider:ue}:{},...we!==void 0?{effort:we}:{},...rt!==void 0?{maxTokens:rt}:{},sink:{onStart:()=>bt?.sink.onStart?.(),onDelta:H=>bt?.sink.onDelta(H),onUsage:H=>bt?.sink.onUsage?.(H),onQuota:H=>bt?.sink.onQuota?.(H),onDone:()=>bt?.sink.onDone?.()}}),Ut=new Kn({client:i,tier:F,tierSource:st,maxTokens:Vf}),Rt=new Kn({client:i,tier:F,tierSource:st,maxTokens:2048}),N=t.subAgents?.enabled?new Kn({client:i,tier:F,tierSource:st,...rt!==void 0?{maxTokens:rt}:{}}):void 0,K=new Map,De,xe=t.subAgents?.enabled?H=>{let de=K.get(H);if(de)return de;let jt=new Kn({client:i,tier:H,...rt!==void 0?{maxTokens:rt}:{}});return De&&jt.attachNativeTools(De),K.set(H,jt),jt}:void 0,Ne=yk(e.ALUY_ROOM_BACKEND,t.roomsBackend);Ne.warning&&t.onConfigWarn&&t.onConfigWarn(Ne.warning);let Pe=(()=>{switch(Ne.backend){case"memory":return new Ir;case"file":return new Ch;case"loopback":case"broker":throw new Error(`Room backend "${Ne.backend}" n\xE3o implementado ainda. Use "memory" ou "file", ou deixe o default.`);default:return new Ir}})(),X=new Eh({model:st,compactionModel:Ut,sideQueryModel:Rt,permission:Oe,roomStore:Pe,ports:J,askResolver:Y,questionResolver:Q,...ae?{preToolGate:ae}:{},...Lt(pe,"user-prompt-submit").length>0?{onUserPromptSubmit:()=>{Z.runAll(Lt(pe,"user-prompt-submit"))}}:{},meta:Bt,limits:Re,...vt.enabled?{selfCheck:vt}:{},...t.autoCompactAt!==void 0?{autoCompactAt:t.autoCompactAt}:{},...t.context?{contextConfig:t.context}:{},contextWindow:ge,...t.projectInstructions!==void 0?{projectInstructions:t.projectInstructions}:{},...t.availableAgents!==void 0?{availableAgents:t.availableAgents}:{},...t.sessionCommands!==void 0?{sessionCommands:t.sessionCommands}:{},...t.mcpTools!==void 0?{mcpTools:t.mcpTools}:{},...t.headroomUrl!==void 0?{headroomRetrieveTool:IL({baseUrl:t.headroomUrl})}:{},...t.subAgents?.enabled?{subAgents:{...t.subAgents,env:t.subAgents.env??e,...Lt(pe,"subagent-stop").length>0?{observer:{onChildEnd:()=>{Z.runAll(Lt(pe,"subagent-stop"))}}}:{}}}:{},...t.subAgents?.enabled&&t.agentRegistry?{agentRegistry:t.agentRegistry}:{},...t.subAgents?.enabled&&t.reloadProjectAgents?{reloadProjectAgents:t.reloadProjectAgents}:{},...N?{subAgentModel:N}:{},...xe?{callerForTier:xe}:{},disableNativeTools:e.ALUY_NATIVE_TOOLS_OFF==="1"||e.ALUY_NATIVE_TOOLS_OFF==="true",watchdogEnv:e,quotaFetcher:()=>u.fetchQuota(),...t.memoryMonitor!==void 0?{memory:{heapLimitMb:t.memoryMonitor.heapLimitMb,sampleHeapUsed:t.memoryMonitor.sampleHeapUsed,env:e,...t.memoryMonitor.sampleIntervalMs!==void 0?{sampleIntervalMs:t.memoryMonitor.sampleIntervalMs}:{}}}:{},onUserPrompt:(H,de)=>{w.markPrompt(H,de)},...(()=>{let H=Kp({env:e,...t.services?{services:t.services}:{}});if(!H)return{};let de=hL(e);return de?{maestro:H,continuationConfig:de}:{maestro:H}})(),...(()=>{let H=pL({env:e,...t.services?{services:t.services}:{}});return H?{memoryEngine:H.memory,memoryScope:H.memoryScope,memoryRecallScopes:H.memoryRecallScopes}:{}})(),onToolsReady:H=>{st.attachNativeTools(H),N?.attachNativeTools(H),De=H;for(let de of K.values())de.attachNativeTools(H)}});return bt=X,{controller:X,login:r,engine:Oe,egress:C,workspace:h,askResolver:Y,questionResolver:Q,journal:y,journalStore:b,checkpoints:w,fileIndex:M,attachReader:j,catalogClient:a,customModelClient:l,providersClient:c,quotaClient:u,ports:J,memory:V,todoStore:z,hookRunner:Z,hooksConfig:pe}}var pn,W5,Ad=p(()=>{"use strict";L();Rs();Mi();NL();or();gS();kd();wd();KP();YP();JP();iw();kd();CF();TF();L();zr();aS();pn="aluy-flux",W5=12e4});var MF={};pt(MF,{runDoctor:()=>G5});async function G5(t={}){let e=t.io??Pt(),o=t.env??process.env,n=t.json===!0,r=t.probe??z5(o,t.deep===!0),s=r.tierTester!==void 0;if(!n){e.out("aluy doctor \u2014 diagn\xF3stico"),e.out("");for(let h of Xp(s))e.out(`\u25F7 ${h.label}: testando\u2026`);let c={...r,onCheck:(h,g)=>{let b=Jp(h,g);if(!b)return;let y=b.status==="ok"?Qu.ok:b.status==="warn"?Qu.warn:Qu.fail;e.out(`${y} ${b.label}: ${b.detail}`),b.status!=="ok"&&b.fix!==void 0&&e.out(` \u2192 ${b.fix}`)}},u=await Vu(c),m=Ju(u),d=PL(m,Qu);return e.out(""),e.out(d[d.length-1]??""),uS(m)?1:0}let i=await Vu(r),a=Ju(i),l=a.checks.map(c=>({id:c.id,status:c.status,label:c.label,detail:c.detail}));return e.out(JSON.stringify(l)),uS(a)?1:0}function z5(t,e){return{env:t,getAccessToken:()=>K5(t),memory:V5(),makeMcpTransport:()=>new Gr({cwd:process.cwd(),parentEnv:t}),...e?{tierTester:()=>eh({tier:Y5(),login:OF(t),env:t})}:{}}}function OF(t){let e=Fo(t),o=new no;return new to({...e,baseUrl:e.identityBaseUrl,store:o})}function K5(t){return OF(t).getAccessToken()}function Y5(){try{let t=new Be({}).load();return Mu(void 0,t,pn)}catch{return pn}}function V5(){return{async count(){try{let t=new ro({}),e=new Wr({workspace:t});return(await new Ei({store:e}).list()).length}catch{return null}}}}var LF=p(()=>{"use strict";L();er();Rs();or();Qa();Yx();qu();cS();Zp();FL();dS();xo();Ad()});function X5(t){return(t.entries.find(o=>o.wave===1)??t.entries[0])?.id??"anthropic"}function Dh(t){return Or({flag:t.flag,env:t.env.ALUY_BACKEND,config:t.config.backend})}function cw(t,e){return t==null?void 0:Cn(e,t)?.id}function uw(t){if(t==null)return;let e=t.trim().toLowerCase();if(e==="apikey"||e==="oauth"||e==="none")return e}function J5(t,e){let o=Cn(e,t)?.auth;return o!==void 0&&o.length>0&&o.every(n=>n==="none")?"none":"apikey"}function ll(t){if(t==null)return;let e=t.trim();return e!==""?e:void 0}function cl(t){let e=t.flags??{},o=t.catalog??zn(),n=cw(e.localProvider,o)??cw(t.env.ALUY_LOCAL_PROVIDER,o)??cw(t.config.localProvider,o)??X5(o),r=Cn(o,n)?.defaultModel??n,s=ll(e.localModel)??ll(t.env.ALUY_LOCAL_MODEL)??ll(t.config.localModel)??r,i=uw(e.localAuth)??uw(t.env.ALUY_LOCAL_AUTH)??uw(t.config.localAuth)??J5(n,o),a=ll(e.localBaseUrl)??ll(t.env.ALUY_LOCAL_BASE_URL)??ll(t.config.localBaseUrl);return{provider:n,model:s,auth:i,...a!==void 0?{baseUrl:a}:{}}}var Th=p(()=>{"use strict";L()});var FF={};pt(FF,{collectSettings:()=>PF,runConfig:()=>rV});import{existsSync as eV}from"node:fs";import{homedir as tV}from"node:os";import{join as _h}from"node:path";function $s(t,e,o,n,r,s){let i=o?.trim();return i!==void 0&&i!==""?{key:t,value:i,origin:"env",source:e}:n!=null?{key:t,value:String(n),origin:"config.json",source:s??`config.${t}`}:{key:t,value:r,origin:"default",source:"\u2014"}}function ul(t,e,o){return e!=null?{key:t,value:String(e),origin:"config.json",source:`config.${t}`}:{key:t,value:o,origin:"default",source:"\u2014"}}function PF(t,e){let o=cl({env:{},config:{}}),n=o.baseUrl??"\u2014";return[$s("backend","ALUY_BACKEND",t.ALUY_BACKEND,e.backend,Dh({env:{},config:{}})),$s("localProvider","ALUY_LOCAL_PROVIDER",t.ALUY_LOCAL_PROVIDER,e.localProvider,o.provider),$s("localModel","ALUY_LOCAL_MODEL",t.ALUY_LOCAL_MODEL,e.localModel,o.model),$s("localAuth","ALUY_LOCAL_AUTH",t.ALUY_LOCAL_AUTH,e.localAuth,o.auth),$s("localBaseUrl","ALUY_LOCAL_BASE_URL",t.ALUY_LOCAL_BASE_URL,e.localBaseUrl,n),ul("profile",e.profile,"turbo"),ul("sidecar.ollama",e.sidecarToggles?.ollama,"on (default)"),ul("sidecar.mem0",e.sidecarToggles?.mem0,"on (default)"),ul("sidecar.headroom",e.sidecarToggles?.headroom,"on (default)"),ul("lang",e.lang,"auto"),ul("theme",e.theme,"default"),$s("maxTokens","ALUY_MAX_TOKENS",t.ALUY_MAX_TOKENS,e.limits?.maxTokens,String(1e7),"config.limits.maxTokens"),$s("maxOutputTokens","ALUY_MAX_OUTPUT_TOKENS",t.ALUY_MAX_OUTPUT_TOKENS,e.limits?.maxOutputTokens,"\u2014 (do servidor/tier)","config.limits.maxOutputTokens"),$s("maxIterations","ALUY_MAX_ITERATIONS",t.ALUY_MAX_ITERATIONS,e.limits?.maxIterations,String(300),"config.limits.maxIterations")]}function oV(t){let e=(o,n)=>{let r=_h(t,o);return{path:r,role:n,exists:eV(r)}};return[e("config.json","configura\xE7\xE3o dur\xE1vel (este comando)"),e("mcp.json","servers MCP (interop; sem credencial \u2014 CLI-SEC-7)"),e("hooks.json","hooks (fronteira de execu\xE7\xE3o; o agente nunca escreve)"),e("providers.json","cat\xE1logo de providers (override do usu\xE1rio)"),e("update-check.json","estado/cache (reescrito pela m\xE1quina)"),e("memory","store do mem0 (chromadb + history)"),e("logs","logs dos sidecars (mem0/ollama/headroom)")]}function rV(t={}){let e=t.io??Pt(),o=t.env??process.env,n=t.baseDir??_h(tV(),".aluy"),s=(t.configStore??new Be({baseDir:n})).load(),i=PF(o,s),a=oV(n);if(t.json===!0)return e.out(JSON.stringify({configPath:_h(n,"config.json"),settings:i.map(u=>({key:u.key,value:u.value,origin:u.origin,source:u.source})),files:a.map(u=>({path:u.path,role:u.role,exists:u.exists}))},null,2)),0;e.out("aluy config \u2014 configura\xE7\xE3o efetiva (read-only)"),e.out(` arquivo dur\xE1vel: ${_h(n,"config.json")}`),e.out(" preced\xEAncia: flag > env (ALUY_*) > config.json > default"),e.out("");let l=Math.max(...i.map(u=>u.key.length),3),c=Math.max(...i.map(u=>u.value.length),5);for(let u of i){let m=nV[u.origin],d=u.origin==="default"?"":` (${u.source})`;e.out(` ${u.key.padEnd(l)} ${u.value.padEnd(c)} [${m}]${d}`)}e.out(""),e.out(" outros arquivos (fora do config.json de prop\xF3sito \u2014 segredo/interop/execu\xE7\xE3o):");for(let u of a){let m=u.exists?"\xB7":"\u25CB";e.out(` ${m} ${u.path} \u2014 ${u.role}`)}return e.out(""),e.out(" segredos (chave de API/token) ficam no keychain do SO, NUNCA no config.json."),0}var nV,IF=p(()=>{"use strict";L();er();xo();Th();nV={env:"env","config.json":"config",default:"default"}});var $F={};pt($F,{defaultUserAgentsDir:()=>lV,runAgents:()=>aV});import{homedir as sV}from"node:os";import{join as NF}from"node:path";function iV(){return NF("~",".aluy",zu)}function aV(t={}){let e=t.out??(a=>process.stdout.write(a+`
|
|
527
|
+
`}if(this.maxBytes>0&&(await Ue.stat(this.filePath(e))).size+Buffer.byteLength(u,"utf-8")>this.maxBytes)throw new Error(`limite de tamanho da sala excedido (${this.maxBytes} bytes). Evicte salas expiradas ou reduza o volume de mensagens.`);await Ue.appendFile(this.filePath(e),u)}}finally{await this.releaseLock(e,n)}}async remove(e){try{return await Ue.unlink(this.filePath(e)),!0}catch(o){if(o.code==="ENOENT")return!1;throw o}}async evictDead(e){let o=e??Date.now(),n;try{n=await Ue.readdir(this.baseDir,{withFileTypes:!0})}catch(s){if(s.code==="ENOENT")return 0;throw s}let r=0;for(let s of n){if(!s.isFile()||!s.name.endsWith(".jsonl"))continue;let i=s.name.slice(0,-6);if(!/^[a-f0-9]{32}$/.test(i))continue;let a=al.join(this.baseDir,s.name);try{let l=await Ah(a,i);(l.revoked||us(l,o))&&(await Ue.unlink(a),r+=1)}catch{try{await Ue.unlink(a),r+=1}catch{}}}return r}}});function DF(t){if(t.config.hooks.some(o=>o.event==="pre-tool"&&o.gate===!0))return async(o,n)=>{let r=Zv(t.config,o.name);if(r.length===0)return{blocked:!1};let s=await t.runner.runGate(r,n);return s.blocked?{blocked:!0,observation:`A tool "${o.name}" foi VETADA por um hook de pre-tool (gate) \u2014 isto N\xC3O \xE9 um erro t\xE9cnico nem um bloqueio da catraca: a pol\xEDtica do dono (hook \`${s.command}\`) decidiu barrar esta chamada (o hook terminou com c\xF3digo de sa\xEDda \u2260 0). N\xC3O repita a mesma chamada \u2014 siga por outro caminho. Sa\xEDda do hook (DADO): ${q5(s.observation)}`}:{blocked:!1}}}function q5(t){return typeof t.text=="string"?t.text:""}var TF=p(()=>{"use strict";L()});function RF(t={}){let e=t.env??process.env,o=Fo(e),n=t.store??new no,r=new to({baseUrl:o.identityBaseUrl,clientId:Hx,store:n,...t.identityFetch?{fetch:t.identityFetch}:{}},{envToken:()=>e.ALUY_TOKEN}),s=un(e),i=t.brokerClient??Ec({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),a=t.catalogClient??Ac({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),l=t.customModelClient??Cc({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),c=t.providersClient??Dc({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),u=t.quotaClient??Db({brokerBaseUrl:s.brokerBaseUrl,login:r,...t.brokerFetch?{fetch:t.brokerFetch}:{}}),m=t.mode??(t.unsafe?"unsafe":"normal"),d=m==="unsafe",h=new ro({...t.workspaceRoot!==void 0?{root:t.workspaceRoot}:{},...d?{unconfined:!0}:{}}),g=t.sessionId??Aa(),b=new id({sessionId:g,...t.journalBaseDir!==void 0?{baseDir:t.journalBaseDir}:{}});b.gcOrphans();let y=new mu({store:b,workspace:h,restoreWriter:new ld({workspace:h}),currentReader:new cd({workspace:h})}),w=new fu({journal:y}),E=new Is({workspace:h}),C=new Fi(t.egressAllow!==void 0?{allow:t.egressAllow}:{}),O=xk(e.ALUY_WEB_FETCH_MAX_CHARS),U=tS({egress:C,policy:{maxObservationChars:O,...d?{allowInternalHosts:!0}:{}}}),q=new Wr({workspace:h,...t.memoryBaseDir!==void 0?{baseDir:t.memoryBaseDir}:{}}),V=new Ei({store:q}),z=new ad({...t.todoBaseDir!==void 0?{baseDir:t.todoBaseDir}:{},sessionId:g}),I=process.env.ALUY_SANDBOX_BASH?rh():void 0,Q=new vh,ne=new ma,J={fs:E,shell:new ed({workspace:h,timeoutMs:W5,...I?{sandboxLauncher:I}:{},egressAllows:H=>{let de=C.inspect(H);return de.hasNetwork&&!de.outsideAllowlist}}),search:new td({workspace:h}),journal:y.toolPort,web:U,cwd:h,memory:{remember:(H,de,jt)=>V.remember(H,de,jt),searchFacts:(H,de)=>V.searchFacts(H,de)},todo:z,question:Q,graph:ne},M=new od({workspace:h}),j=new Sd({workspace:h,fs:E}),Oe=new vo({mode:m,diffPreview:(H,de,jt)=>jt!==void 0?Ra(H,jt,de,!0):Ra(H,"",de,!1),...t.maxMemoryWritesPerSession!==void 0?{maxMemoryWritesPerSession:t.maxMemoryWritesPerSession}:{}}),Y=new bh(t.askTimeoutMs!==void 0?{timeoutMs:t.askTimeoutMs}:{}),pe=(t.hooksConfigStore??new vd({workspaceRoot:t.workspaceRoot??process.cwd()})).load(),Z=new au({permission:Oe,ports:J,askResolver:Y}),ae=DF({runner:Z,config:pe}),F=t.tier??pn,ge=jp(F,e,void 0,t.context?.window),te=F==="custom"?t.model:void 0,ue=te!==void 0?t.provider:void 0,we=t.effort,Re=(t.effectiveBackend!=="local"?(t.localBudget===!1&&t.onConfigWarn?.("aluy: budget OFF n\xE3o se aplica ao backend broker \u2014 o or\xE7amento de sess\xE3o est\xE1 SEMPRE ativo no broker. Use --backend local para deslig\xE1-lo (BYO)."),!0):t.localBudget!==!1)?{...Lo,maxIterations:$m(t.maxIterations,e.ALUY_MAX_ITERATIONS,t.limits?.maxIterations),maxTokens:Nm(t.maxTokens,e.ALUY_MAX_TOKENS,t.limits?.maxTokens)}:{maxIterations:1e4,maxToolCalls:1e4*2},rt=EC(t.maxOutputTokens,e.ALUY_MAX_OUTPUT_TOKENS,t.limits?.maxOutputTokens,t.onConfigWarn),vt=Wb({flag:t.selfCheck,env:e.ALUY_SELF_CHECK,tier:F,everyKEnv:e.ALUY_SELF_CHECK_EVERY,maxVerificationsEnv:e.ALUY_SELF_CHECK_MAX}),Bt={cwd:h.cwd,tier:F,...te!==void 0?{model:te}:{},...t.effectiveBackend!==void 0?{backend:t.effectiveBackend}:{},tokens:0,windowPct:0},bt=null,st=new kh({client:i,tier:F,...t.headroomUrl!==void 0?{headroomUrl:t.headroomUrl}:{},...te!==void 0?{model:te}:{},...ue!==void 0?{provider:ue}:{},...we!==void 0?{effort:we}:{},...rt!==void 0?{maxTokens:rt}:{},sink:{onStart:()=>bt?.sink.onStart?.(),onDelta:H=>bt?.sink.onDelta(H),onUsage:H=>bt?.sink.onUsage?.(H),onQuota:H=>bt?.sink.onQuota?.(H),onDone:()=>bt?.sink.onDone?.()}}),Ut=new Kn({client:i,tier:F,tierSource:st,maxTokens:Vf}),Rt=new Kn({client:i,tier:F,tierSource:st,maxTokens:2048}),N=t.subAgents?.enabled?new Kn({client:i,tier:F,tierSource:st,...rt!==void 0?{maxTokens:rt}:{}}):void 0,K=new Map,De,xe=t.subAgents?.enabled?H=>{let de=K.get(H);if(de)return de;let jt=new Kn({client:i,tier:H,...rt!==void 0?{maxTokens:rt}:{}});return De&&jt.attachNativeTools(De),K.set(H,jt),jt}:void 0,Ne=yk(e.ALUY_ROOM_BACKEND,t.roomsBackend);Ne.warning&&t.onConfigWarn&&t.onConfigWarn(Ne.warning);let Pe=(()=>{switch(Ne.backend){case"memory":return new Ir;case"file":return new Ch;case"loopback":case"broker":throw new Error(`Room backend "${Ne.backend}" n\xE3o implementado ainda. Use "memory" ou "file", ou deixe o default.`);default:return new Ir}})(),X=new Eh({model:st,compactionModel:Ut,sideQueryModel:Rt,permission:Oe,roomStore:Pe,ports:J,askResolver:Y,questionResolver:Q,...ae?{preToolGate:ae}:{},...Lt(pe,"user-prompt-submit").length>0?{onUserPromptSubmit:()=>{Z.runAll(Lt(pe,"user-prompt-submit"))}}:{},meta:Bt,limits:Re,...vt.enabled?{selfCheck:vt}:{},...t.autoCompactAt!==void 0?{autoCompactAt:t.autoCompactAt}:{},...t.context?{contextConfig:t.context}:{},contextWindow:ge,...t.projectInstructions!==void 0?{projectInstructions:t.projectInstructions}:{},...t.availableAgents!==void 0?{availableAgents:t.availableAgents}:{},...t.sessionCommands!==void 0?{sessionCommands:t.sessionCommands}:{},...t.mcpTools!==void 0?{mcpTools:t.mcpTools}:{},...t.headroomUrl!==void 0?{headroomRetrieveTool:IL({baseUrl:t.headroomUrl})}:{},...t.subAgents?.enabled?{subAgents:{...t.subAgents,env:t.subAgents.env??e,...Lt(pe,"subagent-stop").length>0?{observer:{onChildEnd:()=>{Z.runAll(Lt(pe,"subagent-stop"))}}}:{}}}:{},...t.subAgents?.enabled&&t.agentRegistry?{agentRegistry:t.agentRegistry}:{},...t.subAgents?.enabled&&t.reloadProjectAgents?{reloadProjectAgents:t.reloadProjectAgents}:{},...N?{subAgentModel:N}:{},...xe?{callerForTier:xe}:{},disableNativeTools:e.ALUY_NATIVE_TOOLS_OFF==="1"||e.ALUY_NATIVE_TOOLS_OFF==="true",watchdogEnv:e,quotaFetcher:()=>u.fetchQuota(),...t.memoryMonitor!==void 0?{memory:{heapLimitMb:t.memoryMonitor.heapLimitMb,sampleHeapUsed:t.memoryMonitor.sampleHeapUsed,env:e,...t.memoryMonitor.sampleIntervalMs!==void 0?{sampleIntervalMs:t.memoryMonitor.sampleIntervalMs}:{}}}:{},onUserPrompt:(H,de)=>{w.markPrompt(H,de)},...(()=>{let H=Kp({env:e,...t.services?{services:t.services}:{}});if(!H)return{};let de=hL(e);return de?{maestro:H,continuationConfig:de}:{maestro:H}})(),...(()=>{let H=pL({env:e,...t.services?{services:t.services}:{}});return H?{memoryEngine:H.memory,memoryScope:H.memoryScope,memoryRecallScopes:H.memoryRecallScopes}:{}})(),onToolsReady:H=>{st.attachNativeTools(H),N?.attachNativeTools(H),De=H;for(let de of K.values())de.attachNativeTools(H)}});return bt=X,{controller:X,login:r,engine:Oe,egress:C,workspace:h,askResolver:Y,questionResolver:Q,journal:y,journalStore:b,checkpoints:w,fileIndex:M,attachReader:j,catalogClient:a,customModelClient:l,providersClient:c,quotaClient:u,ports:J,memory:V,todoStore:z,hookRunner:Z,hooksConfig:pe}}var pn,W5,Ad=p(()=>{"use strict";L();Rs();Mi();NL();or();gS();kd();wd();KP();YP();JP();iw();kd();CF();TF();L();zr();aS();pn="aluy-flux",W5=12e4});var MF={};pt(MF,{runDoctor:()=>G5});async function G5(t={}){let e=t.io??Pt(),o=t.env??process.env,n=t.json===!0,r=t.probe??z5(o,t.deep===!0),s=r.tierTester!==void 0;if(!n){e.out("aluy doctor \u2014 diagn\xF3stico"),e.out("");for(let h of Xp(s))e.out(`\u25F7 ${h.label}: testando\u2026`);let c={...r,onCheck:(h,g)=>{let b=Jp(h,g);if(!b)return;let y=b.status==="ok"?Qu.ok:b.status==="warn"?Qu.warn:Qu.fail;e.out(`${y} ${b.label}: ${b.detail}`),b.status!=="ok"&&b.fix!==void 0&&e.out(` \u2192 ${b.fix}`)}},u=await Vu(c),m=Ju(u),d=PL(m,Qu);return e.out(""),e.out(d[d.length-1]??""),uS(m)?1:0}let i=await Vu(r),a=Ju(i),l=a.checks.map(c=>({id:c.id,status:c.status,label:c.label,detail:c.detail}));return e.out(JSON.stringify(l)),uS(a)?1:0}function z5(t,e){return{env:t,getAccessToken:()=>K5(t),memory:V5(),makeMcpTransport:()=>new Gr({cwd:process.cwd(),parentEnv:t}),...e?{tierTester:()=>eh({tier:Y5(),login:OF(t),env:t})}:{}}}function OF(t){let e=Fo(t),o=new no;return new to({...e,baseUrl:e.identityBaseUrl,store:o})}function K5(t){return OF(t).getAccessToken()}function Y5(){try{let t=new Be({}).load();return Mu(void 0,t,pn)}catch{return pn}}function V5(){return{async count(){try{let t=new ro({}),e=new Wr({workspace:t});return(await new Ei({store:e}).list()).length}catch{return null}}}}var LF=p(()=>{"use strict";L();er();Rs();or();Qa();Yx();qu();cS();Zp();FL();dS();xo();Ad()});function X5(t){return(t.entries.find(o=>o.wave===1)??t.entries[0])?.id??"anthropic"}function Dh(t){return Or({flag:t.flag,env:t.env.ALUY_BACKEND,config:t.config.backend})}function cw(t,e){return t==null?void 0:Cn(e,t)?.id}function uw(t){if(t==null)return;let e=t.trim().toLowerCase();if(e==="apikey"||e==="oauth"||e==="none")return e}function J5(t,e){let o=Cn(e,t)?.auth;return o!==void 0&&o.length>0&&o.every(n=>n==="none")?"none":"apikey"}function ll(t){if(t==null)return;let e=t.trim();return e!==""?e:void 0}function cl(t){let e=t.flags??{},o=t.catalog??zn(),n=cw(e.localProvider,o)??cw(t.env.ALUY_LOCAL_PROVIDER,o)??cw(t.config.localProvider,o)??X5(o),r=Cn(o,n)?.defaultModel??n,s=ll(e.localModel)??ll(t.env.ALUY_LOCAL_MODEL)??ll(t.config.localModel)??r,i=uw(e.localAuth)??uw(t.env.ALUY_LOCAL_AUTH)??uw(t.config.localAuth)??J5(n,o),a=ll(e.localBaseUrl)??ll(t.env.ALUY_LOCAL_BASE_URL)??ll(t.config.localBaseUrl);return{provider:n,model:s,auth:i,...a!==void 0?{baseUrl:a}:{}}}var Th=p(()=>{"use strict";L()});var FF={};pt(FF,{collectSettings:()=>PF,runConfig:()=>rV});import{existsSync as eV}from"node:fs";import{homedir as tV}from"node:os";import{join as _h}from"node:path";function $s(t,e,o,n,r,s){let i=o?.trim();return i!==void 0&&i!==""?{key:t,value:i,origin:"env",source:e}:n!=null?{key:t,value:String(n),origin:"config.json",source:s??`config.${t}`}:{key:t,value:r,origin:"default",source:"\u2014"}}function ul(t,e,o){return e!=null?{key:t,value:String(e),origin:"config.json",source:`config.${t}`}:{key:t,value:o,origin:"default",source:"\u2014"}}function PF(t,e){let o=cl({env:{},config:{}}),n=o.baseUrl??"\u2014";return[$s("backend","ALUY_BACKEND",t.ALUY_BACKEND,e.backend,Dh({env:{},config:{}})),$s("localProvider","ALUY_LOCAL_PROVIDER",t.ALUY_LOCAL_PROVIDER,e.localProvider,o.provider),$s("localModel","ALUY_LOCAL_MODEL",t.ALUY_LOCAL_MODEL,e.localModel,o.model),$s("localAuth","ALUY_LOCAL_AUTH",t.ALUY_LOCAL_AUTH,e.localAuth,o.auth),$s("localBaseUrl","ALUY_LOCAL_BASE_URL",t.ALUY_LOCAL_BASE_URL,e.localBaseUrl,n),ul("profile",e.profile,"turbo"),ul("sidecar.ollama",e.sidecarToggles?.ollama,"on (default)"),ul("sidecar.mem0",e.sidecarToggles?.mem0,"on (default)"),ul("sidecar.headroom",e.sidecarToggles?.headroom,"on (default)"),ul("lang",e.lang,"auto"),ul("theme",e.theme,"default"),$s("maxTokens","ALUY_MAX_TOKENS",t.ALUY_MAX_TOKENS,e.limits?.maxTokens,String(1e7),"config.limits.maxTokens"),$s("maxOutputTokens","ALUY_MAX_OUTPUT_TOKENS",t.ALUY_MAX_OUTPUT_TOKENS,e.limits?.maxOutputTokens,"\u2014 (do servidor/tier)","config.limits.maxOutputTokens"),$s("maxIterations","ALUY_MAX_ITERATIONS",t.ALUY_MAX_ITERATIONS,e.limits?.maxIterations,String(300),"config.limits.maxIterations")]}function oV(t){let e=(o,n)=>{let r=_h(t,o);return{path:r,role:n,exists:eV(r)}};return[e("config.json","configura\xE7\xE3o dur\xE1vel (este comando)"),e("mcp.json","servers MCP (interop; sem credencial \u2014 CLI-SEC-7)"),e("hooks.json","hooks (fronteira de execu\xE7\xE3o; o agente nunca escreve)"),e("providers.json","cat\xE1logo de providers (override do usu\xE1rio)"),e("update-check.json","estado/cache (reescrito pela m\xE1quina)"),e("sessions","hist\xF3rico das sess\xF5es/conversas (retom\xE1vel com --resume)"),e("audit.jsonl","trilha de auditoria dos efeitos (append-only \u2014 CLI-SEC)"),e("cron","tarefas agendadas (aluy cron)"),e("exports","transcri\xE7\xF5es exportadas (/export)"),e("undo","pilha de undo das edi\xE7\xF5es do agente"),e("memory","store do mem0 (chromadb + history)"),e("logs","logs dos sidecars (mem0/ollama/headroom)")]}function rV(t={}){let e=t.io??Pt(),o=t.env??process.env,n=t.baseDir??_h(tV(),".aluy"),s=(t.configStore??new Be({baseDir:n})).load(),i=PF(o,s),a=oV(n);if(t.json===!0)return e.out(JSON.stringify({configPath:_h(n,"config.json"),settings:i.map(u=>({key:u.key,value:u.value,origin:u.origin,source:u.source})),files:a.map(u=>({path:u.path,role:u.role,exists:u.exists}))},null,2)),0;e.out("aluy config \u2014 configura\xE7\xE3o efetiva (read-only)"),e.out(` arquivo dur\xE1vel: ${_h(n,"config.json")}`),e.out(" preced\xEAncia: flag > env (ALUY_*) > config.json > default"),e.out("");let l=Math.max(...i.map(u=>u.key.length),3),c=Math.max(...i.map(u=>u.value.length),5);for(let u of i){let m=nV[u.origin],d=u.origin==="default"?"":` (${u.source})`;e.out(` ${u.key.padEnd(l)} ${u.value.padEnd(c)} [${m}]${d}`)}e.out(""),e.out(" outros arquivos (fora do config.json de prop\xF3sito \u2014 segredo/interop/execu\xE7\xE3o):");for(let u of a){let m=u.exists?"\xB7":"\u25CB";e.out(` ${m} ${u.path} \u2014 ${u.role}`)}return e.out(""),e.out(" segredos (chave de API/token) ficam no keychain do SO, NUNCA no config.json."),0}var nV,IF=p(()=>{"use strict";L();er();xo();Th();nV={env:"env","config.json":"config",default:"default"}});var $F={};pt($F,{defaultUserAgentsDir:()=>lV,runAgents:()=>aV});import{homedir as sV}from"node:os";import{join as NF}from"node:path";function iV(){return NF("~",".aluy",zu)}function aV(t={}){let e=t.out??(a=>process.stdout.write(a+`
|
|
528
528
|
`)),o=t.loadGlobal??(()=>new Yr().load()),n=t.loadProject??(()=>new $i({workspace:new ro}).load()),r=o(),s=n(),i=Jc({profiles:[...r.profiles,...s.profiles],errors:[...r.errors,...s.errors],globalDir:t.globalDir??iV()});e(i.title==="agents"?"aluy agents \u2014 perfis .md mapeados":i.title);for(let a of i.lines)e(a);return 0}function lV(){return NF(sV(),".aluy",zu)}var BF=p(()=>{"use strict";L();Wp();$S();Qa()});var jF={};pt(jF,{defaultUserSkillsDir:()=>mV,runSkills:()=>dV});import{homedir as cV}from"node:os";import{join as UF}from"node:path";function uV(){return UF("~",".aluy",yd)}function dV(t={}){let e=t.out??(a=>process.stdout.write(a+`
|
|
529
529
|
`)),o=t.loadGlobal??(()=>new Jr().load()),n=t.loadProject??(()=>new Qr({workspace:new ro}).load()),r=o(),s=n(),i=eu({skills:[...r.skills,...s.skills],errors:[...r.errors,...s.errors],globalDir:t.globalDir??uV()});e("aluy skills \u2014 capacidades SKILL.md mapeadas");for(let a of i.lines)e(a);return 0}function mV(){return UF(cV(),".aluy",yd)}var HF=p(()=>{"use strict";L();hh();WS();Qa()});var WF={};pt(WF,{defaultUserWorkflowsDir:()=>gV,runWorkflows:()=>hV});import{homedir as fV}from"node:os";import{join as qF}from"node:path";function pV(){return qF("~",".aluy",sl)}function hV(t={}){let e=t.out??(a=>process.stdout.write(a+`
|
|
530
530
|
`)),o=t.loadGlobal??(()=>new rr().load()),n=t.loadProject??(()=>new sr({workspace:new ro}).load()),r=o(),s=n(),i=nu({workflows:[...r.workflows,...s.workflows],errors:[...r.errors,...s.errors],globalDir:t.globalDir??pV(),projectDir:t.projectDir??".claude/workflows"});e("workflows \u2014 fluxos .md mapeados");for(let a of i.lines)e(a);return 0}function gV(){return qF(fV(),".aluy",sl)}var GF=p(()=>{"use strict";L();hd();gd();Qa()});var YF={};pt(YF,{probeModelReachable:()=>zF,runFirstRunWizard:()=>KF,runInit:()=>vV});import{Entry as yV}from"@napi-rs/keyring";async function zF(t){let{config:e,env:o}=t,n=cl({env:o,config:e}),r=Cn(zn(),n.provider)?.baseUrl,s=n.baseUrl??r;if(s===void 0||s==="")return!0;let i=t.fetchImpl??globalThis.fetch,a=t.timeoutMs??4e3,l=new AbortController,c=setTimeout(()=>l.abort(),a);try{return await i(`${s.replace(/\/+$/,"")}/models`,{signal:l.signal}),!0}catch{return!1}finally{clearTimeout(c)}}async function KF(t){let{config:e,configStore:o,prompt:n,out:r,err:s,entryFactory:i,isInteractive:a}=t,l=e.localProvider!==void 0,c=e.localModel!==void 0,u=!1,m=e.localProvider;if(m)try{let h=(i??bV)(tr,Lp(m)).getPassword();u=h!==""&&h!==void 0}catch{}if(l&&c&&u)return!0;if(!a)return s("aluy bootstrap: configura\xE7\xE3o de 1\xAA execu\xE7\xE3o necess\xE1ria (provider + chave + modelo)."),l||s(" \u2717 Falta provider local em ~/.aluy/config.json."),c||s(" \u2717 Falta modelo local em ~/.aluy/config.json."),u||s(" \u2717 Falta chave de API no keychain do SO."),s(""),s(" Rode `aluy bootstrap` interativamente (num terminal com TTY) para o wizard,"),s(" ou configure manualmente:"),s(" 1. `aluy login --provider <anthropic|openrouter|openai>` (grava a chave no keychain)"),s(" 2. Edite ~/.aluy/config.json e adicione:"),s(' "localProvider": "<provider>",'),s(' "localModel": "<modelo-nativo>"'),s(""),!1;if(r(""),r("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),r("\u2551 Configura\xE7\xE3o de 1\xAA execu\xE7\xE3o \u2014 provider + chave + modelo \u2551"),r("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),r(""),r("O `aluy bootstrap --agent` usa um modelo de linguagem para instalar"),r("depend\xEAncias. Precisamos de provider, chave de API e modelo."),r("(As credenciais ficam no keychain do SO \u2014 nunca em texto.)"),r(""),l)r(`Provider: ${m} (j\xE1 configurado)`);else{let d=(await n(`Provider (${dw.join("/")}): `)).trim().toLowerCase();if(!dw.includes(d))return s(`Provider inv\xE1lido "${d}". Use: ${dw.join(", ")}.`),!1;m=d,r("")}if(u)r("\u2713 Chave j\xE1 est\xE1 no keychain.");else{let d=m,h=(await n(`API key de ${d}: `,{secret:!0})).trim();if(h==="")return s("Chave vazia \u2014 abortando."),!1;try{if(Va(d,h,i),r("\u2713 Chave guardada no keychain do SO."),Fp({service:tr}))for(let g of Ip(Iu(d)))s(g)}catch(g){return s(`Falha ao gravar no keychain: ${g instanceof Error?g.message:String(g)}`),s("(Por seguran\xE7a, a credencial nunca \xE9 gravada em texto. Instale o Secret Service no Linux.)"),!1}r("")}if(!c){let d=m,h=(await n("Modelo nativo (ex.: claude-sonnet-4-8): ")).trim();if(h==="")return s("Modelo vazio \u2014 abortando."),!1;o.save({localProvider:d,localModel:h}),r(`\u2713 Provider "${d}" + modelo "${h}" salvos em ~/.aluy/config.json.`),r("")}return r("Configura\xE7\xE3o conclu\xEDda. Seguindo para o provisionamento\u2026"),r(""),!0}function bV(t,e){return new yV(t,e)}async function vV(t){let{out:e,err:o}=t,n=t.configStore??new Be,r,s,i;try{i=n.load(),r=i.profile,s=i.sidecarToggles}catch{i={}}let a=t.isInteractive!==void 0?t.isInteractive:process.stdin.isTTY===!0&&process.stdout.isTTY===!0;if(t.prompt!==void 0||!a){let u=t.prompt??(async()=>"");if(!await KF({config:i,configStore:n,prompt:u,out:e,err:o,...t.entryFactory!==void 0?{entryFactory:t.entryFactory}:{},isInteractive:a}))return 0}if(e("O Aluy CLI j\xE1 est\xE1 instalado e pronto para uso."),e(""),e("Esta etapa instala os COMPLEMENTOS opcionais (modo turbo): mem\xF3ria, modelos"),e("locais e gest\xE3o de contexto. Eles enriquecem a experi\xEAncia, mas n\xE3o s\xE3o"),e("obrigat\xF3rios \u2014 se algum n\xE3o instalar, voc\xEA usa o Aluy CLI normalmente sem ele."),e(""),e(` Perfil escolhido: ${r??"turbo"}`),r==="leve")return e(" Perfil LEVE: nenhum complemento ser\xE1 instalado \u2014 o Aluy CLI j\xE1 est\xE1 pronto."),e(" Para instal\xE1-los depois, rode `aluy bootstrap` ou troque para o perfil turbo."),0;let l=t.agent!==!1;l&&(await(t.modelProbe??((d,h)=>zF({config:d,env:h})))(i,t.env??process.env)||(e(" \u26A0 O modelo local n\xE3o respondeu \u2014 o instalador via agente precisa dele para rodar."),e(" Caindo no caminho DIRETO (--no-agent), que provisiona sem usar modelo."),e(""),l=!1)),l?(e(" Instalando os complementos com o pr\xF3prio aluy \u2014 ele detecta o sistema, instala o que"),e(" faltar (Python, pip, etc.) e os complementos. \u26A0 Acesso total \xE0 m\xE1quina (com sudo quando"),e(" preciso). Voc\xEA ver\xE1 o progresso de cada um abaixo.")):e(" Instalando os complementos pelo caminho direto (--no-agent; requer Python j\xE1 pronto)..."),e(""),process.env.ALUY_MEM0_EMBEDDER=Ap(i);let c=await VO(r,s,{useAgent:l});for(let u of c.targets){let m=u.installed?"\u2713":"\u2717";e(` ${m} ${u.target}: ${u.message}`)}return e(""),c.anySuccess?(e("Complementos instalados. O Aluy CLI est\xE1 pronto, agora com o modo turbo."),c.allFailed&&e("Observa\xE7\xE3o: alguns complementos n\xE3o instalaram \u2014 o Aluy CLI funciona sem eles."),0):c.targets.length===0?(e("Nenhum complemento a instalar \u2014 o Aluy CLI j\xE1 est\xE1 pronto."),0):(o("Nenhum complemento foi instalado agora \u2014 sem problema, o Aluy CLI funciona"),o("normalmente. Voc\xEA pode tentar de novo depois com `aluy bootstrap`."),1)}var dw,VF=p(()=>{"use strict";xo();Mx();Xa();Ix();Th();L();dw=["anthropic","openrouter","openai"]});var XF={};pt(XF,{runUninstall:()=>AV});import{homedir as kV}from"node:os";import{join as Rh}from"node:path";import{rmSync as xV,existsSync as SV}from"node:fs";import{spawnSync as wV}from"node:child_process";function EV(t){return[{label:"ollama (instala\xE7\xE3o local em ~/.aluy)",path:Rh(t,xs)},{label:"mem0 (venv)",path:Rh(t,$r)},{label:"headroom (venv)",path:Rh(t,Ss)}]}function AV(t={},e={}){let o=e.io??Pt(),n=e.baseDir??Rh(kV(),".aluy"),r=e.remove??(i=>xV(i,{recursive:!0,force:!0})),s=e.exists??SV;o.out("Removendo os complementos gerenciados pelo aluy (em ~/.aluy/)\u2026");for(let i of EV(n)){if(!s(i.path)){o.out(` \xB7 ${i.label}: n\xE3o estava instalado`);continue}try{r(i.path),o.out(` \u2713 ${i.label}: removido`)}catch{o.err(` \u2717 ${i.label}: falha ao remover (${i.path})`)}}return o.out(""),t.agent?DV(o):(o.out("Se o Ollama foi instalado no SISTEMA (via curl/winget), ele N\xC3O fica em ~/.aluy e"),o.out("continua instalado. Para remov\xEA-lo tamb\xE9m: `aluy uninstall --agent` (o aluy remove"),o.out("via o pr\xF3prio agente \u2014 \u26A0 acesso total + sudo). O CLI em si sai com `npm uninstall -g"),o.out("@hiperplano/aluy-cli`; sua config (~/.aluy/config.json) e credenciais N\xC3O s\xE3o tocadas."),0)}function CV(){return"DESINSTALE o Ollama instalado no SISTEMA (fora de ~/.aluy), detectando o SO. No Linux: pare/desabilite o servi\xE7o (`sudo systemctl stop ollama; sudo systemctl disable ollama` se existir), remova o bin\xE1rio (`sudo rm -f /usr/local/bin/ollama` ou onde estiver no PATH) e o usu\xE1rio/servi\xE7o se o install oficial criou. No macOS: encerre o app/servi\xE7o e remova-o. No Windows: `winget uninstall --id Ollama.Ollama`. Pacotes de sistema exigem privil\xE9gio: tente `sudo -n true`; se pedir senha, PE\xC7A ao usu\xE1rio. Opcional: remova os modelos baixados (`~/.ollama/models`). Confirme que `ollama` n\xE3o responde mais em http://127.0.0.1:11434/api/tags. Seja conciso."}function DV(t){let e=process.argv[1];return e?(t.out(" \u2500\u2500 Removendo o Ollama de sistema com o pr\xF3prio aluy \u2500\u2500 (acompanhe abaixo)"),t.out(""),wV(process.execPath,[e,"-p",CV(),"--yolo","--no-self-check"],{stdio:"inherit",timeout:6e5,env:{...process.env,ALUY_NO_WEAK_YOLO_WARN:"1",ALUY_PRINT_VERBOSE:"1"}}),0):(t.err("n\xE3o foi poss\xEDvel localizar o bin\xE1rio do aluy p/ delegar ao agente."),0)}var JF=p(()=>{"use strict";L();er()});function _V(t){let e=/^#?([0-9a-f]{6})$/i.exec(t.trim());return e?`\x1B]11;#${e[1].toUpperCase()}\x07`:""}function RV(t){if(t.NO_COLOR!==void 0)return!1;let e=t.ALUY_SET_BG;if(e===void 0)return!0;let o=e.trim().toLowerCase();return!(o==="0"||o==="false"||o==="no"||o==="off")}function MV(t){if(!t)return null;let e=/rgb:([0-9a-f]{1,4})\/([0-9a-f]{1,4})\/([0-9a-f]{1,4})/i.exec(t);if(e)return{r:mw(e[1]),g:mw(e[2]),b:mw(e[3])};let o=/#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(t);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:null}function mw(t){let e=parseInt(t,16),o=16**t.length-1;return Math.round(e/o*255)}function LV(t){let e=o=>{let n=o/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*e(t.r)+.7152*e(t.g)+.0722*e(t.b)}function PV(t){return LV(t)>=OV?"light":"dark"}function FV(t){let e=MV(t);return e?PV(e):null}function IV(t=process.env){let e=t.ALUY_OSC11_TIMEOUT_MS;if(e!==void 0){let n=Number.parseInt(e,10);if(Number.isFinite(n)&&n>0)return Math.min(n,5e3)}return!!(t.SSH_CONNECTION||t.SSH_TTY||t.SSH_CLIENT)?1e3:500}async function ZF(t){let e=t.env??process.env;if(e.NO_COLOR!==void 0||t.stdout.isTTY!==!0||t.stdin.isTTY!==!0)return null;let o=t.timeoutMs??IV(e),n=t.stdin,r=n.isRaw===!0;return await new Promise(s=>{let i="",a=!1,l={},c=()=>{l.id&&clearTimeout(l.id),n.off("data",m);try{r||n.setRawMode(!1),n.pause()}catch{}},u=d=>{a||(a=!0,c(),s(d))},m=d=>{i+=typeof d=="string"?d:d.toString("utf8");let h=FV(i);h!==null&&u(h)};try{n.setRawMode(!0),n.resume(),n.on("data",m),t.stdout.write(TV)}catch{u(null);return}l.id=setTimeout(()=>u(null),o)})}var TV,QF,Oh,OV,eI=p(()=>{"use strict";TV="\x1B]11;?\x07",QF="\x1B]111\x07";Oh=class{stdout;enabled;applied=!1;didReset=!1;constructor(e){let o=e.env??process.env;this.stdout=e.stdout,this.enabled=e.stdout.isTTY===!0&&RV(o)}get active(){return this.enabled}apply(e){if(!this.enabled)return"";let o=_V(e);return o===""?"":(this.stdout.write(o),this.applied=!0,this.didReset=!1,o)}reset(){return!this.enabled||!this.applied||this.didReset?"":(this.didReset=!0,this.stdout.write(QF),QF)}},OV=.5});import{createContext as NV,useContext as $V}from"react";import{Text as tI}from"ink";import{jsx as Mh}from"react/jsx-runtime";function Ui(t){return Mh(oI.Provider,{value:t.theme,children:t.children})}function oe(){return $V(oI)}function f(t){let o=oe().role(t.name),n={};return o.color!==void 0&&(n.color=o.color),o.bold!==void 0&&(n.bold=o.bold),o.dimColor!==void 0&&(n.dimColor=o.dimColor),o.inverse!==void 0&&(n.inverse=o.inverse),Mh(tI,{...n,children:t.children})}function P(t){let o=oe().glyph(t.name);return t.role?Mh(f,{name:t.role,children:o}):Mh(tI,{children:o})}var oI,nI=p(()=>{"use strict";Sp();oI=NV(ln())});var se=p(()=>{"use strict";yp();bp();Sp();kp();As();eI();nI()});import"react";import{Box as Lh}from"ink";import{jsx as dl,jsxs as rI}from"react/jsx-runtime";function Zr(t){let e=oe(),n=(t.columns??80)<Dd,r=e.unicode?"\u039B":"/\\";if(n)return rI(Lh,{children:[dl(f,{name:"accent",children:r}),dl(f,{name:"accent",children:" luy"})]});let s=e.unicode?ml:sI,i=e.unicode?Cd:iI;return rI(Lh,{flexDirection:"row",children:[dl(Lh,{flexDirection:"column",children:s.map((a,l)=>dl(f,{name:"accent",children:a},l))}),dl(Lh,{flexDirection:"column",children:i.map((a,l)=>dl(f,{name:"accent",children:BV+a},l))})]})}var ml,Cd,sI,iI,BV,Dd,fw,ji=p(()=>{"use strict";se();bp();ml=[" \u2588\u2588 "," \u2588\u2588\u2588\u2588 "," \u2588\u2588 \u2588\u2588 ","\u2588\u2588 \u2588\u2588","\u2588\u2588 \u2588\u2588"," "],Cd=["\u2588\u2588 ","\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588","\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588","\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588","\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588"," \u2588\u2588"],sI=[" /\\ "," / \\ ","/ \\","/ \\","/ \\"," "],iI=["## ","## ## ## ## ##","## ## ## ## ##","## ## ## #####","## ##### ##"," ##"],BV=" ",Dd=28,fw=ml.length});async function aI(t){let e=t.fetchImpl??fetch,o=t.baseUrl.replace(/\/+$/,""),n=new AbortController,r=setTimeout(()=>n.abort(),t.timeoutMs??15e3);try{let s=t.wireFormat==="anthropic"?await e(`${o}/v1/messages`,{method:"POST",signal:n.signal,headers:{"content-type":"application/json","x-api-key":t.key,"anthropic-version":"2023-06-01"},body:JSON.stringify({model:t.model,max_tokens:1,messages:[{role:"user",content:"ping"}]})}):await e(`${o}/chat/completions`,{method:"POST",signal:n.signal,headers:{"content-type":"application/json",authorization:`Bearer ${t.key}`},body:JSON.stringify({model:t.model,max_tokens:1,messages:[{role:"user",content:"ping"}]})});if(s.ok)return{ok:!0,detail:`HTTP ${s.status}`};let i="";try{i=(await s.text()).replace(/\s+/g," ").slice(0,160)}catch{}let a=s.status===401||s.status===403?" \u2014 chave inv\xE1lida?":s.status===404?" \u2014 modelo ou baseURL errado?":"";return{ok:!1,detail:`HTTP ${s.status}${a} ${i}`.trim()}}catch(s){return{ok:!1,detail:`n\xE3o conectou (baseURL/rede?): ${s instanceof Error?s.message:String(s)}`}}finally{clearTimeout(r)}}var lI=p(()=>{"use strict"});import{mkdirSync as UV,readFileSync as jV,renameSync as HV,statSync as qV,writeFileSync as WV}from"node:fs";import{dirname as GV,join as zV}from"node:path";function cI(t){let e={};for(let o of t.servers){let n={command:o.command,args:[...o.args]};Object.keys(o.env).length>0&&(n.env={...o.env}),o.disabled===!0&&(n.disabled=!0),e[o.name]=n}return JSON.stringify({mcpServers:e},null,2)+`
|
package/dist-bundle/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var BI=Object.create;var Fp=Object.defineProperty;var UI=Object.getOwnPropertyDescriptor;var jI=Object.getOwnPropertyNames;var HI=Object.getPrototypeOf,qI=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 WI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Ip=(t,e)=>{for(var o in e)Fp(t,o,{get:e[o],enumerable:!0})},GI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of jI(e))!qI.call(t,r)&&r!==o&&Fp(t,r,{get:()=>e[r],enumerable:!(n=UI(e,r))||n.enumerable});return t};var zI=(t,e,o)=>(o=t!=null?BI(HI(t)):{},GI(e||!t||!t.__esModule?Fp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,UE=S(()=>{"use strict";Ua="1.0.0-rc.
|
|
1
|
+
var BI=Object.create;var Fp=Object.defineProperty;var UI=Object.getOwnPropertyDescriptor;var jI=Object.getOwnPropertyNames;var HI=Object.getPrototypeOf,qI=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 WI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Ip=(t,e)=>{for(var o in e)Fp(t,o,{get:e[o],enumerable:!0})},GI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of jI(e))!qI.call(t,r)&&r!==o&&Fp(t,r,{get:()=>e[r],enumerable:!(n=UI(e,r))||n.enumerable});return t};var zI=(t,e,o)=>(o=t!=null?BI(HI(t)):{},GI(e||!t||!t.__esModule?Fp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,UE=S(()=>{"use strict";Ua="1.0.0-rc.82"});function zn(t,e){return t.decide(e)}var ds=S(()=>{"use strict"});var pn,Kn,Yn=S(()=>{"use strict";pn="remember",Kn="recall"});var Np,KI,hi,$p=S(()=>{"use strict";Np=class{id;horizon;label;parentId;children;dependencies;pinned;closed;createdAt;lastAccessedAt;accessCount;context;constructor(e,o,n,r,s){this.id=e,this.horizon=o,this.label=n,this.parentId=r,this.children=new Set,this.dependencies=new Set,this.pinned=!1,this.closed=!1,this.createdAt=s,this.lastAccessedAt=s,this.accessCount=0,this.context=[]}touch(e){this.lastAccessedAt=e,this.accessCount+=1}snapshot(){return{id:this.id,horizon:this.horizon,label:this.label,parentId:this.parentId,children:[...this.children],dependencies:[...this.dependencies],pinned:this.pinned,closed:this.closed,createdAt:this.createdAt,lastAccessedAt:this.lastAccessedAt,accessCount:this.accessCount,contextSize:this.context.length}}},KI=200,hi=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??KI,this.now=e?.clock??Date.now}static boxId(e,o){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}-${o.toString(36)}`}openBox(e,o,n,r){let s=this.nodes.get(e);if(s)return s.touch(this.now()),{box:s.snapshot(),created:!1};if(this.nodes.size>=this.maxBoxes&&(this.evictOne(),this.nodes.size>=this.maxBoxes))return null;let i=this.now(),a=new Np(e,o,n,r??null,i);if(r){let l=this.nodes.get(r);l&&l.children.add(e)}return this.nodes.set(e,a),{box:a.snapshot(),created:!0}}closeBox(e){let o=this.nodes.get(e);return o?(o.closed=!0,o.touch(this.now()),o.snapshot()):null}isClosed(e){let o=this.nodes.get(e);return o?o.closed:!1}reopenBox(e){let o=this.nodes.get(e);return o?(o.closed=!1,o.touch(this.now()),o.snapshot()):null}setHorizon(e,o){let n=this.nodes.get(e);return n?(n.horizon=o,n.touch(this.now()),n.snapshot()):null}setParent(e,o){let n=this.nodes.get(e);return n?n.parentId===o?n.snapshot():o!==null&&this.wouldCreateCycle(e,o)?null:(n.parentId&&this.nodes.get(n.parentId)?.children.delete(e),n.parentId=o,o&&this.nodes.get(o)?.children.add(e),n.touch(this.now()),n.snapshot()):null}wouldCreateCycle(e,o){let n=new Set,r=o;for(;r!==null;){if(r===e||n.has(r))return!0;n.add(r),r=this.nodes.get(r)?.parentId??null}return!1}getBox(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),o.snapshot()):null}listBoxes(e="lastAccessedAt"){let o=[...this.nodes.values()].map(n=>n.snapshot());switch(e){case"createdAt":return o.sort((n,r)=>n.createdAt-r.createdAt);case"accessCount":return o.sort((n,r)=>r.accessCount-n.accessCount);default:return o.sort((n,r)=>r.lastAccessedAt-n.lastAccessedAt)}}get size(){return this.nodes.size}addContext(e,o){let n=this.nodes.get(e);return n?(n.context.push({ts:this.now(),text:o}),n.touch(this.now()),n.snapshot()):null}getContext(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),[...o.context]):[]}getContextChain(e){let o=[],n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let s=this.nodes.get(r);if(!s)break;s.touch(this.now()),o.push({boxId:s.id,entries:[...s.context]}),r=s.parentId}return o}addDependency(e,o){let n=this.nodes.get(e);return!n||!this.nodes.has(o)||n.id===o?!1:(n.dependencies.add(o),n.touch(this.now()),!0)}getDependencies(e){let o=this.nodes.get(e);return o?[...o.dependencies]:[]}pinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!0,o.touch(this.now()),o.snapshot()):null}unpinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!1,o.touch(this.now()),o.snapshot()):null}evictOne(){let e=[];for(let n of this.nodes.values())n.horizon==="longo"||n.pinned||e.push(n);if(e.length===0)return null;e.sort((n,r)=>{let s=n.horizon==="curto"?0:1,i=r.horizon==="curto"?0:1;if(s!==i)return s-i;let a=n.closed?0:1,l=r.closed?0:1;return a!==l?a-l:n.lastAccessedAt!==r.lastAccessedAt?n.lastAccessedAt-r.lastAccessedAt:n.accessCount-r.accessCount});let o=e[0];return this.removeNode(o)}forceEvict(e){let o=this.nodes.get(e);return!o||o.horizon==="longo"||o.pinned?null:this.removeNode(o)}removeBox(e){let o=this.nodes.get(e);return o?this.removeNode(o):null}removeNode(e){if(e.parentId){let o=this.nodes.get(e.parentId);o&&o.children.delete(e.id)}return this.nodes.delete(e.id),e.snapshot()}}});function Wu(t){let e=[];for(let o of t){e.push({step:o,depth:0});for(let n of o.substeps??[])e.push({step:n,depth:1})}return e}function qE(t,e){let o,n="pending",r;if(typeof t=="string")o=t;else if(t!==null&&typeof t=="object"){let i=t,a=i.title??i.step??i.text??i.name??i.content;if(typeof a=="string"&&(o=a),typeof i.status=="string"&&YI.has(i.status)&&(n=i.status),e){let l=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(l)&&l.length>0){let c=[];for(let u of l){let f=qE(u,!1);if(typeof f=="string")return f;c.push(f)}r=c}}}if(o===void 0||o.trim()==="")return XI;let s=o.trim().slice(0,VI);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function JI(t){let e=t.steps??t.plan??t.todos??t.items;if(!Array.isArray(e))return{error:'update_plan: passe "steps" como uma LISTA de passos (string ou {title,status}).'};if(e.length===0)return{error:"update_plan: a lista de passos est\xE1 vazia."};let o=[];for(let i of e){let a=qE(i,!0);if(typeof a=="string")return{error:a};o.push(a)}let n=new Set,r=i=>{if(!n.has(i))return n.add(i),i;for(let a=2;;a++){let l=`${i} #${a}`;if(!n.has(l))return n.add(l),l}};for(let i=0;i<o.length;i++){let a=o[i],l=r(a.title),c=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Wu(o).length;return s>jE?{error:`update_plan: no m\xE1ximo ${jE} passos (recebidos ${s}).`}:{steps:o}}function QI(t){let e=Wu(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${WE[r.step.status]} ${r.step.title}`).join(`
|
|
2
2
|
`);return`plano (${o}/${e.length}):
|
|
3
3
|
${n}`}function eN(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function tN(t,e){let o=new Map;for(let i of e.listBoxes())o.set(i.label,i.id);let n=t.findIndex(i=>i.status==="in_progress"||(i.substeps??[]).some(a=>a.status==="in_progress")),r=(i,a,l)=>{let c=i.status==="in_progress"?"curto":l,u=o.get(i.title),f=u??hi.boxId(i.title,0);return u?(i.status!=="completed"&&e.isClosed(u)&&e.reopenBox(u),e.setHorizon(u,c),e.setParent(u,a)):e.openBox(f,c,i.title,a),i.status==="completed"&&!e.isClosed(f)&&e.closeBox(f),o.set(i.title,f),f};t.forEach((i,a)=>{let l=eN(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 oN(t,e){if(!e)return QI(t);let o=new Map;for(let c of e.listBoxes())o.set(c.label,c);let n=new Map;for(let c of e.listBoxes())n.set(c.id,c);let r=new Map,s=(c,u=new Set)=>{let f=r.get(c);if(f!==void 0)return f;let d=n.get(c);if(!d||!d.parentId||u.has(c))return r.set(c,0),0;let p=s(d.parentId,new Set(u).add(c))+1;return r.set(c,p),p},i=Wu(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:u}of i){let f=o.get(c.title),d=f?ZI[f.horizon]:"",p=f?s(f.id):u,h=" ".repeat(p),y=WE[c.status];l.push(`${h}${d} ${y} ${c.title}`)}return l.join(`
|
|
4
4
|
`)}var ja,YI,jE,VI,XI,WE,ZI,HE,nN,GE,Gu=S(()=>{"use strict";$p();ja="update_plan";YI=new Set(["pending","in_progress","completed"]),jE=30,VI=120,XI="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";WE={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};ZI={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};HE=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),nN=Object.freeze({type:"object",properties:{steps:{type:"array",description:"A lista COMPLETA de passos do plano (re-emita TODOS a cada atualiza\xE7\xE3o \u2014 substitui o anterior).",items:{type:"object",properties:{title:{type:"string",description:"O passo, curto e no imperativo."},status:HE,substeps:{type:"array",description:"OPCIONAL: sub-passos que detalham este passo (1 n\xEDvel). Aparecem indentados sob o passo e seguem o foco dele. Use quando um passo tem a\xE7\xF5es menores distintas.",items:{type:"object",properties:{title:{type:"string",description:"O sub-passo, curto e no imperativo."},status:HE},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),GE={name:ja,effect:"read",description:"Declara/atualiza um PLANO vis\xEDvel (checklist de passos). Use ao iniciar uma tarefa com V\xC1RIOS passos e a cada progresso: re-emita a lista TODA marcando o status de cada passo (pending/in_progress/completed). Mantenha 1 passo in_progress por vez. N\xE3o tem efeito no sistema \u2014 \xE9 s\xF3 o seu plano, para voc\xEA e para o usu\xE1rio acompanharem.",parameters:nN,async run(t,e){let o=JI(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&tN(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:oN(o.steps,e.graph)})}}});function zE(t){let e=t.question??t.prompt??t.text??t.message;if(typeof e!="string"||e.trim()==="")return{error:'perguntar: passe "question" (a pergunta em texto). Para escolha, passe tamb\xE9m "options".'};let o=e.trim().slice(0,2e3),n=t.header??t.title,r=typeof n=="string"&&n.trim()!==""?n.trim().slice(0,200):void 0,s=t.options??t.choices,i=Array.isArray(s)?sN(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&rN.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 sN(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 iN(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 HD(t,e,o=ec){let{older:n,recent:r}=mm(t,o);if(n.length===
|
|
|
137
137
|
\u2026[truncado: ${t.length-Fb} chars omitidos]`}function KU(t){return t.length<=Nb?t:`${t.slice(0,Nb)}\u2026`}function C0(t){let e=A0(t.server,t.descriptor.name),o=KU(t.descriptor.description.trim()),n=`[tool de um SERVER MCP de terceiro "${t.server}" \u2014 efeito n\xE3o-confi\xE1vel, passa pela catraca] ${o||"(sem descri\xE7\xE3o)"}`,r=t.descriptor.inputSchema,s=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:void 0;return{name:e,effect:"mcp",description:n,...s?{parameters:s}:{},async run(i,a,l){try{let c=await t.transport.callTool(t.descriptor.name,i,l?.signal),u=Ue(c.content);return c.ok?{ok:!0,observation:w0(u),display:`${e}(${YU(i)})`}:{ok:!1,observation:w0(`MCP "${e}" erro: ${u}`)}}catch(c){return{ok:!1,observation:`MCP "${e}" falhou: ${c instanceof Error?c.message:String(c)}`}}}}}function $b(t,e){let o=[],n=new Set,r=new Map,s=new Map,i=new Set;for(let a of t){let l=C0(a);if(n.has(l.name))continue;n.add(l.name);let c=a.server;s.set(c,(s.get(c)??0)+1);let u=r.get(c)??0;if(u>=Ib){i.add(c);continue}r.set(c,u+1),o.push(l)}if(e)for(let a of i){let l=s.get(a)??0;e(`server MCP "${a}" exp\xF4s ${l} tools; usando as primeiras ${Ib} (teto por server, anti-estouro de contexto). As demais foram ignoradas \u2014 revise o server ou reduza as tools que ele exp\xF5e.`)}return o}function YU(t){if(Object.keys(t).length===0)return"";let o=JSON.stringify(t);return o.length<=200?o:`${o.slice(0,200)}\u2026`}var Fb,Ib,Nb,D0=S(()=>{"use strict";Yu();Zn();Fb=2e4;Ib=128,Nb=1024});function R0(t,e){let o=new URL(_0);return t.trim().length>0&&o.searchParams.set("search",t.trim()),o.searchParams.set("limit",String(XU)),e!==void 0&&e.length>0&&o.searchParams.set("cursor",e),o.toString()}async function Ub(t,e,o){let n=t.trim(),r=[],s;for(let i=0;i<VU;i++){let a=R0(n,s),l;try{l=await e(a,o)}catch(f){return{ok:!1,query:n,reason:xm(o2(f))}}if(!l.ok)return{ok:!1,query:n,reason:xm(l.reason)};if(l.status<200||l.status>=300)return{ok:!1,query:n,reason:xm(`HTTP ${l.status}`)};let c;try{c=JSON.parse(l.body)}catch{return{ok:!1,query:n,reason:xm("resposta n\xE3o \xE9 JSON v\xE1lido")}}let u=M0(c);for(let f of u.servers)if(O0(f,n)&&r.push(f),r.length>=Bb)break;if(r.length>=Bb||(s=u.nextCursor,s===void 0||s.length===0))break}return{ok:!0,query:n,results:r}}function xm(t){return`registro MCP indispon\xEDvel (${Wi}): ${t}`}function O0(t,e){if(e.length===0)return!0;let o=e.toLowerCase();return[t.name,t.title??"",t.description,t.run.command??"",t.run.args.join(" ")].join(" ").toLowerCase().includes(o)}function M0(t){if(!nr(t))return{servers:[]};let e=Array.isArray(t.servers)?t.servers:[],o=[];for(let s of e){let i=JU(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 JU(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=QU(e);return{name:o,description:n,run:i,...r!==void 0?{title:r}:{},...s!==void 0?{version:s}:{}}}function QU(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=ZU(r);if(s!==void 0)return{...s,remoteUrls:e}}return{args:[],env:[],remoteUrls:e}}function ZU(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=t2(t.environmentVariables),a=T0(t.runtimeArguments),l=T0(t.packageArguments),c=n!==void 0?`${o}@${n}`:o;return e==="npm"||r==="npx"?{command:"npx",args:e2(["-y",...a,c,...l]),env:i,...s!==void 0?{transport:s}:{}}:e==="pypi"||r==="uvx"||r==="uv"?{command:"uvx",args:[...a,o,...l],env:i,...s!==void 0?{transport:s}:{}}:e==="oci"||r==="docker"?{command:"docker",args:["run","-i","--rm",...a,c,...l],env:i,...s!==void 0?{transport:s}:{}}:{args:[c],env:i,...s!==void 0?{transport:s}:{}}}function e2(t){let e=[],o=!1;for(let n of t){if(n==="-y"||n==="--yes"){if(o)continue;o=!0}e.push(n)}return e}function T0(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)nr(o)&&typeof o.value=="string"&&e.push(o.value);return e}function t2(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 o2(t){return t instanceof Error?t.message:String(t)}var Wi,_0,VU,XU,Bb,L0=S(()=>{"use strict";Wi="registry.modelcontextprotocol.io",_0=`https://${Wi}/v0/servers`,VU=5,XU=100,Bb=25});function F0(t){let{command:e,args:o}=t.run;if(e===void 0)return;let n=I0(t.name);return["aluy","mcp","add",P0(n),"--",e,...o.map(P0)].join(" ")}function I0(t){let o=(t.split("/").pop()??t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");return o.length>0?o:"server"}function P0(t){return/^[A-Za-z0-9_./@:+=-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function jb(t){if(!t.ok)return`\u26A0 ${t.reason}
|
|
138
138
|
Tente de novo em instantes; a busca no registro n\xE3o bloqueia o resto do aluy.`;if(t.results.length===0)return`nenhum server encontrado para "${t.query}" no registro oficial MCP.`;let e=[],o=t.results.length;e.push(`${o} server${o===1?"":"s"} para "${t.query}" (registro oficial MCP):`),e.push("");for(let n of t.results)e.push(n2(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 n2(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(` ${r2(t.description,200)}`);let r=F0(t);if(r!==void 0){o.push(` \u2192 ${r}`),t.run.transport!==void 0&&t.run.transport!=="stdio"&&o.push(` (transporte "${t.run.transport}" \u2014 v1 do aluy s\xF3 pluga servers stdio LOCAIS)`);let s=t.run.env.filter(i=>i.required).map(i=>i.name);s.length>0&&o.push(` requer env: ${s.join(", ")} (defina por-server no mcp.json)`)}else t.run.remoteUrls.length>0?o.push(` (server REMOTO: ${t.run.remoteUrls.join(", ")} \u2014 fora do v1 de \`aluy mcp add\`)`):o.push(" (sem pacote local conhecido \u2014 nada a instalar pelo aluy)");return o.join(`
|
|
140
|
-
`)}function r2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var N0=S(()=>{"use strict"});var $0=S(()=>{"use strict";km();b0();v0();k0();x0();S0();D0();Yu();L0();N0()});function Hb(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(t.trim());if(!e)return null;let o=e[4]?e[4].split(".").map(n=>/^\d+$/.test(n)?Number(n):n):[];return{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),pre:o}}function B0(t,e){let o=Hb(t),n=Hb(e);if(!o||!n)return null;for(let s of["major","minor","patch"])if(o[s]!==n[s])return o[s]<n[s]?-1:1;if(o.pre.length===0&&n.pre.length===0)return 0;if(o.pre.length===0)return 1;if(n.pre.length===0)return-1;let r=Math.max(o.pre.length,n.pre.length);for(let s=0;s<r;s++){let i=o.pre[s],a=n.pre[s];if(i===void 0)return-1;if(a===void 0)return 1;if(i===a)continue;let l=typeof i=="number",c=typeof a=="number";return l&&c?i<a?-1:1:l?-1:c?1:i<a?-1:1}return 0}function qb(t,e){return B0(t,e)===1}var U0=S(()=>{"use strict"});function Em(t,e,o){if(e.size===0)return{kind:"discard",reason:"allowlist vazia (default fechado)"};if(!e.has(t.conversation))return{kind:"discard",reason:`canal ${t.conversation} n\xE3o-allowlistado`};if(t.senderIsBot===!0)return{kind:"discard",reason:"remetente \xE9 bot (anti-loop, TC-6)"};let n=t.content.trim();if(n==="")return{kind:"discard",reason:"mensagem sem conte\xFAdo"};if(o.authIsForgeable)return{kind:"data",text:n};if(t.provenance.kind==="third-party-relayed")return{kind:"data",text:n};let r=t.provenance.embeddedThirdParty?.trim();return r?{kind:"instruction",text:n,forwardedData:r}:{kind:"instruction",text:n}}var Wb=S(()=>{"use strict"});function Gb(t){let e;if(t.forwarded===!0)e={kind:"third-party-relayed"};else{let o=(t.quotedText??"").trim();e=o?{kind:"author-direct",embeddedThirdParty:o}:{kind:"author-direct"}}return{content:t.text,sender:String(t.fromId),conversation:String(t.chatId),provenance:e,...t.isBot===!0?{senderIsBot:!0}:{}}}function zb(t){let e=new Set;for(let o of t)typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&e.add(o);return e}var lc,j0=S(()=>{"use strict";Wb();lc={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function Kb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Yb(t,e){let o=Gi(t);if(!o||o.ok!==!0||!Array.isArray(o.result))return{updates:[],nextOffset:e};let n=[],r=e-1;for(let s of o.result){let i=Gi(s);if(!i)continue;let a=Kb(i.update_id);a!==void 0&&a>r&&(r=a);let l=Gi(i.message);if(!l)continue;let c=Gi(l.chat),u=Kb(c?.id);if(u===void 0||c?.type!=="private")continue;let f=Gi(l.from),d=Kb(f?.id)??u,p=f?.is_bot===!0,h=typeof l.text=="string"?l.text:"",y=l.forward_origin!==void 0||l.forward_from!==void 0||l.forward_from_chat!==void 0||l.forward_sender_name!==void 0||l.forward_date!==void 0,g=(()=>{let E=Gi(l.quote)?.text;return typeof E=="string"&&E.trim()!==""?E:void 0})();n.push({chatId:u,fromId:d,text:h,...y?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var H0=S(()=>{"use strict"});var cc,q0=S(()=>{"use strict";cc=class{maxPerWindow;windowMs;stamps=[];constructor(e,o){this.maxPerWindow=e,this.windowMs=o}tryConsume(e){let o=e-this.windowMs;for(;this.stamps.length>0&&this.stamps[0]<=o;)this.stamps.shift();return this.stamps.length>=this.maxPerWindow?!1:(this.stamps.push(e),!0)}get used(){return this.stamps.length}}});function Vb(t){return`connector-${t}-token`}function uc(t){let e=t.trim(),o=e.indexOf(":");return o<=0?`\u2026(${e.length} chars)`:`${e.slice(0,o)}:\u2026(${e.length-o-1} chars)`}function Xb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var W0=S(()=>{"use strict"});var B=S(()=>{"use strict";UE();cS();xS();Uw();a0();Gy();h0();$0();Eb();Jd();U0();Wb();j0();H0();q0();W0()});import{posix as w8}from"node:path";function A8(t){return w8.normalize(t)}function po(t){let e=A8(t);for(let o of C8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function pv(t){return po(t).kind==="allow"}var C8,$r=S(()=>{"use strict";C8=[{re:/(?:^|\/|~\/)\.ssh(?:\/|$)/,why:"chaves SSH (~/.ssh)",deny:!0},{re:/(?:^|\/|~\/)\.aws(?:\/|$)/,why:"credenciais AWS (~/.aws)",deny:!0},{re:/(?:^|\/|~\/)\.gnupg(?:\/|$)/,why:"chaves GPG (~/.gnupg)",deny:!0},{re:/(?:~\/|\$\{?HOME\}?\/|\/(?:home|Users)\/[^/]+\/)\.aluy\/rooms(?:\/|$)/,why:"arquivos de sala do Aluy (~/.aluy/rooms)",deny:!0},{re:/~\/\.aluy(?:\/|$)/,why:"estado/credencial do Aluy (~/.aluy)",deny:!0},{re:/(?:^|\/)\.aluy(?:\/(?!agents\/|workflows\/|commands\/)|$)/,why:"estado/credencial do Aluy (.aluy/)",deny:!0},{re:/(?:^|\/|~\/)\.config\/gh\/hosts\.yml$/,why:"token do gh CLI",deny:!0},{re:/(?:^|\/|~\/)\.docker\/config\.json$/,why:"credenciais Docker",deny:!0},{re:/(?:^|\/|~\/)\.kube\/config$/,why:"kubeconfig",deny:!0},{re:/(?:^|\/)id_(?:rsa|ed25519|ecdsa|dsa)\b/,why:"chave privada",deny:!0},{re:/\.pem$|\.p12$|\.pfx$|\.key$/i,why:"material de chave privada",deny:!0},{re:/(?:^|[/\w.-])\.env(?:\.(?!example$|sample$|template$|dist$)[\w.-]+)?$/,why:"arquivo .env (segredos)",deny:!1},{re:/(?:^|\/)[^/]*(?:secret|credential|token|apikey|api_key|password|passwd)[^/]*$/i,why:"arquivo com nome sens\xEDvel (token/secret)",deny:!1}]});var Iv={};Ip(Iv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Fv});import{homedir as d3}from"node:os";import{join as Pv}from"node:path";import{readdirSync as m3,readFileSync as f3,mkdirSync as p3,statSync as h3}from"node:fs";var g3,Fv,y3,b3,Hr,Hm=S(()=>{"use strict";B();g3=448,Fv="workflows",y3=64*1024,b3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Pv(d3(),".aluy");this.dir=Pv(o,Fv)}get workflowsDir(){return this.dir}ensureDir(){try{p3(this.dir,{mode:g3,recursive:!0})}catch{}}load(){let e;try{e=m3(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>=b3)break;let a=this.readOne(i);if(a!==null){if(Ul(a)){s.push(a);continue}n.has(a.name)||(n.add(a.name),r.push(a))}}return{workflows:r,errors:s}}readOne(e){let o=Pv(this.dir,e);try{let n=h3(o);if(!n.isFile()||n.size>y3)return null;let r=f3(o,"utf8");return jl(e,r,"global")}catch{return null}}}});var $v={};Ip($v,{PROJECT_WORKFLOWS_DIRNAMES:()=>Nv,ProjectWorkflowsLoader:()=>qr});import{join as v3}from"node:path";import{readdirSync as k3,readFileSync as x3,statSync as E3}from"node:fs";var Nv,S3,w3,qr,qm=S(()=>{"use strict";B();$r();Nv=[".claude/workflows",".aluy/workflows"],S3=64*1024,w3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Nv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=k3(s,{withFileTypes:!0})}catch{continue}let a=i.filter(l=>(l.isFile()||l.isSymbolicLink())&&l.name.toLowerCase().endsWith(".md")).map(l=>l.name).sort((l,c)=>l.localeCompare(c));for(let l of a){if(o.length>=w3)break;let c=this.readOne(r,s,l);if(c!==null){if(Ul(c)){n.push(c);continue}e.has(c.name)||(e.add(c.name),o.push(c))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(po(r).kind!=="allow")return null;let s=v3(o,n);try{this.workspace.resolveInside(r);let i=E3(s);if(!i.isFile()||i.size>S3)return null;let a=x3(s,"utf8");return jl(n,a,"project")}catch{return null}}}});var _M=WI((Vge,TM)=>{TM.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Gn="1.0.0-rc.81";B();var G0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
140
|
+
`)}function r2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var N0=S(()=>{"use strict"});var $0=S(()=>{"use strict";km();b0();v0();k0();x0();S0();D0();Yu();L0();N0()});function Hb(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(t.trim());if(!e)return null;let o=e[4]?e[4].split(".").map(n=>/^\d+$/.test(n)?Number(n):n):[];return{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),pre:o}}function B0(t,e){let o=Hb(t),n=Hb(e);if(!o||!n)return null;for(let s of["major","minor","patch"])if(o[s]!==n[s])return o[s]<n[s]?-1:1;if(o.pre.length===0&&n.pre.length===0)return 0;if(o.pre.length===0)return 1;if(n.pre.length===0)return-1;let r=Math.max(o.pre.length,n.pre.length);for(let s=0;s<r;s++){let i=o.pre[s],a=n.pre[s];if(i===void 0)return-1;if(a===void 0)return 1;if(i===a)continue;let l=typeof i=="number",c=typeof a=="number";return l&&c?i<a?-1:1:l?-1:c?1:i<a?-1:1}return 0}function qb(t,e){return B0(t,e)===1}var U0=S(()=>{"use strict"});function Em(t,e,o){if(e.size===0)return{kind:"discard",reason:"allowlist vazia (default fechado)"};if(!e.has(t.conversation))return{kind:"discard",reason:`canal ${t.conversation} n\xE3o-allowlistado`};if(t.senderIsBot===!0)return{kind:"discard",reason:"remetente \xE9 bot (anti-loop, TC-6)"};let n=t.content.trim();if(n==="")return{kind:"discard",reason:"mensagem sem conte\xFAdo"};if(o.authIsForgeable)return{kind:"data",text:n};if(t.provenance.kind==="third-party-relayed")return{kind:"data",text:n};let r=t.provenance.embeddedThirdParty?.trim();return r?{kind:"instruction",text:n,forwardedData:r}:{kind:"instruction",text:n}}var Wb=S(()=>{"use strict"});function Gb(t){let e;if(t.forwarded===!0)e={kind:"third-party-relayed"};else{let o=(t.quotedText??"").trim();e=o?{kind:"author-direct",embeddedThirdParty:o}:{kind:"author-direct"}}return{content:t.text,sender:String(t.fromId),conversation:String(t.chatId),provenance:e,...t.isBot===!0?{senderIsBot:!0}:{}}}function zb(t){let e=new Set;for(let o of t)typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&e.add(o);return e}var lc,j0=S(()=>{"use strict";Wb();lc={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function Kb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Yb(t,e){let o=Gi(t);if(!o||o.ok!==!0||!Array.isArray(o.result))return{updates:[],nextOffset:e};let n=[],r=e-1;for(let s of o.result){let i=Gi(s);if(!i)continue;let a=Kb(i.update_id);a!==void 0&&a>r&&(r=a);let l=Gi(i.message);if(!l)continue;let c=Gi(l.chat),u=Kb(c?.id);if(u===void 0||c?.type!=="private")continue;let f=Gi(l.from),d=Kb(f?.id)??u,p=f?.is_bot===!0,h=typeof l.text=="string"?l.text:"",y=l.forward_origin!==void 0||l.forward_from!==void 0||l.forward_from_chat!==void 0||l.forward_sender_name!==void 0||l.forward_date!==void 0,g=(()=>{let E=Gi(l.quote)?.text;return typeof E=="string"&&E.trim()!==""?E:void 0})();n.push({chatId:u,fromId:d,text:h,...y?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var H0=S(()=>{"use strict"});var cc,q0=S(()=>{"use strict";cc=class{maxPerWindow;windowMs;stamps=[];constructor(e,o){this.maxPerWindow=e,this.windowMs=o}tryConsume(e){let o=e-this.windowMs;for(;this.stamps.length>0&&this.stamps[0]<=o;)this.stamps.shift();return this.stamps.length>=this.maxPerWindow?!1:(this.stamps.push(e),!0)}get used(){return this.stamps.length}}});function Vb(t){return`connector-${t}-token`}function uc(t){let e=t.trim(),o=e.indexOf(":");return o<=0?`\u2026(${e.length} chars)`:`${e.slice(0,o)}:\u2026(${e.length-o-1} chars)`}function Xb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var W0=S(()=>{"use strict"});var B=S(()=>{"use strict";UE();cS();xS();Uw();a0();Gy();h0();$0();Eb();Jd();U0();Wb();j0();H0();q0();W0()});import{posix as w8}from"node:path";function A8(t){return w8.normalize(t)}function po(t){let e=A8(t);for(let o of C8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function pv(t){return po(t).kind==="allow"}var C8,$r=S(()=>{"use strict";C8=[{re:/(?:^|\/|~\/)\.ssh(?:\/|$)/,why:"chaves SSH (~/.ssh)",deny:!0},{re:/(?:^|\/|~\/)\.aws(?:\/|$)/,why:"credenciais AWS (~/.aws)",deny:!0},{re:/(?:^|\/|~\/)\.gnupg(?:\/|$)/,why:"chaves GPG (~/.gnupg)",deny:!0},{re:/(?:~\/|\$\{?HOME\}?\/|\/(?:home|Users)\/[^/]+\/)\.aluy\/rooms(?:\/|$)/,why:"arquivos de sala do Aluy (~/.aluy/rooms)",deny:!0},{re:/~\/\.aluy(?:\/|$)/,why:"estado/credencial do Aluy (~/.aluy)",deny:!0},{re:/(?:^|\/)\.aluy(?:\/(?!agents\/|workflows\/|commands\/)|$)/,why:"estado/credencial do Aluy (.aluy/)",deny:!0},{re:/(?:^|\/|~\/)\.config\/gh\/hosts\.yml$/,why:"token do gh CLI",deny:!0},{re:/(?:^|\/|~\/)\.docker\/config\.json$/,why:"credenciais Docker",deny:!0},{re:/(?:^|\/|~\/)\.kube\/config$/,why:"kubeconfig",deny:!0},{re:/(?:^|\/)id_(?:rsa|ed25519|ecdsa|dsa)\b/,why:"chave privada",deny:!0},{re:/\.pem$|\.p12$|\.pfx$|\.key$/i,why:"material de chave privada",deny:!0},{re:/(?:^|[/\w.-])\.env(?:\.(?!example$|sample$|template$|dist$)[\w.-]+)?$/,why:"arquivo .env (segredos)",deny:!1},{re:/(?:^|\/)[^/]*(?:secret|credential|token|apikey|api_key|password|passwd)[^/]*$/i,why:"arquivo com nome sens\xEDvel (token/secret)",deny:!1}]});var Iv={};Ip(Iv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Fv});import{homedir as d3}from"node:os";import{join as Pv}from"node:path";import{readdirSync as m3,readFileSync as f3,mkdirSync as p3,statSync as h3}from"node:fs";var g3,Fv,y3,b3,Hr,Hm=S(()=>{"use strict";B();g3=448,Fv="workflows",y3=64*1024,b3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Pv(d3(),".aluy");this.dir=Pv(o,Fv)}get workflowsDir(){return this.dir}ensureDir(){try{p3(this.dir,{mode:g3,recursive:!0})}catch{}}load(){let e;try{e=m3(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>=b3)break;let a=this.readOne(i);if(a!==null){if(Ul(a)){s.push(a);continue}n.has(a.name)||(n.add(a.name),r.push(a))}}return{workflows:r,errors:s}}readOne(e){let o=Pv(this.dir,e);try{let n=h3(o);if(!n.isFile()||n.size>y3)return null;let r=f3(o,"utf8");return jl(e,r,"global")}catch{return null}}}});var $v={};Ip($v,{PROJECT_WORKFLOWS_DIRNAMES:()=>Nv,ProjectWorkflowsLoader:()=>qr});import{join as v3}from"node:path";import{readdirSync as k3,readFileSync as x3,statSync as E3}from"node:fs";var Nv,S3,w3,qr,qm=S(()=>{"use strict";B();$r();Nv=[".claude/workflows",".aluy/workflows"],S3=64*1024,w3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Nv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=k3(s,{withFileTypes:!0})}catch{continue}let a=i.filter(l=>(l.isFile()||l.isSymbolicLink())&&l.name.toLowerCase().endsWith(".md")).map(l=>l.name).sort((l,c)=>l.localeCompare(c));for(let l of a){if(o.length>=w3)break;let c=this.readOne(r,s,l);if(c!==null){if(Ul(c)){n.push(c);continue}e.has(c.name)||(e.add(c.name),o.push(c))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(po(r).kind!=="allow")return null;let s=v3(o,n);try{this.workspace.resolveInside(r);let i=E3(s);if(!i.isFile()||i.size>S3)return null;let a=x3(s,"utf8");return jl(n,a,"project")}catch{return null}}}});var _M=WI((Vge,TM)=>{TM.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Gn="1.0.0-rc.82";B();var G0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
141
141
|
|
|
142
142
|
Uso:
|
|
143
143
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hiperplano/aluy-cli",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.82",
|
|
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",
|