@hiperplano/aluy-cli 1.0.0-rc.124 → 1.0.0-rc.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-bundle/bin/aluy.js +4 -4
- package/dist-bundle/index.js +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 kG=Object.create;var ok=Object.defineProperty;var xG=Object.getOwnPropertyDescriptor;var SG=Object.getOwnPropertyNames;var wG=Object.getPrototypeOf,EG=Object.prototype.hasOwnProperty;var g=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var AG=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Tt=(t,e)=>{for(var o in e)ok(t,o,{get:e[o],enumerable:!0})},CG=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of SG(e))!EG.call(t,r)&&r!==o&&ok(t,r,{get:()=>e[r],enumerable:!(n=xG(e,r))||n.enumerable});return t};var TG=(t,e,o)=>(o=t!=null?kG(wG(t)):{},CG(e||!t||!t.__esModule?ok(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as DG}from"node:os";import{join as RG}from"node:path";function ou(t=DG()){return RG(t,".aluy")}var Qp=g(()=>{"use strict"});var nu,b0=g(()=>{"use strict";nu="1.0.0-rc.
|
|
2
|
+
var kG=Object.create;var ok=Object.defineProperty;var xG=Object.getOwnPropertyDescriptor;var SG=Object.getOwnPropertyNames;var wG=Object.getPrototypeOf,EG=Object.prototype.hasOwnProperty;var g=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var AG=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Tt=(t,e)=>{for(var o in e)ok(t,o,{get:e[o],enumerable:!0})},CG=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of SG(e))!EG.call(t,r)&&r!==o&&ok(t,r,{get:()=>e[r],enumerable:!(n=xG(e,r))||n.enumerable});return t};var TG=(t,e,o)=>(o=t!=null?kG(wG(t)):{},CG(e||!t||!t.__esModule?ok(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as DG}from"node:os";import{join as RG}from"node:path";function ou(t=DG()){return RG(t,".aluy")}var Qp=g(()=>{"use strict"});var nu,b0=g(()=>{"use strict";nu="1.0.0-rc.125"});function nr(t,e){return t.decide(e)}var da=g(()=>{"use strict"});var $r,bs,vs=g(()=>{"use strict";$r="remember",bs="recall"});var nk,_G,zl,rk=g(()=>{"use strict";nk=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}}},_G=200,zl=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??_G,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 nk(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 Zp(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 x0(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"&&OG.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 d of l){let m=x0(d,!1);if(typeof m=="string")return m;c.push(m)}r=c}}}if(o===void 0||o.trim()==="")return PG;let s=o.trim().slice(0,MG);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function LG(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=x0(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(d=>({...d,title:r(d.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Zp(o).length;return s>v0?{error:`update_plan: no m\xE1ximo ${v0} passos (recebidos ${s}).`}:{steps:o}}function IG(t){let e=Zp(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${S0[r.step.status]} ${r.step.title}`).join(`
|
|
3
3
|
`);return`plano (${o}/${e.length}):
|
|
4
4
|
${n}`}function FG(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function $G(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,d=o.get(i.title),m=d??zl.boxId(i.title,0);return d?(i.status!=="completed"&&e.isClosed(d)&&e.reopenBox(d),e.setHorizon(d,c),e.setParent(d,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=FG(a,n),c=r(i,null,l);for(let d of i.substeps??[])r(d,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 BG(t,e){if(!e)return IG(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,d=new Set)=>{let m=r.get(c);if(m!==void 0)return m;let u=n.get(c);if(!u||!u.parentId||d.has(c))return r.set(c,0),0;let p=s(u.parentId,new Set(d).add(c))+1;return r.set(c,p),p},i=Zp(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:d}of i){let m=o.get(c.title),u=m?NG[m.horizon]:"",p=m?s(m.id):d,h=" ".repeat(p),b=S0[c.status];l.push(`${h}${u} ${b} ${c.title}`)}return l.join(`
|
|
5
5
|
`)}var ru,OG,v0,MG,PG,S0,NG,k0,UG,w0,eg=g(()=>{"use strict";rk();ru="update_plan";OG=new Set(["pending","in_progress","completed"]),v0=30,MG=120,PG="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";S0={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};NG={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};k0=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),UG=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:k0,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:k0},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),w0={name:ru,effect:"read",group:"plano",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:UG,async run(t,e){let o=LG(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&$G(o.steps,e.graph),e.plan&&e.plan.set(Zp(o.steps).map(r=>({title:r.step.title,status:r.step.status}))),{ok:!0,observation:BG(o.steps,e.graph)})}}});function E0(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)?qG(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&jG.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 qG(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 HG(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(`
|
|
@@ -175,7 +175,7 @@ ${t.trim()}`}}function CI(t,e,o=Om){let{older:n,recent:r}=Mh(t,o);if(n.length===
|
|
|
175
175
|
`);let i=Uo(process.execPath,[n,"-p",o,"--yolo","--no-self-check","--anonymous"],{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=_e($n(),Ds),c=_e(l,dr);ut(l)&&dy(my(),c)}catch{}t==="ollama"&&(await _7(),O7()),process.stderr.write(`
|
|
176
176
|
verificando "${t}"\u2026 (alguns segundos; a pr\xF3xima etapa vem em seguida)
|
|
177
177
|
`);let a=await tF(t,process.platform,!0);for(let l=0;l<T7&&!a;l++)await R7(D7),a=await tF(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 R7(t){return new Promise(e=>setTimeout(e,t))}async function _7(){for(let t of[lr,fy()])try{await(await fetch(`http://${Nn}:${zr}/api/pull`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,stream:!1})})).text()}catch{}}function O7(){if(process.platform!=="win32")try{let t=Uo("sh",["-lc","command -v ollama"],{encoding:"utf8",timeout:1e4});if(t.status===0&&(t.stdout??"").trim()!=="")return;let e=uy(),n=["/usr/local/bin/ollama","/usr/bin/ollama","/opt/homebrew/bin/ollama",_e(e,".ollama","bin","ollama"),_e($n(),yi,"bin","ollama")].find(i=>ut(i));if(n===void 0)return;let r=_e(e,".local","bin");eA(r,{recursive:!0});let s=_e(r,"ollama");try{if(JN(s)===JN(n))return;c7(s)}catch{}try{l7(n,s)}catch{}}catch{}}function M7(){try{return Uo("python3",["-m","venv","--help"],{timeout:1e4}).status===0}catch{return!1}}function P7(){try{return Uo("python3",["-m","pip","--version"],{timeout:1e4}).status===0}catch{return!1}}function L7(t){let e=[],o=[];if(t.has("ollama")&&(nF()||(e.push("zstd (extrair o Ollama)"),o.push("zstd")),rF()||(e.push("tar (extrair o Ollama)"),o.push("tar"))),t.has("mem0")||t.has("headroom")){let r=oA();r.ok?(M7()||(e.push("m\xF3dulo venv do Python (mem0/headroom criam um virtualenv)"),o.push("python3-venv")),P7()||(e.push("pip do Python (mem0/headroom instalam pacotes)"),o.push("python3-pip"))):(e.push(`python3 >= ${Lm} 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 iF(t,e,o){let n=t??"turbo",r=cr(e??{}),s=o?.useAgent!==!1,i=new ZE({...o?.platform?{platform:o.platform}:{},...s?{agentInstaller:C7}:{}});if(!s)for(let a of L7(r))process.stderr.write(a+`
|
|
178
|
-
`);return i.provisionAll(n,r)}var oF,Uc,f7,dr,ZN,ZE,eF,E7,T7,D7,nA=g(()=>{"use strict";N();oF=".aluy",Uc=448,f7=384;dr="aluy-mem0-server.py";ZN="application/vnd.ollama.image.model";ZE=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=_e($n(),yi,"bin","ollama");return ut(o)}case"mem0":{let o=_e($n(),Ds,"bin","python3");return ut(o)&&Vm(o)}case"headroom":{let o=_e($n(),bi,"bin","headroom");return ut(o)}default:return!1}}async provision(e,o){let n=u7().uid;if(gE(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 b7();case"mem0":return S7();case"headroom":return w7();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!Nm(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(d){let m=d instanceof Error?d.message:String(d);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}}},eF="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",E7="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. ";T7=24,D7=5e3});var Bn,qc=g(()=>{"use strict";Bn="1.0.0-rc.124"});var uF={};Tt(uF,{HELP_TEXT:()=>lF,parseArgs:()=>rA,suggestFlag:()=>U7,versionText:()=>cF});function Dt(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 I7(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 N7(t,e){let o=[],n=new Set,r=`--${e}=`;for(let s=0;s<t.length;s++){let i=t[s];if(i!==void 0){if(i===`--${e}`){let a=t[s+1];a!==void 0&&!a.startsWith("-")&&(o.push(a),n.add(s+1));continue}i.startsWith(r)&&o.push(i.slice(r.length))}}return{values:o,valueIndices:n}}function cF(){return`aluy ${Bn} (@hiperplano/aluy-cli-core ${nu})`}function B7(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 U7(t){let e,o=3;for(let n of dF){let r=B7(t,n);r<o&&(o=r,e=n)}return e}function j7(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===""||dF.has(s)||o.push(`--${s}`)}return o}function rA(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let K=t.slice(1),v=Dt(K,"token"),ft=Dt(K,"org"),$t=K.includes("--device"),ot=Dt(K,"provider"),tr=K.includes("--oauth");return{kind:"login",forceDeviceFlow:$t,...v!==void 0?{token:v}:{},...ft!==void 0?{org:ft}:{},...ot!==void 0?{provider:ot}:{},...tr?{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 K=t.includes("--deep")||t.includes("--test"),v=t.includes("--json");return{kind:"doctor",deep:K,json:v}}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 K=t.includes("--json"),v=t.findIndex($t=>$t==="--backend"||$t.startsWith("--backend=")),ft="both";if(v!==-1){let ot=(t[v].includes("=")?t[v].slice(10):t[v+1]??"").trim().toLowerCase();ot==="local"?ft="local":ot==="broker"&&(ft="broker")}return{kind:"models",scope:ft,json:K,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let K=t[1];if(K===void 0||!["login","logout","allow","deny","status"].includes(K))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let ft=t.slice(2);if(K==="login"){let $t=Dt(ft,"token");return{kind:"telegram",sub:"login",...$t!==void 0?{token:$t}:{}}}if(K==="allow"||K==="deny"){let $t=ft.find(tr=>!tr.startsWith("-")),ot=$t!==void 0&&/^-?\d+$/.test($t)?Number($t):void 0;return ot===void 0?{kind:"usage-error",message:`uso: aluy telegram ${K} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:K,chatId:ot}}return{kind:"telegram",sub:K}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(v=>!v.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(e==="service")return{kind:"service",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:cF()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:lF};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,d=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,u=Dt(t,"tier"),p=Dt(t,"lang"),h=Dt(t,"max-tokens"),b=Dt(t,"max-iterations"),y=Dt(t,"max-output-tokens"),S=!(t.includes("--no-subagents")||t.includes("--no-subagent")),x=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,w=t.includes("--no-autocompact")?"off":Dt(t,"autocompact-at"),T=t.includes("--quiet")?!0:void 0,P=t.includes("--cycle")?!0:void 0,O=Dt(t,"cycles"),H=Dt(t,"cycle-for"),{values:M,valueIndices:B}=N7(t,"image"),Y=Dt(t,"backend"),q=Dt(t,"local-provider"),z=Dt(t,"local-model"),L=Dt(t,"local-auth"),U=Dt(t,"local-base-url"),ue=Dt(t,"model"),de=Dt(t,"provider");if((t.includes("--provider")||t.some(K=>K.startsWith("--provider=")))&&(ue===void 0||ue.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((ue===void 0||ue.trim()==="")&&u!==void 0&&u.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 ie=Dt(t,"effort"),he=t.includes("--effort")||t.some(K=>K.startsWith("--effort=")),$;if(ie!==void 0){if(ie.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(ie.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};$=ie}else if(he)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let fe=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(K=>K.startsWith("-p=")||K.startsWith("--print=")||K.startsWith("--exec=")),me=fe?Dt(t,"print",{allowDashValue:!0})??Dt(t,"exec",{allowDashValue:!0})??I7(t,"p")??void 0:void 0,ne=fe?Dt(t,"output-format"):void 0;if(ne!==void 0&&!["text","json","stream-json"].includes(ne.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${ne}" (use text | json | stream-json)`,exitCode:2};let qe=t.includes("--new"),eo=t.includes("--continue"),et=t.indexOf("--resume"),At=t.find(K=>K.startsWith("--resume=")),Ne=et>=0||At!==void 0,at=t.includes("--anonymous");if(at&&(eo||Ne))return{kind:"usage-error",message:"aluy: --anonymous n\xE3o combina com --continue/--resume (retomar precisa de uma sess\xE3o salva; an\xF4nimo n\xE3o grava nenhuma). Escolha um dos dois.",exitCode:2};let _t;if(At!==void 0)_t=At.slice(9);else if(et>=0){let K=t[et+1];K!==void 0&&!K.startsWith("-")&&(_t=K)}let Fe=u!==void 0?t.indexOf("--tier")+1:-1,mt=p!==void 0&&!t.some(K=>K.startsWith("--lang="))?t.indexOf("--lang")+1:-1,G=_t!==void 0&&At===void 0?et+1:-1,De=h!==void 0&&!t.some(K=>K.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,Ye=b!==void 0&&!t.some(K=>K.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,Q=O!==void 0&&!t.some(K=>K.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Ce=H!==void 0&&!t.some(K=>K.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,to=y!==void 0&&!t.some(K=>K.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,Vo=w!==void 0&&!t.includes("--no-autocompact")&&!t.some(K=>K.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,Lo=Y!==void 0&&!t.some(K=>K.startsWith("--backend="))?t.indexOf("--backend")+1:-1,Ft=(K,v)=>v!==void 0&&!t.some(ft=>ft.startsWith(`--${K}=`))?t.indexOf(`--${K}`)+1:-1,Or=Ft("local-provider",q),re=Ft("local-model",z),Te=Ft("local-auth",L),Nt=Ft("local-base-url",U),lt=ue!==void 0&&!t.some(K=>K.startsWith("--model="))?t.indexOf("--model")+1:-1,Mr=de!==void 0&&!t.some(K=>K.startsWith("--provider="))?t.indexOf("--provider")+1:-1,Js=$!==void 0&&!t.some(K=>K.startsWith("--effort="))?t.indexOf("--effort")+1:-1,er=ne!==void 0&&!t.some(K=>K.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,ra=me!==void 0&&!t.some(K=>K.startsWith("-p=")||K.startsWith("--print=")||K.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,Pr=t.find((K,v)=>!K.startsWith("-")&&v!==Fe&&v!==mt&&v!==Lo&&v!==Or&&v!==re&&v!==Te&&v!==Nt&&v!==lt&&v!==Mr&&v!==Js&&v!==er&&v!==ra&&v!==G&&v!==De&&v!==Ye&&v!==to&&v!==Vo&&v!==Q&&v!==Ce&&!B.has(v)),lo=(me??Pr??"").trim();if(lo!==""&&!/\s/.test(lo)&&$7.has(lo.toLowerCase()))return{kind:"usage-error",message:`aluy: "${lo}" \xE9 um comando de SESS\xC3O, n\xE3o um objetivo. Use /${lo} 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 "${lo} o arquivo X"\`).`,exitCode:2};let Mn=eo?{kind:"continue"}:Ne?{kind:"resume",..._t!==void 0?{id:_t}:{}}:void 0,Io=new Set([Fe,mt,Lo,Or,re,Te,Nt,lt,Mr,Js,er,ra,G,De,Ye,to,Vo,Q,Ce].filter(K=>K>=0));for(let K of B)Io.add(K);for(let K of F7){let v=t.indexOf(K);v>=0&&!t[v].includes("=")&&Io.add(v+1)}let gs=j7(t,Io);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...gs.length>0?{unknownFlags:gs}:{},dense:i,fresh:qe,anonymous:at,subAgents:S,safeGlyphs:a,telegram:l,print:fe,...c!==void 0?{split:c}:{},...d!==void 0?{fullscreen:d}:{},...m!==void 0?{budget:m}:{},...Pr!==void 0?{goal:Pr}:{},...u!==void 0?{tier:u}:{},...Y!==void 0?{backend:Y}:{},...q!==void 0?{localProvider:q}:{},...z!==void 0?{localModel:z}:{},...L!==void 0?{localAuth:L}:{},...U!==void 0?{localBaseUrl:U}:{},...ue!==void 0?{model:ue}:{},...de!==void 0?{provider:de}:{},...$!==void 0?{effort:$}:{},...me!==void 0?{printArg:me}:{},...ne!==void 0?{outputFormat:ne}:{},...p!==void 0?{lang:p}:{},...Mn!==void 0?{resume:Mn}:{},...h!==void 0?{maxTokens:h}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...x!==void 0?{selfCheck:x}:{},...w!==void 0?{autoCompactAt:w}:{},...T!==void 0?{quiet:T}:{},...P!==void 0?{cycle:P}:{},...O!==void 0?{cycles:O}:{},...H!==void 0?{cycleFor:H}:{},...M.length>0?{images:M}:{}}}var lF,dF,F7,$7,sA=g(()=>{"use strict";N();qc();lF=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
178
|
+
`);return i.provisionAll(n,r)}var oF,Uc,f7,dr,ZN,ZE,eF,E7,T7,D7,nA=g(()=>{"use strict";N();oF=".aluy",Uc=448,f7=384;dr="aluy-mem0-server.py";ZN="application/vnd.ollama.image.model";ZE=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=_e($n(),yi,"bin","ollama");return ut(o)}case"mem0":{let o=_e($n(),Ds,"bin","python3");return ut(o)&&Vm(o)}case"headroom":{let o=_e($n(),bi,"bin","headroom");return ut(o)}default:return!1}}async provision(e,o){let n=u7().uid;if(gE(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 b7();case"mem0":return S7();case"headroom":return w7();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!Nm(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(d){let m=d instanceof Error?d.message:String(d);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}}},eF="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",E7="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. ";T7=24,D7=5e3});var Bn,qc=g(()=>{"use strict";Bn="1.0.0-rc.125"});var uF={};Tt(uF,{HELP_TEXT:()=>lF,parseArgs:()=>rA,suggestFlag:()=>U7,versionText:()=>cF});function Dt(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 I7(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 N7(t,e){let o=[],n=new Set,r=`--${e}=`;for(let s=0;s<t.length;s++){let i=t[s];if(i!==void 0){if(i===`--${e}`){let a=t[s+1];a!==void 0&&!a.startsWith("-")&&(o.push(a),n.add(s+1));continue}i.startsWith(r)&&o.push(i.slice(r.length))}}return{values:o,valueIndices:n}}function cF(){return`aluy ${Bn} (@hiperplano/aluy-cli-core ${nu})`}function B7(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 U7(t){let e,o=3;for(let n of dF){let r=B7(t,n);r<o&&(o=r,e=n)}return e}function j7(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===""||dF.has(s)||o.push(`--${s}`)}return o}function rA(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let K=t.slice(1),v=Dt(K,"token"),ft=Dt(K,"org"),$t=K.includes("--device"),ot=Dt(K,"provider"),tr=K.includes("--oauth");return{kind:"login",forceDeviceFlow:$t,...v!==void 0?{token:v}:{},...ft!==void 0?{org:ft}:{},...ot!==void 0?{provider:ot}:{},...tr?{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 K=t.includes("--deep")||t.includes("--test"),v=t.includes("--json");return{kind:"doctor",deep:K,json:v}}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 K=t.includes("--json"),v=t.findIndex($t=>$t==="--backend"||$t.startsWith("--backend=")),ft="both";if(v!==-1){let ot=(t[v].includes("=")?t[v].slice(10):t[v+1]??"").trim().toLowerCase();ot==="local"?ft="local":ot==="broker"&&(ft="broker")}return{kind:"models",scope:ft,json:K,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let K=t[1];if(K===void 0||!["login","logout","allow","deny","status"].includes(K))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let ft=t.slice(2);if(K==="login"){let $t=Dt(ft,"token");return{kind:"telegram",sub:"login",...$t!==void 0?{token:$t}:{}}}if(K==="allow"||K==="deny"){let $t=ft.find(tr=>!tr.startsWith("-")),ot=$t!==void 0&&/^-?\d+$/.test($t)?Number($t):void 0;return ot===void 0?{kind:"usage-error",message:`uso: aluy telegram ${K} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:K,chatId:ot}}return{kind:"telegram",sub:K}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(v=>!v.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(e==="service")return{kind:"service",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:cF()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:lF};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,d=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,u=Dt(t,"tier"),p=Dt(t,"lang"),h=Dt(t,"max-tokens"),b=Dt(t,"max-iterations"),y=Dt(t,"max-output-tokens"),S=!(t.includes("--no-subagents")||t.includes("--no-subagent")),x=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,w=t.includes("--no-autocompact")?"off":Dt(t,"autocompact-at"),T=t.includes("--quiet")?!0:void 0,P=t.includes("--cycle")?!0:void 0,O=Dt(t,"cycles"),H=Dt(t,"cycle-for"),{values:M,valueIndices:B}=N7(t,"image"),Y=Dt(t,"backend"),q=Dt(t,"local-provider"),z=Dt(t,"local-model"),L=Dt(t,"local-auth"),U=Dt(t,"local-base-url"),ue=Dt(t,"model"),de=Dt(t,"provider");if((t.includes("--provider")||t.some(K=>K.startsWith("--provider=")))&&(ue===void 0||ue.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((ue===void 0||ue.trim()==="")&&u!==void 0&&u.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 ie=Dt(t,"effort"),he=t.includes("--effort")||t.some(K=>K.startsWith("--effort=")),$;if(ie!==void 0){if(ie.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(ie.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};$=ie}else if(he)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let fe=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(K=>K.startsWith("-p=")||K.startsWith("--print=")||K.startsWith("--exec=")),me=fe?Dt(t,"print",{allowDashValue:!0})??Dt(t,"exec",{allowDashValue:!0})??I7(t,"p")??void 0:void 0,ne=fe?Dt(t,"output-format"):void 0;if(ne!==void 0&&!["text","json","stream-json"].includes(ne.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${ne}" (use text | json | stream-json)`,exitCode:2};let qe=t.includes("--new"),eo=t.includes("--continue"),et=t.indexOf("--resume"),At=t.find(K=>K.startsWith("--resume=")),Ne=et>=0||At!==void 0,at=t.includes("--anonymous");if(at&&(eo||Ne))return{kind:"usage-error",message:"aluy: --anonymous n\xE3o combina com --continue/--resume (retomar precisa de uma sess\xE3o salva; an\xF4nimo n\xE3o grava nenhuma). Escolha um dos dois.",exitCode:2};let _t;if(At!==void 0)_t=At.slice(9);else if(et>=0){let K=t[et+1];K!==void 0&&!K.startsWith("-")&&(_t=K)}let Fe=u!==void 0?t.indexOf("--tier")+1:-1,mt=p!==void 0&&!t.some(K=>K.startsWith("--lang="))?t.indexOf("--lang")+1:-1,G=_t!==void 0&&At===void 0?et+1:-1,De=h!==void 0&&!t.some(K=>K.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,Ye=b!==void 0&&!t.some(K=>K.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,Q=O!==void 0&&!t.some(K=>K.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Ce=H!==void 0&&!t.some(K=>K.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,to=y!==void 0&&!t.some(K=>K.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,Vo=w!==void 0&&!t.includes("--no-autocompact")&&!t.some(K=>K.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,Lo=Y!==void 0&&!t.some(K=>K.startsWith("--backend="))?t.indexOf("--backend")+1:-1,Ft=(K,v)=>v!==void 0&&!t.some(ft=>ft.startsWith(`--${K}=`))?t.indexOf(`--${K}`)+1:-1,Or=Ft("local-provider",q),re=Ft("local-model",z),Te=Ft("local-auth",L),Nt=Ft("local-base-url",U),lt=ue!==void 0&&!t.some(K=>K.startsWith("--model="))?t.indexOf("--model")+1:-1,Mr=de!==void 0&&!t.some(K=>K.startsWith("--provider="))?t.indexOf("--provider")+1:-1,Js=$!==void 0&&!t.some(K=>K.startsWith("--effort="))?t.indexOf("--effort")+1:-1,er=ne!==void 0&&!t.some(K=>K.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,ra=me!==void 0&&!t.some(K=>K.startsWith("-p=")||K.startsWith("--print=")||K.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,Pr=t.find((K,v)=>!K.startsWith("-")&&v!==Fe&&v!==mt&&v!==Lo&&v!==Or&&v!==re&&v!==Te&&v!==Nt&&v!==lt&&v!==Mr&&v!==Js&&v!==er&&v!==ra&&v!==G&&v!==De&&v!==Ye&&v!==to&&v!==Vo&&v!==Q&&v!==Ce&&!B.has(v)),lo=(me??Pr??"").trim();if(lo!==""&&!/\s/.test(lo)&&$7.has(lo.toLowerCase()))return{kind:"usage-error",message:`aluy: "${lo}" \xE9 um comando de SESS\xC3O, n\xE3o um objetivo. Use /${lo} 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 "${lo} o arquivo X"\`).`,exitCode:2};let Mn=eo?{kind:"continue"}:Ne?{kind:"resume",..._t!==void 0?{id:_t}:{}}:void 0,Io=new Set([Fe,mt,Lo,Or,re,Te,Nt,lt,Mr,Js,er,ra,G,De,Ye,to,Vo,Q,Ce].filter(K=>K>=0));for(let K of B)Io.add(K);for(let K of F7){let v=t.indexOf(K);v>=0&&!t[v].includes("=")&&Io.add(v+1)}let gs=j7(t,Io);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...gs.length>0?{unknownFlags:gs}:{},dense:i,fresh:qe,anonymous:at,subAgents:S,safeGlyphs:a,telegram:l,print:fe,...c!==void 0?{split:c}:{},...d!==void 0?{fullscreen:d}:{},...m!==void 0?{budget:m}:{},...Pr!==void 0?{goal:Pr}:{},...u!==void 0?{tier:u}:{},...Y!==void 0?{backend:Y}:{},...q!==void 0?{localProvider:q}:{},...z!==void 0?{localModel:z}:{},...L!==void 0?{localAuth:L}:{},...U!==void 0?{localBaseUrl:U}:{},...ue!==void 0?{model:ue}:{},...de!==void 0?{provider:de}:{},...$!==void 0?{effort:$}:{},...me!==void 0?{printArg:me}:{},...ne!==void 0?{outputFormat:ne}:{},...p!==void 0?{lang:p}:{},...Mn!==void 0?{resume:Mn}:{},...h!==void 0?{maxTokens:h}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...x!==void 0?{selfCheck:x}:{},...w!==void 0?{autoCompactAt:w}:{},...T!==void 0?{quiet:T}:{},...P!==void 0?{cycle:P}:{},...O!==void 0?{cycles:O}:{},...H!==void 0?{cycleFor:H}:{},...M.length>0?{images:M}:{}}}var lF,dF,F7,$7,sA=g(()=>{"use strict";N();qc();lF=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
179
179
|
|
|
180
180
|
Uso:
|
|
181
181
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
|
@@ -803,7 +803,7 @@ Notas:
|
|
|
803
803
|
privil\xE9gios. S\xF3 plugue servers que voc\xEA confia. A credencial do Aluy NUNCA \xE9
|
|
804
804
|
repassada ao server.`;Mue=256*1024});function _6(){return new Wa($R,BR)}async function O6(t,e){let o=bw(t.channel);if(o===void 0)return{reason:t.channel===void 0?'servi\xE7o sem "channel:" declarado':`"channel: ${t.channel}" n\xE3o \xE9 um canal Telegram suportado (\xFAnica fase v1)`};let n=e.secretStore??new Jr("telegram"),r;try{r=await n.get()}catch{r=null}if(r===null||r.trim()==="")return{reason:'sem token de Telegram no keychain \u2014 rode "aluy telegram login"'};let s=e.clientFactory?e.clientFactory(r):new Gd({token:r});return{chatId:o,client:s}}async function M6(t,e,o){let n=o.log,r=await O6(t,o);if(!("client"in r)){n(`[service/channel] mensagem N\xC3O enviada (fail-open) \u2014 ${r.reason}.`);return}let s=o.now??Date.now;if(!o.egressLimiter.tryConsume(s())){n("[service/channel] teto anti-spam atingido \u2014 mensagem N\xC3O enviada.");return}try{await r.client.send(r.chatId,e)||n("[service/channel] falha ao enviar (Bot API recusou/erro de rede) \u2014 seguindo (fail-open).")}catch(i){n(`[service/channel] erro ao enviar \u2014 ${r.client.safeForLog(String(i))}`)}}async function r0(t,e,o){await M6(t,sw(e),o)}async function qp(t,e,o){await M6(t,iw(t.name,e),o)}async function Iue(t){let{stop:e,localAnswer:o,timeoutMs:n,now:r,log:s}=t,i=r(),a=new AbortController,l=()=>a.abort();e.addEventListener("abort",l,{once:!0});let c=o.waitForAnswer(a.signal).then(d=>({kind:"local",text:d}));try{for(;!e.aborted;){if(yh(i,r(),n))return s('[service/channel] ask-espera (sem canal remoto): TIMEOUT \u2014 o dono n\xE3o entrou por "aluy service attach"; turno encerra sem a\xE7\xE3o.'),{kind:"timeout"};let d,m=new Promise(p=>{d=setTimeout(()=>p({kind:"tick"}),Lue),d.unref?.()}),u=await Promise.race([c,m]);if(d!==void 0&&clearTimeout(d),u.kind==="local")return s('[service/channel] resposta recebida via "aluy service attach" \u2014 retomando o turno de onde parou.'),{kind:"answered",text:u.text}}return{kind:"stopped"}}finally{a.abort(),e.removeEventListener("abort",l)}}async function P6(t){let{manifest:e,question:o,stop:n,deps:r}=t,s=r.log,i=r.now??Date.now,a=r.askTimeoutMs??hh,l=process.env[R6];if(l!==void 0)return s(`[service/channel] ${R6} setado \u2014 resposta mockada TEST-ONLY (sem rede real).`),{kind:"answered",text:l};let c=await O6(e,r);if(!("client"in c))return t.localAnswer!==void 0?(s(`[service/channel] sem canal remoto (${c.reason}) \u2014 ESPERANDO o dono por "aluy service attach" (a pergunta est\xE1 no log e em "aluy service status").`),Iue({stop:n,localAnswer:t.localAnswer,timeoutMs:a,now:i,log:s})):(s(`[service/channel] ask-espera n\xE3o enviada (fail-open) \u2014 ${c.reason}.`),{kind:"no-channel",reason:c.reason});let{chatId:d,client:m}=c,u=aw(e.name,o);if(!r.egressLimiter.tryConsume(i()))s("[service/channel] ask-espera: teto anti-spam atingido \u2014 pergunta N\xC3O enviada; aguardando mesmo assim.");else try{let b=await m.send(d,u);s(b?`[service/channel] pergunta enviada ao canal (chat ${d}) \u2014 aguardando resposta do dono.`:"[service/channel] falha ao enviar a pergunta (Bot API recusou/erro de rede) \u2014 aguardando mesmo assim.")}catch(b){s(`[service/channel] erro ao enviar a pergunta \u2014 ${m.safeForLog(String(b))}`)}let p=i(),h=new Set([d]);for(;!n.aborted;){if(yh(p,i(),a)){let T=i()-p,P=cw(e.name,o,T);if(r.egressLimiter.tryConsume(i()))try{await m.send(d,P)}catch{}return s("[service/channel] ask-espera: TIMEOUT \u2014 sem resposta do dono; turno encerra sem a\xE7\xE3o."),{kind:"timeout"}}let b=new AbortController,y=()=>b.abort();n.addEventListener("abort",y,{once:!0});let S=m.poll(b.signal).then(T=>({kind:"poll",updates:T})).catch(()=>({kind:"poll",updates:[]})),x=t.localAnswer?.waitForAnswer(b.signal).then(T=>({kind:"local",text:T})),w=x?await Promise.race([S,x]):await S;if(b.abort(),n.removeEventListener("abort",y),n.aborted)break;if(w.kind==="local")return s('[service/channel] resposta LOCAL recebida via "aluy service attach" \u2014 retomando o turno de onde parou.'),{kind:"answered",text:w.text};for(let T of w.updates){let P=NE(T,h);if(P.kind==="instruction")return s("[service/channel] dono respondeu no canal \u2014 retomando o turno de onde parou."),{kind:"answered",text:P.text};P.kind==="discard"?s(`[service/channel] ask-espera: ingresso descartado (${P.reason}).`):s("[service/channel] ask-espera: ingresso classificado como DADO (n\xE3o-confi\xE1vel) \u2014 ignorado.")}}return{kind:"stopped"}}var R6,Lue,L6=g(()=>{"use strict";N();ef();$v();UR();R6="ALUY_SERVICE_ASK_TEST_REPLY";Lue=1e3});import{createServer as Nue}from"node:net";import{existsSync as I6,mkdirSync as Fue,unlinkSync as N6,chmodSync as $ue}from"node:fs";function F6(t,e,o){let n=jv(t),r=new Set,s,i=l=>{for(let c of r)try{c.write(l)}catch{}},a;try{if(Fue(Dr(t),{mode:Uue,recursive:!0}),I6(n))try{N6(n)}catch{}a=Nue(l=>{if(r.add(l),l.setEncoding("utf8"),s)try{l.write(wc({t:"state",turnState:s.turnState,atIso:new Date().toISOString(),...s.detail!==void 0?{detail:s.detail}:{}}))}catch{}let c="";l.on("data",m=>{c+=typeof m=="string"?m:m.toString("utf8");let u=c.indexOf(`
|
|
805
805
|
`);for(;u!==-1;){let p=c.slice(0,u);c=c.slice(u+1);let h=xw(p);h?.t==="say"&&e.onSay(h.text),u=c.indexOf(`
|
|
806
|
-
`)}});let d=()=>{r.delete(l)};l.on("error",d),l.on("close",d)}),a.on("error",l=>{o(`[attach] erro no socket (${n}) \u2014 ${String(l)}.`)}),a.listen(n,()=>{try{$ue(n,Bue)}catch{}o(`[attach] socket dispon\xEDvel em ${n} \u2014 "aluy service attach" pode conectar.`)})}catch(l){o(`[attach] falha ao subir o socket de attach \u2014 ${String(l)}. Servi\xE7o segue sem attach.`)}return{broadcastLog:l=>{i(wc({t:"log",line:l,atIso:new Date().toISOString()}))},broadcastState:(l,c)=>{s={turnState:l,...c!==void 0?{detail:c}:{}},i(wc({t:"state",turnState:l,atIso:new Date().toISOString(),...c!==void 0?{detail:c}:{}}))},broadcastBlock:(l,c)=>{i(wc({t:"block",role:l,text:c,atIso:new Date().toISOString()}))},clientCount:()=>r.size,close:()=>{for(let l of r)try{l.end()}catch{}r.clear();try{a?.close()}catch{}try{I6(n)&&N6(n)}catch{}}}}var Bue,Uue,$6=g(()=>{"use strict";N();Qi();Bue=384,Uue=448});import{join as jue}from"node:path";function B6(){return{emittedCount:0}}function que(t){switch(t.kind){case"you":return t.text.trim()===""?void 0:{role:"you",text:t.text};case"aluy":return t.text.trim()===""?void 0:{role:"aluy",text:t.text};case"tool":return{role:"tool",text:`${t.verb} ${t.target} \u2192 ${t.result||t.status}`}
|
|
806
|
+
`)}});let d=()=>{r.delete(l)};l.on("error",d),l.on("close",d)}),a.on("error",l=>{o(`[attach] erro no socket (${n}) \u2014 ${String(l)}.`)}),a.listen(n,()=>{try{$ue(n,Bue)}catch{}o(`[attach] socket dispon\xEDvel em ${n} \u2014 "aluy service attach" pode conectar.`)})}catch(l){o(`[attach] falha ao subir o socket de attach \u2014 ${String(l)}. Servi\xE7o segue sem attach.`)}return{broadcastLog:l=>{i(wc({t:"log",line:l,atIso:new Date().toISOString()}))},broadcastState:(l,c)=>{s={turnState:l,...c!==void 0?{detail:c}:{}},i(wc({t:"state",turnState:l,atIso:new Date().toISOString(),...c!==void 0?{detail:c}:{}}))},broadcastBlock:(l,c)=>{i(wc({t:"block",role:l,text:c,atIso:new Date().toISOString()}))},clientCount:()=>r.size,close:()=>{for(let l of r)try{l.end()}catch{}r.clear();try{a?.close()}catch{}try{I6(n)&&N6(n)}catch{}}}}var Bue,Uue,$6=g(()=>{"use strict";N();Qi();Bue=384,Uue=448});import{join as jue}from"node:path";function B6(){return{emittedCount:0}}function que(t){switch(t.kind){case"you":return t.text.trim()===""?void 0:{role:"you",text:t.text};case"aluy":return t.text.trim()===""?void 0:{role:"aluy",text:t.text};case"tool":{let e=t.status==="err"?(t.output??"").trim():"",o=e!==""?`: ${e}`:"";return{role:"tool",text:`${t.verb} ${t.target} \u2192 ${t.result||t.status}${o}`}}case"bang":return{role:"bang",text:`! ${t.command} (${t.status})`};case"note":return{role:"note",text:`${t.title}: ${t.lines.join(" ")}`};case"inject":return t.text.trim()===""?void 0:{role:"you",text:t.text};case"broker-error":return{role:"erro",text:t.message};case"deny":case"doctor":case"subagents":case"testrun":return;default:return}}function U6(t,e){try{let o=new tl({baseDir:jue(t,".state")}),r=o.list()[0];if(r===void 0)return[];r.id!==e.sessionId&&(e.sessionId=r.id,e.emittedCount=0);let s=o.load(r.id);if(s===null)return[];let i=s.blocks.slice(e.emittedCount);e.emittedCount=s.blocks.length;let a=[];for(let l of i){let c=que(l);c!==void 0&&a.push(c)}return a}catch{return[]}}var j6=g(()=>{"use strict";Zy()});var Vv,q6=g(()=>{"use strict";Vv=class{pendingResolvers=[];queuedAnswers=[];submit(e){let o=this.pendingResolvers.shift();if(o){o(e);return}this.queuedAnswers.push(e)}waitForAnswer(e){return new Promise(o=>{let n=this.queuedAnswers.shift();if(n!==void 0){o(n);return}if(e.aborted)return;let r=i=>{e.removeEventListener("abort",s),o(i)},s=()=>{let i=this.pendingResolvers.indexOf(r);i>=0&&this.pendingResolvers.splice(i,1)};this.pendingResolvers.push(r),e.addEventListener("abort",s,{once:!0})})}}});import{spawn as Hue}from"node:child_process";import{readFileSync as Wue,existsSync as Gue}from"node:fs";import{resolve as H6,sep as zue}from"node:path";function W6(t){if(t.exitCode!==null||t.killed)return;try{t.kill("SIGTERM")}catch{}setTimeout(()=>{try{t.exitCode===null&&t.kill("SIGKILL")}catch{}},Kue).unref()}function Vue(t,e,o=Yue){let n=Math.max(0,e-t);return Math.min(n,o)}function Xue(t,e){return new Promise(o=>{if(e.aborted){o("stopped");return}let n=setTimeout(()=>{e.removeEventListener("abort",r),o("woke")},t),r=()=>{clearTimeout(n),o("stopped")};e.addEventListener("abort",r,{once:!0})})}async function Jue(t,e){let o=t.getTime();for(;;){if(e.aborted)return"stopped";let n=Vue(Date.now(),o);if(n<=0)return"woke";if(await Xue(n,e)==="stopped")return"stopped"}}function Que(t,e){let o=bh(t,e);return o===void 0||o>0}function Zue(t){let e=t.resumeContext!==void 0?`${t.resumeContext}
|
|
807
807
|
|
|
808
808
|
`:"",o=t.ownerSayContext!==void 0?`${t.ownerSayContext}
|
|
809
809
|
|
|
@@ -813,7 +813,7 @@ Notas:
|
|
|
813
813
|
${e}${o}${n}`}function eme(t,e,o=process.env,n){return{...o,ALUY_SERVICE_HOME:t,...e!==void 0?{ALUY_SERVICE_PERSONA:e}:{},...n===mi?{ALUY_SERVICE_AUTONOMY:n}:{}}}function tme(t,e=z6){return t!==void 0&&t<=0?{hasTime:!1}:e==="unlimited"?t===void 0?{hasTime:!0,unlimited:!0}:{hasTime:!0,timeoutMs:t}:t===void 0?{hasTime:!0,timeoutMs:e}:{hasTime:!0,timeoutMs:Math.min(t,e)}}function ome(t){return t.stopAborted?"cancelled":t.signal!==null?"deadline":"continue"}function nme(t){let e=t.trim().split(`
|
|
814
814
|
`).pop()??"",o;try{o=JSON.parse(e)}catch{o=void 0}if(!(o===void 0||typeof o.result!="string"||typeof o.ok!="boolean"))return{result:o.result,ok:o.ok}}function rme(t,e){let o=e.trim();return o===""?{action:"ignore"}:t==="awaiting-owner"?{action:"answer-local",text:o,logLine:'[attach] "say" recebido durante ASK-ESPERA \u2014 tratado como resposta LOCAL do dono.'}:{action:"queue",text:o,logLine:t==="sleeping"?'[attach] "say" recebido com o servi\xE7o DORMINDO \u2014 vira instru\xE7\xE3o do PR\xD3XIMO despertar.':'[attach] "say" recebido com turno EM ANDAMENTO \u2014 entregue \xE0 PR\xD3XIMA atividade do workflow (degrade documentado \u2014 sem plumbing de mid-turno de verdade no processo-filho).'}}async function sme(t){let{activity:e,index:o,total:n,untilRemainingMs:r,activityTimeoutCap:s,stop:i,log:a}=t;if(i.aborted)return{ok:!1,stop:"cancelled"};let l=tme(r,s);if(!l.hasTime)return a(`atividade ${o+1}/${n} "${e.id}": expediente j\xE1 encerrado (until) \u2014 pulada.`),{ok:!1,stop:"limit"};t.ownerSayContext!==void 0&&a(`atividade ${o+1}/${n} "${e.id}": entregando fala(s) do dono via attach.`);let c=Zue({orchestratorPreamble:t.orchestratorPreamble,activity:e,index:o,total:n,...t.resumeContext!==void 0?{resumeContext:t.resumeContext}:{},...t.ownerSayContext!==void 0?{ownerSayContext:t.ownerSayContext}:{}}),d=[t.aluyEntrypoint,"-p",c,"--output-format","json","--quiet"];t.budgetTokens!==void 0&&d.push("--max-tokens",String(t.budgetTokens)),t.model!==void 0&&d.push("--model",t.model);let m="unlimited"in l?void 0:l.timeoutMs,u=m===void 0?"sem teto":`teto ${Math.round(m/1e3)}s`;a(e.agent!==void 0?`atividade ${o+1}/${n} "${e.id}": iniciando turno TRAVADO na persona "${e.agent}" (${u})\u2026`:`atividade ${o+1}/${n} "${e.id}": iniciando turno (${u})\u2026`);let p=Hue(t.execPath,d,{cwd:t.serviceDir,env:eme(t.serviceDir,e.agent,process.env,t.autonomy),stdio:["ignore","pipe","pipe"]}),h="",b="";p.stdout?.on("data",O=>{h+=O.toString("utf8")}),p.stderr?.on("data",O=>{b+=O.toString("utf8")});let y=()=>W6(p);i.addEventListener("abort",y,{once:!0});let S=m!==void 0?setTimeout(()=>W6(p),m):void 0;S?.unref();let x=await new Promise(O=>{p.on("close",(H,M)=>O({code:H,signal:M})),p.on("error",()=>O({code:null,signal:null}))});S!==void 0&&clearTimeout(S),i.removeEventListener("abort",y);let w=ome({stopAborted:i.aborted,signal:x.signal});if(w==="cancelled")return a(`atividade ${o+1}/${n} "${e.id}": interrompida (stop do runner).`),{ok:!1,stop:"cancelled"};if(w==="deadline")return a(`atividade ${o+1}/${n} "${e.id}": ATINGIU O TETO (until/teto duro) \u2014 encerrada.`),{ok:!1,stop:"limit"};let T=nme(h);if(T===void 0)return a(`atividade ${o+1}/${n} "${e.id}": sa\xEDda ileg\xEDvel (exit ${x.code}) \u2014 ${b.trim().slice(0,500)||"(sem stderr)"}`),{ok:!1,stop:"error"};if(!T.ok){let O=b.trim().slice(0,500);return a(`atividade ${o+1}/${n} "${e.id}": turno terminou com erro.`+(O!==""?` \u2014 ${O}`:"")),{ok:!1,stop:"error"}}let P=T.result;if(cc(P)){let O=P.trim().split(`
|
|
815
815
|
`).slice(-3).join(" ");return t.pendingQuestionRef.current=O,a(`atividade ${o+1}/${n} "${e.id}": AGUARDANDO DONO \u2014 "${O}"`),{ok:!1,stop:"awaiting-owner"}}return a(`atividade ${o+1}/${n} "${e.id}": ok.`),{ok:!0}}async function K6(t,e={}){let o=new Us(e.aluyBaseDir!==void 0?{baseDir:e.aluyBaseDir}:{}),n=o.get(t);if(n===void 0||pr(n))return process.stderr.write(`aluy: servi\xE7o "${t}" inv\xE1lido/n\xE3o encontrado \u2014 n\xE3o \xE9 poss\xEDvel iniciar o runner.
|
|
816
|
-
`),1;let r=n,s=r.dir,i=e.log?void 0:Rr(s),a=e.log??(M=>ea(i,M)),l={},c=M=>{a(M),l.current?.broadcastLog(M)},d={egressLimiter:e.channelDeps?.egressLimiter??_6(),log:c,...e.channelDeps?.secretStore!==void 0?{secretStore:e.channelDeps.secretStore}:{},...e.channelDeps?.clientFactory!==void 0?{clientFactory:e.channelDeps.clientFactory}:{},...e.channelDeps?.now!==void 0?{now:e.channelDeps.now}:{},...e.channelDeps?.askTimeoutMs!==void 0?{askTimeoutMs:e.channelDeps.askTimeoutMs}:{}};if(r.manifest.schedule===void 0){let M='servi\xE7o sem "schedule:" declarado \u2014 o runner n\xE3o sabe quando acordar.';return c(`FATAL: ${M} Abortando.`),await qp(r.manifest,M,d),1}let m=Ji(s);qv(m,process.pid),c(`runner iniciado (pid ${process.pid}) \u2014 servi\xE7o "${r.manifest.name}".`);let u="sleeping",p=[],h=new Vv;l.current=F6(s,{onSay:M=>{let B=rme(u,M);if(B.action!=="ignore"){if(B.action==="answer-local"){c(B.logLine),h.submit(B.text);return}p.push(B.text),c(B.logLine)}}},c);let b=B6(),y=setInterval(()=>{for(let M of U6(s,b))l.current?.broadcastBlock(M.role,M.text)},1500);y.unref();let S=new AbortController,x=M=>{c(`sinal ${M} recebido \u2014 encerrando graciosamente\u2026`),S.abort()};process.on("SIGTERM",x),process.on("SIGINT",x),e.externalStop?.addEventListener("abort",()=>S.abort(),{once:!0});let w=M=>{F3(s,M),u=M.turnState,l.current?.broadcastState(M.turnState,M.pendingQuestion??M.lastReportSummary)},T=()=>{ta(s,c),w({turnState:"sleeping"}),clearInterval(y),l.current?.close(),fn(m),process.off("SIGTERM",x),process.off("SIGINT",x),c("runner encerrado.")},P=e.execPath??process.execPath,O=e.aluyEntrypoint??process.argv[1]??"",H=!0;try{for(;!S.signal.aborted;){let M=new Date,B=mw(r.manifest.schedule,M);if(B===void 0){let ue=`"schedule: ${r.manifest.schedule}" nunca dispara (ou \xE9 inv\xE1lido).`;return c(`FATAL: ${ue} Abortando.`),await qp(r.manifest,ue,d),process.off("SIGTERM",x),process.off("SIGINT",x),clearInterval(y),l.current?.close(),fn(m),1}let Y=H&&r.manifest.immediate===!0,q=Y&&Que(M,r.manifest.until);if(Y&&!q&&c(`"immediate: true" declarado, mas o expediente ("until: ${r.manifest.until}") j\xE1 encerrou \u2014 turno imediato pulado; segue para o ciclo normal de cron.`),H=!1,q)c('"immediate: true" declarado \u2014 turno IMEDIATO antes do primeiro ciclo de cron\u2026');else if(w({turnState:"sleeping",nextFireIso:B.toISOString()}),c(`dormindo at\xE9 ${B.toISOString()} (pr\xF3ximo turno).`),await Jue(B,S.signal)==="stopped")break;let z=o.get(t);if(z===void 0||pr(z)){let ue=z===void 0?"o diret\xF3rio do servi\xE7o sumiu do disco entre um despertar e outro \u2014 turno pulado.":`manifesto inv\xE1lido p\xF3s-edi\xE7\xE3o \u2014 ${z.reason} \u2014 turno pulado.`;c(`FALHA ao abrir o turno: ${ue}`),await qp(r.manifest,ue,d);continue}c("acordou \u2014 in\xEDcio do expediente: subindo daemons pr\xF3prios (se houver)\u2026"),B3(s,c),w({turnState:"running-turn"});let L={serviceDir:s,serviceName:r.manifest.name,workflowName:r.manifest.workflow,orchestratorBody:r.manifest.orchestrator,budgetRaw:r.manifest.budget,modelRaw:r.manifest.model,untilRaw:r.manifest.until,activityTimeoutRaw:r.manifest.activityTimeout,stop:S.signal,execPath:P,aluyEntrypoint:O,log:c,ownerSay:p,...r.manifest.autonomy!==void 0?{autonomy:r.manifest.autonomy}:{}},U=await G6(L);for(;U.kind==="awaiting-owner";){w({turnState:"awaiting-owner",pendingQuestion:U.question,lastReportSummary:`aguardando dono: ${U.question}`}),c("turno pausado \u2014 AGUARDANDO DONO \u2014 enviando a pergunta ao canal e entrando em modo espera\u2026");let ue=await P6({manifest:r.manifest,question:U.question,stop:S.signal,deps:d,localAnswer:h});if(ue.kind==="stopped"){c("ask-espera interrompida (stop do runner).");break}if(ue.kind==="no-channel")return c(`ask-espera n\xE3o p\xF4de ser feita (${ue.reason}) \u2014 encerrando o runner (religue com "aluy service start" quando resolver o canal/decis\xE3o).`),ta(s,c),clearInterval(y),l.current?.close(),fn(m),process.off("SIGTERM",x),process.off("SIGINT",x),c("runner encerrado (aguardando dono, sem canal dispon\xEDvel)."),0;if(ue.kind==="timeout"){U={kind:"stopped",critical:!1,summary:"aguardando dono \u2014 SEM RESPOSTA a tempo (ask-espera expirou); turno encerrado sem a\xE7\xE3o."};break}c(`dono respondeu pelo canal \u2014 retomando a atividade ${U.activityIndex+1} do workflow.`),U=await G6({...L,resume:{activityIndex:U.activityIndex,question:U.question,answer:ue.text}})}U.kind!=="awaiting-owner"&&(c(`turno encerrado \u2014 ${U.summary}`),U.kind==="ok"?await r0(r.manifest,{serviceName:r.manifest.name,ok:!0,critical:!1,summary:U.summary},d):U.critical?await qp(r.manifest,U.summary,d):await r0(r.manifest,{serviceName:r.manifest.name,ok:!1,critical:!1,summary:U.summary},d),c("fim do expediente \u2014 derrubando daemons pr\xF3prios\u2026"),ta(s,c))}}finally{S.signal.aborted&&T()}return 0}function ime(t,e){let o=e??0;return o>=t?{ok:!1,startOffset:o}:{ok:!0,startOffset:o}}function ame(t){let{res:e,startOffset:o,totalActivities:n,pendingQuestionText:r,pendingActivityIndex:s}=t;return e.lastStop==="awaiting-owner"?{kind:"awaiting-owner",question:r??"(ver runner.log)",activityIndex:s??o}:e.stopped?{kind:"stopped",critical:e.lastStop==="error",summary:`parou em ${o+e.activitiesRun}/${n} atividades (${e.lastStop??"motivo desconhecido"}).`}:{kind:"ok",summary:`${o+e.activitiesRun}/${n} atividades conclu\xEDdas.`}}async function G6(t){let{serviceDir:e,workflowName:o,log:n}=t;if(o===void 0)return n('sem "workflow:" declarado \u2014 nada a executar neste turno.'),{kind:"ok",summary:"sem workflow declarado (no-op)."};let r=H6(e,"workflows"),s=H6(r,`${o}.md`);if(s!==r&&!s.startsWith(r+zue))return n(`FATAL do turno: "workflow: ${o}" aponta para fora de workflows/ \u2014 recusado.`),{kind:"stopped",critical:!0,summary:"workflow fora do diret\xF3rio do servi\xE7o."};if(!Gue(s))return n(`FATAL do turno: workflows/${o}.md n\xE3o encontrado.`),{kind:"stopped",critical:!0,summary:`workflow "${o}" n\xE3o encontrado.`};let i=Wue(s,"utf8"),a=La(`${o}.md`,i,"project");if(Pa(a))return n(`FATAL do turno: workflow "${o}" inv\xE1lido \u2014 ${a.reason}`),{kind:"stopped",critical:!0,summary:`workflow inv\xE1lido \u2014 ${a.reason}`};let l=ime(a.activities.length,t.resume?.activityIndex);if(!l.ok)return n("retomada: a atividade pendente n\xE3o existe mais no workflow (editado entre a pergunta e a resposta) \u2014 turno encerrado."),{kind:"stopped",critical:!0,summary:"a atividade da retomada n\xE3o existe mais no workflow (editado entre a pergunta e a resposta)."};let c=l.startOffset,d=a.activities.slice(c),m=fw(t.budgetRaw),u=gw(t.activityTimeoutRaw)??z6,p=`Voc\xEA coordena o servi\xE7o "${t.serviceName}" \u2014 rege, n\xE3o opera:
|
|
816
|
+
`),1;let r=n,s=r.dir,i=e.log?void 0:Rr(s),a=e.log??(M=>ea(i,M)),l={},c=M=>{a(M),l.current?.broadcastLog(M)},d={egressLimiter:e.channelDeps?.egressLimiter??_6(),log:c,...e.channelDeps?.secretStore!==void 0?{secretStore:e.channelDeps.secretStore}:{},...e.channelDeps?.clientFactory!==void 0?{clientFactory:e.channelDeps.clientFactory}:{},...e.channelDeps?.now!==void 0?{now:e.channelDeps.now}:{},...e.channelDeps?.askTimeoutMs!==void 0?{askTimeoutMs:e.channelDeps.askTimeoutMs}:{}};if(r.manifest.schedule===void 0){let M='servi\xE7o sem "schedule:" declarado \u2014 o runner n\xE3o sabe quando acordar.';return c(`FATAL: ${M} Abortando.`),await qp(r.manifest,M,d),1}let m=Ji(s);qv(m,process.pid),c(`runner iniciado (pid ${process.pid}) \u2014 servi\xE7o "${r.manifest.name}".`);let u="sleeping",p=[],h=new Vv;l.current=F6(s,{onSay:M=>{let B=rme(u,M);if(B.action!=="ignore"){if(B.action==="answer-local"){c(B.logLine),h.submit(B.text);return}p.push(B.text),c(B.logLine)}}},c);let b=B6(),y=setInterval(()=>{for(let M of U6(s,b))l.current?.broadcastBlock(M.role,M.text),M.role==="tool"&&/ → err/.test(M.text)&&c(`[tool] ${M.text}`)},1500);y.unref();let S=new AbortController,x=M=>{c(`sinal ${M} recebido \u2014 encerrando graciosamente\u2026`),S.abort()};process.on("SIGTERM",x),process.on("SIGINT",x),e.externalStop?.addEventListener("abort",()=>S.abort(),{once:!0});let w=M=>{F3(s,M),u=M.turnState,l.current?.broadcastState(M.turnState,M.pendingQuestion??M.lastReportSummary)},T=()=>{ta(s,c),w({turnState:"sleeping"}),clearInterval(y),l.current?.close(),fn(m),process.off("SIGTERM",x),process.off("SIGINT",x),c("runner encerrado.")},P=e.execPath??process.execPath,O=e.aluyEntrypoint??process.argv[1]??"",H=!0;try{for(;!S.signal.aborted;){let M=new Date,B=mw(r.manifest.schedule,M);if(B===void 0){let ue=`"schedule: ${r.manifest.schedule}" nunca dispara (ou \xE9 inv\xE1lido).`;return c(`FATAL: ${ue} Abortando.`),await qp(r.manifest,ue,d),process.off("SIGTERM",x),process.off("SIGINT",x),clearInterval(y),l.current?.close(),fn(m),1}let Y=H&&r.manifest.immediate===!0,q=Y&&Que(M,r.manifest.until);if(Y&&!q&&c(`"immediate: true" declarado, mas o expediente ("until: ${r.manifest.until}") j\xE1 encerrou \u2014 turno imediato pulado; segue para o ciclo normal de cron.`),H=!1,q)c('"immediate: true" declarado \u2014 turno IMEDIATO antes do primeiro ciclo de cron\u2026');else if(w({turnState:"sleeping",nextFireIso:B.toISOString()}),c(`dormindo at\xE9 ${B.toISOString()} (pr\xF3ximo turno).`),await Jue(B,S.signal)==="stopped")break;let z=o.get(t);if(z===void 0||pr(z)){let ue=z===void 0?"o diret\xF3rio do servi\xE7o sumiu do disco entre um despertar e outro \u2014 turno pulado.":`manifesto inv\xE1lido p\xF3s-edi\xE7\xE3o \u2014 ${z.reason} \u2014 turno pulado.`;c(`FALHA ao abrir o turno: ${ue}`),await qp(r.manifest,ue,d);continue}c("acordou \u2014 in\xEDcio do expediente: subindo daemons pr\xF3prios (se houver)\u2026"),B3(s,c),w({turnState:"running-turn"});let L={serviceDir:s,serviceName:r.manifest.name,workflowName:r.manifest.workflow,orchestratorBody:r.manifest.orchestrator,budgetRaw:r.manifest.budget,modelRaw:r.manifest.model,untilRaw:r.manifest.until,activityTimeoutRaw:r.manifest.activityTimeout,stop:S.signal,execPath:P,aluyEntrypoint:O,log:c,ownerSay:p,...r.manifest.autonomy!==void 0?{autonomy:r.manifest.autonomy}:{}},U=await G6(L);for(;U.kind==="awaiting-owner";){w({turnState:"awaiting-owner",pendingQuestion:U.question,lastReportSummary:`aguardando dono: ${U.question}`}),c("turno pausado \u2014 AGUARDANDO DONO \u2014 enviando a pergunta ao canal e entrando em modo espera\u2026");let ue=await P6({manifest:r.manifest,question:U.question,stop:S.signal,deps:d,localAnswer:h});if(ue.kind==="stopped"){c("ask-espera interrompida (stop do runner).");break}if(ue.kind==="no-channel")return c(`ask-espera n\xE3o p\xF4de ser feita (${ue.reason}) \u2014 encerrando o runner (religue com "aluy service start" quando resolver o canal/decis\xE3o).`),ta(s,c),clearInterval(y),l.current?.close(),fn(m),process.off("SIGTERM",x),process.off("SIGINT",x),c("runner encerrado (aguardando dono, sem canal dispon\xEDvel)."),0;if(ue.kind==="timeout"){U={kind:"stopped",critical:!1,summary:"aguardando dono \u2014 SEM RESPOSTA a tempo (ask-espera expirou); turno encerrado sem a\xE7\xE3o."};break}c(`dono respondeu pelo canal \u2014 retomando a atividade ${U.activityIndex+1} do workflow.`),U=await G6({...L,resume:{activityIndex:U.activityIndex,question:U.question,answer:ue.text}})}U.kind!=="awaiting-owner"&&(c(`turno encerrado \u2014 ${U.summary}`),U.kind==="ok"?await r0(r.manifest,{serviceName:r.manifest.name,ok:!0,critical:!1,summary:U.summary},d):U.critical?await qp(r.manifest,U.summary,d):await r0(r.manifest,{serviceName:r.manifest.name,ok:!1,critical:!1,summary:U.summary},d),c("fim do expediente \u2014 derrubando daemons pr\xF3prios\u2026"),ta(s,c))}}finally{S.signal.aborted&&T()}return 0}function ime(t,e){let o=e??0;return o>=t?{ok:!1,startOffset:o}:{ok:!0,startOffset:o}}function ame(t){let{res:e,startOffset:o,totalActivities:n,pendingQuestionText:r,pendingActivityIndex:s}=t;return e.lastStop==="awaiting-owner"?{kind:"awaiting-owner",question:r??"(ver runner.log)",activityIndex:s??o}:e.stopped?{kind:"stopped",critical:e.lastStop==="error",summary:`parou em ${o+e.activitiesRun}/${n} atividades (${e.lastStop??"motivo desconhecido"}).`}:{kind:"ok",summary:`${o+e.activitiesRun}/${n} atividades conclu\xEDdas.`}}async function G6(t){let{serviceDir:e,workflowName:o,log:n}=t;if(o===void 0)return n('sem "workflow:" declarado \u2014 nada a executar neste turno.'),{kind:"ok",summary:"sem workflow declarado (no-op)."};let r=H6(e,"workflows"),s=H6(r,`${o}.md`);if(s!==r&&!s.startsWith(r+zue))return n(`FATAL do turno: "workflow: ${o}" aponta para fora de workflows/ \u2014 recusado.`),{kind:"stopped",critical:!0,summary:"workflow fora do diret\xF3rio do servi\xE7o."};if(!Gue(s))return n(`FATAL do turno: workflows/${o}.md n\xE3o encontrado.`),{kind:"stopped",critical:!0,summary:`workflow "${o}" n\xE3o encontrado.`};let i=Wue(s,"utf8"),a=La(`${o}.md`,i,"project");if(Pa(a))return n(`FATAL do turno: workflow "${o}" inv\xE1lido \u2014 ${a.reason}`),{kind:"stopped",critical:!0,summary:`workflow inv\xE1lido \u2014 ${a.reason}`};let l=ime(a.activities.length,t.resume?.activityIndex);if(!l.ok)return n("retomada: a atividade pendente n\xE3o existe mais no workflow (editado entre a pergunta e a resposta) \u2014 turno encerrado."),{kind:"stopped",critical:!0,summary:"a atividade da retomada n\xE3o existe mais no workflow (editado entre a pergunta e a resposta)."};let c=l.startOffset,d=a.activities.slice(c),m=fw(t.budgetRaw),u=gw(t.activityTimeoutRaw)??z6,p=`Voc\xEA coordena o servi\xE7o "${t.serviceName}" \u2014 rege, n\xE3o opera:
|
|
817
817
|
${t.orchestratorBody}`,h={},b,S=await kc(d,{async runActivity({index:x,id:w,goal:T,signal:P}){let O=x+c,M=bh(new Date,t.untilRaw),B=t.resume!==void 0&&x===0?lw(t.resume.question,t.resume.answer):void 0,Y=t.ownerSay?.splice(0,t.ownerSay.length)??[],q=Y.length>0?dw(Y):void 0,z=await sme({serviceDir:e,serviceName:t.serviceName,orchestratorPreamble:p,activity:{id:w,goal:T,agent:a.activities[O]?.agent},index:O,total:a.activities.length,...m!==void 0?{budgetTokens:m}:{},...t.modelRaw!==void 0?{model:t.modelRaw}:{},untilRemainingMs:M,activityTimeoutCap:u,stop:t.stop,execPath:t.execPath,aluyEntrypoint:t.aluyEntrypoint,log:t.log,...q!==void 0?{ownerSayContext:q}:{},pendingQuestionRef:h,...B!==void 0?{resumeContext:B}:{},...t.autonomy!==void 0?{autonomy:t.autonomy}:{}});return!z.ok&&z.stop==="awaiting-owner"&&(b=O),z}},t.stop);return ame({res:S,startOffset:c,totalActivities:a.activities.length,pendingQuestionText:h.current,pendingActivityIndex:b})}var z6,Kue,Yue,Y6=g(()=>{"use strict";N();ob();Qi();zd();Gv();Qi();Wv();Kv();L6();$6();j6();q6();z6=30*6e4,Kue=8e3;Yue=1440*6e4});import{createConnection as lme}from"node:net";function cme(t){return t.code==="ENOENT"||t.code==="ECONNREFUSED"?"o servi\xE7o n\xE3o est\xE1 rodando (ou o socket de attach ainda n\xE3o subiu).":`conex\xE3o perdida \u2014 ${String(t)}.`}function dme(t){return typeof t=="string"?t:t.toString("utf8")}function V6(t,e){let o=!1,n=i=>{o||(o=!0,e.onClose(i))},r;try{r=lme(t)}catch(i){return n(`n\xE3o foi poss\xEDvel conectar (${String(i)}).`),{send:()=>{},close:()=>{}}}r.setEncoding("utf8");let s="";return r.on("data",i=>{s+=dme(i);let a=s.indexOf(`
|
|
818
818
|
`);for(;a!==-1;){let l=s.slice(0,a);s=s.slice(a+1);let c=kw(l);c!==void 0&&e.onLine(Sw(c)),a=s.indexOf(`
|
|
819
819
|
`)}}),r.on("error",i=>n(cme(i))),r.on("close",()=>{n("conex\xE3o encerrada pelo servi\xE7o (parou, ou o attach caiu).")}),{send:i=>{if(!o)try{r.write(vw({t:"say",text:i}))}catch{}},close:()=>{if(!o){o=!0;try{r.end()}catch{}}}}}var X6=g(()=>{"use strict";N()});var nG={};Tt(nG,{parseServiceCommand:()=>Z6,runService:()=>wme});import{existsSync as Nl,mkdtempSync as ume,readFileSync as mme,rmSync as Q6,statSync as fme,cpSync as J6}from"node:fs";import{execFileSync as pme,spawn as gme}from"node:child_process";import{createInterface as hme}from"node:readline";import{tmpdir as yme}from"node:os";import{join as s0}from"node:path";function i0(t){let e=t.indexOf("--group");if(e===-1)return{};let o=t[e+1];return o===void 0||o.startsWith("--")?{error:'"--group" precisa de um valor (ex.: --group mesa-trading).'}:{group:o}}function Z6(t){let e=t[0];if(e===void 0||e==="list"){let o=e===void 0?t:t.slice(1),{group:n,error:r}=i0(o);return r!==void 0?{kind:"error",message:`service list: ${r}`}:n!==void 0?{kind:"list",group:n}:{kind:"list"}}if(e==="help"||e==="-h"||e==="--help")return{kind:"help"};if(e==="status"){let o=t[1];return o?{kind:"status",name:o}:{kind:"error",message:"service status: falta o <nome> do servi\xE7o."}}if(e==="install"){let o=t.slice(1),n=o.includes("--yes"),r=o.find(s=>!s.startsWith("--"));return r?{kind:"install",source:r,yes:n}:{kind:"error",message:"service install: falta <path|git-url>."}}if(e==="uninstall"){let o=t.slice(1),n=o.includes("--yes"),r=o.find(s=>!s.startsWith("--"));return r?{kind:"uninstall",name:r,yes:n}:{kind:"error",message:"service uninstall: falta o <nome> do servi\xE7o."}}if(e==="start"){let o=t.slice(1),n=o.includes("--yes"),{group:r,error:s}=i0(o);if(s!==void 0)return{kind:"error",message:`service start: ${s}`};if(r!==void 0)return{kind:"start-group",group:r,yes:n};let i=o.find(a=>!a.startsWith("--"));return i?{kind:"start",name:i,yes:n}:{kind:"error",message:'service start: falta o <nome> do servi\xE7o (ou "--group <nome>").'}}if(e==="stop"){let o=t.slice(1),{group:n,error:r}=i0(o);if(r!==void 0)return{kind:"error",message:`service stop: ${r}`};if(n!==void 0)return{kind:"stop-group",group:n};let s=o[0];return s?{kind:"stop",name:s}:{kind:"error",message:'service stop: falta o <nome> do servi\xE7o (ou "--group <nome>").'}}if(e==="logs"){let o=t.slice(1),n=o.includes("-f")||o.includes("--follow"),r=o.find(c=>!c.startsWith("-"));if(!r)return{kind:"error",message:"service logs: falta o <nome> do servi\xE7o."};let s=o.indexOf("-n"),i=s!==-1?o[s+1]:void 0,a=i!==void 0?Number(i):NaN,l=Number.isInteger(a)&&a>0?a:50;return{kind:"logs",name:r,follow:n,lines:l}}if(e==="attach"){let o=t[1];return o?{kind:"attach",name:o}:{kind:"error",message:"service attach: falta o <nome> do servi\xE7o."}}if(e==="create")return{kind:"create-redirect"};if(e==="run"){let o=t.slice(1),n=o.find(r=>!r.startsWith("--"));return!n||!o.includes("--runner")?{kind:"error",message:'service run: uso interno \u2014 precisa de "<nome> --runner".'}:{kind:"run-runner",name:n}}return bme.has(e)?{kind:"not-yet",sub:e}:{kind:"error",message:`service: subcomando desconhecido "${e}".`}}function kme(t){return[`"aluy service ${t}" ainda n\xE3o existe \u2014 chega numa fase seguinte (git pull).`]}function xme(){return['"aluy service create" \xE9 CONVERSACIONAL \u2014 o agente entrevista o que faltar',"(schedule/canal/autonomia/funil de risco) antes de escrever. Isso exige um",'CANAL de ida-e-volta que o shell n\xE3o tem (ao contr\xE1rio de "install"/"start",','que s\xF3 confirmam um "sim/n\xE3o").',"","Abra uma sess\xE3o do aluy e rode:"," /service create <descri\xE7\xE3o em prosa do servi\xE7o>","","o agente escreve o rascunho em staging (PARADO); revise e ent\xE3o",'"aluy service install <path>" para ativar de verdade.']}function Sme(t){return/^(https?:\/\/|git@|ssh:\/\/)/i.test(t)||t.endsWith(".git")}async function a0(t,e){let o=(await t.prompt(e)).trim().toLowerCase();return o==="y"||o==="yes"||o==="s"||o==="sim"}async function wme(t,e={}){let o=e.io??jt(),n=e.store??new Us,r=e.gitClone??((i,a)=>{pme("git",["clone","--depth","1",i,a],{stdio:"pipe"})}),s=Z6(t);switch(s.kind){case"help":return o.out(vme),0;case"error":return o.err(`aluy: ${s.message}`),o.err("rode 'aluy service --help' para ver o uso."),1;case"not-yet":for(let i of kme(s.sub))o.out(i);return 1;case"list":{let{services:i,errors:a}=n.list(),l=s.group!==void 0?i.filter(u=>u.manifest.group===s.group):i;if(s.group!==void 0&&l.length===0&&a.length===0)return o.out(i.length===0?`nenhum servi\xE7o instalado \u2014 instale um diret\xF3rio-manifesto em ${n.servicesDir}/<nome>/.`:`nenhum servi\xE7o com "group: ${s.group}" (${i.length} instalado(s) no total, nenhum neste grupo).`),0;let c=l.map(u=>({...u,runtimeStatus:Eme(_r(u.dir))})),d=ym({services:c,errors:a.map(u=>({dirName:u.dirName,reason:u.reason})),servicesDir:n.servicesDir,nowMs:Date.now()}),m=s.group!==void 0?` (grupo: ${s.group})`:"";o.out(`${d.title} \u2014 servi\xE7os instalados${m}`);for(let u of d.lines)o.out(u);return 0}case"status":{let i=n.get(s.name);if(i===void 0)return o.err(`aluy: servi\xE7o "${s.name}" n\xE3o encontrado em ${n.servicesDir}.`),1;if(pr(i))return o.out(`servi\xE7o "${s.name}" \u2014 INV\xC1LIDO:`),o.out(` \u26A0 ${i.reason}`),1;let a=i.manifest,l=_r(i.dir);if(o.out(`servi\xE7o "${a.name}" \u2014 ${Ame(l)}`),o.out(` dir: ${i.dir}`),l.running&&l.pid!==void 0&&o.out(` pid: ${l.pid}`),l.running&&l.snapshot?.pendingQuestion!==void 0){let c=l.snapshot.updatedAtIso,d=c!==void 0?` (enviada h\xE1 ${As(Date.now()-Date.parse(c))})`:"";o.out(` \u26A0 pergunta pendente${d}: ${l.snapshot.pendingQuestion}`)}if(a.description!==void 0&&o.out(` descri\xE7\xE3o: ${a.description}`),o.out(` grupo: ${a.group??"(n\xE3o declarado)"}`),o.out(` modelo: ${a.model??"(n\xE3o declarado \u2014 default global)"}`),o.out(` schedule: ${a.schedule??"(n\xE3o declarado)"}`),o.out(` until: ${a.until??"(n\xE3o declarado)"}`),o.out(` workflow: ${a.workflow??"(n\xE3o declarado)"}`),o.out(` canal: ${a.channel??"(NENHUM)"}`),o.out(` autonomia: ${a.autonomy??"(n\xE3o declarada)"}`),o.out(` budget: ${a.budget??"(n\xE3o declarado)"}`),a.immediate===!0&&o.out(" \u26A0 imediato: sim \u2014 roda um turno j\xE1 no start/rein\xEDcio, antes do 1\xBA cron"),a.tunables.length>0){o.out(" tun\xE1veis/circuit-breakers:");for(let c of a.tunables){let d=c.min!==void 0&&c.max!==void 0?` [${c.min}..${c.max}]`:"";o.out(` \xB7 ${c.key}: ${c.value}${d}`)}}return a.ignoredFrontmatterKeys.length>0&&o.out(` \u26A0 campos ignorados: ${a.ignoredFrontmatterKeys.join(", ")}`),o.out(" valida\xE7\xE3o: OK (schedule/workflow conferidos pelo registry)"),0}case"install":return Cme(s.source,s.yes,o,n,r);case"uninstall":return Tme(s.name,s.yes,o,n);case"start":return eG(s.name,s.yes,o,n);case"start-group":return Dme(s.group,s.yes,o,n);case"stop":return tG(s.name,o,n);case"stop-group":return Rme(s.group,o,n);case"logs":return _me(s.name,s.follow,s.lines,o,n);case"attach":return Ome(s.name,o,n,e.attachConnect??V6,e.attachStdin??process.stdin);case"create-redirect":for(let i of xme())o.out(i);return 0;case"run-runner":return K6(s.name)}}function Eme(t){return{running:t.running,...t.snapshot?.turnState!==void 0?{turnState:t.snapshot.turnState}:{},...t.snapshot?.nextFireIso!==void 0?{nextFireIso:t.snapshot.nextFireIso}:{},...t.snapshot?.turnState==="awaiting-owner"&&t.snapshot.updatedAtIso!==void 0?{pendingSinceIso:t.snapshot.updatedAtIso}:{}}}function Ame(t){if(!t.running)return"PARADO";let e=t.snapshot?.turnState;if(e==="running-turn")return"RODANDO \xB7 turno em andamento";if(e==="awaiting-owner"){let o=t.snapshot?.updatedAtIso;return`RODANDO \xB7 \u26A0 aguardando dono${o!==void 0?` (pergunta enviada h\xE1 ${As(Date.now()-Date.parse(o))})`:""}`}return e==="sleeping"&&t.snapshot?.nextFireIso!==void 0?`RODANDO \xB7 dormindo at\xE9 ${t.snapshot.nextFireIso}`:"RODANDO"}async function Cme(t,e,o,n,r){let s=ume(s0(yme(),"aluy-service-install-")),i=()=>{try{Q6(s,{recursive:!0,force:!0})}catch{}};try{if(Sme(t)){o.out(`clonando ${t}\u2026`);try{r(t,s)}catch{return o.err(`aluy: falha ao clonar "${t}" \u2014 confira a URL/credenciais e o \`git\` instalado.`),1}}else{let p;try{p=fme(t)}catch{return o.err(`aluy: caminho "${t}" n\xE3o encontrado.`),1}if(!p.isDirectory())return o.err(`aluy: "${t}" n\xE3o \xE9 um diret\xF3rio (um servi\xE7o \xE9 um diret\xF3rio-manifesto).`),1;J6(t,s,{recursive:!0})}let a=s0(s,"service.md"),l;try{l=mme(a,"utf8")}catch{return o.err(`aluy: "${t}" n\xE3o tem service.md \u2014 n\xE3o \xE9 um diret\xF3rio-servi\xE7o.`),1}let c=hm("service.md",l);if(gm(c))return o.err(`aluy: service.md inv\xE1lido \u2014 ${c.reason}`),1;if(c.schedule!==void 0){let p=nl(c.schedule);if(p!==void 0)return o.err(`aluy: "schedule: ${c.schedule}" inv\xE1lido \u2014 ${p}`),1}if(c.workflow!==void 0){let p=s0(s,"workflows",`${c.workflow}.md`);if(!Nl(p))return o.err(`aluy: "workflow: ${c.workflow}" n\xE3o encontrado (esperado workflows/${c.workflow}.md).`),1}let d=n.resolveDir(c.name);if(d===void 0)return o.err(`aluy: nome de servi\xE7o inv\xE1lido "${c.name}".`),1;if(Nl(d))return o.err(`aluy: j\xE1 existe um servi\xE7o "${c.name}" instalado em ${d} \u2014 rode \`aluy service uninstall ${c.name}\` antes de reinstalar.`),1;let m=rd(s),u=xc({manifest:c,...m});o.out(u.title);for(let p of u.lines)o.out(p);return o.out(""),!e&&!await a0(o,"confirma a instala\xE7\xE3o deste servi\xE7o? [y/N] ")?(o.out("instala\xE7\xE3o cancelada \u2014 nada foi escrito em ~/.aluy/services/."),1):(n.ensureDir(),J6(s,d,{recursive:!0}),o.out(`\u2713 servi\xE7o "${c.name}" instalado em ${d}.`),o.out(` PARADO \u2014 "aluy service start ${c.name}" para ligar.`),0)}finally{i()}}async function Tme(t,e,o,n){let r=n.resolveDir(t);return r===void 0||!Nl(r)?(o.err(`aluy: servi\xE7o "${t}" n\xE3o encontrado em ${n.servicesDir}.`),1):_r(r).running?(o.err(`aluy: servi\xE7o "${t}" est\xE1 RODANDO \u2014 rode \`aluy service stop ${t}\` antes.`),1):!e&&!await a0(o,`remover o servi\xE7o "${t}" (${r})? [y/N] `)?(o.out("remo\xE7\xE3o cancelada."),1):(Q6(r,{recursive:!0,force:!0}),o.out(`\u2713 servi\xE7o "${t}" removido (${r}).`),0)}async function eG(t,e,o,n){let r=n.get(t);if(r===void 0)return o.err(`aluy: servi\xE7o "${t}" n\xE3o encontrado em ${n.servicesDir}.`),1;if(pr(r))return o.err(`aluy: servi\xE7o "${t}" inv\xE1lido \u2014 ${r.reason}`),1;let s=r;if(s.manifest.schedule===void 0)return o.err(`aluy: servi\xE7o "${t}" n\xE3o declara "schedule:" \u2014 o runner n\xE3o saberia quando acordar.`),1;if(_r(s.dir).running)return o.err(`aluy: servi\xE7o "${t}" j\xE1 est\xE1 RODANDO.`),1;let i=rd(s.dir),a=xc({manifest:s.manifest,...i});o.out(a.title);for(let m of a.lines)o.out(m);if(o.out(""),!e&&!await a0(o,`iniciar o servi\xE7o "${t}" agora? [y/N] `))return o.out("in\xEDcio cancelado."),1;let l=Rr(s.dir);ea(l,`"aluy service start ${t}" \u2014 spawnando o runner\u2026`);let c=process.argv[1]??"",d=gme(process.execPath,[c,"service","run",t,"--runner"],{detached:!0,stdio:"ignore",cwd:s.dir});return d.unref(),d.pid===void 0?(o.err(`aluy: falha ao dar spawn no runner de "${t}".`),1):(o.out(`\u2713 servi\xE7o "${t}" iniciado (pid ${d.pid}).`),o.out(` logs: aluy service logs ${t} \xB7 parar: aluy service stop ${t}`),0)}async function tG(t,e,o){let n=o.resolveDir(t);if(n===void 0||!Nl(n))return e.err(`aluy: servi\xE7o "${t}" n\xE3o encontrado em ${o.servicesDir}.`),1;let r=Ji(n),s=Zi(r);if(s===void 0||!ms(r))return e.out(`servi\xE7o "${t}" j\xE1 est\xE1 parado.`),fn(r),0;try{process.kill(s,"SIGTERM")}catch{}e.out(`SIGTERM enviado ao servi\xE7o "${t}" (pid ${s})\u2026`);let i=Date.now()+1e4;for(;Date.now()<i&&ms(r);)await new Promise(a=>setTimeout(a,300));if(ms(r))try{process.kill(s,"SIGKILL"),e.out(" n\xE3o encerrou a tempo \u2014 SIGKILL enviado.")}catch{}return ta(n,a=>ea(Rr(n),a)),fn(r),e.out(`\u2713 servi\xE7o "${t}" parado.`),0}function oG(t,e){let{services:o}=t.list();return o.filter(n=>n.manifest.group===e).map(n=>n.name).sort((n,r)=>n.localeCompare(r))}async function Dme(t,e,o,n){let r=oG(n,t);if(r.length===0)return o.err(`aluy: nenhum servi\xE7o com "group: ${t}" encontrado em ${n.servicesDir}.`),1;o.out(`grupo "${t}" \u2014 ${r.length} servi\xE7o(s): ${r.join(", ")}`);let s=[];for(let i of r){o.out(""),o.out(`\u2014 ${i} \u2014`);try{await eG(i,e,o,n)!==0&&s.push(i)}catch(a){s.push(i),o.err(`aluy: erro inesperado ao iniciar "${i}" \u2014 ${a instanceof Error?a.message:String(a)}`)}}return o.out(""),s.length>0?(o.out(`\u26A0 grupo "${t}": ${r.length-s.length}/${r.length} iniciado(s) \u2014 falharam: ${s.join(", ")} (veja as mensagens acima de cada um).`),1):(o.out(`\u2713 grupo "${t}": todos os ${r.length} servi\xE7o(s) iniciados.`),0)}async function Rme(t,e,o){let n=oG(o,t);if(n.length===0)return e.err(`aluy: nenhum servi\xE7o com "group: ${t}" encontrado em ${o.servicesDir}.`),1;e.out(`grupo "${t}" \u2014 ${n.length} servi\xE7o(s): ${n.join(", ")}`);let r=[];for(let s of n){e.out(""),e.out(`\u2014 ${s} \u2014`);try{await tG(s,e,o)!==0&&r.push(s)}catch(i){r.push(s),e.err(`aluy: erro inesperado ao parar "${s}" \u2014 ${i instanceof Error?i.message:String(i)}`)}}return e.out(""),r.length>0?(e.out(`\u26A0 grupo "${t}": ${n.length-r.length}/${n.length} parado(s) \u2014 falharam: ${r.join(", ")} (veja as mensagens acima de cada um).`),1):(e.out(`\u2713 grupo "${t}": todos os ${n.length} servi\xE7o(s) parados.`),0)}async function _me(t,e,o,n,r){let s=r.resolveDir(t);if(s===void 0||!Nl(s))return n.err(`aluy: servi\xE7o "${t}" n\xE3o encontrado em ${r.servicesDir}.`),1;let i=Rr(s),a=Kd(i,o);if(a.length===0)n.out(`(sem log ainda para "${t}" \u2014 o servi\xE7o nunca rodou, ou ${i} est\xE1 vazio.)`);else for(let c of a)n.out(c);if(!e)return 0;let l=a.length;return n.out("\u2014 acompanhando ao vivo (Ctrl-C para sair) \u2014"),await new Promise(c=>{let d=setInterval(()=>{let u=Kd(i,l+1e3);if(u.length>l){for(let p of u.slice(l))n.out(p);l=u.length}},500),m=()=>{clearInterval(d),c(0)};process.once("SIGINT",m),process.once("SIGTERM",m)})}async function Ome(t,e,o,n,r){let s=o.resolveDir(t);if(s===void 0||!Nl(s))return e.err(`aluy: servi\xE7o "${t}" n\xE3o encontrado em ${o.servicesDir}.`),1;if(!_r(s).running)return e.err(`aluy: servi\xE7o "${t}" est\xE1 PARADO \u2014 rode \`aluy service start ${t}\` primeiro.`),1;let i=jv(s),a=Date.now()+3e3;for(;!Nl(i)&&Date.now()<a;)await new Promise(l=>setTimeout(l,100));return e.out(`conectando ao servi\xE7o "${t}"\u2026 (Ctrl-C p/ detach \u2014 o servi\xE7o segue rodando)`),await new Promise(l=>{let c=!1,d=()=>{},m=y=>{c||(c=!0,d(),l(y))},u=n(i,{onLine:y=>e.out(y),onClose:y=>{e.out(`\u2014 ${y} \u2014`),m(0)}}),p=()=>{c||(e.out("\u2014 detach \u2014 o servi\xE7o segue rodando \u2014"),u.close(),m(0))},h=hme({input:r,terminal:!1});h.on("line",y=>{let S=y.trim();S!==""&&u.send(S)}),h.on("close",p);let b=()=>p();process.once("SIGINT",b),d=()=>{h.close(),process.off("SIGINT",b)}})}var bme,vme,rG=g(()=>{"use strict";N();ur();ob();nd();Qi();Wv();zd();Gv();Y6();Kv();X6();bme=new Set(["update"]),vme=`aluy service \u2014 SERVI\xC7OS plug\xE1veis
|
package/dist-bundle/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var uU=Object.create;var qg=Object.defineProperty;var mU=Object.getOwnPropertyDescriptor;var fU=Object.getOwnPropertyNames;var pU=Object.getPrototypeOf,hU=Object.prototype.hasOwnProperty;var A=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var gU=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Hg=(t,e)=>{for(var o in e)qg(t,o,{get:e[o],enumerable:!0})},yU=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of fU(e))!hU.call(t,r)&&r!==o&&qg(t,r,{get:()=>e[r],enumerable:!(n=mU(e,r))||n.enumerable});return t};var bU=(t,e,o)=>(o=t!=null?uU(pU(t)):{},yU(e||!t||!t.__esModule?qg(o,"default",{value:t,enumerable:!0}):o,t));var fc,BA=A(()=>{"use strict";fc="1.0.0-rc.
|
|
1
|
+
var uU=Object.create;var qg=Object.defineProperty;var mU=Object.getOwnPropertyDescriptor;var fU=Object.getOwnPropertyNames;var pU=Object.getPrototypeOf,hU=Object.prototype.hasOwnProperty;var A=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var gU=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Hg=(t,e)=>{for(var o in e)qg(t,o,{get:e[o],enumerable:!0})},yU=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of fU(e))!hU.call(t,r)&&r!==o&&qg(t,r,{get:()=>e[r],enumerable:!(n=mU(e,r))||n.enumerable});return t};var bU=(t,e,o)=>(o=t!=null?uU(pU(t)):{},yU(e||!t||!t.__esModule?qg(o,"default",{value:t,enumerable:!0}):o,t));var fc,BA=A(()=>{"use strict";fc="1.0.0-rc.125"});function An(t,e){return t.decide(e)}var Qs=A(()=>{"use strict"});var Jn,Cr,Dr=A(()=>{"use strict";Jn="remember",Cr="recall"});var Wg,vU,xa,Gg=A(()=>{"use strict";Wg=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}}},vU=200,xa=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??vU,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 Wg(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 Gm(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 qA(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"&&kU.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 d of l){let m=qA(d,!1);if(typeof m=="string")return m;c.push(m)}r=c}}}if(o===void 0||o.trim()==="")return SU;let s=o.trim().slice(0,xU);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function EU(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=qA(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(d=>({...d,title:r(d.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Gm(o).length;return s>UA?{error:`update_plan: no m\xE1ximo ${UA} passos (recebidos ${s}).`}:{steps:o}}function wU(t){let e=Gm(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${HA[r.step.status]} ${r.step.title}`).join(`
|
|
2
2
|
`);return`plano (${o}/${e.length}):
|
|
3
3
|
${n}`}function CU(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function DU(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,d=o.get(i.title),m=d??xa.boxId(i.title,0);return d?(i.status!=="completed"&&e.isClosed(d)&&e.reopenBox(d),e.setHorizon(d,c),e.setParent(d,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=CU(a,n),c=r(i,null,l);for(let d of i.substeps??[])r(d,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 TU(t,e){if(!e)return wU(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,d=new Set)=>{let m=r.get(c);if(m!==void 0)return m;let u=n.get(c);if(!u||!u.parentId||d.has(c))return r.set(c,0),0;let p=s(u.parentId,new Set(d).add(c))+1;return r.set(c,p),p},i=Gm(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:d}of i){let m=o.get(c.title),u=m?AU[m.horizon]:"",p=m?s(m.id):d,h=" ".repeat(p),v=HA[c.status];l.push(`${h}${u} ${v} ${c.title}`)}return l.join(`
|
|
4
4
|
`)}var pc,kU,UA,xU,SU,HA,AU,jA,RU,WA,zm=A(()=>{"use strict";Gg();pc="update_plan";kU=new Set(["pending","in_progress","completed"]),UA=30,xU=120,SU="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";HA={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};AU={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};jA=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),RU=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:jA,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:jA},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),WA={name:pc,effect:"read",group:"plano",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:RU,async run(t,e){let o=EU(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&DU(o.steps,e.graph),e.plan&&e.plan.set(Gm(o.steps).map(r=>({title:r.step.title,status:r.step.status}))),{ok:!0,observation:TU(o.steps,e.graph)})}}});function GA(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)?MU(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&_U.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 MU(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 OU(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(`
|
|
@@ -143,7 +143,7 @@ ${t.trim()}`}}function j_(t,e,o=$d){let{older:n,recent:r}=xp(t,o);if(n.length===
|
|
|
143
143
|
`;case"t":return" ";case"r":return"\r";case'"':return'"';case"\\":return"\\";default:throw new xe(`config.toml:${e}: escape n\xE3o suportado "\\${i}".`)}})}function LH(t,e,o){let n=e.trim();if(!n.startsWith("[")||!n.endsWith("]"))throw new xe(`config.toml:${o}: ${t} deve ser um array de strings em uma linha.`);let r=n.slice(1,-1).trim();if(r.length===0)return[];let s=[];for(let i of xM(r,",")){let a=i.trim();if(a.length===0)continue;let l=rx(a,o);if(l===void 0)throw new xe(`config.toml:${o}: ${t} \u2014 todo item deve ser string.`);s.push(l)}return s}function FH(t,e,o){let n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))throw new xe(`config.toml:${o}: ${t} deve ser uma tabela inline { K = "v" }.`);let r=n.slice(1,-1).trim(),s={};if(r.length===0)return s;for(let i of xM(r,",")){let a=i.trim();if(a.length===0)continue;let l=kM(a);if(l===-1)throw new xe(`config.toml:${o}: ${t} \u2014 esperava K = "v".`);let c=nx(a.slice(0,l).trim(),o);if(c.length!==1)throw new xe(`config.toml:${o}: ${t} \u2014 chave inv\xE1lida.`);let d=rx(a.slice(l+1).trim(),o);if(d===void 0)throw new xe(`config.toml:${o}: ${t}["${c[0]}"] deve ser string.`);s[c[0]]=d}return s}function xM(t,e){let o=[],n=0,r=!1,s="",i=0;for(let a=0;a<t.length;a++){let l=t[a];r?l===s&&t[a-1]!=="\\"&&(r=!1):l==='"'||l==="'"?(r=!0,s=l):l==="["||l==="{"?n++:l==="]"||l==="}"?n--:l===e&&n===0&&(o.push(t.slice(i,a)),i=a+1)}return o.push(t.slice(i)),o}var RH,SM=A(()=>{"use strict";_p();RH="mcp_servers"});function $H(t){if(t.length<20||/\s/.test(t)||/^[~./]/.test(t)||!/^[A-Za-z0-9_\-+/=.]+$/.test(t))return!1;let e=/[A-Z]/.test(t),o=/[a-z]/.test(t),n=/[0-9]/.test(t);return(e?1:0)+(o?1:0)+(n?1:0)>=2||t.length>=32}function BH(t){let e=t.toLowerCase();return NH.some(o=>e.includes(o))}function sx(t,e){if(IH.test(e.trim()))return{looksLikeSecret:!1,signals:[]};let o=[];return e.length>0&&BH(t)&&o.push("secret-key-name"),$H(e)&&o.push("high-entropy"),{looksLikeSecret:o.length>0,signals:o}}var NH,IH,EM=A(()=>{"use strict";NH=["token","secret","password","passwd","apikey","api_key","access_key","accesskey","private_key","privatekey","credential","auth"],IH=/^\$\{?[A-Za-z_][A-Za-z0-9_]*\}?$|^%[A-Za-z_][A-Za-z0-9_]*%$/});function UH(t,e){return`mcp__${t}__${e}`}function jH(t){return t==="aluy-global"||t==="project"}function Hd(t,e){let o=[],n=new Map;for(let{origin:s,config:i}of t)for(let a of i.servers)n.has(a.name)||o.push(a.name),n.set(a.name,{origin:s,server:a});let r=e?qH(e):void 0;return o.map(s=>{let{origin:i,server:a}=n.get(s),l=r?.get(s),c=a.disabled===!0?{kind:"disabled"}:l?l.ok?{kind:"ok",toolCount:l.tools.length}:{kind:"error",error:l.error??"falha na conex\xE3o"}:{kind:"unknown"},d=c.kind==="ok"&&l?l.tools:[];return{name:s,origin:i,command:a.command,args:a.args,envKeys:Object.keys(a.env),managed:jH(i),state:c,tools:d}})}function qH(t){let e=new Map;for(let o of t.servers){let n=o.tools.map(r=>({qualifiedName:UH(o.server,r.descriptor.name),...r.descriptor.description!==void 0?{description:r.descriptor.description}:{}}));e.set(o.server,{ok:o.ok,...o.error!==void 0?{error:o.error}:{},tools:n})}return e}function Wd(t){if(t.command.trim()!=="--")return;let e=t.args.length>0?t.args.join(" "):"<command> [args...]";return`server "${t.name}" com command inv\xE1lido "--" (separador gravado por engano \u2014 nunca vai conectar). Re-adicione: aluy mcp add ${t.name} --force -- ${e}`}function ix(t){switch(t){case"aluy-global":return"~/.aluy/mcp.json";case"project":return".mcp.json (projeto)";case"codex":return"~/.codex (Codex)"}}var wM=A(()=>{"use strict"});var AM=A(()=>{"use strict"});function HH(t){return t instanceof Error?t.message:String(t)}async function Gd(t,e,o){let n=t.servers.filter(l=>l.disabled!==!0),r=await Promise.all(n.map(async l=>{let c=e(l);try{let m=(await c.connect(l)).map(p=>({server:l.name,descriptor:p,transport:c})),u={server:l.name,ok:!0,tools:m};return o?.onServerResult?.(u),{result:u,transport:c}}catch(d){CM(c);let m={server:l.name,ok:!1,tools:[],error:HH(d)};return o?.onServerResult?.(m),{result:m}}})),s=[],i=[],a=[];for(let l of r)s.push(l.result),i.push(...l.result.tools),l.transport&&a.push(l.transport);return{servers:s,tools:i,transports:a}}async function ax(t){await Promise.all(t.map(e=>CM(e)))}async function CM(t){try{await t.close()}catch{}}var DM=A(()=>{"use strict";_p()});function _M(t,e){let o=new URL(RM);return t.trim().length>0&&o.searchParams.set("search",t.trim()),o.searchParams.set("limit",String(GH)),e!==void 0&&e.length>0&&o.searchParams.set("cursor",e),o.toString()}async function cx(t,e,o){let n=t.trim(),r=[],s;for(let i=0;i<WH;i++){let a=_M(n,s),l;try{l=await e(a,o)}catch(m){return{ok:!1,query:n,reason:Mp(JH(m))}}if(!l.ok)return{ok:!1,query:n,reason:Mp(l.reason)};if(l.status<200||l.status>=300)return{ok:!1,query:n,reason:Mp(`HTTP ${l.status}`)};let c;try{c=JSON.parse(l.body)}catch{return{ok:!1,query:n,reason:Mp("resposta n\xE3o \xE9 JSON v\xE1lido")}}let d=OM(c);for(let m of d.servers)if(MM(m,n)&&r.push(m),r.length>=lx)break;if(r.length>=lx||(s=d.nextCursor,s===void 0||s.length===0))break}return{ok:!0,query:n,results:r}}function Mp(t){return`registro MCP indispon\xEDvel (${ll}): ${t}`}function MM(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 OM(t){if(!Fr(t))return{servers:[]};let e=Array.isArray(t.servers)?t.servers:[],o=[];for(let s of e){let i=zH(s);i!==void 0&&o.push(i)}let n=Fr(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 zH(t){if(!Fr(t))return;let e=Fr(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=KH(e);return{name:o,description:n,run:i,...r!==void 0?{title:r}:{},...s!==void 0?{version:s}:{}}}function KH(t){let e=[],o=Array.isArray(t.remotes)?t.remotes:[];for(let r of o)Fr(r)&&typeof r.url=="string"&&e.push(r.url);let n=Array.isArray(t.packages)?t.packages:[];for(let r of n){if(!Fr(r))continue;let s=VH(r);if(s!==void 0)return{...s,remoteUrls:e}}return{args:[],env:[],remoteUrls:e}}function VH(t){let e=wi(t.registryType)??wi(t.registry_name),o=wi(t.identifier)??wi(t.name);if(o===void 0)return;let n=wi(t.version),r=wi(t.runtimeHint),s=Fr(t.transport)?wi(t.transport.type):void 0,i=XH(t.environmentVariables),a=TM(t.runtimeArguments),l=TM(t.packageArguments),c=n!==void 0?`${o}@${n}`:o;return e==="npm"||r==="npx"?{command:"npx",args:YH(["-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 YH(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 TM(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)Fr(o)&&typeof o.value=="string"&&e.push(o.value);return e}function XH(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)Fr(o)&&typeof o.name=="string"&&o.name.length>0&&e.push({name:o.name,required:o.isRequired===!0});return e}function wi(t){return typeof t=="string"&&t.trim().length>0?t.trim():void 0}function Fr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function JH(t){return t instanceof Error?t.message:String(t)}var ll,RM,WH,GH,lx,PM=A(()=>{"use strict";ll="registry.modelcontextprotocol.io",RM=`https://${ll}/v0/servers`,WH=5,GH=100,lx=25});function FM(t){let{command:e,args:o}=t.run;if(e===void 0)return;let n=NM(t.name);return["aluy","mcp","add",LM(n),"--",e,...o.map(LM)].join(" ")}function NM(t){let o=(t.split("/").pop()??t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");return o.length>0?o:"server"}function LM(t){return/^[A-Za-z0-9_./@:+=-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function dx(t){if(!t.ok)return`\u26A0 ${t.reason}
|
|
144
144
|
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(QH(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(`
|
|
145
145
|
`)}function QH(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(` ${ZH(t.description,200)}`);let r=FM(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(`
|
|
146
|
-
`)}function ZH(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var IM=A(()=>{"use strict"});var $M=A(()=>{"use strict";_p();SM();EM();wM();AM();DM();Yb();Ym();PM();IM()});function ux(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 BM(t,e){let o=ux(t),n=ux(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 mx(t,e){return BM(t,e)===1}var UM=A(()=>{"use strict"});function Op(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)"};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 fx=A(()=>{"use strict"});function px(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 hx(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 zd,jM=A(()=>{"use strict";fx();zd={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function gx(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function cl(t){return typeof t=="object"&&t!==null?t:void 0}function yx(t,e){let o=cl(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=cl(s);if(!i)continue;let a=gx(i.update_id);a!==void 0&&a>r&&(r=a);let l=cl(i.message);if(!l)continue;let c=cl(l.chat),d=gx(c?.id);if(d===void 0||c?.type!=="private")continue;let m=cl(l.from),u=gx(m?.id)??d,p=m?.is_bot===!0,h=typeof l.text=="string"?l.text:"",v=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 S=cl(l.quote)?.text;return typeof S=="string"&&S.trim()!==""?S:void 0})();n.push({chatId:d,fromId:u,text:h,...v?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var qM=A(()=>{"use strict"});var Kd,HM=A(()=>{"use strict";Kd=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 bx(t){return`connector-${t}-token`}function Vd(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 vx(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var WM=A(()=>{"use strict"});var B=A(()=>{"use strict";BA();uC();EC();YD();uM();hk();vM();$M();Yk();ip();UM();fx();jM();qM();HM();WM()});import{posix as k6}from"node:path";function x6(t){return k6.normalize(t)}function $o(t){let e=x6(t);for(let o of S6)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function Ix(t){return $o(t).kind==="allow"}var S6,Ss=A(()=>{"use strict";S6=[{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 iS={};Hg(iS,{UserWorkflowsLoader:()=>ir,WORKFLOWS_DIRNAME:()=>sS});import{homedir as u9}from"node:os";import{join as rS}from"node:path";import{readdirSync as m9,readFileSync as f9,mkdirSync as p9,statSync as h9}from"node:fs";var g9,sS,y9,b9,ir,Qp=A(()=>{"use strict";B();g9=448,sS="workflows",y9=64*1024,b9=256,ir=class{dir;constructor(e={}){let o=e.baseDir??rS(u9(),".aluy");this.dir=rS(o,sS)}get workflowsDir(){return this.dir}ensureDir(){try{p9(this.dir,{mode:g9,recursive:!0})}catch{}}load(){let e;try{e=m9(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>=b9)break;let a=this.readOne(i);if(a!==null){if(Ed(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=rS(this.dir,e);try{let n=h9(o);if(!n.isFile()||n.size>y9)return null;let r=f9(o,"utf8");return wd(e,r,"global")}catch{return null}}}});var lS={};Hg(lS,{PROJECT_WORKFLOWS_DIRNAMES:()=>aS,ProjectWorkflowsLoader:()=>ar});import{join as v9}from"node:path";import{readdirSync as k9,readFileSync as x9,statSync as S9}from"node:fs";var aS,E9,w9,ar,Zp=A(()=>{"use strict";B();Ss();aS=[".claude/workflows",".aluy/workflows"],E9=64*1024,w9=256,ar=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of aS){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=k9(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>=w9)break;let c=this.readOne(r,s,l);if(c!==null){if(Ed(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($o(r).kind!=="allow")return null;let s=v9(o,n);try{this.workspace.resolveInside(r);let i=S9(s);if(!i.isFile()||i.size>E9)return null;let a=x9(s,"utf8");return wd(n,a,"project")}catch{return null}}}});var wI=gU((JCe,EI)=>{EI.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 wn="1.0.0-rc.124";B();var GM=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
146
|
+
`)}function ZH(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var IM=A(()=>{"use strict"});var $M=A(()=>{"use strict";_p();SM();EM();wM();AM();DM();Yb();Ym();PM();IM()});function ux(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 BM(t,e){let o=ux(t),n=ux(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 mx(t,e){return BM(t,e)===1}var UM=A(()=>{"use strict"});function Op(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)"};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 fx=A(()=>{"use strict"});function px(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 hx(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 zd,jM=A(()=>{"use strict";fx();zd={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function gx(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function cl(t){return typeof t=="object"&&t!==null?t:void 0}function yx(t,e){let o=cl(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=cl(s);if(!i)continue;let a=gx(i.update_id);a!==void 0&&a>r&&(r=a);let l=cl(i.message);if(!l)continue;let c=cl(l.chat),d=gx(c?.id);if(d===void 0||c?.type!=="private")continue;let m=cl(l.from),u=gx(m?.id)??d,p=m?.is_bot===!0,h=typeof l.text=="string"?l.text:"",v=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 S=cl(l.quote)?.text;return typeof S=="string"&&S.trim()!==""?S:void 0})();n.push({chatId:d,fromId:u,text:h,...v?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var qM=A(()=>{"use strict"});var Kd,HM=A(()=>{"use strict";Kd=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 bx(t){return`connector-${t}-token`}function Vd(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 vx(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var WM=A(()=>{"use strict"});var B=A(()=>{"use strict";BA();uC();EC();YD();uM();hk();vM();$M();Yk();ip();UM();fx();jM();qM();HM();WM()});import{posix as k6}from"node:path";function x6(t){return k6.normalize(t)}function $o(t){let e=x6(t);for(let o of S6)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function Ix(t){return $o(t).kind==="allow"}var S6,Ss=A(()=>{"use strict";S6=[{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 iS={};Hg(iS,{UserWorkflowsLoader:()=>ir,WORKFLOWS_DIRNAME:()=>sS});import{homedir as u9}from"node:os";import{join as rS}from"node:path";import{readdirSync as m9,readFileSync as f9,mkdirSync as p9,statSync as h9}from"node:fs";var g9,sS,y9,b9,ir,Qp=A(()=>{"use strict";B();g9=448,sS="workflows",y9=64*1024,b9=256,ir=class{dir;constructor(e={}){let o=e.baseDir??rS(u9(),".aluy");this.dir=rS(o,sS)}get workflowsDir(){return this.dir}ensureDir(){try{p9(this.dir,{mode:g9,recursive:!0})}catch{}}load(){let e;try{e=m9(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>=b9)break;let a=this.readOne(i);if(a!==null){if(Ed(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=rS(this.dir,e);try{let n=h9(o);if(!n.isFile()||n.size>y9)return null;let r=f9(o,"utf8");return wd(e,r,"global")}catch{return null}}}});var lS={};Hg(lS,{PROJECT_WORKFLOWS_DIRNAMES:()=>aS,ProjectWorkflowsLoader:()=>ar});import{join as v9}from"node:path";import{readdirSync as k9,readFileSync as x9,statSync as S9}from"node:fs";var aS,E9,w9,ar,Zp=A(()=>{"use strict";B();Ss();aS=[".claude/workflows",".aluy/workflows"],E9=64*1024,w9=256,ar=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of aS){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=k9(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>=w9)break;let c=this.readOne(r,s,l);if(c!==null){if(Ed(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($o(r).kind!=="allow")return null;let s=v9(o,n);try{this.workspace.resolveInside(r);let i=S9(s);if(!i.isFile()||i.size>E9)return null;let a=x9(s,"utf8");return wd(n,a,"project")}catch{return null}}}});var wI=gU((JCe,EI)=>{EI.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 wn="1.0.0-rc.125";B();var GM=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
147
147
|
|
|
148
148
|
Uso:
|
|
149
149
|
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.125",
|
|
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",
|