@hiperplano/aluy-cli 1.0.0-rc.73 → 1.0.0-rc.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-bundle/bin/aluy.js +3 -3
- package/dist-bundle/index.js +3 -3
- package/package.json +1 -1
package/dist-bundle/bin/aluy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var s8=Object.create;var sy=Object.defineProperty;var i8=Object.getOwnPropertyDescriptor;var a8=Object.getOwnPropertyNames;var l8=Object.getPrototypeOf,c8=Object.prototype.hasOwnProperty;var p=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var u8=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},pt=(t,e)=>{for(var o in e)sy(t,o,{get:e[o],enumerable:!0})},d8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of a8(e))!c8.call(t,r)&&r!==o&&sy(t,r,{get:()=>e[r],enumerable:!(n=i8(e,r))||n.enumerable});return t};var m8=(t,e,o)=>(o=t!=null?s8(l8(t)):{},d8(e||!t||!t.__esModule?sy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as f8}from"node:os";import{join as p8}from"node:path";function Yl(t=f8()){return p8(t,".aluy")}var Dm=p(()=>{"use strict"});var Vl,cC=p(()=>{"use strict";Vl="1.0.0-rc.
|
|
2
|
+
var s8=Object.create;var sy=Object.defineProperty;var i8=Object.getOwnPropertyDescriptor;var a8=Object.getOwnPropertyNames;var l8=Object.getPrototypeOf,c8=Object.prototype.hasOwnProperty;var p=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var u8=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},pt=(t,e)=>{for(var o in e)sy(t,o,{get:e[o],enumerable:!0})},d8=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of a8(e))!c8.call(t,r)&&r!==o&&sy(t,r,{get:()=>e[r],enumerable:!(n=i8(e,r))||n.enumerable});return t};var m8=(t,e,o)=>(o=t!=null?s8(l8(t)):{},d8(e||!t||!t.__esModule?sy(o,"default",{value:t,enumerable:!0}):o,t));import{homedir as f8}from"node:os";import{join as p8}from"node:path";function Yl(t=f8()){return p8(t,".aluy")}var Dm=p(()=>{"use strict"});var Vl,cC=p(()=>{"use strict";Vl="1.0.0-rc.74"});function Dr(t,e){return t.decide(e)}var ni=p(()=>{"use strict"});var jn,Tr,_r=p(()=>{"use strict";jn="remember",Tr="recall"});var iy,h8,da,ay=p(()=>{"use strict";iy=class{id;horizon;label;parentId;children;dependencies;pinned;closed;createdAt;lastAccessedAt;accessCount;context;constructor(e,o,n,r,s){this.id=e,this.horizon=o,this.label=n,this.parentId=r,this.children=new Set,this.dependencies=new Set,this.pinned=!1,this.closed=!1,this.createdAt=s,this.lastAccessedAt=s,this.accessCount=0,this.context=[]}touch(e){this.lastAccessedAt=e,this.accessCount+=1}snapshot(){return{id:this.id,horizon:this.horizon,label:this.label,parentId:this.parentId,children:[...this.children],dependencies:[...this.dependencies],pinned:this.pinned,closed:this.closed,createdAt:this.createdAt,lastAccessedAt:this.lastAccessedAt,accessCount:this.accessCount,contextSize:this.context.length}}},h8=200,da=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??h8,this.now=e?.clock??Date.now}static boxId(e,o){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}-${o.toString(36)}`}openBox(e,o,n,r){let s=this.nodes.get(e);if(s)return s.touch(this.now()),{box:s.snapshot(),created:!1};if(this.nodes.size>=this.maxBoxes&&(this.evictOne(),this.nodes.size>=this.maxBoxes))return null;let i=this.now(),a=new iy(e,o,n,r??null,i);if(r){let l=this.nodes.get(r);l&&l.children.add(e)}return this.nodes.set(e,a),{box:a.snapshot(),created:!0}}closeBox(e){let o=this.nodes.get(e);return o?(o.closed=!0,o.touch(this.now()),o.snapshot()):null}isClosed(e){let o=this.nodes.get(e);return o?o.closed:!1}reopenBox(e){let o=this.nodes.get(e);return o?(o.closed=!1,o.touch(this.now()),o.snapshot()):null}setHorizon(e,o){let n=this.nodes.get(e);return n?(n.horizon=o,n.touch(this.now()),n.snapshot()):null}setParent(e,o){let n=this.nodes.get(e);return n?n.parentId===o?n.snapshot():o!==null&&this.wouldCreateCycle(e,o)?null:(n.parentId&&this.nodes.get(n.parentId)?.children.delete(e),n.parentId=o,o&&this.nodes.get(o)?.children.add(e),n.touch(this.now()),n.snapshot()):null}wouldCreateCycle(e,o){let n=new Set,r=o;for(;r!==null;){if(r===e||n.has(r))return!0;n.add(r),r=this.nodes.get(r)?.parentId??null}return!1}getBox(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),o.snapshot()):null}listBoxes(e="lastAccessedAt"){let o=[...this.nodes.values()].map(n=>n.snapshot());switch(e){case"createdAt":return o.sort((n,r)=>n.createdAt-r.createdAt);case"accessCount":return o.sort((n,r)=>r.accessCount-n.accessCount);default:return o.sort((n,r)=>r.lastAccessedAt-n.lastAccessedAt)}}get size(){return this.nodes.size}addContext(e,o){let n=this.nodes.get(e);return n?(n.context.push({ts:this.now(),text:o}),n.touch(this.now()),n.snapshot()):null}getContext(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),[...o.context]):[]}getContextChain(e){let o=[],n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let s=this.nodes.get(r);if(!s)break;s.touch(this.now()),o.push({boxId:s.id,entries:[...s.context]}),r=s.parentId}return o}addDependency(e,o){let n=this.nodes.get(e);return!n||!this.nodes.has(o)||n.id===o?!1:(n.dependencies.add(o),n.touch(this.now()),!0)}getDependencies(e){let o=this.nodes.get(e);return o?[...o.dependencies]:[]}pinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!0,o.touch(this.now()),o.snapshot()):null}unpinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!1,o.touch(this.now()),o.snapshot()):null}evictOne(){let e=[];for(let n of this.nodes.values())n.horizon==="longo"||n.pinned||e.push(n);if(e.length===0)return null;e.sort((n,r)=>{let s=n.horizon==="curto"?0:1,i=r.horizon==="curto"?0:1;if(s!==i)return s-i;let a=n.closed?0:1,l=r.closed?0:1;return a!==l?a-l:n.lastAccessedAt!==r.lastAccessedAt?n.lastAccessedAt-r.lastAccessedAt:n.accessCount-r.accessCount});let o=e[0];return this.removeNode(o)}forceEvict(e){let o=this.nodes.get(e);return!o||o.horizon==="longo"||o.pinned?null:this.removeNode(o)}removeBox(e){let o=this.nodes.get(e);return o?this.removeNode(o):null}removeNode(e){if(e.parentId){let o=this.nodes.get(e.parentId);o&&o.children.delete(e.id)}return this.nodes.delete(e.id),e.snapshot()}}});function Tm(t){let e=[];for(let o of t){e.push({step:o,depth:0});for(let n of o.substeps??[])e.push({step:n,depth:1})}return e}function mC(t,e){let o,n="pending",r;if(typeof t=="string")o=t;else if(t!==null&&typeof t=="object"){let i=t,a=i.title??i.step??i.text??i.name??i.content;if(typeof a=="string"&&(o=a),typeof i.status=="string"&&g8.has(i.status)&&(n=i.status),e){let l=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(l)&&l.length>0){let c=[];for(let u of l){let m=mC(u,!1);if(typeof m=="string")return m;c.push(m)}r=c}}}if(o===void 0||o.trim()==="")return b8;let s=o.trim().slice(0,y8);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function v8(t){let e=t.steps??t.plan??t.todos??t.items;if(!Array.isArray(e))return{error:'update_plan: passe "steps" como uma LISTA de passos (string ou {title,status}).'};if(e.length===0)return{error:"update_plan: a lista de passos est\xE1 vazia."};let o=[];for(let i of e){let a=mC(i,!0);if(typeof a=="string")return{error:a};o.push(a)}let n=new Set,r=i=>{if(!n.has(i))return n.add(i),i;for(let a=2;;a++){let l=`${i} #${a}`;if(!n.has(l))return n.add(l),l}};for(let i=0;i<o.length;i++){let a=o[i],l=r(a.title),c=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Tm(o).length;return s>uC?{error:`update_plan: no m\xE1ximo ${uC} passos (recebidos ${s}).`}:{steps:o}}function k8(t){let e=Tm(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${fC[r.step.status]} ${r.step.title}`).join(`
|
|
3
3
|
`);return`plano (${o}/${e.length}):
|
|
4
4
|
${n}`}function S8(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function w8(t,e){let o=new Map;for(let i of e.listBoxes())o.set(i.label,i.id);let n=t.findIndex(i=>i.status==="in_progress"||(i.substeps??[]).some(a=>a.status==="in_progress")),r=(i,a,l)=>{let c=i.status==="in_progress"?"curto":l,u=o.get(i.title),m=u??da.boxId(i.title,0);return u?(i.status!=="completed"&&e.isClosed(u)&&e.reopenBox(u),e.setHorizon(u,c),e.setParent(u,a)):e.openBox(m,c,i.title,a),i.status==="completed"&&!e.isClosed(m)&&e.closeBox(m),o.set(i.title,m),m};t.forEach((i,a)=>{let l=S8(a,n),c=r(i,null,l);for(let u of i.substeps??[])r(u,c,l)});let s=new Set;for(let i of t){s.add(i.title);for(let a of i.substeps??[])s.add(a.title)}for(let i of e.listBoxes())s.has(i.label)||e.removeBox(i.id)}function E8(t,e){if(!e)return k8(t);let o=new Map;for(let c of e.listBoxes())o.set(c.label,c);let n=new Map;for(let c of e.listBoxes())n.set(c.id,c);let r=new Map,s=(c,u=new Set)=>{let m=r.get(c);if(m!==void 0)return m;let d=n.get(c);if(!d||!d.parentId||u.has(c))return r.set(c,0),0;let h=s(d.parentId,new Set(u).add(c))+1;return r.set(c,h),h},i=Tm(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:u}of i){let m=o.get(c.title),d=m?x8[m.horizon]:"",h=m?s(m.id):u,g=" ".repeat(h),b=fC[c.status];l.push(`${g}${d} ${b} ${c.title}`)}return l.join(`
|
|
5
5
|
`)}var Xl,g8,uC,y8,b8,fC,x8,dC,A8,pC,_m=p(()=>{"use strict";ay();Xl="update_plan";g8=new Set(["pending","in_progress","completed"]),uC=30,y8=120,b8="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";fC={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};x8={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};dC=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),A8=Object.freeze({type:"object",properties:{steps:{type:"array",description:"A lista COMPLETA de passos do plano (re-emita TODOS a cada atualiza\xE7\xE3o \u2014 substitui o anterior).",items:{type:"object",properties:{title:{type:"string",description:"O passo, curto e no imperativo."},status:dC,substeps:{type:"array",description:"OPCIONAL: sub-passos que detalham este passo (1 n\xEDvel). Aparecem indentados sob o passo e seguem o foco dele. Use quando um passo tem a\xE7\xF5es menores distintas.",items:{type:"object",properties:{title:{type:"string",description:"O sub-passo, curto e no imperativo."},status:dC},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),pC={name:Xl,effect:"read",description:"Declara/atualiza um PLANO vis\xEDvel (checklist de passos). Use ao iniciar uma tarefa com V\xC1RIOS passos e a cada progresso: re-emita a lista TODA marcando o status de cada passo (pending/in_progress/completed). Mantenha 1 passo in_progress por vez. N\xE3o tem efeito no sistema \u2014 \xE9 s\xF3 o seu plano, para voc\xEA e para o usu\xE1rio acompanharem.",parameters:A8,async run(t,e){let o=v8(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&w8(o.steps,e.graph),e.plan&&e.plan.set(Tm(o.steps).map(r=>({title:r.step.title,status:r.step.status}))),{ok:!0,observation:E8(o.steps,e.graph)})}}});function hC(t){let e=t.question??t.prompt??t.text??t.message;if(typeof e!="string"||e.trim()==="")return{error:'perguntar: passe "question" (a pergunta em texto). Para escolha, passe tamb\xE9m "options".'};let o=e.trim().slice(0,2e3),n=t.header??t.title,r=typeof n=="string"&&n.trim()!==""?n.trim().slice(0,200):void 0,s=t.options??t.choices,i=Array.isArray(s)?D8(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&C8.has(l))a=l;else{if(typeof l=="string"&&l.trim()!=="")return{error:`perguntar: "kind" inv\xE1lido "${l}". Use "single", "multi" ou "text".`};a=i!==void 0&&i.length>0?"single":"text"}if((a==="single"||a==="multi")&&(i===void 0||i.length===0))return{error:`perguntar: kind "${a}" requer "options" (uma lista de ao menos 1 op\xE7\xE3o).`};let c=t.allowOther!==!1;return{spec:{kind:a,question:o,...r!==void 0?{header:r}:{},...a!=="text"&&i!==void 0?{options:i}:{},...a!=="text"?{allowOther:c}:{}}}}function D8(t){if(t.length===0)return'perguntar: a lista de "options" est\xE1 vazia.';if(t.length>12)return`perguntar: no m\xE1ximo 12 op\xE7\xF5es (recebidas ${t.length}).`;let e=[];for(let o of t){let n,r;if(typeof o=="string")n=o;else if(o!==null&&typeof o=="object"){let s=o,i=s.label??s.text??s.value??s.name??s.title;typeof i=="string"&&(n=i),typeof s.description=="string"&&s.description.trim()!==""&&(r=s.description.trim().slice(0,300))}if(n===void 0||n.trim()==="")return'perguntar: cada op\xE7\xE3o precisa de um "label" (texto) n\xE3o-vazio.';e.push({label:n.trim().slice(0,200),...r!==void 0?{description:r}:{}})}return e}function T8(t){switch(t.kind){case"choice":return t.label;case"choices":return t.labels.length===0?"(nenhuma)":t.labels.join(", ");case"text":{let e=t.text.split(`
|
|
@@ -154,7 +154,7 @@ ${t.trim()}`}}function gR(t,e,o=pu){let{older:n,recent:r}=Jf(t,o);if(n.length===
|
|
|
154
154
|
`);let i=xo(process.execPath,[n,"-p",o,"--yolo","--no-self-check"],{stdio:"inherit",timeout:9e5,env:{...process.env,ALUY_OVERWRITE_RENDER:"0",ALUY_SYNC_OUTPUT:"0",ALUY_NO_WEAK_YOLO_WARN:"1",ALUY_PRINT_VERBOSE:"1"}});if(t==="mem0")try{let l=ve(an(),Nr),c=ve(l,_n);Ze(l)&&Tp(Rp(),c)}catch{}t==="ollama"&&(await NG(),$G()),process.stderr.write(`
|
|
155
155
|
verificando "${t}"\u2026 (alguns segundos; a pr\xF3xima etapa vem em seguida)
|
|
156
156
|
`);let a=await HO(t,process.platform,!0);for(let l=0;l<PG&&!a;l++)await IG(FG),a=await HO(t,process.platform,!0);return{target:t,hashOk:a,installed:a,message:a?`complemento "${t}" instalado e verificado.`:`o complemento "${t}" ainda n\xE3o respondeu como esperado. O Aluy CLI funciona sem ele; voc\xEA pode tentar de novo depois com \`aluy bootstrap\`.`}}function IG(t){return new Promise(e=>setTimeout(e,t))}async function NG(){for(let t of[Tn,Op()])try{await(await fetch(`http://${rn}:${Vn}/api/pull`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,stream:!1})})).text()}catch{}}function $G(){if(process.platform!=="win32")try{let t=xo("sh",["-lc","command -v ollama"],{encoding:"utf8",timeout:1e4});if(t.status===0&&(t.stdout??"").trim()!=="")return;let e=_p(),n=["/usr/local/bin/ollama","/usr/bin/ollama","/opt/homebrew/bin/ollama",ve(e,".ollama","bin","ollama"),ve(an(),ks,"bin","ollama")].find(i=>Ze(i));if(n===void 0)return;let r=ve(e,".local","bin");Tx(r,{recursive:!0});let s=ve(r,"ollama");try{if($O(s)===$O(n))return;gG(s)}catch{}try{hG(n,s)}catch{}}catch{}}function BG(){try{return xo("python3",["-m","venv","--help"],{timeout:1e4}).status===0}catch{return!1}}function UG(){try{return xo("python3",["-m","pip","--version"],{timeout:1e4}).status===0}catch{return!1}}function jG(t){let e=[],o=[];if(t.has("ollama")&&(WO()||(e.push("zstd (extrair o Ollama)"),o.push("zstd")),GO()||(e.push("tar (extrair o Ollama)"),o.push("tar"))),t.has("mem0")||t.has("headroom")){let r=Rx();r.ok?(BG()||(e.push("m\xF3dulo venv do Python (mem0/headroom criam um virtualenv)"),o.push("python3-venv")),UG()||(e.push("pip do Python (mem0/headroom instalam pacotes)"),o.push("python3-pip"))):(e.push(`python3 >= ${yu} para mem0/headroom (encontrado: ${r.version||"nenhum"})`),o.push("python3","python3-venv","python3-pip"))}if(e.length===0)return[];let n=[...new Set(o)];return["Faltam pr\xE9-requisitos para o modo turbo (o que conseguir, instala; o resto fica de fora):",...e.map(r=>` \u2022 ${r}`),`Instale e rode \`aluy bootstrap\` de novo: sudo apt install -y ${n.join(" ")}`,""]}async function KO(t,e,o){let n=t??"turbo",r=$r(e??{}),s=o?.useAgent!==!1,i=new Dx({...o?.platform?{platform:o.platform}:{},...s?{agentInstaller:LG}:{}});if(!s)for(let a of jG(r))process.stderr.write(a+`
|
|
157
|
-
`);return i.provisionAll(n,r)}var qO,za,kG,_n,UO,Dx,jO,OG,PG,FG,Ox=p(()=>{"use strict";L();qO=".aluy",za=448,kG=384;_n="aluy-mem0-server.py";UO="application/vnd.ollama.image.model";Dx=class{platform;agentInstaller;constructor(e={}){this.platform=e.platform??process.platform,this.agentInstaller=e.agentInstaller}hasPinnedArtifact(){return this.platform==="linux"}async isProvisioned(e){switch(e){case"ollama":{let o=ve(an(),ks,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(an(),Nr,"bin","python3");return Ze(o)&&Lu(o)}case"headroom":{let o=ve(an(),xs,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=bG().uid;if(Hk(n))return{target:e,hashOk:!1,installed:!1,message:"RECUSA ROOT (uid=0): provisionamento de sidecars \xE9 user-space. Execute como usu\xE1rio normal."};if(this.agentInstaller)return this.agentInstaller(e,o);if(!this.hasPinnedArtifact())return{target:e,hashOk:!1,installed:!1,message:`SO '${this.platform}' sem artefato pinado p/ provisionamento direto. Rode \`aluy bootstrap\` (o aluy instala via o pr\xF3prio agente, \u26A0 --yolo) ou instale manualmente.`};switch(e){case"ollama":return AG();case"mem0":return _G();case"headroom":return RG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!vu(e))return{profile:e,targets:[],anySuccess:!1,allFailed:!1};let n=[],r=[...o];for(let a=0;a<r.length;a++){let l=r[a],c={index:a+1,total:r.length,plan:r};try{n.push(await this.provision(l,c))}catch(u){let m=u instanceof Error?u.message:String(u);n.push({target:l,hashOk:!1,installed:!1,message:`falha inesperada ao provisionar \u2014 seguindo p/ os pr\xF3ximos (${m}).`})}}let s=n.some(a=>a.installed),i=n.length>0&&n.every(a=>!a.installed);return{profile:e,targets:n,anySuccess:s,allFailed:i}}},jO="na faixa 3.10\u20133.12 (N\xC3O use 3.13+/3.14 \u2014 as depend\xEAncias nativas n\xE3o t\xEAm wheels e o pip falha ao compilar; no Windows prefira `py -3.12` ou `py -3.11`). Se N\xC3O houver um Python 3.10\u20133.12 instalado, INSTALE primeiro (no Windows: `winget install -e --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements`; no Linux/macOS use o gerenciador do sistema). Se j\xE1 existir um venv nesse caminho numa vers\xE3o incompat\xEDvel (ex.: 3.14), APAGUE e recrie com a vers\xE3o certa",OG="IMPORTANTE \u2014 o usu\xE1rio quer ACOMPANHAR: antes de cada passo, diga em 1 linha o que vai fazer; rode os comandos de instala\xE7\xE3o de forma VIS\xCDVEL (N\xC3O silencie pip/apt/curl com -q; mostre a sa\xEDda/progresso). Sem modo silencioso. ";PG=24,FG=5e3});var Jn,Pu=p(()=>{"use strict";Jn="1.0.0-rc.73"});var QO={};pt(QO,{HELP_TEXT:()=>VO,parseArgs:()=>Mx,suggestFlag:()=>GG,versionText:()=>XO});function ut(t,e,o={}){let n=`--${e}=`;for(let r=0;r<t.length;r++){let s=t[r];if(s===`--${e}`){let i=t[r+1];return i===void 0||(o.allowDashValue?i.startsWith("--"):i.startsWith("-"))?void 0:i}if(s!==void 0&&s.startsWith(n))return s.slice(n.length)}}function HG(t,e){let o=`-${e}=`;for(let n=0;n<t.length;n++){let r=t[n];if(r===`-${e}`){let s=t[n+1];return s!==void 0&&!s.startsWith("-")?s:void 0}if(r!==void 0&&r.startsWith(o))return r.slice(o.length)}}function XO(){return`aluy ${Jn} (@hiperplano/aluy-cli-core ${Vl})`}function WG(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 GG(t){let e,o=3;for(let n of JO){let r=WG(t,n);r<o&&(o=r,e=n)}return e}function zG(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")break;if(!r.startsWith("--")||r.length===2||e.has(n))continue;let s=r.slice(2).split("=",1)[0];s===""||JO.has(s)||o.push(`--${s}`)}return o}function Mx(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let W=t.slice(1),ge=ut(W,"token"),xt=ut(W,"org"),to=W.includes("--device"),Uo=ut(W,"provider"),Sr=W.includes("--oauth");return{kind:"login",forceDeviceFlow:to,...ge!==void 0?{token:ge}:{},...xt!==void 0?{org:xt}:{},...Uo!==void 0?{provider:Uo}:{},...Sr?{oauth:!0}:{}}}if(e==="logout"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"logout"};if(e==="whoami"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"whoami"};if(e==="doctor"&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--deep")||t.includes("--test"),ge=t.includes("--json");return{kind:"doctor",deep:W,json:ge}}if(e==="config"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"config",json:t.includes("--json")};if(e==="agents"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"agents"};if(e==="bootstrap"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"bootstrap",agent:!t.includes("--no-agent")};if(e==="uninstall"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"uninstall",agent:t.includes("--agent")};if(e==="onboard"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"onboard"};if(e==="skills"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"skills"};if(e==="workflows"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"workflows"};if((e==="models"||e==="providers")&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--json"),ge=t.findIndex(to=>to==="--backend"||to.startsWith("--backend=")),xt="both";if(ge!==-1){let Uo=(t[ge].includes("=")?t[ge].slice(10):t[ge+1]??"").trim().toLowerCase();Uo==="local"?xt="local":Uo==="broker"&&(xt="broker")}return{kind:"models",scope:xt,json:W,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let W=t[1];if(W===void 0||!["login","logout","allow","deny","status"].includes(W))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let xt=t.slice(2);if(W==="login"){let to=ut(xt,"token");return{kind:"telegram",sub:"login",...to!==void 0?{token:to}:{}}}if(W==="allow"||W==="deny"){let to=xt.find(Sr=>!Sr.startsWith("-")),Uo=to!==void 0&&/^-?\d+$/.test(to)?Number(to):void 0;return Uo===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Uo}}return{kind:"telegram",sub:W}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(ge=>!ge.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:XO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:VO};let o=t.includes("--plan"),n=t.includes("--unsafe"),r=t.includes("--yolo")||n,s=o?"plan":r?"unsafe":"normal",i=t.includes("--dense"),a=t.includes("--ascii"),l=t.includes("--telegram"),c=t.includes("--split")||t.includes("--view")?!0:void 0,u=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,d=ut(t,"tier"),h=ut(t,"lang"),g=ut(t,"max-tokens"),b=ut(t,"max-iterations"),y=ut(t,"max-output-tokens"),S=!(t.includes("--no-subagents")||t.includes("--no-subagent")),E=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,C=t.includes("--no-autocompact")?"off":ut(t,"autocompact-at"),O=t.includes("--quiet")?!0:void 0,U=t.includes("--cycle")?!0:void 0,q=ut(t,"cycles"),V=ut(t,"cycle-for"),z=ut(t,"backend"),I=ut(t,"local-provider"),Q=ut(t,"local-model"),ne=ut(t,"local-auth"),J=ut(t,"local-base-url"),M=ut(t,"model"),j=ut(t,"provider");if((t.includes("--provider")||t.some(W=>W.startsWith("--provider=")))&&(M===void 0||M.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((M===void 0||M.trim()==="")&&d!==void 0&&d.trim().toLowerCase()==="custom")return{kind:"usage-error",message:"aluy: --tier custom exige --model <slug> (ex.: --model deepseek-v4-pro). A via Custom precisa do slug do modelo; sem ele use um tier can\xF4nico (aluy-flux, aluy-granito, \u2026).",exitCode:2};let Y=ut(t,"effort"),fe=t.includes("--effort")||t.some(W=>W.startsWith("--effort=")),Z;if(Y!==void 0){if(Y.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(Y.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};Z=Y}else if(fe)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let ae=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec=")),F=ae?ut(t,"print",{allowDashValue:!0})??ut(t,"exec",{allowDashValue:!0})??HG(t,"p")??void 0:void 0,he=ae?ut(t,"output-format"):void 0;if(he!==void 0&&!["text","json","stream-json"].includes(he.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${he}" (use text | json | stream-json)`,exitCode:2};let te=t.includes("--new"),ue=t.includes("--continue"),we=t.indexOf("--resume"),Rt=t.find(W=>W.startsWith("--resume=")),Re=we>=0||Rt!==void 0,rt;if(Rt!==void 0)rt=Rt.slice(9);else if(we>=0){let W=t[we+1];W!==void 0&&!W.startsWith("-")&&(rt=W)}let vt=d!==void 0?t.indexOf("--tier")+1:-1,bt=h!==void 0&&!t.some(W=>W.startsWith("--lang="))?t.indexOf("--lang")+1:-1,st=rt!==void 0&&Rt===void 0?we+1:-1,Ot=g!==void 0&&!t.some(W=>W.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,K=b!==void 0&&!t.some(W=>W.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,xe=q!==void 0&&!t.some(W=>W.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Pe=V!==void 0&&!t.some(W=>W.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,H=y!==void 0&&!t.some(W=>W.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,Ht=C!==void 0&&!t.includes("--no-autocompact")&&!t.some(W=>W.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,_o=z!==void 0&&!t.some(W=>W.startsWith("--backend="))?t.indexOf("--backend")+1:-1,k=(W,ge)=>ge!==void 0&&!t.some(xt=>xt.startsWith(`--${W}=`))?t.indexOf(`--${W}`)+1:-1,go=k("local-provider",I),Mt=k("local-model",Q),kt=k("local-auth",ne),rs=k("local-base-url",J),ss=M!==void 0&&!t.some(W=>W.startsWith("--model="))?t.indexOf("--model")+1:-1,vr=j!==void 0&&!t.some(W=>W.startsWith("--provider="))?t.indexOf("--provider")+1:-1,kr=Z!==void 0&&!t.some(W=>W.startsWith("--effort="))?t.indexOf("--effort")+1:-1,qt=he!==void 0&&!t.some(W=>W.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,Wt=F!==void 0&&!t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,vn=t.find((W,ge)=>!W.startsWith("-")&&ge!==vt&&ge!==bt&&ge!==_o&&ge!==go&&ge!==Mt&&ge!==kt&&ge!==rs&&ge!==ss&&ge!==vr&&ge!==kr&&ge!==qt&&ge!==Wt&&ge!==st&&ge!==Ot&&ge!==K&&ge!==H&&ge!==Ht&&ge!==xe&&ge!==Pe),xr=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,as=new Set([vt,bt,_o,go,Mt,kt,rs,ss,vr,kr,qt,Wt,st,Ot,K,H,Ht,xe,Pe].filter(W=>W>=0));for(let W of qG){let ge=t.indexOf(W);ge>=0&&!t[ge].includes("=")&&as.add(ge+1)}let kn=zG(t,as);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...kn.length>0?{unknownFlags:kn}:{},dense:i,fresh:te,subAgents:S,safeGlyphs:a,telegram:l,print:ae,...c!==void 0?{split:c}:{},...u!==void 0?{fullscreen:u}:{},...m!==void 0?{budget:m}:{},...vn!==void 0?{goal:vn}:{},...d!==void 0?{tier:d}:{},...z!==void 0?{backend:z}:{},...I!==void 0?{localProvider:I}:{},...Q!==void 0?{localModel:Q}:{},...ne!==void 0?{localAuth:ne}:{},...J!==void 0?{localBaseUrl:J}:{},...M!==void 0?{model:M}:{},...j!==void 0?{provider:j}:{},...Z!==void 0?{effort:Z}:{},...F!==void 0?{printArg:F}:{},...he!==void 0?{outputFormat:he}:{},...h!==void 0?{lang:h}:{},...xr!==void 0?{resume:xr}:{},...g!==void 0?{maxTokens:g}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...E!==void 0?{selfCheck:E}:{},...C!==void 0?{autoCompactAt:C}:{},...O!==void 0?{quiet:O}:{},...U!==void 0?{cycle:U}:{},...q!==void 0?{cycles:q}:{},...V!==void 0?{cycleFor:V}:{}}}var VO,JO,qG,Lx=p(()=>{"use strict";L();Pu();VO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
157
|
+
`);return i.provisionAll(n,r)}var qO,za,kG,_n,UO,Dx,jO,OG,PG,FG,Ox=p(()=>{"use strict";L();qO=".aluy",za=448,kG=384;_n="aluy-mem0-server.py";UO="application/vnd.ollama.image.model";Dx=class{platform;agentInstaller;constructor(e={}){this.platform=e.platform??process.platform,this.agentInstaller=e.agentInstaller}hasPinnedArtifact(){return this.platform==="linux"}async isProvisioned(e){switch(e){case"ollama":{let o=ve(an(),ks,"bin","ollama");return Ze(o)}case"mem0":{let o=ve(an(),Nr,"bin","python3");return Ze(o)&&Lu(o)}case"headroom":{let o=ve(an(),xs,"bin","headroom");return Ze(o)}default:return!1}}async provision(e,o){let n=bG().uid;if(Hk(n))return{target:e,hashOk:!1,installed:!1,message:"RECUSA ROOT (uid=0): provisionamento de sidecars \xE9 user-space. Execute como usu\xE1rio normal."};if(this.agentInstaller)return this.agentInstaller(e,o);if(!this.hasPinnedArtifact())return{target:e,hashOk:!1,installed:!1,message:`SO '${this.platform}' sem artefato pinado p/ provisionamento direto. Rode \`aluy bootstrap\` (o aluy instala via o pr\xF3prio agente, \u26A0 --yolo) ou instale manualmente.`};switch(e){case"ollama":return AG();case"mem0":return _G();case"headroom":return RG();default:return{target:e,hashOk:!1,installed:!1,message:`Alvo desconhecido: ${String(e)}`}}}async provisionAll(e,o){if(!vu(e))return{profile:e,targets:[],anySuccess:!1,allFailed:!1};let n=[],r=[...o];for(let a=0;a<r.length;a++){let l=r[a],c={index:a+1,total:r.length,plan:r};try{n.push(await this.provision(l,c))}catch(u){let m=u instanceof Error?u.message:String(u);n.push({target:l,hashOk:!1,installed:!1,message:`falha inesperada ao provisionar \u2014 seguindo p/ os pr\xF3ximos (${m}).`})}}let s=n.some(a=>a.installed),i=n.length>0&&n.every(a=>!a.installed);return{profile:e,targets:n,anySuccess:s,allFailed:i}}},jO="na faixa 3.10\u20133.12 (N\xC3O use 3.13+/3.14 \u2014 as depend\xEAncias nativas n\xE3o t\xEAm wheels e o pip falha ao compilar; no Windows prefira `py -3.12` ou `py -3.11`). Se N\xC3O houver um Python 3.10\u20133.12 instalado, INSTALE primeiro (no Windows: `winget install -e --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements`; no Linux/macOS use o gerenciador do sistema). Se j\xE1 existir um venv nesse caminho numa vers\xE3o incompat\xEDvel (ex.: 3.14), APAGUE e recrie com a vers\xE3o certa",OG="IMPORTANTE \u2014 o usu\xE1rio quer ACOMPANHAR: antes de cada passo, diga em 1 linha o que vai fazer; rode os comandos de instala\xE7\xE3o de forma VIS\xCDVEL (N\xC3O silencie pip/apt/curl com -q; mostre a sa\xEDda/progresso). Sem modo silencioso. ";PG=24,FG=5e3});var Jn,Pu=p(()=>{"use strict";Jn="1.0.0-rc.74"});var QO={};pt(QO,{HELP_TEXT:()=>VO,parseArgs:()=>Mx,suggestFlag:()=>GG,versionText:()=>XO});function ut(t,e,o={}){let n=`--${e}=`;for(let r=0;r<t.length;r++){let s=t[r];if(s===`--${e}`){let i=t[r+1];return i===void 0||(o.allowDashValue?i.startsWith("--"):i.startsWith("-"))?void 0:i}if(s!==void 0&&s.startsWith(n))return s.slice(n.length)}}function HG(t,e){let o=`-${e}=`;for(let n=0;n<t.length;n++){let r=t[n];if(r===`-${e}`){let s=t[n+1];return s!==void 0&&!s.startsWith("-")?s:void 0}if(r!==void 0&&r.startsWith(o))return r.slice(o.length)}}function XO(){return`aluy ${Jn} (@hiperplano/aluy-cli-core ${Vl})`}function WG(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 GG(t){let e,o=3;for(let n of JO){let r=WG(t,n);r<o&&(o=r,e=n)}return e}function zG(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")break;if(!r.startsWith("--")||r.length===2||e.has(n))continue;let s=r.slice(2).split("=",1)[0];s===""||JO.has(s)||o.push(`--${s}`)}return o}function Mx(t){let e=t[0];if(e==="login"&&!t.includes("-h")&&!t.includes("--help")){let W=t.slice(1),ge=ut(W,"token"),xt=ut(W,"org"),to=W.includes("--device"),Uo=ut(W,"provider"),Sr=W.includes("--oauth");return{kind:"login",forceDeviceFlow:to,...ge!==void 0?{token:ge}:{},...xt!==void 0?{org:xt}:{},...Uo!==void 0?{provider:Uo}:{},...Sr?{oauth:!0}:{}}}if(e==="logout"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"logout"};if(e==="whoami"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"whoami"};if(e==="doctor"&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--deep")||t.includes("--test"),ge=t.includes("--json");return{kind:"doctor",deep:W,json:ge}}if(e==="config"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"config",json:t.includes("--json")};if(e==="agents"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"agents"};if(e==="bootstrap"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"bootstrap",agent:!t.includes("--no-agent")};if(e==="uninstall"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"uninstall",agent:t.includes("--agent")};if(e==="onboard"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"onboard"};if(e==="skills"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"skills"};if(e==="workflows"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"workflows"};if((e==="models"||e==="providers")&&!t.includes("-h")&&!t.includes("--help")){let W=t.includes("--json"),ge=t.findIndex(to=>to==="--backend"||to.startsWith("--backend=")),xt="both";if(ge!==-1){let Uo=(t[ge].includes("=")?t[ge].slice(10):t[ge+1]??"").trim().toLowerCase();Uo==="local"?xt="local":Uo==="broker"&&(xt="broker")}return{kind:"models",scope:xt,json:W,which:e==="providers"?"providers":"models"}}if(e==="telegram"&&!t.includes("-h")&&!t.includes("--help")){let W=t[1];if(W===void 0||!["login","logout","allow","deny","status"].includes(W))return{kind:"usage-error",message:"uso: aluy telegram <login|logout|allow|deny|status>",exitCode:2};let xt=t.slice(2);if(W==="login"){let to=ut(xt,"token");return{kind:"telegram",sub:"login",...to!==void 0?{token:to}:{}}}if(W==="allow"||W==="deny"){let to=xt.find(Sr=>!Sr.startsWith("-")),Uo=to!==void 0&&/^-?\d+$/.test(to)?Number(to):void 0;return Uo===void 0?{kind:"usage-error",message:`uso: aluy telegram ${W} <chat-id> (um inteiro)`,exitCode:2}:{kind:"telegram",sub:W,chatId:Uo}}return{kind:"telegram",sub:W}}if(e==="mcp"&&t[1]==="search"&&!t.includes("-h")&&!t.includes("--help"))return{kind:"mcp-search",query:t.slice(2).filter(ge=>!ge.startsWith("-")).join(" ").trim()};if(e==="mcp")return{kind:"mcp",argv:t.slice(1)};if(e==="cron")return{kind:"cron",argv:t.slice(1)};if(t.includes("-v")||t.includes("--version"))return{kind:"version",text:XO()};if(t.includes("-h")||t.includes("--help"))return{kind:"help",text:VO};let o=t.includes("--plan"),n=t.includes("--unsafe"),r=t.includes("--yolo")||n,s=o?"plan":r?"unsafe":"normal",i=t.includes("--dense"),a=t.includes("--ascii"),l=t.includes("--telegram"),c=t.includes("--split")||t.includes("--view")?!0:void 0,u=t.includes("--fullscreen")||t.includes("--cockpit")?!0:void 0,m=t.includes("--no-budget")?!1:t.includes("--budget")?!0:void 0,d=ut(t,"tier"),h=ut(t,"lang"),g=ut(t,"max-tokens"),b=ut(t,"max-iterations"),y=ut(t,"max-output-tokens"),S=!(t.includes("--no-subagents")||t.includes("--no-subagent")),E=t.includes("--no-self-check")?"0":t.includes("--self-check")?"1":void 0,C=t.includes("--no-autocompact")?"off":ut(t,"autocompact-at"),O=t.includes("--quiet")?!0:void 0,U=t.includes("--cycle")?!0:void 0,q=ut(t,"cycles"),V=ut(t,"cycle-for"),z=ut(t,"backend"),I=ut(t,"local-provider"),Q=ut(t,"local-model"),ne=ut(t,"local-auth"),J=ut(t,"local-base-url"),M=ut(t,"model"),j=ut(t,"provider");if((t.includes("--provider")||t.some(W=>W.startsWith("--provider=")))&&(M===void 0||M.trim()===""))return{kind:"usage-error",message:"aluy: --provider exige --model (ex.: --provider <provider> --model <slug>)",exitCode:2};if((M===void 0||M.trim()==="")&&d!==void 0&&d.trim().toLowerCase()==="custom")return{kind:"usage-error",message:"aluy: --tier custom exige --model <slug> (ex.: --model deepseek-v4-pro). A via Custom precisa do slug do modelo; sem ele use um tier can\xF4nico (aluy-flux, aluy-granito, \u2026).",exitCode:2};let Y=ut(t,"effort"),fe=t.includes("--effort")||t.some(W=>W.startsWith("--effort=")),Z;if(Y!==void 0){if(Y.trim()==="")return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};if(Y.length>32)return{kind:"usage-error",message:"aluy: --effort aceita no m\xE1ximo 32 caracteres",exitCode:2};Z=Y}else if(fe)return{kind:"usage-error",message:"aluy: --effort requer um valor (ex.: --effort low)",exitCode:2};let ae=t.includes("-p")||t.includes("--print")||t.includes("--exec")||t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec=")),F=ae?ut(t,"print",{allowDashValue:!0})??ut(t,"exec",{allowDashValue:!0})??HG(t,"p")??void 0:void 0,he=ae?ut(t,"output-format"):void 0;if(he!==void 0&&!["text","json","stream-json"].includes(he.trim()))return{kind:"usage-error",message:`aluy: --output-format inv\xE1lido "${he}" (use text | json | stream-json)`,exitCode:2};let te=t.includes("--new"),ue=t.includes("--continue"),we=t.indexOf("--resume"),Rt=t.find(W=>W.startsWith("--resume=")),Re=we>=0||Rt!==void 0,rt;if(Rt!==void 0)rt=Rt.slice(9);else if(we>=0){let W=t[we+1];W!==void 0&&!W.startsWith("-")&&(rt=W)}let vt=d!==void 0?t.indexOf("--tier")+1:-1,bt=h!==void 0&&!t.some(W=>W.startsWith("--lang="))?t.indexOf("--lang")+1:-1,st=rt!==void 0&&Rt===void 0?we+1:-1,Ot=g!==void 0&&!t.some(W=>W.startsWith("--max-tokens="))?t.indexOf("--max-tokens")+1:-1,K=b!==void 0&&!t.some(W=>W.startsWith("--max-iterations="))?t.indexOf("--max-iterations")+1:-1,xe=q!==void 0&&!t.some(W=>W.startsWith("--cycles="))?t.indexOf("--cycles")+1:-1,Pe=V!==void 0&&!t.some(W=>W.startsWith("--cycle-for="))?t.indexOf("--cycle-for")+1:-1,H=y!==void 0&&!t.some(W=>W.startsWith("--max-output-tokens="))?t.indexOf("--max-output-tokens")+1:-1,Ht=C!==void 0&&!t.includes("--no-autocompact")&&!t.some(W=>W.startsWith("--autocompact-at="))?t.indexOf("--autocompact-at")+1:-1,_o=z!==void 0&&!t.some(W=>W.startsWith("--backend="))?t.indexOf("--backend")+1:-1,k=(W,ge)=>ge!==void 0&&!t.some(xt=>xt.startsWith(`--${W}=`))?t.indexOf(`--${W}`)+1:-1,go=k("local-provider",I),Mt=k("local-model",Q),kt=k("local-auth",ne),rs=k("local-base-url",J),ss=M!==void 0&&!t.some(W=>W.startsWith("--model="))?t.indexOf("--model")+1:-1,vr=j!==void 0&&!t.some(W=>W.startsWith("--provider="))?t.indexOf("--provider")+1:-1,kr=Z!==void 0&&!t.some(W=>W.startsWith("--effort="))?t.indexOf("--effort")+1:-1,qt=he!==void 0&&!t.some(W=>W.startsWith("--output-format="))?t.indexOf("--output-format")+1:-1,Wt=F!==void 0&&!t.some(W=>W.startsWith("-p=")||W.startsWith("--print=")||W.startsWith("--exec="))?Math.max(t.indexOf("-p"),t.indexOf("--print"),t.indexOf("--exec"))+1:-1,vn=t.find((W,ge)=>!W.startsWith("-")&&ge!==vt&&ge!==bt&&ge!==_o&&ge!==go&&ge!==Mt&&ge!==kt&&ge!==rs&&ge!==ss&&ge!==vr&&ge!==kr&&ge!==qt&&ge!==Wt&&ge!==st&&ge!==Ot&&ge!==K&&ge!==H&&ge!==Ht&&ge!==xe&&ge!==Pe),xr=ue?{kind:"continue"}:Re?{kind:"resume",...rt!==void 0?{id:rt}:{}}:void 0,as=new Set([vt,bt,_o,go,Mt,kt,rs,ss,vr,kr,qt,Wt,st,Ot,K,H,Ht,xe,Pe].filter(W=>W>=0));for(let W of qG){let ge=t.indexOf(W);ge>=0&&!t[ge].includes("=")&&as.add(ge+1)}let kn=zG(t,as);return{kind:"launch",mode:s,unsafe:s==="unsafe",unsafeAliasUsed:n,...kn.length>0?{unknownFlags:kn}:{},dense:i,fresh:te,subAgents:S,safeGlyphs:a,telegram:l,print:ae,...c!==void 0?{split:c}:{},...u!==void 0?{fullscreen:u}:{},...m!==void 0?{budget:m}:{},...vn!==void 0?{goal:vn}:{},...d!==void 0?{tier:d}:{},...z!==void 0?{backend:z}:{},...I!==void 0?{localProvider:I}:{},...Q!==void 0?{localModel:Q}:{},...ne!==void 0?{localAuth:ne}:{},...J!==void 0?{localBaseUrl:J}:{},...M!==void 0?{model:M}:{},...j!==void 0?{provider:j}:{},...Z!==void 0?{effort:Z}:{},...F!==void 0?{printArg:F}:{},...he!==void 0?{outputFormat:he}:{},...h!==void 0?{lang:h}:{},...xr!==void 0?{resume:xr}:{},...g!==void 0?{maxTokens:g}:{},...b!==void 0?{maxIterations:b}:{},...y!==void 0?{maxOutputTokens:y}:{},...E!==void 0?{selfCheck:E}:{},...C!==void 0?{autoCompactAt:C}:{},...O!==void 0?{quiet:O}:{},...U!==void 0?{cycle:U}:{},...q!==void 0?{cycles:q}:{},...V!==void 0?{cycleFor:V}:{}}}var VO,JO,qG,Lx=p(()=>{"use strict";L();Pu();VO=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
158
158
|
|
|
159
159
|
Uso:
|
|
160
160
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
|
@@ -624,7 +624,7 @@ Notas:
|
|
|
624
624
|
`)}var MQ,Vo,PQ,NQ,Cl=p(()=>{"use strict";zS();Tt();MQ=56;Vo=[{name:"help",summary:"mostra esta lista",summaryKey:"cmd.help",source:"native",id:"help",section:"sess\xE3o",parallelWhileBusy:!0},{name:"login",summary:"entrar na conta",summaryKey:"cmd.login",source:"native",id:"login",section:"conta"},{name:"logout",summary:"sair da conta",summaryKey:"cmd.logout",source:"native",id:"logout",section:"conta"},{name:"whoami",summary:"conta, org e escopos atuais",summaryKey:"cmd.whoami",source:"native",id:"whoami",section:"conta",parallelWhileBusy:!0},{name:"telegram",summary:"conector Telegram \xB7 status/allow/deny/logout (setup na sess\xE3o)",summaryKey:"cmd.telegram",source:"native",id:"telegram",section:"conta",parallelWhileBusy:!0},{name:"doctor",summary:"diagn\xF3stico da instala\xE7\xE3o \xB7 credencial, broker, MCP, config (read-only)",summaryKey:"cmd.doctor",source:"native",id:"doctor",section:"conta",parallelWhileBusy:!0},{name:"model",summary:"trocar o tier",summaryKey:"cmd.model",source:"native",id:"model",section:"sess\xE3o"},{name:"provider",summary:"seta o provider do modelo Custom",summaryKey:"cmd.provider",source:"native",id:"provider",section:"sess\xE3o"},{name:"effort",summary:"seta o reasoning_effort (low/medium/high/custom) \xB7 passthrough \u226432 chars",summaryKey:"cmd.effort",source:"native",id:"effort",section:"sess\xE3o",parallelWhileBusyWith:RQ},{name:"theme",summary:"trocar o tema (dark/light) \xB7 auto-detecta no boot",summaryKey:"cmd.theme",source:"native",id:"theme",section:"sess\xE3o"},{name:"lang",summary:"trocar o idioma (pt-BR/en) \xB7 auto-detecta no boot",summaryKey:"cmd.lang",source:"native",id:"lang",section:"sess\xE3o"},{name:"usage",summary:"tokens e janela desta sess\xE3o",summaryKey:"cmd.usage",source:"native",id:"usage",section:"sess\xE3o",parallelWhileBusy:!0},{name:"rename",summary:"d\xE1 um nome + cor de identifica\xE7\xE3o \xE0 sess\xE3o \xB7 \u25CFnome no composer",summaryKey:"cmd.rename",source:"native",id:"rename",section:"sess\xE3o"},{name:"history",summary:"navega e RETOMA uma sess\xE3o anterior \xB7 sem sair do aluy",summaryKey:"cmd.history",source:"native",id:"history",section:"sess\xE3o"},{name:"ask",summary:"pergunta PARALELA (read-only) sem parar o trabalho em curso",source:"native",id:"ask",section:"sess\xE3o",parallelWhileBusy:!0},{name:"notify",summary:"liga/desliga o sino de aten\xE7\xE3o (on/off)",summaryKey:"cmd.notify",source:"native",id:"notify",section:"sess\xE3o"},{name:"split",summary:"liga/desliga o painel de LOG ao lado do chat (Ctrl+L \xB7 /view)",source:"native",id:"split",section:"sess\xE3o"},{name:"fullscreen",summary:"modo cockpit (tela cheia, alt-screen)",summaryKey:"cmd.fullscreen",source:"native",id:"fullscreen",section:"sess\xE3o"},{name:"undo",summary:"desfaz a \xFAltima edi\xE7\xE3o de arquivo do agente",summaryKey:"cmd.undo",source:"native",id:"undo",section:"workspace"},{name:"redo",summary:"refaz a \xFAltima edi\xE7\xE3o desfeita",summaryKey:"cmd.redo",source:"native",id:"redo",section:"workspace"},{name:"rewind",summary:"volta a um ponto da sess\xE3o (c\xF3digo e/ou conversa) \xB7 Esc Esc",summaryKey:"cmd.rewind",source:"native",id:"rewind",section:"workspace"},{name:"clear",summary:"limpa a sess\xE3o (contexto) \xB7 full tamb\xE9m APAGA a mem\xF3ria do agente",summaryKey:"cmd.clear",source:"native",id:"clear",section:"sess\xE3o",subcommands:[{name:"full",summary:"limpa a sess\xE3o E APAGA a mem\xF3ria (global+projeto) \xB7 confirma",usage:"full",terminal:!0},{name:"memory",summary:"APAGA s\xF3 a mem\xF3ria do agente (global+projeto) \xB7 confirma",usage:"memory",terminal:!0}]},{name:"compact",summary:"compacta o contexto (resume a conversa e continua)",summaryKey:"cmd.compact",source:"native",id:"compact",section:"sess\xE3o"},{name:"cycle",summary:"roda uma tarefa em ciclos \xB7 com tetos duros e parada (anti-runaway)",summaryKey:"cmd.cycle",source:"native",id:"cycle",section:"sess\xE3o",usage:'<intervalo> "<tarefa>"',subcommands:[{name:"pause",summary:"pausa o /cycle em execu\xE7\xE3o (sem matar; Esc ainda para)",usage:"pause",terminal:!0},{name:"resume",summary:"retoma um /cycle pausado",usage:"resume",terminal:!0},{name:"edit",summary:"reconfigura o /cycle ativo \xB7 vale na pr\xF3xima itera\xE7\xE3o",usage:'edit ["<tarefa>"] [<intervalo>] [--max-iter N]'},{name:"status",summary:"mostra o /cycle ativo (config corrente \xB7 pausado?)",usage:"status",terminal:!0},{name:"stop",summary:"para/encerra o /cycle em execu\xE7\xE3o (= Esc)",usage:"stop",terminal:!0}]},{name:"cron",summary:"agendamento PERSISTENTE \xB7 lista/gerencia os jobs (mesmo motor do aluy cron)",source:"native",id:"cron",section:"sess\xE3o",usage:'list \xB7 add <quando> "<tarefa>" \xB7 edit/enable/disable/rm <id>',subcommands:[{name:"list",summary:"lista os jobs (id \xB7 on/off \xB7 schedule \xB7 tarefa)",usage:"list",terminal:!0},{name:"add",summary:"agenda um job novo (cron de 5 campos)",usage:'add <quando> "<tarefa>" [--yolo]'},{name:"edit",summary:"reconfigura um job (preserva id)",usage:'edit <id> [--quando "<cron>"] [--tarefa "<txt>"] [--yolo|--no-yolo]'},{name:"enable",summary:"reativa um job desabilitado",usage:"enable <id>"},{name:"disable",summary:"desabilita SEM excluir (sai do agendador)",usage:"disable <id>"},{name:"rm",summary:"remove um job de vez",usage:"rm <id>"}]},{name:"permissions",summary:"painel \xB7 modo, grants e tools seguras (sempre-ask travado)",summaryKey:"cmd.permissions",source:"native",id:"permissions",section:"workspace"},{name:"tools",summary:"invent\xE1rio unificado das ferramentas \xB7 nativas, MCP, permiss\xE3o (read-only)",summaryKey:"cmd.tools",source:"native",id:"tools",section:"workspace",parallelWhileBusy:!0},{name:"add-dir",summary:"autoriza um diret\xF3rio EXTRA p/ o agente (sess\xE3o) \xB7 sem args lista",summaryKey:"cmd.addDir",source:"native",id:"add-dir",section:"workspace"},{name:"init",summary:"cria um ALUY.md neste projeto",summaryKey:"cmd.init",source:"native",id:"init",section:"workspace"},{name:"memory",summary:"v\xEA/edita/esquece/fixa a mem\xF3ria do agente (global + projeto)",summaryKey:"cmd.memory",source:"native",id:"memory",section:"workspace",subcommands:[{name:"list",summary:"lista a mem\xF3ria (global + projeto)",usage:"list"},{name:"forget",summary:"remove um fato pelo id",usage:"forget <id>"},{name:"edit",summary:"corrige o texto de um fato",usage:"edit <id> <texto>"},{name:"pin",summary:"fixa um fato (reten\xE7\xE3o)",usage:"pin <id>"},{name:"unpin",summary:"desfixa um fato",usage:"unpin <id>"}]},{name:"todo",summary:"v\xEA/gerencia o backlog de tarefas anotadas (done/clear)",summaryKey:"cmd.todo",source:"native",id:"todo",section:"workspace",subcommands:[{name:"list",summary:"lista o backlog (pendentes + feitos)",usage:"list"},{name:"done",summary:"marca um item como conclu\xEDdo",usage:"done <id>"},{name:"clear",summary:"remove os itens j\xE1 feitos",usage:"clear",terminal:!0}]},{name:"mcp",summary:"lista/gerencia servers MCP (add/remove/disable/enable \xB7 search <termo>)",summaryKey:"cmd.mcp",source:"native",id:"mcp",section:"workspace",parallelWhileBusyWith:OQ,subcommands:[{name:"search",summary:"busca no registro oficial aberto",usage:"search <termo>"},{name:"add",summary:"adiciona um server local (stdio)",usage:"add <nome> -- <cmd> [args...]"},{name:"list",summary:"lista os servers de todas as fontes",usage:"list"},{name:"remove",summary:"remove um server gerenciado pelo aluy",usage:"remove <nome>"},{name:"disable",summary:"desativa um server sem desinstalar",usage:"disable <nome>"},{name:"enable",summary:"reativa um server desativado",usage:"enable <nome>"},{name:"reconnect",summary:'re-sobe + re-handshake os servers (recupera "Not connected")',usage:"reconnect [all|<nome>]"},{name:"reload",summary:"re-l\xEA o ~/.aluy/mcp.json + reconecta (aplica edi\xE7\xF5es da config)",usage:"reload [all|<nome>]"}]},{name:"agents",summary:"lista os agentes .md mapeados (global + projeto \xB7 v\xE1lidos + rejeitados)",source:"native",id:"agents",section:"workspace",parallelWhileBusy:!0},{name:"skills",summary:"lista as skills SKILL.md mapeadas (global + projeto \xB7 v\xE1lidas + rejeitadas)",source:"native",id:"skills",section:"workspace",parallelWhileBusy:!0},{name:"inventory",summary:"invent\xE1rio do que foi carregado da .aluy/ (agentes\xB7comandos\xB7skills\xB7workflows\xB7mem\xF3ria + ALUY.md)",source:"native",id:"inventory",section:"workspace",parallelWhileBusy:!0},{name:"workflows",summary:"fluxos de atividades que coordenam o agente \u2014 lista, executa e ativa",summaryKey:"cmd.workflows",source:"native",id:"workflows",section:"workspace",subcommands:[{name:"run",summary:"executa as atividades do workflow em sequ\xEAncia",usage:"run <nome>"},{name:"use",summary:"ativa o modo de workflow \u2014 submiss\xF5es seguem o fluxo",usage:"use <nome>"}],parallelWhileBusy:!0},{name:"rooms",summary:"salas entre agentes \u2014 lista, cria, l\xEA e OBSERVA AO VIVO a conversa da frota",source:"native",id:"rooms",section:"workspace",subcommands:[{name:"list",summary:"lista as salas (c\xF3digo \xB7 msgs \xB7 atividade \xB7 quem)",usage:"list"},{name:"new",summary:"cria uma sala e mostra o c\xF3digo",usage:"new"},{name:"read",summary:"snapshot da conversa de uma sala",usage:"read <c\xF3digo>"},{name:"watch",summary:"observa a conversa AO VIVO (poll at\xE9 2min)",usage:"watch <c\xF3digo>"}]},{name:"subagent",summary:"fala 1:1 com um sub-agente (perfil .md) numa sub-sess\xE3o focada e cont\xEDnua",source:"native",id:"subagent",section:"workspace"},{name:"back",summary:"volta ao agente principal (sai do foco de /subagent)",source:"native",id:"back",section:"workspace"},{name:"quit",summary:"sair do aluy",summaryKey:"cmd.quit",source:"native",id:"quit",section:"sess\xE3o"}];PQ=[{id:"action:cycle-mode",label:"trocar modo",description:"cicla o modo da sess\xE3o (plan \u2192 normal \u2192 yolo) \xB7 tamb\xE9m no Tab",action:{kind:"action",actionId:"cycle-mode"}}];NQ="COMANDOS DA SESS\xC3O (o HUMANO os digita; voc\xEA os RECOMENDA, n\xE3o os invoca como ferramenta):"});import $Q from"react";import{Box as Dl,Text as BQ}from"ink";import{Fragment as jQ,jsx as hn,jsxs as Ws}from"react/jsx-runtime";function UQ(t){let e=t.sel?"accent":t.sub?"fgDim":"fg",o=t.query.trim().replace(/\s+/g," ").toLowerCase(),n=o?t.path.toLowerCase().indexOf(o):-1;if(n<0||o==="")return Ws(f,{name:e,children:["/",t.path]});let r=t.path.slice(0,n),s=t.path.slice(n,n+o.length),i=t.path.slice(n+o.length);return Ws(jQ,{children:[Ws(f,{name:e,children:["/",r]}),hn(f,{name:"accent",children:s}),hn(f,{name:e,children:i})]})}function ig(t){let e=t.query??"",o=t.maxRows!==void 0?j$(t.commands,t.selected,t.maxRows,t.columns):{slice:t.commands,hiddenAbove:0,hiddenBelow:0},n=t.selected-o.hiddenAbove,r=null;return Ws(Dl,{flexDirection:"column",children:[hn(Dl,{children:hn(f,{name:"fgDim",children:"/ para comandos \xB7 \u2191\u2193 navega \xB7 enter executa \xB7 esc fecha"})}),o.hiddenAbove>0&&hn(Dl,{children:Ws(f,{name:"fgDim",children:[" \u2191 ",o.hiddenAbove," acima"]})}),o.slice.map((s,i)=>{let a=i===n,l=gE(s),c=l!==r?l:null;r=l;let u=rg(s),m=s.kind==="subcommand",d=a?"\u203A ":m?" ":" ";return Ws($Q.Fragment,{children:[c&&hn(Dl,{children:hn(f,{name:"fgDim",children:c==="usu\xE1rio"?"\u2500\u2500\u2500 seus comandos":c})}),Ws(Dl,{children:[hn(f,{name:a?"accent":"fgDim",children:d}),hn(UQ,{path:u,query:e,sel:a,sub:m}),hn(BQ,{children:" ".repeat(Math.max(1,18-u.length))}),hn(f,{name:"fgDim",children:yE(s)})]})]},`${l}:${u}`)}),o.hiddenBelow>0&&hn(Dl,{children:Ws(f,{name:"fgDim",children:[" \u2193 ",o.hiddenBelow," mais (refine a busca)"]})})]})}var K$=p(()=>{"use strict";se();Cl()});import"react";import{Box as Tl,Text as HQ}from"ink";import{Fragment as GQ,jsx as No,jsxs as Jd}from"react/jsx-runtime";function qQ(t){let e=t.sel?"accent":"fg",o=new Set(t.matched);if(o.size===0)return No(f,{name:e,children:t.label});let n=[],r=0;for(;r<t.label.length;){let s=o.has(r),i=r;for(;i<t.label.length&&o.has(i)===s;)i++;n.push(No(f,{name:s?"accent":e,children:t.label.slice(r,i)},r)),r=i}return No(GQ,{children:n})}function WQ(t,e,o){if(t.length<=o)return{start:0,slice:t};let n=e-Math.floor(o/2);return n<0&&(n=0),n+o>t.length&&(n=t.length-o),{start:n,slice:t.slice(n,n+o)}}function ag(t){let{t:e}=ke(),o=t.maxRows??8,n=t.query??"",{start:r,slice:s}=WQ(t.hits,t.selected,o),i=s.reduce((a,l)=>Math.max(a,l.label.length),0);return Jd(Tl,{flexDirection:"column",children:[No(Tl,{children:No(f,{name:"fgDim",children:e("picker.palette.help")})}),Jd(Tl,{children:[No(f,{name:"accent",children:"> "}),n===""?No(f,{name:"fgDim",children:e("picker.palette.search")}):No(f,{name:"fg",children:n})]}),t.hits.length===0?No(Tl,{children:Jd(f,{name:"fgDim",children:[" ",e("picker.palette.empty",{query:n})]})}):s.map((a,l)=>{let u=r+l===t.selected;return Jd(Tl,{children:[No(f,{name:u?"accent":"fgDim",children:u?"\u203A ":" "}),No(qQ,{label:a.label,matched:a.matched,sel:u}),No(HQ,{children:" ".repeat(Math.max(1,i-a.label.length+2))}),No(f,{name:"fgDim",children:a.description})]},a.id)}),t.hits.length>s.length&&No(Tl,{children:Jd(f,{name:"fgDim",children:[" ",e("picker.palette.more",{count:t.hits.length-s.length})]})})]})}var Y$=p(()=>{"use strict";se();ht()});import"react";import{Box as Qd}from"ink";import{Fragment as YQ,jsx as mr,jsxs as lg}from"react/jsx-runtime";function V$(t,e){if(e<=0||t.length<=e)return t;if(e<=1)return t.slice(0,e);let o="\u2026",n=e-o.length,r=Math.ceil(n/2),s=Math.floor(n/2);return t.slice(0,r)+o+t.slice(t.length-s)}function zQ(t){let e=t.sel?"accent":"fg",o=new Set(t.matched);if(o.size===0)return mr(f,{name:e,children:t.path});let n=[],r=0;for(;r<t.path.length;){let s=o.has(r),i=r;for(;i<t.path.length&&o.has(i)===s;)i++;let a=t.path.slice(r,i);n.push(mr(f,{name:s?"accent":e,children:a},r)),r=i}return mr(YQ,{children:n})}function KQ(t,e,o){if(t.length<=o)return{start:0,slice:t};let n=e-Math.floor(o/2);return n<0&&(n=0),n+o>t.length&&(n=t.length-o),{start:n,slice:t.slice(n,n+o)}}function kE(t){let{t:e}=ke(),o=t.columns??80,n=t.maxRows??8,r=Math.max(8,o-4),{start:s,slice:i}=KQ(t.hits,t.selected,n);return lg(Qd,{flexDirection:"column",children:[mr(Qd,{children:mr(f,{name:"fgDim",children:e("picker.file.help")})}),t.hits.length===0?mr(Qd,{children:lg(f,{name:"fgDim",children:[" ",e("picker.file.empty",{query:t.query??""})]})}):i.map((a,l)=>{let u=s+l===t.selected,m=V$(a.path,r),d=m===a.path;return lg(Qd,{children:[mr(f,{name:u?"accent":"fgDim",children:u?"\u203A ":" "}),d?mr(zQ,{path:a.path,matched:a.matched,sel:u}):mr(f,{name:u?"accent":"fg",children:m})]},a.path)}),t.hits.length>i.length&&mr(Qd,{children:lg(f,{name:"fgDim",children:[" ",e("picker.file.more",{count:t.hits.length-i.length})]})})]})}var X$=p(()=>{"use strict";se();ht()});import"react";import{Box as He,Text as VQ}from"ink";import{Fragment as xE,jsx as ie,jsxs as Ye}from"react/jsx-runtime";function cg(t){let{t:e}=ke();if(t.effortStepOpen)return ie(tZ,{...t});if(t.customInputOpen)return ie(JQ,{...t});let o=t.tiers.length;return Ye(He,{flexDirection:"column",children:[ie(He,{children:ie(f,{name:"fgDim",children:e("picker.model.help")})}),t.loading?ie(He,{children:Ye(f,{name:"fgDim",children:[" ",e("picker.model.loading")]})}):Ye(xE,{children:[t.tiers.map((n,r)=>{let s=r===t.selected,i=n.key===t.currentTier,a=Xx(n),l=Vx(n.costSignal);return Ye(He,{children:[ie(f,{name:s?"accent":"fgDim",children:s?"\u203A ":" "}),ie(f,{name:i?"accent":"fgDim",children:i?"\u25CF ":" "}),ie(f,{name:s?"accent":"fg",children:n.displayName}),a!==""&&Ye(xE,{children:[ie(f,{name:"fgDim",children:" \xB7 "}),ie(f,{name:"depth",children:a})]}),Ye(f,{name:"fgDim",children:[" \xB7 ",l]})]},n.key)}),Ye(He,{children:[ie(f,{name:t.selected===o?"accent":"fgDim",children:t.selected===o?"\u203A ":" "}),ie(f,{name:t.currentTier==="custom"?"accent":"fgDim",children:t.currentTier==="custom"?"\u25CF ":" "}),ie(f,{name:t.selected===o?"accent":"fg",children:"Custom"}),Ye(f,{name:"fgDim",children:[" \xB7 ",e("picker.model.customLine")]})]},"__custom__")]}),t.usingFallback===!0&&!t.loading&&ie(He,{children:Ye(f,{name:"fgDim",children:[" ","\u25CD ",e("picker.model.fallback")]})})]})}function JQ(t){return t.customBrowserAvailable===!0?ie(eZ,{...t}):ie(nZ,{...t})}function QQ(t){return t.supportsTools===!0?ie(f,{name:"accent",children:"\u2713 tools"}):t.supportsTools===!1?ie(f,{name:"fgDim",children:"\u2014 tools"}):ie(f,{name:"fgDim",children:"\xB7 tools?"})}function ZQ(t){let{model:e,highlighted:o}=t.row,n=[e.family,e.context].map(r=>r.trim()).filter(r=>r!=="");return Ye(He,{children:[ie(f,{name:o?"accent":"fgDim",children:o?"\u203A ":" "}),ie(f,{name:o?"accent":"fg",children:e.id}),n.length>0&&Ye(xE,{children:[ie(f,{name:"fgDim",children:" "}),ie(f,{name:"depth",children:n.join(" \xB7 ")})]}),ie(VQ,{children:" "}),ie(QQ,{supportsTools:e.supportsTools})]})}function eZ(t){let{t:e}=ke(),o=t.customInput??"",n=t.customRows??[],r=t.customFilteredCount??0,s=t.customTotalCount??0,i=t.customToolsOnly===!0,a=t.customNoToolsWarning??null;return Ye(He,{flexDirection:"column",children:[ie(He,{children:ie(f,{name:"fgDim",children:e("picker.model.browseHelp")})}),Ye(He,{children:[ie(f,{name:"accent",children:"filtro \u203A "}),ie(f,{name:"fg",children:o}),ie(f,{name:"accent",children:"\u258F"}),Ye(f,{name:"fgDim",children:[" ",e("picker.model.browseCount",{filtered:r,total:s}),i?e("picker.model.toolsOnlySuffix"):""]})]}),t.customHasMoreAbove===!0&&ie(He,{children:Ye(f,{name:"fgDim",children:[" ",e("picker.model.moreAbove")]})}),n.length===0?ie(He,{children:Ye(f,{name:"fgDim",children:[" ",e("picker.model.noFilterMatch")]})}):ie(He,{flexDirection:"column",children:n.map(l=>ie(ZQ,{row:l},l.model.id))}),t.customHasMoreBelow===!0&&ie(He,{children:Ye(f,{name:"fgDim",children:[" ",e("picker.model.moreBelow")]})}),a!==null&&ie(He,{children:Ye(f,{name:"accent",children:[" ",e("picker.model.noTools")]})})]})}function tZ(t){let{t:e}=ke();if(t.effortCustomOpen===!0)return ie(oZ,{...t});let o=t.effortOptions??[],n=t.effortSelected??0,r=t.currentEffort;return Ye(He,{flexDirection:"column",children:[ie(He,{children:ie(f,{name:"fgDim",children:e("picker.effort.help")})}),o.map((s,i)=>{let a=i===n,l=s.kind==="level"&&s.value===r||s.kind==="keep"&&(r===void 0||r==="");return Ye(He,{children:[ie(f,{name:a?"accent":"fgDim",children:a?"\u203A ":" "}),ie(f,{name:l?"accent":"fgDim",children:l?"\u25CF ":" "}),ie(f,{name:a?"accent":"fg",children:e(XQ[s.id]??"picker.effort.keep")})]},s.id)})]})}function oZ(t){let{t:e}=ke(),o=t.effortCustomInput??"",n=t.effortCustomWarn??null;return Ye(He,{flexDirection:"column",children:[ie(He,{children:ie(f,{name:"fgDim",children:e("picker.effort.customHelp")})}),Ye(He,{children:[ie(f,{name:"accent",children:"\u203A "}),ie(f,{name:"fg",children:o}),ie(f,{name:"accent",children:"\u258F"})]}),n!==null&&ie(He,{children:Ye(f,{name:"accent",children:[" ",e(n==="empty"?"picker.effort.warnEmpty":"picker.effort.warnTooLong")]})})]})}function nZ(t){let{t:e}=ke(),o=t.customInput??"",n=t.customSuggestions??[],r=t.customWarnOutOfCatalog===!0;return Ye(He,{flexDirection:"column",children:[ie(He,{children:ie(f,{name:"fgDim",children:e("picker.model.freeHelp")})}),Ye(He,{children:[ie(f,{name:"accent",children:"\u203A "}),ie(f,{name:"fg",children:o}),ie(f,{name:"accent",children:"\u258F"})]}),n.length>0&&ie(He,{flexDirection:"column",children:n.map(s=>Ye(He,{children:[ie(f,{name:"fgDim",children:" \u25CD "}),ie(f,{name:"depth",children:s})]},s))}),r&&ie(He,{children:Ye(f,{name:"accent",children:[" ",e("picker.model.outOfCatalog")]})})]})}var XQ,J$=p(()=>{"use strict";se();ht();Gr();XQ={keep:"picker.effort.keep",low:"picker.effort.low",medium:"picker.effort.medium",high:"picker.effort.high",custom:"picker.effort.custom"}});function wE(t,e=SE){let o;try{o=t.list()}catch{return[]}return o.slice(0,Math.max(0,e))}function Q$(t){let e=new Date(t),o=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function rZ(t){for(let e of t)if(e.kind==="you"){let o=e.text.replace(/\s+/g," ").trim();return o===""?void 0:o.length>60?o.slice(0,57)+"\u2026":o}}function Zd(t,e){let o=wd(t.cwd,e??process.env.HOME??""),n=t.label?.trim();if(n)return`${n} \xB7 ${Q$(t.updatedAt)} \xB7 ${o}`;let r=t.title??(t.blocks?rZ(t.blocks):void 0)??"(sem objetivo)";return`${Q$(t.updatedAt)} \xB7 ${o} \xB7 ${r}`}function sZ(t,e){if(t.length===0)return["nenhuma sess\xE3o anterior."];let o=["sess\xF5es anteriores (retome com: /history <id>):",""];for(let n of t){o.push(` ${n.id}`);let r=n.label?.trim()?"\u25CF ":"";o.push(` ${r}${Zd(n,e)}`)}return o}function Z$(t,e){e.switchSession({id:t.id,cwd:t.cwd,tier:t.tier}),e.resetContinuation?.(),e.clearScreen(),e.restoreBlocks(t.blocks);let o=Fi(t.blocks);o.length>0&&e.seedHistory(o),t.cwd.trim()!==""&&e.setSessionCwd?.(t.cwd)}function e1(t,e,o){let n=(t??"").trim();if(n!=="/history"&&!n.startsWith("/history "))return!1;let r=n==="/history"?"":n.slice(9).trim();if(r===""){let i=wE(o.store,o.limit);for(let a of sZ(i,o.home))e.write(`[history] ${a}
|
|
625
625
|
`);return!0}let s=o.store.load(r);return s?(o.resume(s),e.write(`[history] sess\xE3o retomada: ${r} (${Zd(s,o.home)})
|
|
626
626
|
`),!0):(e.write(`[history] sess\xE3o n\xE3o encontrada: ${r}
|
|
627
|
-
`),!0)}var SE,ug=p(()=>{"use strict";vd();dn();SE=15});function fr(t,e,o,n){if(n===void 0){if(t.length<=o)return{start:0,slice:t};let h=e-Math.floor(o/2);return h<0&&(h=0),h+o>t.length&&(h=t.length-o),{start:h,slice:t.slice(h,h+o)}}let r=t.length;if(r===0)return{start:0,slice:t};let s=h=>Math.max(1,Math.floor(n(t[h]))),i=0;for(let h=0;h<r;h+=1)i+=s(h);if(i<=o)return{start:0,slice:t};let a=Math.max(0,Math.min(e,r-1)),l=a,c=a+1,u=s(a),m=!0,d=!0;for(;d;){d=!1;let h=()=>l>0&&u+s(l-1)<=o?(l-=1,u+=s(l),!0):!1,g=()=>c<r&&u+s(c)<=o?(u+=s(c),c+=1,!0):!1;d=m?h()||g():g()||h(),m=!m}return{start:l,slice:t.slice(l,c)}}var _l=p(()=>{"use strict"});import"react";import{Box as em,Text as t1}from"ink";import{Fragment as iZ,jsx as Gs,jsxs as tm}from"react/jsx-runtime";function dg(t){let e=oe(),{t:o}=ke(),n=e.glyph("sessionDot"),r=Math.max(1,t.maxRows??10),s=t.columns,i=s!==void 0&&s>0?c=>{let u=2+(c.label?.trim()?2:0)+be(Zd(c,t.home));return Math.max(1,Math.ceil(u/s))}:void 0,{start:a,slice:l}=fr(t.sessions,t.selected,r,i);return tm(em,{flexDirection:"column",children:[Gs(em,{children:Gs(f,{name:"fgDim",children:o("picker.history.help")})}),t.sessions.length===0?Gs(em,{children:tm(f,{name:"fgDim",children:[" ",o("picker.history.empty")]})}):l.map((c,u)=>{let d=a+u===t.selected,h=c.label?.trim(),g=h?e.sessionColor(c.labelColor??h):void 0,b={};return g?.color!==void 0&&(b.color=g.color),g?.bold!==void 0&&(b.bold=g.bold),tm(em,{children:[Gs(f,{name:d?"accent":"fgDim",children:d?"\u203A ":" "}),h&&tm(iZ,{children:[Gs(t1,{...b,children:n}),Gs(t1,{children:" "})]}),Gs(f,{name:d?"accent":"fg",children:Zd(c,t.home)})]},c.id)}),t.sessions.length>l.length&&Gs(em,{children:tm(f,{name:"fgDim",children:[" ",o("picker.history.more",{count:t.sessions.length-l.length})]})})]})}var o1=p(()=>{"use strict";se();ht();ug();Tt();_l()});function n1(t,e=30){return[...t].reverse().slice(0,e)}function EE(t){let e=aZ(t.ts);return`#${t.ordinal} \xB7 ${e} \xB7 ${t.label}`}function aZ(t){let e=new Date(t),o=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${o}:${n}`}var mg,AE=p(()=>{"use strict";mg=["both","conversation","code"]});import"react";import{Box as gn}from"ink";import{jsx as uo,jsxs as Qi}from"react/jsx-runtime";function lZ(t){switch(t){case"both":return"picker.rewind.action.both";case"conversation":return"picker.rewind.action.conversation";case"code":return"picker.rewind.action.code"}}function fg(t){let{t:e}=ke();if(t.phase==="list"){let o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>Math.max(1,Math.ceil((2+be(EE(a)))/n)):void 0,{start:s,slice:i}=fr(t.checkpoints,t.selected,o,r);return Qi(gn,{flexDirection:"column",children:[uo(gn,{children:uo(f,{name:"fgDim",children:e("picker.rewind.help")})}),t.checkpoints.length===0?uo(gn,{children:Qi(f,{name:"fgDim",children:[" ",e("picker.rewind.empty")]})}):i.map((a,l)=>{let c=s+l===t.selected;return Qi(gn,{children:[uo(f,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),uo(f,{name:c?"accent":"fg",children:EE(a)})]},a.id)}),t.checkpoints.length>i.length&&uo(gn,{children:Qi(f,{name:"fgDim",children:[" ",e("picker.rewind.more",{count:t.checkpoints.length-i.length})]})})]})}return Qi(gn,{flexDirection:"column",children:[uo(gn,{children:uo(f,{name:"fgDim",children:e("picker.rewind.action.help")})}),t.target&&uo(gn,{children:uo(f,{name:"fgDim",children:` \u2192 #${t.target.ordinal} \xB7 ${t.target.label}`})}),t.actions.map((o,n)=>{let r=n===t.selected;return Qi(gn,{children:[uo(f,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),uo(f,{name:r?"accent":"fg",children:e(lZ(o))})]},o)}),t.barrierWarnings&&t.barrierWarnings.length>0&&Qi(gn,{flexDirection:"column",marginTop:1,children:[uo(gn,{children:uo(f,{name:"accent",children:`\u26A0 ${e("picker.rewind.barrier.warn")}:`})}),t.barrierWarnings.map((o,n)=>uo(gn,{children:uo(f,{name:"fgDim",children:` \xB7 ${o}`})},n))]})]})}var r1=p(()=>{"use strict";se();ht();AE();Tt();_l()});import cZ from"react";import{Box as Co,Text as uZ}from"ink";import{Fragment as pZ,jsx as qe,jsxs as Xo}from"react/jsx-runtime";function dZ(t){switch(t){case"mode":return"modo de sessao \xB7 enter cicla plan \u2192 normal \u2192 yolo";case"safe-tool":return"tools seguras (leitura) \xB7 enter alterna allow \u21C4 ask";case"grant":return"liberados nesta sessao \xB7 enter REVOGA";case"locked":return"TRAVADO por seguranca \xB7 so via --yolo"}}function mZ(t){let{row:e,sel:o}=t,n=qe(f,{name:o?"accent":"fgDim",children:o?"\u203A ":" "});switch(e.kind){case"mode":return Xo(Co,{children:[n,qe(f,{name:o?"accent":"fg",children:"modo: "}),qe(f,{name:e.mode==="unsafe"?"danger":o?"accent":"fg",children:CE[e.mode]})]});case"safe-tool":return Xo(Co,{children:[n,qe(f,{name:o?"accent":"fg",children:e.tool}),qe(f,{name:"fgDim",children:" = "}),qe(f,{name:e.decision==="allow"?"success":"fgDim",children:e.decision})]});case"grant":return Xo(Co,{children:[n,qe(f,{name:"success",children:"\u25CF "}),qe(f,{name:o?"accent":"fg",children:e.grantKey}),qe(f,{name:"fgDim",children:" (enter revoga)"})]});case"locked":{let r=e.category.lock==="deny";return Xo(Co,{flexDirection:"column",children:[Xo(Co,{children:[n,qe(P,{name:"ask",role:"danger"}),qe(f,{name:"danger",children:" [travado] "}),qe(f,{name:o?"accent":"fg",children:e.category.label}),Xo(f,{name:"danger",children:[" \xB7 ",r?"deny (nem --yolo)":"sempre pergunta"]})]}),o&&qe(Co,{paddingLeft:4,children:qe(f,{name:"fgDim",children:e.category.why})})]})}}}function DE(t){let e=Math.max(1,t.maxRows??14),o=t.columns,n=l=>{switch(l.kind){case"mode":return 8+be(CE[l.mode]);case"safe-tool":return 5+be(l.tool)+be(l.decision);case"grant":return 19+be(l.grantKey);case"locked":return 28+be(l.category.label)}},r=o!==void 0&&o>0?l=>Math.max(1,Math.ceil(n(l)/o)):void 0,{start:s,slice:i}=fr(t.rows,t.selected,e,r),a=null;return Xo(Co,{flexDirection:"column",children:[qe(Co,{children:qe(f,{name:"fgDim",children:"permissoes \xB7 \u2191\u2193 navega \xB7 enter muda \xB7 esc fecha"})}),Xo(Co,{children:[qe(f,{name:"fgDim",children:"modo atual: "}),qe(f,{name:t.mode==="unsafe"?"danger":"fg",children:CE[t.mode]})]}),t.rows.length===0?qe(Co,{children:qe(f,{name:"fgDim",children:" nada a mostrar"})}):Xo(pZ,{children:[s>0&&qe(Co,{children:Xo(f,{name:"fgDim",children:[" \u2191 ",s," acima"]})}),i.map((l,c)=>{let u=s+c,m=l.kind!==a?dZ(l.kind):null;return a=l.kind,Xo(cZ.Fragment,{children:[m&&qe(Co,{paddingTop:1,children:Xo(f,{name:"fgDim",children:["\u2500\u2500\u2500 ",m]})}),qe(mZ,{row:l,sel:u===t.selected})]},fZ(l,u))}),s+i.length<t.rows.length&&qe(Co,{children:Xo(f,{name:"fgDim",children:[" \u2193 ",t.rows.length-(s+i.length)," abaixo"]})})]}),qe(Co,{paddingTop:1,children:qe(uZ,{children:" "})}),qe(Co,{children:qe(f,{name:"fgDim",children:"o painel nao relaxa as categorias travadas \u2014 o unico bypass total e --yolo"})})]})}function fZ(t,e){switch(t.kind){case"mode":return"mode";case"safe-tool":return`safe:${t.tool}`;case"grant":return`grant:${t.grantKey}`;case"locked":return`locked:${t.category.category}`;default:return`row:${e}`}}var CE,s1=p(()=>{"use strict";se();_l();Tt();CE={plan:"PLAN (read-only)",normal:"NORMAL (catraca padrao)",unsafe:"YOLO (aprovacao DESLIGADA)"}});import"react";import{Box as TE}from"ink";import{jsx as om,jsxs as _E}from"react/jsx-runtime";function pg(t){let{t:e}=ke();return _E(TE,{flexDirection:"column",children:[om(TE,{children:om(f,{name:"fgDim",children:e("picker.theme.help")})}),t.themes.map((o,n)=>{let r=n===t.selected,s=o.name===t.currentTheme;return _E(TE,{children:[om(f,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),om(f,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),om(f,{name:r?"accent":"fg",children:o.label}),_E(f,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.name)})]})}var i1=p(()=>{"use strict";se();ht()});import"react";import{Box as RE}from"ink";import{jsx as nm,jsxs as OE}from"react/jsx-runtime";function hg(t){let{t:e}=ke();return OE(RE,{flexDirection:"column",children:[nm(RE,{children:nm(f,{name:"fgDim",children:e("picker.lang.help")})}),t.langs.map((o,n)=>{let r=n===t.selected,s=o.code===t.currentLang;return OE(RE,{children:[nm(f,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),nm(f,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),nm(f,{name:r?"accent":"fg",children:o.label}),OE(f,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.code)})]})}var a1=p(()=>{"use strict";se();ht()});import"react";import{Box as rm}from"ink";import{jsx as zs,jsxs as sm}from"react/jsx-runtime";function ME(t){let{t:e}=ke(),o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>{let l=4+be(`${a.label} \xB7 ${a.summary}`)+(a.isDefault?2+be(e("picker.provider.default")):0);return Math.max(1,Math.ceil(l/n))}:void 0,{start:s,slice:i}=fr(t.providers,t.selected,o,r);return sm(rm,{flexDirection:"column",children:[zs(rm,{children:zs(f,{name:"fgDim",children:e("picker.provider.help")})}),t.usingFallback===!0?zs(rm,{children:zs(f,{name:"fgDim",children:e("picker.provider.fallback")})}):null,i.map((a,l)=>{let c=s+l===t.selected,u=a.name===t.currentProvider;return sm(rm,{children:[zs(f,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),zs(f,{name:u?"accent":"fgDim",children:u?"\u25CF ":" "}),zs(f,{name:c?"accent":"fg",children:a.label}),sm(f,{name:"fgDim",children:[" \xB7 ",a.summary]}),a.isDefault?sm(f,{name:"fgDim",children:[" \xB7 ",e("picker.provider.default")]}):null]},a.name)}),t.providers.length>i.length&&zs(rm,{children:sm(f,{name:"fgDim",children:[" ",e("picker.provider.more",{count:t.providers.length-i.length})]})})]})}var l1=p(()=>{"use strict";se();ht();Tt();_l()});import"react";import{Box as c1,Text as hZ}from"ink";import{jsx as LE,jsxs as u1}from"react/jsx-runtime";function PE(t){if(t.chips.length===0)return null;let e=t.active??-1;return LE(c1,{flexWrap:"wrap",children:t.chips.map((o,n)=>{let r=n===e;return u1(c1,{marginRight:1,children:[u1(f,{name:r?"accent":"depth",children:[r?"\u203A ":"","@",o.path,o.truncated?"~":""]}),LE(hZ,{children:" "}),LE(f,{name:"fgDim",children:"[\u232B]"})]},o.path)})})}var d1=p(()=>{"use strict";se()});import"react";import{Box as im,Text as m1}from"ink";import{jsx as Pn,jsxs as Ks}from"react/jsx-runtime";function FE(t){let e=oe(),{t:o}=ke(),n=t.columns??80,r=t.plan??"assinatura",s=e.glyph("wave").repeat(17);return Ks(im,{flexDirection:"column",paddingY:1,children:[Pn(Qr,{columns:n}),Pn(im,{paddingTop:1,paddingLeft:2,children:Pn(f,{name:"fgDim",children:o("boot.tagline")})}),Ks(im,{paddingLeft:2,children:[Pn(f,{name:"accent",children:s}),t.version!==void 0&&Ks(f,{name:"fgDim",children:[" v",t.version]})]}),Ks(im,{paddingLeft:2,children:[Pn(P,{name:"window",role:"fgDim"}),Ks(f,{name:"fgDim",children:[" ",r," \xB7 "]}),Pn(f,{name:"fgDim",children:t.tier}),Pn(m1,{children:" "}),Pn(f,{name:"fgDim",children:"\xB7 "}),Pn(P,{name:"broker",role:"depth"}),Ks(f,{name:"depth",children:[" ",o("boot.broker")]})]}),t.status!==void 0&&Ks(im,{paddingTop:1,paddingLeft:2,children:[Pn(zi,{frame:t.frame??0}),Pn(m1,{children:" "}),Ks(f,{name:"fgDim",children:[t.status,"\u2026"]})]})]})}var f1=p(()=>{"use strict";se();ht();zd();Bi()});import"react";import{Box as p1}from"ink";import{jsx as IE,jsxs as NE}from"react/jsx-runtime";function $E(t){let e=t.suggestions??gZ;return NE(p1,{flexDirection:"column",children:[IE(f,{name:"fg",children:t.name?`bom te ver de novo, ${t.name}.`:"bom te ver por aqui."}),IE(f,{name:"fgDim",children:"eu leio e edito arquivos e rodo comandos aqui \u2014 sempre te mostrando o efeito exato antes."}),NE(p1,{paddingTop:1,flexDirection:"column",children:[IE(f,{name:"fgDim",children:"experimente:"}),e.map((o,n)=>NE(f,{name:"fgDim",children:[" \xB7 ",o]},n))]})]})}var gZ,h1=p(()=>{"use strict";se();gZ=['"explique a estrutura deste repo"','"rode os testes e resuma as falhas"',"/help para comandos \xB7 /login conta \xB7 /quit"]});import"react";import{jsx as _0e}from"react/jsx-runtime";var g1=p(()=>{"use strict";se()});import"react";import{Box as y1,Text as BE}from"ink";import{jsx as Zi,jsxs as gg}from"react/jsx-runtime";function v1(t,e){return!Number.isFinite(t)||!Number.isFinite(e)||e<=0?0:Math.max(0,Math.min(1,t/e))}function k1(t,e,o,n,r){let s=Math.max(1,Math.trunc(n)),i=Math.max(0,Math.min(1,t)),a=Math.round(i*s);i>0&&a===0&&(a=1),i<1&&a===s&&(a=s-1);let l=e.repeat(a),c=o.repeat(s-a);return r?{filled:l,rest:c}:{filled:`[${l}`,rest:`${c}]`}}function Rl(t){let e=oe(),o=t.role??"accent";if(t.value!==void 0&&t.max!==void 0){let a=v1(t.value,t.max),l=Math.round(a*100),c=e.glyph("barFull"),u=e.glyph("barEmpty"),m=t.width??b1,{filled:d,rest:h}=k1(a,c,u,m,e.unicode);return gg(y1,{children:[Zi(f,{name:o,children:d}),Zi(f,{name:"fgDim",children:h}),Zi(BE,{children:" "}),gg(f,{name:o,children:[l,"%"]}),Zi(BE,{children:" "}),Zi(f,{name:"fgDim",children:t.label})]})}let r=e.spinnerFrames,s=e.animate?r[(t.frame??0)%r.length]:e.glyph("clock"),i=t.elapsedMs!==void 0?sl(t.elapsedMs):void 0;return gg(y1,{children:[Zi(f,{name:o,children:s}),Zi(BE,{children:" "}),gg(f,{name:"fgDim",children:[t.label,"\u2026",i!==void 0?` ${i}`:""]})]})}var b1,UE=p(()=>{"use strict";se();dn();b1=12});import"react";import{Box as yZ}from"ink";import{jsx as bZ,jsxs as x1}from"react/jsx-runtime";function jE(t){let{t:e}=ke(),o=(t.columns??80)<60,n=e(o?"banner.yolo.narrow":"banner.yolo");return x1(yZ,{children:[bZ(P,{name:"ask",role:"danger"}),x1(f,{name:"danger",children:[" ",n]})]})}var HE=p(()=>{"use strict";se();ht()});import"react";import{Box as vZ}from"ink";import{jsx as S1,jsxs as qE}from"react/jsx-runtime";function yg(t){let{t:e}=ke();if(t.mode==="unsafe")return S1(jE,{...t.columns!==void 0?{columns:t.columns}:{}});let o=kZ[t.mode],n=(t.columns??80)<60;return qE(vZ,{children:[S1(P,{name:o.glyph,role:o.role}),qE(f,{name:o.role,children:[" ",e("mode.label")," ",o.word]}),!n&&qE(f,{name:"fgDim",children:[" \xB7 ",e(o.caption)]})]})}var kZ,w1=p(()=>{"use strict";se();HE();ht();kZ={plan:{glyph:"planMode",role:"depth",word:"PLAN",caption:"mode.plan.caption"},normal:{glyph:"normalMode",role:"fgDim",word:"NORMAL",caption:"mode.normal.caption"},unsafe:{glyph:"ask",role:"danger",word:"YOLO",caption:"mode.unsafe.caption"}}});import"react";import{jsx as E1}from"react/jsx-runtime";function am(t){let{t:e}=ke();if(t.armedExit===!0)return E1(f,{name:"accent",children:e("hints.ctrlcAgain")});let o=e(xZ[t.state]),n=t.elapsed!==void 0&&t.elapsed!==""&&SZ.has(t.state);return E1(f,{name:"fgDim",children:n?`${o} \xB7 ${t.elapsed}`:o})}var xZ,SZ,A1=p(()=>{"use strict";se();ht();xZ={idle:"hints.idle",thinking:"hints.thinking",streaming:"hints.streaming",ask:"hints.ask","ask-destructive":"hints.askDestructive",slash:"hints.slash",palette:"hints.palette",budget:"hints.budget",error:"hints.error","work-subagents":"hints.workSubagents","idle-subagents":"hints.idleSubagents"},SZ=new Set(["thinking","streaming","work-subagents"])});import"react";import{Box as WE}from"ink";import{jsx as GE,jsxs as zE}from"react/jsx-runtime";function bg(t){return zE(WE,{flexDirection:"column",children:[zE(WE,{children:[GE(P,{name:"clock",role:"depth"}),zE(f,{name:"depth",children:[" ",t.title]})]}),GE(WE,{flexDirection:"column",paddingLeft:2,children:t.lines.map((e,o)=>GE(f,{name:"fgDim",children:e},o))})]})}var C1=p(()=>{"use strict";se()});import"react";import{Box as ea,Text as wZ}from"ink";import{jsx as Fn,jsxs as yn}from"react/jsx-runtime";function KE(t){let e=oe();if(t.status==="running"){let a=ar(t.liveOutput??"",kl).replace(/\n+$/,""),l=t.columns&&t.columns>0?t.columns-EZ:0,{text:c,hidden:u}=Zr(a,t.maxLines,l);return yn(ea,{flexDirection:"column",paddingLeft:2,children:[Fn(Yi,{glyph:"toolInflight",glyphRole:"depth",label:`rodando $ ${t.command}`,...t.frame!==void 0?{frame:t.frame}:{}}),c.length>0&&yn(ea,{flexDirection:"column",paddingLeft:2,children:[u>0&&yn(f,{name:"fgDim",children:["\u2026 (",u," linhas acima)"]}),c.split(`
|
|
627
|
+
`),!0)}var SE,ug=p(()=>{"use strict";vd();dn();SE=15});function fr(t,e,o,n){if(n===void 0){if(t.length<=o)return{start:0,slice:t};let h=e-Math.floor(o/2);return h<0&&(h=0),h+o>t.length&&(h=t.length-o),{start:h,slice:t.slice(h,h+o)}}let r=t.length;if(r===0)return{start:0,slice:t};let s=h=>Math.max(1,Math.floor(n(t[h]))),i=0;for(let h=0;h<r;h+=1)i+=s(h);if(i<=o)return{start:0,slice:t};let a=Math.max(0,Math.min(e,r-1)),l=a,c=a+1,u=s(a),m=!0,d=!0;for(;d;){d=!1;let h=()=>l>0&&u+s(l-1)<=o?(l-=1,u+=s(l),!0):!1,g=()=>c<r&&u+s(c)<=o?(u+=s(c),c+=1,!0):!1;d=m?h()||g():g()||h(),m=!m}return{start:l,slice:t.slice(l,c)}}var _l=p(()=>{"use strict"});import"react";import{Box as em,Text as t1}from"ink";import{Fragment as iZ,jsx as Gs,jsxs as tm}from"react/jsx-runtime";function dg(t){let e=oe(),{t:o}=ke(),n=e.glyph("sessionDot"),r=Math.max(1,t.maxRows??10),s=t.columns,i=s!==void 0&&s>0?c=>{let u=2+(c.label?.trim()?2:0)+be(Zd(c,t.home));return Math.max(1,Math.ceil(u/s))}:void 0,{start:a,slice:l}=fr(t.sessions,t.selected,r,i);return tm(em,{flexDirection:"column",children:[Gs(em,{children:Gs(f,{name:"fgDim",children:o("picker.history.help")})}),t.sessions.length===0?Gs(em,{children:tm(f,{name:"fgDim",children:[" ",o("picker.history.empty")]})}):l.map((c,u)=>{let d=a+u===t.selected,h=c.label?.trim(),g=h?e.sessionColor(c.labelColor??h):void 0,b={};return g?.color!==void 0&&(b.color=g.color),g?.bold!==void 0&&(b.bold=g.bold),tm(em,{children:[Gs(f,{name:d?"accent":"fgDim",children:d?"\u203A ":" "}),h&&tm(iZ,{children:[Gs(t1,{...b,children:n}),Gs(t1,{children:" "})]}),Gs(f,{name:d?"accent":"fg",children:Zd(c,t.home)})]},c.id)}),t.sessions.length>l.length&&Gs(em,{children:tm(f,{name:"fgDim",children:[" ",o("picker.history.more",{count:t.sessions.length-l.length})]})})]})}var o1=p(()=>{"use strict";se();ht();ug();Tt();_l()});function n1(t,e=30){return[...t].reverse().slice(0,e)}function EE(t){let e=aZ(t.ts);return`#${t.ordinal} \xB7 ${e} \xB7 ${t.label}`}function aZ(t){let e=new Date(t),o=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${o}:${n}`}var mg,AE=p(()=>{"use strict";mg=["both","conversation","code"]});import"react";import{Box as gn}from"ink";import{jsx as uo,jsxs as Qi}from"react/jsx-runtime";function lZ(t){switch(t){case"both":return"picker.rewind.action.both";case"conversation":return"picker.rewind.action.conversation";case"code":return"picker.rewind.action.code"}}function fg(t){let{t:e}=ke();if(t.phase==="list"){let o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>Math.max(1,Math.ceil((2+be(EE(a)))/n)):void 0,{start:s,slice:i}=fr(t.checkpoints,t.selected,o,r);return Qi(gn,{flexDirection:"column",children:[uo(gn,{children:uo(f,{name:"fgDim",children:e("picker.rewind.help")})}),t.checkpoints.length===0?uo(gn,{children:Qi(f,{name:"fgDim",children:[" ",e("picker.rewind.empty")]})}):i.map((a,l)=>{let c=s+l===t.selected;return Qi(gn,{children:[uo(f,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),uo(f,{name:c?"accent":"fg",children:EE(a)})]},a.id)}),t.checkpoints.length>i.length&&uo(gn,{children:Qi(f,{name:"fgDim",children:[" ",e("picker.rewind.more",{count:t.checkpoints.length-i.length})]})})]})}return Qi(gn,{flexDirection:"column",children:[uo(gn,{children:uo(f,{name:"fgDim",children:e("picker.rewind.action.help")})}),t.target&&uo(gn,{children:uo(f,{name:"fgDim",children:` \u2192 #${t.target.ordinal} \xB7 ${t.target.label}`})}),t.actions.map((o,n)=>{let r=n===t.selected;return Qi(gn,{children:[uo(f,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),uo(f,{name:r?"accent":"fg",children:e(lZ(o))})]},o)}),t.barrierWarnings&&t.barrierWarnings.length>0&&Qi(gn,{flexDirection:"column",marginTop:1,children:[uo(gn,{children:uo(f,{name:"accent",children:`\u26A0 ${e("picker.rewind.barrier.warn")}:`})}),t.barrierWarnings.map((o,n)=>uo(gn,{children:uo(f,{name:"fgDim",children:` \xB7 ${o}`})},n))]})]})}var r1=p(()=>{"use strict";se();ht();AE();Tt();_l()});import cZ from"react";import{Box as Co,Text as uZ}from"ink";import{Fragment as pZ,jsx as qe,jsxs as Xo}from"react/jsx-runtime";function dZ(t){switch(t){case"mode":return"modo de sess\xE3o \xB7 enter cicla plan \u2192 normal \u2192 yolo";case"safe-tool":return"tools seguras (leitura) \xB7 enter alterna allow \u21C4 ask";case"grant":return"liberados nesta sess\xE3o \xB7 enter REVOGA";case"locked":return"TRAVADO por seguran\xE7a \xB7 s\xF3 via --yolo"}}function mZ(t){let{row:e,sel:o}=t,n=qe(f,{name:o?"accent":"fgDim",children:o?"\u203A ":" "});switch(e.kind){case"mode":return Xo(Co,{children:[n,qe(f,{name:o?"accent":"fg",children:"modo: "}),qe(f,{name:e.mode==="unsafe"?"danger":o?"accent":"fg",children:CE[e.mode]})]});case"safe-tool":return Xo(Co,{children:[n,qe(f,{name:o?"accent":"fg",children:e.tool}),qe(f,{name:"fgDim",children:" = "}),qe(f,{name:e.decision==="allow"?"success":"fgDim",children:e.decision})]});case"grant":return Xo(Co,{children:[n,qe(f,{name:"success",children:"\u25CF "}),qe(f,{name:o?"accent":"fg",children:e.grantKey}),qe(f,{name:"fgDim",children:" (enter revoga)"})]});case"locked":{let r=e.category.lock==="deny";return Xo(Co,{flexDirection:"column",children:[Xo(Co,{children:[n,qe(P,{name:"ask",role:"danger"}),qe(f,{name:"danger",children:" [travado] "}),qe(f,{name:o?"accent":"fg",children:e.category.label}),Xo(f,{name:"danger",children:[" \xB7 ",r?"deny (nem --yolo)":"sempre pergunta"]})]}),o&&qe(Co,{paddingLeft:4,children:qe(f,{name:"fgDim",children:e.category.why})})]})}}}function DE(t){let e=Math.max(1,t.maxRows??14),o=t.columns,n=l=>{switch(l.kind){case"mode":return 8+be(CE[l.mode]);case"safe-tool":return 5+be(l.tool)+be(l.decision);case"grant":return 19+be(l.grantKey);case"locked":return 28+be(l.category.label)}},r=o!==void 0&&o>0?l=>Math.max(1,Math.ceil(n(l)/o)):void 0,{start:s,slice:i}=fr(t.rows,t.selected,e,r),a=null;return Xo(Co,{flexDirection:"column",children:[qe(Co,{children:qe(f,{name:"fgDim",children:"permissoes \xB7 \u2191\u2193 navega \xB7 enter muda \xB7 esc fecha"})}),Xo(Co,{children:[qe(f,{name:"fgDim",children:"modo atual: "}),qe(f,{name:t.mode==="unsafe"?"danger":"fg",children:CE[t.mode]})]}),t.rows.length===0?qe(Co,{children:qe(f,{name:"fgDim",children:" nada a mostrar"})}):Xo(pZ,{children:[s>0&&qe(Co,{children:Xo(f,{name:"fgDim",children:[" \u2191 ",s," acima"]})}),i.map((l,c)=>{let u=s+c,m=l.kind!==a?dZ(l.kind):null;return a=l.kind,Xo(cZ.Fragment,{children:[m&&qe(Co,{paddingTop:1,children:Xo(f,{name:"fgDim",children:["\u2500\u2500\u2500 ",m]})}),qe(mZ,{row:l,sel:u===t.selected})]},fZ(l,u))}),s+i.length<t.rows.length&&qe(Co,{children:Xo(f,{name:"fgDim",children:[" \u2193 ",t.rows.length-(s+i.length)," abaixo"]})})]}),qe(Co,{paddingTop:1,children:qe(uZ,{children:" "})}),qe(Co,{children:qe(f,{name:"fgDim",children:"o painel n\xE3o relaxa as categorias travadas \u2014 o \xFAnico bypass total \xE9 --yolo"})})]})}function fZ(t,e){switch(t.kind){case"mode":return"mode";case"safe-tool":return`safe:${t.tool}`;case"grant":return`grant:${t.grantKey}`;case"locked":return`locked:${t.category.category}`;default:return`row:${e}`}}var CE,s1=p(()=>{"use strict";se();_l();Tt();CE={plan:"PLAN (read-only)",normal:"NORMAL (catraca padr\xE3o)",unsafe:"YOLO (aprova\xE7\xE3o DESLIGADA)"}});import"react";import{Box as TE}from"ink";import{jsx as om,jsxs as _E}from"react/jsx-runtime";function pg(t){let{t:e}=ke();return _E(TE,{flexDirection:"column",children:[om(TE,{children:om(f,{name:"fgDim",children:e("picker.theme.help")})}),t.themes.map((o,n)=>{let r=n===t.selected,s=o.name===t.currentTheme;return _E(TE,{children:[om(f,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),om(f,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),om(f,{name:r?"accent":"fg",children:o.label}),_E(f,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.name)})]})}var i1=p(()=>{"use strict";se();ht()});import"react";import{Box as RE}from"ink";import{jsx as nm,jsxs as OE}from"react/jsx-runtime";function hg(t){let{t:e}=ke();return OE(RE,{flexDirection:"column",children:[nm(RE,{children:nm(f,{name:"fgDim",children:e("picker.lang.help")})}),t.langs.map((o,n)=>{let r=n===t.selected,s=o.code===t.currentLang;return OE(RE,{children:[nm(f,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),nm(f,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),nm(f,{name:r?"accent":"fg",children:o.label}),OE(f,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.code)})]})}var a1=p(()=>{"use strict";se();ht()});import"react";import{Box as rm}from"ink";import{jsx as zs,jsxs as sm}from"react/jsx-runtime";function ME(t){let{t:e}=ke(),o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>{let l=4+be(`${a.label} \xB7 ${a.summary}`)+(a.isDefault?2+be(e("picker.provider.default")):0);return Math.max(1,Math.ceil(l/n))}:void 0,{start:s,slice:i}=fr(t.providers,t.selected,o,r);return sm(rm,{flexDirection:"column",children:[zs(rm,{children:zs(f,{name:"fgDim",children:e("picker.provider.help")})}),t.usingFallback===!0?zs(rm,{children:zs(f,{name:"fgDim",children:e("picker.provider.fallback")})}):null,i.map((a,l)=>{let c=s+l===t.selected,u=a.name===t.currentProvider;return sm(rm,{children:[zs(f,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),zs(f,{name:u?"accent":"fgDim",children:u?"\u25CF ":" "}),zs(f,{name:c?"accent":"fg",children:a.label}),sm(f,{name:"fgDim",children:[" \xB7 ",a.summary]}),a.isDefault?sm(f,{name:"fgDim",children:[" \xB7 ",e("picker.provider.default")]}):null]},a.name)}),t.providers.length>i.length&&zs(rm,{children:sm(f,{name:"fgDim",children:[" ",e("picker.provider.more",{count:t.providers.length-i.length})]})})]})}var l1=p(()=>{"use strict";se();ht();Tt();_l()});import"react";import{Box as c1,Text as hZ}from"ink";import{jsx as LE,jsxs as u1}from"react/jsx-runtime";function PE(t){if(t.chips.length===0)return null;let e=t.active??-1;return LE(c1,{flexWrap:"wrap",children:t.chips.map((o,n)=>{let r=n===e;return u1(c1,{marginRight:1,children:[u1(f,{name:r?"accent":"depth",children:[r?"\u203A ":"","@",o.path,o.truncated?"~":""]}),LE(hZ,{children:" "}),LE(f,{name:"fgDim",children:"[\u232B]"})]},o.path)})})}var d1=p(()=>{"use strict";se()});import"react";import{Box as im,Text as m1}from"ink";import{jsx as Pn,jsxs as Ks}from"react/jsx-runtime";function FE(t){let e=oe(),{t:o}=ke(),n=t.columns??80,r=t.plan??"assinatura",s=e.glyph("wave").repeat(17);return Ks(im,{flexDirection:"column",paddingY:1,children:[Pn(Qr,{columns:n}),Pn(im,{paddingTop:1,paddingLeft:2,children:Pn(f,{name:"fgDim",children:o("boot.tagline")})}),Ks(im,{paddingLeft:2,children:[Pn(f,{name:"accent",children:s}),t.version!==void 0&&Ks(f,{name:"fgDim",children:[" v",t.version]})]}),Ks(im,{paddingLeft:2,children:[Pn(P,{name:"window",role:"fgDim"}),Ks(f,{name:"fgDim",children:[" ",r," \xB7 "]}),Pn(f,{name:"fgDim",children:t.tier}),Pn(m1,{children:" "}),Pn(f,{name:"fgDim",children:"\xB7 "}),Pn(P,{name:"broker",role:"depth"}),Ks(f,{name:"depth",children:[" ",o("boot.broker")]})]}),t.status!==void 0&&Ks(im,{paddingTop:1,paddingLeft:2,children:[Pn(zi,{frame:t.frame??0}),Pn(m1,{children:" "}),Ks(f,{name:"fgDim",children:[t.status,"\u2026"]})]})]})}var f1=p(()=>{"use strict";se();ht();zd();Bi()});import"react";import{Box as p1}from"ink";import{jsx as IE,jsxs as NE}from"react/jsx-runtime";function $E(t){let e=t.suggestions??gZ;return NE(p1,{flexDirection:"column",children:[IE(f,{name:"fg",children:t.name?`bom te ver de novo, ${t.name}.`:"bom te ver por aqui."}),IE(f,{name:"fgDim",children:"eu leio e edito arquivos e rodo comandos aqui \u2014 sempre te mostrando o efeito exato antes."}),NE(p1,{paddingTop:1,flexDirection:"column",children:[IE(f,{name:"fgDim",children:"experimente:"}),e.map((o,n)=>NE(f,{name:"fgDim",children:[" \xB7 ",o]},n))]})]})}var gZ,h1=p(()=>{"use strict";se();gZ=['"explique a estrutura deste repo"','"rode os testes e resuma as falhas"',"/help para comandos \xB7 /login conta \xB7 /quit"]});import"react";import{jsx as _0e}from"react/jsx-runtime";var g1=p(()=>{"use strict";se()});import"react";import{Box as y1,Text as BE}from"ink";import{jsx as Zi,jsxs as gg}from"react/jsx-runtime";function v1(t,e){return!Number.isFinite(t)||!Number.isFinite(e)||e<=0?0:Math.max(0,Math.min(1,t/e))}function k1(t,e,o,n,r){let s=Math.max(1,Math.trunc(n)),i=Math.max(0,Math.min(1,t)),a=Math.round(i*s);i>0&&a===0&&(a=1),i<1&&a===s&&(a=s-1);let l=e.repeat(a),c=o.repeat(s-a);return r?{filled:l,rest:c}:{filled:`[${l}`,rest:`${c}]`}}function Rl(t){let e=oe(),o=t.role??"accent";if(t.value!==void 0&&t.max!==void 0){let a=v1(t.value,t.max),l=Math.round(a*100),c=e.glyph("barFull"),u=e.glyph("barEmpty"),m=t.width??b1,{filled:d,rest:h}=k1(a,c,u,m,e.unicode);return gg(y1,{children:[Zi(f,{name:o,children:d}),Zi(f,{name:"fgDim",children:h}),Zi(BE,{children:" "}),gg(f,{name:o,children:[l,"%"]}),Zi(BE,{children:" "}),Zi(f,{name:"fgDim",children:t.label})]})}let r=e.spinnerFrames,s=e.animate?r[(t.frame??0)%r.length]:e.glyph("clock"),i=t.elapsedMs!==void 0?sl(t.elapsedMs):void 0;return gg(y1,{children:[Zi(f,{name:o,children:s}),Zi(BE,{children:" "}),gg(f,{name:"fgDim",children:[t.label,"\u2026",i!==void 0?` ${i}`:""]})]})}var b1,UE=p(()=>{"use strict";se();dn();b1=12});import"react";import{Box as yZ}from"ink";import{jsx as bZ,jsxs as x1}from"react/jsx-runtime";function jE(t){let{t:e}=ke(),o=(t.columns??80)<60,n=e(o?"banner.yolo.narrow":"banner.yolo");return x1(yZ,{children:[bZ(P,{name:"ask",role:"danger"}),x1(f,{name:"danger",children:[" ",n]})]})}var HE=p(()=>{"use strict";se();ht()});import"react";import{Box as vZ}from"ink";import{jsx as S1,jsxs as qE}from"react/jsx-runtime";function yg(t){let{t:e}=ke();if(t.mode==="unsafe")return S1(jE,{...t.columns!==void 0?{columns:t.columns}:{}});let o=kZ[t.mode],n=(t.columns??80)<60;return qE(vZ,{children:[S1(P,{name:o.glyph,role:o.role}),qE(f,{name:o.role,children:[" ",e("mode.label")," ",o.word]}),!n&&qE(f,{name:"fgDim",children:[" \xB7 ",e(o.caption)]})]})}var kZ,w1=p(()=>{"use strict";se();HE();ht();kZ={plan:{glyph:"planMode",role:"depth",word:"PLAN",caption:"mode.plan.caption"},normal:{glyph:"normalMode",role:"fgDim",word:"NORMAL",caption:"mode.normal.caption"},unsafe:{glyph:"ask",role:"danger",word:"YOLO",caption:"mode.unsafe.caption"}}});import"react";import{jsx as E1}from"react/jsx-runtime";function am(t){let{t:e}=ke();if(t.armedExit===!0)return E1(f,{name:"accent",children:e("hints.ctrlcAgain")});let o=e(xZ[t.state]),n=t.elapsed!==void 0&&t.elapsed!==""&&SZ.has(t.state);return E1(f,{name:"fgDim",children:n?`${o} \xB7 ${t.elapsed}`:o})}var xZ,SZ,A1=p(()=>{"use strict";se();ht();xZ={idle:"hints.idle",thinking:"hints.thinking",streaming:"hints.streaming",ask:"hints.ask","ask-destructive":"hints.askDestructive",slash:"hints.slash",palette:"hints.palette",budget:"hints.budget",error:"hints.error","work-subagents":"hints.workSubagents","idle-subagents":"hints.idleSubagents"},SZ=new Set(["thinking","streaming","work-subagents"])});import"react";import{Box as WE}from"ink";import{jsx as GE,jsxs as zE}from"react/jsx-runtime";function bg(t){return zE(WE,{flexDirection:"column",children:[zE(WE,{children:[GE(P,{name:"clock",role:"depth"}),zE(f,{name:"depth",children:[" ",t.title]})]}),GE(WE,{flexDirection:"column",paddingLeft:2,children:t.lines.map((e,o)=>GE(f,{name:"fgDim",children:e},o))})]})}var C1=p(()=>{"use strict";se()});import"react";import{Box as ea,Text as wZ}from"ink";import{jsx as Fn,jsxs as yn}from"react/jsx-runtime";function KE(t){let e=oe();if(t.status==="running"){let a=ar(t.liveOutput??"",kl).replace(/\n+$/,""),l=t.columns&&t.columns>0?t.columns-EZ:0,{text:c,hidden:u}=Zr(a,t.maxLines,l);return yn(ea,{flexDirection:"column",paddingLeft:2,children:[Fn(Yi,{glyph:"toolInflight",glyphRole:"depth",label:`rodando $ ${t.command}`,...t.frame!==void 0?{frame:t.frame}:{}}),c.length>0&&yn(ea,{flexDirection:"column",paddingLeft:2,children:[u>0&&yn(f,{name:"fgDim",children:["\u2026 (",u," linhas acima)"]}),c.split(`
|
|
628
628
|
`).map((m,d)=>Fn(ea,{children:Fn(f,{name:"fgDim",children:m})},d))]})]})}let o=t.status==="err",n=t.status==="blocked",r=n?"bloqueado":o?"erro":"ok",s=t.output??"";return yn(ea,{flexDirection:"column",paddingLeft:2,children:[yn(ea,{children:[n?Fn(P,{name:"err",role:"danger"}):Fn(P,{name:"tool",role:"depth"}),yn(f,{name:"fg",children:[" ",AZ," "]}),Fn(f,{name:"accent",children:"$ "}),Fn(f,{name:"fg",children:t.command}),Fn(wZ,{children:" "}),n||o?Fn(P,{name:"err",role:"danger"}):Fn(P,{name:"ok",role:"success"}),yn(f,{name:n||o?"danger":"fgDim",children:[" ",r]})]}),s.trim()!==""&&yn(ea,{flexDirection:"column",paddingLeft:2,children:[yn(f,{name:"fgDim",children:[e.box.topLeft," sa\xEDda ",e.box.horizontal.repeat(8)]}),s.split(`
|
|
629
629
|
`).map((i,a)=>yn(ea,{children:[yn(f,{name:"fgDim",children:[e.box.vertical," "]}),Fn(f,{name:n||o?"danger":"fg",children:i})]},a)),yn(f,{name:"fgDim",children:[e.box.bottomLeft," ",r," ",e.box.horizontal.repeat(4)]})]})]})}var EZ,AZ,D1=p(()=>{"use strict";se();tg();Tt();Ki();EZ=4,AZ="shell"});import"react";import{Box as YE,Text as T1}from"ink";import{jsx as pr,jsxs as Ol}from"react/jsx-runtime";function CZ(t){if(t.status==="running")return"rodando";if(t.status==="done")return"pronto";if(t.status==="cancelled")return"parado";switch(t.stop){case"timeout":return"timeout";case"limit":return"teto";default:return"falhou"}}function DZ(t){let e=t.child,o=CZ(e),n=e.status==="running"?pr(P,{name:"clock",role:"depth"}):e.status==="done"?pr(P,{name:"ok",role:"success"}):e.status==="cancelled"?pr(P,{name:"err",role:"fgDim"}):pr(P,{name:"err",role:"danger"}),r=e.status==="done"?"success":e.status==="fail"?"danger":"fgDim";return Ol(YE,{paddingLeft:2,children:[Ol(f,{name:"accent",children:["[",e.label,"]"]}),pr(T1,{children:" "}),n,pr(T1,{children:" "}),pr(f,{name:r,children:o}),e.summary!==void 0&&e.status!=="running"&&Ol(f,{name:"fgDim",children:[" \xB7 ",e.summary]})]})}function VE(t){let e=t.childrenStatus,o=e.length,n=e.filter(s=>s.status==="running").length,r=n>0?` (${n} rodando)`:"";return Ol(YE,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[Ol(YE,{children:[pr(P,{name:"subagents",role:"accent"}),Ol(f,{name:"fg",children:[" ",o," sub-agente",o===1?"":"s",":"]}),r!==""&&pr(f,{name:"fgDim",children:r})]}),e.map((s,i)=>pr(DZ,{child:s},`${s.label}:${i}`))]})}var _1=p(()=>{"use strict";se()});import"react";import{Box as Ml,Text as XE}from"ink";import{jsx as $o,jsxs as Ys}from"react/jsx-runtime";function TZ(t){switch(t){case"pending":return"testando";case"ok":return"ok";case"warn":return"aviso";default:return"falha"}}function _Z(t){let e=oe(),o=t.check,n=TZ(o.status),r,s;if(o.status==="pending"){let i=e.spinnerFrames,a=e.animate?i[(t.frame??0)%i.length]:e.glyph("clock");r=$o(f,{name:"accent",children:a}),s="fgDim"}else o.status==="ok"?(r=$o(P,{name:"ok",role:"success"}),s="success"):o.status==="warn"?(r=$o(P,{name:"ask",role:"accent"}),s="accent"):(r=$o(P,{name:"err",role:"danger"}),s="danger");return Ys(Ml,{flexDirection:"column",children:[Ys(Ml,{children:[$o(XE,{children:" "}),r,$o(XE,{children:" "}),Ys(f,{name:"fg",children:[o.label,":"]}),$o(XE,{children:" "}),o.detail!==void 0&&o.detail!==""?$o(f,{name:s,children:o.detail}):Ys(f,{name:s,children:[n,"\u2026"]})]}),o.status!=="pending"&&o.status!=="ok"&&o.fix!==void 0&&$o(Ml,{paddingLeft:4,children:Ys(f,{name:"fgDim",children:["\u2192 ",o.fix]})})]})}function JE(t){let e=t.checks,o=e.filter(s=>s.status==="pending").length,n=o>0?` (${o} testando)`:"",r=t.frame??0;return Ys(Ml,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[Ys(Ml,{children:[$o(P,{name:"clock",role:"accent"}),$o(f,{name:"fg",children:" doctor \u2014 diagn\xF3stico"}),n!==""&&$o(f,{name:"fgDim",children:n})]}),e.map(s=>$o(_Z,{check:s,frame:r},s.id)),t.summary!==void 0&&$o(Ml,{paddingTop:1,children:Ys(f,{name:"fgDim",children:["resumo: ",t.summary]})})]})}var R1=p(()=>{"use strict";se()});import"react";import{Box as mo,Text as vg}from"ink";import{jsx as Le,jsxs as ft}from"react/jsx-runtime";function O1(t){switch(t){case"done":return"success";case"cancelled":return"fgDim";case"failed":return"danger";default:return"accent"}}function ZE(t){let e=[`${Xt(t.tokens)} tokens`];return t.toolCalls>0&&e.push(`${t.toolCalls} tools`),e.push(un(t.durationMs)),e.join(" \xB7 ")}function RZ(t){let e=t.node,o=e.kind==="root"?0:2,n=t.focused?"\u25B8":" ";return ft(mo,{paddingLeft:o,children:[ft(f,{name:t.focused?"accent":"fgDim",children:[n," "]}),ft(f,{name:"accent",children:["[",e.label,"]"]}),Le(vg,{children:" "}),Le(f,{name:O1(e.phase),children:QE[e.phase]}),ft(f,{name:"fgDim",children:[" \xB7 ",ZE(e.accounting)]})]})}function OZ(t){let{t:e}=ke(),o=t.progress,n=o.max>1,r=o.subcyclesTotal>0,s=`${e("flowtree.subcycles")} ${o.subcyclesDone}/${o.subcyclesTotal}`;return n?ft(mo,{flexDirection:"column",children:[Le(mo,{children:ft(f,{name:"accent",children:["\u21BB ",e("flowtree.cycle")," ",o.iteration,"/",o.max]})}),ft(mo,{paddingLeft:2,children:[Le(f,{name:"fgDim",children:"\u2514 "}),r&&ft(f,{name:"fgDim",children:[s," \xB7 "]}),ft(f,{name:"accent",children:[e("flowtree.turn")," ",o.iteration]})]})]}):ft(mo,{children:[ft(f,{name:"accent",children:["\u21BB ",e("flowtree.cycle")]}),r&&ft(f,{name:"fgDim",children:[" \xB7 ",s]})]})}function MZ(t){let e=Math.max(1,t.maxRows??10),o=t.columns,n=o!==void 0&&o>0?i=>{let l=(i.kind==="root"?0:2)+be(` [${i.label}] ${QE[i.phase]} \xB7 ${ZE(i.accounting)}`);return Math.max(1,Math.ceil(l/o))}:void 0,{start:r,slice:s}=fr(t.overview,t.selected,e,n);return ft(mo,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[t.cycleProgress!==void 0&&Le(OZ,{progress:t.cycleProgress}),ft(mo,{children:[Le(P,{name:"subagents",role:"accent"}),Le(f,{name:"fg",children:" \xE1rvore de fluxos \u2014 ver \xB7 parar \xB7 interagir"})]}),s.map((i,a)=>Le(RZ,{node:i,focused:r+a===t.selected},i.id)),t.overview.length>s.length&&Le(mo,{children:ft(f,{name:"fgDim",children:[" \u2026 ",t.overview.length-s.length," n\xF3s a mais (\u2191\u2193 rola)"]})}),Le(mo,{paddingTop:1,children:Le(f,{name:"fgDim",children:"\u2191\u2193 navega \xB7 enter: ver \xB7 p: parar este \xB7 P: parar todos \xB7 i: interagir \xB7 esc: fecha"})})]})}function LZ(t){let e=t.activity,o=[];return e.durationMs!==void 0&&o.push(un(e.durationMs)),(e.added!==void 0||e.removed!==void 0)&&o.push(`+${e.added??0}/\u2212${e.removed??0}`),e.tokens!==void 0&&o.push(`${Xt(e.tokens)} tok`),ft(mo,{flexDirection:"column",paddingLeft:2,children:[ft(mo,{children:[e.running?Le(P,{name:"clock",role:"depth"}):e.ok?Le(P,{name:"ok",role:"success"}):Le(P,{name:"err",role:"danger"}),Le(vg,{children:" "}),Le(f,{name:"fg",children:e.tool}),e.target!==""&&ft(f,{name:"fgDim",children:[" ",e.target]}),Le(vg,{children:" "}),Le(f,{name:e.running?"fgDim":e.ok?"success":"danger",children:e.summary&&e.summary!==""?e.summary:e.running?"rodando":e.ok?"ok":"erro"}),o.length>0&&ft(f,{name:"fgDim",children:[" \xB7 ",o.join(" \xB7 ")]})]}),e.running&&e.tail!==void 0&&e.tail!==""&&Le(mo,{paddingLeft:4,children:Le(f,{name:"fgDim",children:e.tail})})]})}function PZ(t){let e=t.node;return ft(mo,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[ft(mo,{children:[Le(P,{name:"subagents",role:"accent"}),Le(f,{name:"fg",children:" "}),ft(f,{name:"accent",children:["[",e.label,"]"]}),Le(vg,{children:" "}),Le(f,{name:O1(e.phase),children:QE[e.phase]}),ft(f,{name:"fgDim",children:[" \xB7 ",ZE(e.accounting)]})]}),e.recent.length===0?Le(mo,{paddingLeft:2,children:Le(f,{name:"fgDim",children:"sem atividade recente."})}):e.recent.map((o,n)=>Le(LZ,{activity:o},`${o.tool}:${n}`)),Le(mo,{paddingTop:1,children:Le(f,{name:"fgDim",children:"p: parar este \xB7 i: interagir \xB7 esc/enter: volta \xE0 \xE1rvore"})})]})}function eA(t){return t.drillIn?Le(PZ,{node:t.drillIn}):Le(MZ,{...t})}var QE,M1=p(()=>{"use strict";se();dn();Tt();ht();_l();QE={thinking:"pensando",tool:"rodando tool",asking:"aguardando confirma\xE7\xE3o",done:"conclu\xEDdo",cancelled:"parado",failed:"falhou"}});function tA({onlyFirst:t=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,t?void 0:"g")}var L1=p(()=>{});function lm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(FZ,"")}var FZ,oA=p(()=>{L1();FZ=tA()});var P1,F1,I1,N1,$1,B1,nA,U1=p(()=>{P1=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],F1=12288,I1=65510,N1=[12288,12288,65281,65376,65504,65510],$1=4352,B1=262141,nA=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var kg,j1=p(()=>{kg=(t,e)=>{let o=0,n=Math.floor(t.length/2)-1;for(;o<=n;){let r=Math.floor((o+n)/2),s=r*2;if(e<t[s])n=r-1;else if(e>t[s+1])o=r+1;else return!0}return!1}});function UZ(t){let e=t[0],o=t[1];for(let n=0;n<t.length;n+=2){let r=t[n],s=t[n+1];if(H1>=r&&H1<=s)return[r,s];s-r>o-e&&(e=r,o=s)}return[e,o]}var H1,$Z,BZ,q1,W1,G1,z1=p(()=>{U1();j1();H1=19968,[$Z,BZ]=UZ(nA);q1=t=>t<161||t>1114109?!1:kg(P1,t),W1=t=>t<F1||t>I1?!1:kg(N1,t),G1=t=>t>=$Z&&t<=BZ?!0:t<$1||t>B1?!1:kg(nA,t)});function jZ(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function K1(t,{ambiguousAsWide:e=!1}={}){return jZ(t),W1(t)||G1(t)||e&&q1(t)?2:1}var Y1=p(()=>{z1()});var X1=u8((s_e,V1)=>{V1.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});function ta(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:o=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=lm(t)),t.length===0)return 0;let r=0,s={ambiguousAsWide:!o};for(let{segment:i}of HZ.segment(t)){let a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!qZ.test(i)){if((0,J1.default)().test(i)){r+=2;continue}r+=K1(a,s)}}return r}var J1,HZ,qZ,Q1=p(()=>{oA();Y1();J1=m8(X1(),1),HZ=new Intl.Segmenter,qZ=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function zZ(){let t=new Map;for(let[e,o]of Object.entries(lt)){for(let[n,r]of Object.entries(o))lt[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},o[n]=lt[n],t.set(r[0],r[1]);Object.defineProperty(lt,e,{value:o,enumerable:!1})}return Object.defineProperty(lt,"codes",{value:t,enumerable:!1}),lt.color.close="\x1B[39m",lt.bgColor.close="\x1B[49m",lt.color.ansi=Z1(),lt.color.ansi256=eB(),lt.color.ansi16m=tB(),lt.bgColor.ansi=Z1(10),lt.bgColor.ansi256=eB(10),lt.bgColor.ansi16m=tB(10),Object.defineProperties(lt,{rgbToAnsi256:{value(e,o,n){return e===o&&o===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(o/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!o)return[0,0,0];let[n]=o;n.length===3&&(n=[...n].map(s=>s+s).join(""));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>lt.rgbToAnsi256(...lt.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let o,n,r;if(e>=232)o=((e-232)*10+8)/255,n=o,r=o;else{e-=16;let a=e%36;o=Math.floor(e/36)/5,n=Math.floor(a/6)/5,r=a%6/5}let s=Math.max(o,n,r)*2;if(s===0)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(o));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,o,n)=>lt.ansi256ToAnsi(lt.rgbToAnsi256(e,o,n)),enumerable:!1},hexToAnsi:{value:e=>lt.ansi256ToAnsi(lt.hexToAnsi256(e)),enumerable:!1}}),lt}var Z1,eB,tB,lt,c_e,WZ,GZ,u_e,KZ,oB,nB=p(()=>{Z1=(t=0)=>e=>`\x1B[${e+t}m`,eB=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,tB=(t=0)=>(e,o,n)=>`\x1B[${38+t};2;${e};${o};${n}m`,lt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},c_e=Object.keys(lt.modifier),WZ=Object.keys(lt.color),GZ=Object.keys(lt.bgColor),u_e=[...WZ,...GZ];KZ=zZ(),oB=KZ});function iA(t,e,o){return String(t).normalize().replaceAll(`\r
|
|
630
630
|
`,`
|
package/dist-bundle/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $I=Object.create;var Pp=Object.defineProperty;var BI=Object.getOwnPropertyDescriptor;var UI=Object.getOwnPropertyNames;var jI=Object.getPrototypeOf,HI=Object.prototype.hasOwnProperty;var S=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var qI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Fp=(t,e)=>{for(var o in e)Pp(t,o,{get:e[o],enumerable:!0})},WI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of UI(e))!HI.call(t,r)&&r!==o&&Pp(t,r,{get:()=>e[r],enumerable:!(n=BI(e,r))||n.enumerable});return t};var GI=(t,e,o)=>(o=t!=null?$I(jI(t)):{},WI(e||!t||!t.__esModule?Pp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,$E=S(()=>{"use strict";Ua="1.0.0-rc.
|
|
1
|
+
var $I=Object.create;var Pp=Object.defineProperty;var BI=Object.getOwnPropertyDescriptor;var UI=Object.getOwnPropertyNames;var jI=Object.getPrototypeOf,HI=Object.prototype.hasOwnProperty;var S=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(n){throw o=[n],n}};var qI=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},Fp=(t,e)=>{for(var o in e)Pp(t,o,{get:e[o],enumerable:!0})},WI=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of UI(e))!HI.call(t,r)&&r!==o&&Pp(t,r,{get:()=>e[r],enumerable:!(n=BI(e,r))||n.enumerable});return t};var GI=(t,e,o)=>(o=t!=null?$I(jI(t)):{},WI(e||!t||!t.__esModule?Pp(o,"default",{value:t,enumerable:!0}):o,t));var Ua,$E=S(()=>{"use strict";Ua="1.0.0-rc.74"});function zn(t,e){return t.decide(e)}var us=S(()=>{"use strict"});var mn,Kn,Yn=S(()=>{"use strict";mn="remember",Kn="recall"});var Ip,zI,hi,Np=S(()=>{"use strict";Ip=class{id;horizon;label;parentId;children;dependencies;pinned;closed;createdAt;lastAccessedAt;accessCount;context;constructor(e,o,n,r,s){this.id=e,this.horizon=o,this.label=n,this.parentId=r,this.children=new Set,this.dependencies=new Set,this.pinned=!1,this.closed=!1,this.createdAt=s,this.lastAccessedAt=s,this.accessCount=0,this.context=[]}touch(e){this.lastAccessedAt=e,this.accessCount+=1}snapshot(){return{id:this.id,horizon:this.horizon,label:this.label,parentId:this.parentId,children:[...this.children],dependencies:[...this.dependencies],pinned:this.pinned,closed:this.closed,createdAt:this.createdAt,lastAccessedAt:this.lastAccessedAt,accessCount:this.accessCount,contextSize:this.context.length}}},zI=200,hi=class{nodes=new Map;maxBoxes;now;constructor(e){this.maxBoxes=e?.maxBoxes??zI,this.now=e?.clock??Date.now}static boxId(e,o){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}-${o.toString(36)}`}openBox(e,o,n,r){let s=this.nodes.get(e);if(s)return s.touch(this.now()),{box:s.snapshot(),created:!1};if(this.nodes.size>=this.maxBoxes&&(this.evictOne(),this.nodes.size>=this.maxBoxes))return null;let i=this.now(),a=new Ip(e,o,n,r??null,i);if(r){let l=this.nodes.get(r);l&&l.children.add(e)}return this.nodes.set(e,a),{box:a.snapshot(),created:!0}}closeBox(e){let o=this.nodes.get(e);return o?(o.closed=!0,o.touch(this.now()),o.snapshot()):null}isClosed(e){let o=this.nodes.get(e);return o?o.closed:!1}reopenBox(e){let o=this.nodes.get(e);return o?(o.closed=!1,o.touch(this.now()),o.snapshot()):null}setHorizon(e,o){let n=this.nodes.get(e);return n?(n.horizon=o,n.touch(this.now()),n.snapshot()):null}setParent(e,o){let n=this.nodes.get(e);return n?n.parentId===o?n.snapshot():o!==null&&this.wouldCreateCycle(e,o)?null:(n.parentId&&this.nodes.get(n.parentId)?.children.delete(e),n.parentId=o,o&&this.nodes.get(o)?.children.add(e),n.touch(this.now()),n.snapshot()):null}wouldCreateCycle(e,o){let n=new Set,r=o;for(;r!==null;){if(r===e||n.has(r))return!0;n.add(r),r=this.nodes.get(r)?.parentId??null}return!1}getBox(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),o.snapshot()):null}listBoxes(e="lastAccessedAt"){let o=[...this.nodes.values()].map(n=>n.snapshot());switch(e){case"createdAt":return o.sort((n,r)=>n.createdAt-r.createdAt);case"accessCount":return o.sort((n,r)=>r.accessCount-n.accessCount);default:return o.sort((n,r)=>r.lastAccessedAt-n.lastAccessedAt)}}get size(){return this.nodes.size}addContext(e,o){let n=this.nodes.get(e);return n?(n.context.push({ts:this.now(),text:o}),n.touch(this.now()),n.snapshot()):null}getContext(e){let o=this.nodes.get(e);return o?(o.touch(this.now()),[...o.context]):[]}getContextChain(e){let o=[],n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let s=this.nodes.get(r);if(!s)break;s.touch(this.now()),o.push({boxId:s.id,entries:[...s.context]}),r=s.parentId}return o}addDependency(e,o){let n=this.nodes.get(e);return!n||!this.nodes.has(o)||n.id===o?!1:(n.dependencies.add(o),n.touch(this.now()),!0)}getDependencies(e){let o=this.nodes.get(e);return o?[...o.dependencies]:[]}pinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!0,o.touch(this.now()),o.snapshot()):null}unpinBox(e){let o=this.nodes.get(e);return o?(o.pinned=!1,o.touch(this.now()),o.snapshot()):null}evictOne(){let e=[];for(let n of this.nodes.values())n.horizon==="longo"||n.pinned||e.push(n);if(e.length===0)return null;e.sort((n,r)=>{let s=n.horizon==="curto"?0:1,i=r.horizon==="curto"?0:1;if(s!==i)return s-i;let a=n.closed?0:1,l=r.closed?0:1;return a!==l?a-l:n.lastAccessedAt!==r.lastAccessedAt?n.lastAccessedAt-r.lastAccessedAt:n.accessCount-r.accessCount});let o=e[0];return this.removeNode(o)}forceEvict(e){let o=this.nodes.get(e);return!o||o.horizon==="longo"||o.pinned?null:this.removeNode(o)}removeBox(e){let o=this.nodes.get(e);return o?this.removeNode(o):null}removeNode(e){if(e.parentId){let o=this.nodes.get(e.parentId);o&&o.children.delete(e.id)}return this.nodes.delete(e.id),e.snapshot()}}});function Wu(t){let e=[];for(let o of t){e.push({step:o,depth:0});for(let n of o.substeps??[])e.push({step:n,depth:1})}return e}function jE(t,e){let o,n="pending",r;if(typeof t=="string")o=t;else if(t!==null&&typeof t=="object"){let i=t,a=i.title??i.step??i.text??i.name??i.content;if(typeof a=="string"&&(o=a),typeof i.status=="string"&&KI.has(i.status)&&(n=i.status),e){let l=i.substeps??i.subtasks??i.subpassos??i.children;if(Array.isArray(l)&&l.length>0){let c=[];for(let u of l){let f=jE(u,!1);if(typeof f=="string")return f;c.push(f)}r=c}}}if(o===void 0||o.trim()==="")return VI;let s=o.trim().slice(0,YI);return r?{title:s,status:n,substeps:r}:{title:s,status:n}}function XI(t){let e=t.steps??t.plan??t.todos??t.items;if(!Array.isArray(e))return{error:'update_plan: passe "steps" como uma LISTA de passos (string ou {title,status}).'};if(e.length===0)return{error:"update_plan: a lista de passos est\xE1 vazia."};let o=[];for(let i of e){let a=jE(i,!0);if(typeof a=="string")return{error:a};o.push(a)}let n=new Set,r=i=>{if(!n.has(i))return n.add(i),i;for(let a=2;;a++){let l=`${i} #${a}`;if(!n.has(l))return n.add(l),l}};for(let i=0;i<o.length;i++){let a=o[i],l=r(a.title),c=a.substeps?.map(u=>({...u,title:r(u.title)}));o[i]=c!==void 0?{...a,title:l,substeps:c}:{...a,title:l}}let s=Wu(o).length;return s>BE?{error:`update_plan: no m\xE1ximo ${BE} passos (recebidos ${s}).`}:{steps:o}}function JI(t){let e=Wu(t),o=e.filter(r=>r.step.status==="completed").length,n=e.map(r=>`${" ".repeat(r.depth)}${HE[r.step.status]} ${r.step.title}`).join(`
|
|
2
2
|
`);return`plano (${o}/${e.length}):
|
|
3
3
|
${n}`}function ZI(t,e){return e<0?"m\xE9dio":t===e?"curto":t>e?"longo":"m\xE9dio"}function eN(t,e){let o=new Map;for(let i of e.listBoxes())o.set(i.label,i.id);let n=t.findIndex(i=>i.status==="in_progress"||(i.substeps??[]).some(a=>a.status==="in_progress")),r=(i,a,l)=>{let c=i.status==="in_progress"?"curto":l,u=o.get(i.title),f=u??hi.boxId(i.title,0);return u?(i.status!=="completed"&&e.isClosed(u)&&e.reopenBox(u),e.setHorizon(u,c),e.setParent(u,a)):e.openBox(f,c,i.title,a),i.status==="completed"&&!e.isClosed(f)&&e.closeBox(f),o.set(i.title,f),f};t.forEach((i,a)=>{let l=ZI(a,n),c=r(i,null,l);for(let u of i.substeps??[])r(u,c,l)});let s=new Set;for(let i of t){s.add(i.title);for(let a of i.substeps??[])s.add(a.title)}for(let i of e.listBoxes())s.has(i.label)||e.removeBox(i.id)}function tN(t,e){if(!e)return JI(t);let o=new Map;for(let c of e.listBoxes())o.set(c.label,c);let n=new Map;for(let c of e.listBoxes())n.set(c.id,c);let r=new Map,s=(c,u=new Set)=>{let f=r.get(c);if(f!==void 0)return f;let d=n.get(c);if(!d||!d.parentId||u.has(c))return r.set(c,0),0;let p=s(d.parentId,new Set(u).add(c))+1;return r.set(c,p),p},i=Wu(t),l=[`plano (${i.filter(c=>c.step.status==="completed").length}/${i.length}):`];for(let{step:c,depth:u}of i){let f=o.get(c.title),d=f?QI[f.horizon]:"",p=f?s(f.id):u,h=" ".repeat(p),y=HE[c.status];l.push(`${h}${d} ${y} ${c.title}`)}return l.join(`
|
|
4
4
|
`)}var ja,KI,BE,YI,VI,HE,QI,UE,oN,qE,Gu=S(()=>{"use strict";Np();ja="update_plan";KI=new Set(["pending","in_progress","completed"]),BE=30,YI=120,VI="update_plan: cada passo precisa de um t\xEDtulo (texto) n\xE3o-vazio.";HE={pending:"\u2610",in_progress:"\u25B6",completed:"\u2611"};QI={longo:"[\u{1F4D0}]",m\u00E9dio:"[\u{1F4CB}]",curto:"[\u{1F4CC}]"};UE=Object.freeze({type:"string",enum:["pending","in_progress","completed"],description:"pending (a fazer) \xB7 in_progress (em curso) \xB7 completed (feito)."}),oN=Object.freeze({type:"object",properties:{steps:{type:"array",description:"A lista COMPLETA de passos do plano (re-emita TODOS a cada atualiza\xE7\xE3o \u2014 substitui o anterior).",items:{type:"object",properties:{title:{type:"string",description:"O passo, curto e no imperativo."},status:UE,substeps:{type:"array",description:"OPCIONAL: sub-passos que detalham este passo (1 n\xEDvel). Aparecem indentados sob o passo e seguem o foco dele. Use quando um passo tem a\xE7\xF5es menores distintas.",items:{type:"object",properties:{title:{type:"string",description:"O sub-passo, curto e no imperativo."},status:UE},required:["title"],additionalProperties:!1}}},required:["title"],additionalProperties:!1}}},required:["steps"],additionalProperties:!1}),qE={name:ja,effect:"read",description:"Declara/atualiza um PLANO vis\xEDvel (checklist de passos). Use ao iniciar uma tarefa com V\xC1RIOS passos e a cada progresso: re-emita a lista TODA marcando o status de cada passo (pending/in_progress/completed). Mantenha 1 passo in_progress por vez. N\xE3o tem efeito no sistema \u2014 \xE9 s\xF3 o seu plano, para voc\xEA e para o usu\xE1rio acompanharem.",parameters:oN,async run(t,e){let o=XI(t);return"error"in o?{ok:!1,observation:o.error}:(e.graph&&eN(o.steps,e.graph),e.plan&&e.plan.set(Wu(o.steps).map(r=>({title:r.step.title,status:r.step.status}))),{ok:!0,observation:tN(o.steps,e.graph)})}}});function WE(t){let e=t.question??t.prompt??t.text??t.message;if(typeof e!="string"||e.trim()==="")return{error:'perguntar: passe "question" (a pergunta em texto). Para escolha, passe tamb\xE9m "options".'};let o=e.trim().slice(0,2e3),n=t.header??t.title,r=typeof n=="string"&&n.trim()!==""?n.trim().slice(0,200):void 0,s=t.options??t.choices,i=Array.isArray(s)?rN(s):void 0;if(typeof i=="string")return{error:i};let a,l=t.kind??t.type;if(typeof l=="string"&&nN.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 rN(t){if(t.length===0)return'perguntar: a lista de "options" est\xE1 vazia.';if(t.length>12)return`perguntar: no m\xE1ximo 12 op\xE7\xF5es (recebidas ${t.length}).`;let e=[];for(let o of t){let n,r;if(typeof o=="string")n=o;else if(o!==null&&typeof o=="object"){let s=o,i=s.label??s.text??s.value??s.name??s.title;typeof i=="string"&&(n=i),typeof s.description=="string"&&s.description.trim()!==""&&(r=s.description.trim().slice(0,300))}if(n===void 0||n.trim()==="")return'perguntar: cada op\xE7\xE3o precisa de um "label" (texto) n\xE3o-vazio.';e.push({label:n.trim().slice(0,200),...r!==void 0?{description:r}:{}})}return e}function sN(t){switch(t.kind){case"choice":return t.label;case"choices":return t.labels.length===0?"(nenhuma)":t.labels.join(", ");case"text":{let e=t.text.split(`
|
|
@@ -137,7 +137,7 @@ ${t.trim()}`}}function UD(t,e,o=ec){let{older:n,recent:r}=mm(t,o);if(n.length===
|
|
|
137
137
|
\u2026[truncado: ${t.length-Pb} chars omitidos]`}function zU(t){return t.length<=Ib?t:`${t.slice(0,Ib)}\u2026`}function w0(t){let e=S0(t.server,t.descriptor.name),o=zU(t.descriptor.description.trim()),n=`[tool de um SERVER MCP de terceiro "${t.server}" \u2014 efeito n\xE3o-confi\xE1vel, passa pela catraca] ${o||"(sem descri\xE7\xE3o)"}`,r=t.descriptor.inputSchema,s=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:void 0;return{name:e,effect:"mcp",description:n,...s?{parameters:s}:{},async run(i,a,l){try{let c=await t.transport.callTool(t.descriptor.name,i,l?.signal),u=Ue(c.content);return c.ok?{ok:!0,observation:E0(u),display:`${e}(${KU(i)})`}:{ok:!1,observation:E0(`MCP "${e}" erro: ${u}`)}}catch(c){return{ok:!1,observation:`MCP "${e}" falhou: ${c instanceof Error?c.message:String(c)}`}}}}}function Nb(t,e){let o=[],n=new Set,r=new Map,s=new Map,i=new Set;for(let a of t){let l=w0(a);if(n.has(l.name))continue;n.add(l.name);let c=a.server;s.set(c,(s.get(c)??0)+1);let u=r.get(c)??0;if(u>=Fb){i.add(c);continue}r.set(c,u+1),o.push(l)}if(e)for(let a of i){let l=s.get(a)??0;e(`server MCP "${a}" exp\xF4s ${l} tools; usando as primeiras ${Fb} (teto por server, anti-estouro de contexto). As demais foram ignoradas \u2014 revise o server ou reduza as tools que ele exp\xF5e.`)}return o}function KU(t){if(Object.keys(t).length===0)return"";let o=JSON.stringify(t);return o.length<=200?o:`${o.slice(0,200)}\u2026`}var Pb,Fb,Ib,A0=S(()=>{"use strict";Yu();Zn();Pb=2e4;Fb=128,Ib=1024});function T0(t,e){let o=new URL(D0);return t.trim().length>0&&o.searchParams.set("search",t.trim()),o.searchParams.set("limit",String(VU)),e!==void 0&&e.length>0&&o.searchParams.set("cursor",e),o.toString()}async function Bb(t,e,o){let n=t.trim(),r=[],s;for(let i=0;i<YU;i++){let a=T0(n,s),l;try{l=await e(a,o)}catch(f){return{ok:!1,query:n,reason:xm(t2(f))}}if(!l.ok)return{ok:!1,query:n,reason:xm(l.reason)};if(l.status<200||l.status>=300)return{ok:!1,query:n,reason:xm(`HTTP ${l.status}`)};let c;try{c=JSON.parse(l.body)}catch{return{ok:!1,query:n,reason:xm("resposta n\xE3o \xE9 JSON v\xE1lido")}}let u=R0(c);for(let f of u.servers)if(_0(f,n)&&r.push(f),r.length>=$b)break;if(r.length>=$b||(s=u.nextCursor,s===void 0||s.length===0))break}return{ok:!0,query:n,results:r}}function xm(t){return`registro MCP indispon\xEDvel (${Wi}): ${t}`}function _0(t,e){if(e.length===0)return!0;let o=e.toLowerCase();return[t.name,t.title??"",t.description,t.run.command??"",t.run.args.join(" ")].join(" ").toLowerCase().includes(o)}function R0(t){if(!nr(t))return{servers:[]};let e=Array.isArray(t.servers)?t.servers:[],o=[];for(let s of e){let i=XU(s);i!==void 0&&o.push(i)}let n=nr(t.metadata)?t.metadata:void 0,r=n!==void 0&&typeof n.nextCursor=="string"?n.nextCursor:void 0;return{servers:o,...r!==void 0?{nextCursor:r}:{}}}function XU(t){if(!nr(t))return;let e=nr(t.server)?t.server:t,o=typeof e.name=="string"?e.name.trim():"";if(o.length===0)return;let n=typeof e.description=="string"?e.description.trim():"",r=typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():void 0,s=typeof e.version=="string"?e.version.trim():void 0,i=JU(e);return{name:o,description:n,run:i,...r!==void 0?{title:r}:{},...s!==void 0?{version:s}:{}}}function JU(t){let e=[],o=Array.isArray(t.remotes)?t.remotes:[];for(let r of o)nr(r)&&typeof r.url=="string"&&e.push(r.url);let n=Array.isArray(t.packages)?t.packages:[];for(let r of n){if(!nr(r))continue;let s=QU(r);if(s!==void 0)return{...s,remoteUrls:e}}return{args:[],env:[],remoteUrls:e}}function QU(t){let e=Rs(t.registryType)??Rs(t.registry_name),o=Rs(t.identifier)??Rs(t.name);if(o===void 0)return;let n=Rs(t.version),r=Rs(t.runtimeHint),s=nr(t.transport)?Rs(t.transport.type):void 0,i=e2(t.environmentVariables),a=C0(t.runtimeArguments),l=C0(t.packageArguments),c=n!==void 0?`${o}@${n}`:o;return e==="npm"||r==="npx"?{command:"npx",args:ZU(["-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 ZU(t){let e=[],o=!1;for(let n of t){if(n==="-y"||n==="--yes"){if(o)continue;o=!0}e.push(n)}return e}function C0(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)nr(o)&&typeof o.value=="string"&&e.push(o.value);return e}function e2(t){if(!Array.isArray(t))return[];let e=[];for(let o of t)nr(o)&&typeof o.name=="string"&&o.name.length>0&&e.push({name:o.name,required:o.isRequired===!0});return e}function Rs(t){return typeof t=="string"&&t.trim().length>0?t.trim():void 0}function nr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function t2(t){return t instanceof Error?t.message:String(t)}var Wi,D0,YU,VU,$b,O0=S(()=>{"use strict";Wi="registry.modelcontextprotocol.io",D0=`https://${Wi}/v0/servers`,YU=5,VU=100,$b=25});function L0(t){let{command:e,args:o}=t.run;if(e===void 0)return;let n=P0(t.name);return["aluy","mcp","add",M0(n),"--",e,...o.map(M0)].join(" ")}function P0(t){let o=(t.split("/").pop()??t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");return o.length>0?o:"server"}function M0(t){return/^[A-Za-z0-9_./@:+=-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function Ub(t){if(!t.ok)return`\u26A0 ${t.reason}
|
|
138
138
|
Tente de novo em instantes; a busca no registro n\xE3o bloqueia o resto do aluy.`;if(t.results.length===0)return`nenhum server encontrado para "${t.query}" no registro oficial MCP.`;let e=[],o=t.results.length;e.push(`${o} server${o===1?"":"s"} para "${t.query}" (registro oficial MCP):`),e.push("");for(let n of t.results)e.push(o2(n)),e.push("");return e.push('Para instalar, copie a linha "\u2192 aluy mcp add \u2026" do server desejado.'),e.push("A sa\xEDda do registro \xE9 apenas informativa \u2014 nada \xE9 executado pela busca."),e.join(`
|
|
139
139
|
`)}function o2(t){let o=[`\u2022 ${t.version!==void 0?`${t.name} (v${t.version})`:t.name}`],n=t.title!==void 0&&t.title!==t.name?t.title:void 0;n!==void 0&&o.push(` ${n}`),t.description.length>0&&o.push(` ${n2(t.description,200)}`);let r=L0(t);if(r!==void 0){o.push(` \u2192 ${r}`),t.run.transport!==void 0&&t.run.transport!=="stdio"&&o.push(` (transporte "${t.run.transport}" \u2014 v1 do aluy s\xF3 pluga servers stdio LOCAIS)`);let s=t.run.env.filter(i=>i.required).map(i=>i.name);s.length>0&&o.push(` requer env: ${s.join(", ")} (defina por-server no mcp.json)`)}else t.run.remoteUrls.length>0?o.push(` (server REMOTO: ${t.run.remoteUrls.join(", ")} \u2014 fora do v1 de \`aluy mcp add\`)`):o.push(" (sem pacote local conhecido \u2014 nada a instalar pelo aluy)");return o.join(`
|
|
140
|
-
`)}function n2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var F0=S(()=>{"use strict"});var I0=S(()=>{"use strict";km();g0();y0();b0();v0();x0();A0();Yu();O0();F0()});function jb(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(t.trim());if(!e)return null;let o=e[4]?e[4].split(".").map(n=>/^\d+$/.test(n)?Number(n):n):[];return{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),pre:o}}function N0(t,e){let o=jb(t),n=jb(e);if(!o||!n)return null;for(let s of["major","minor","patch"])if(o[s]!==n[s])return o[s]<n[s]?-1:1;if(o.pre.length===0&&n.pre.length===0)return 0;if(o.pre.length===0)return 1;if(n.pre.length===0)return-1;let r=Math.max(o.pre.length,n.pre.length);for(let s=0;s<r;s++){let i=o.pre[s],a=n.pre[s];if(i===void 0)return-1;if(a===void 0)return 1;if(i===a)continue;let 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 Hb(t,e){return N0(t,e)===1}var $0=S(()=>{"use strict"});function Em(t,e,o){if(e.size===0)return{kind:"discard",reason:"allowlist vazia (default fechado)"};if(!e.has(t.conversation))return{kind:"discard",reason:`canal ${t.conversation} n\xE3o-allowlistado`};if(t.senderIsBot===!0)return{kind:"discard",reason:"remetente \xE9 bot (anti-loop, TC-6)"};let n=t.content.trim();if(n==="")return{kind:"discard",reason:"mensagem sem conte\xFAdo"};if(o.authIsForgeable)return{kind:"data",text:n};if(t.provenance.kind==="third-party-relayed")return{kind:"data",text:n};let r=t.provenance.embeddedThirdParty?.trim();return r?{kind:"instruction",text:n,forwardedData:r}:{kind:"instruction",text:n}}var qb=S(()=>{"use strict"});function Wb(t){let e;if(t.forwarded===!0)e={kind:"third-party-relayed"};else{let o=(t.quotedText??"").trim();e=o?{kind:"author-direct",embeddedThirdParty:o}:{kind:"author-direct"}}return{content:t.text,sender:String(t.fromId),conversation:String(t.chatId),provenance:e,...t.isBot===!0?{senderIsBot:!0}:{}}}function Gb(t){let e=new Set;for(let o of t)typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&e.add(o);return e}var lc,B0=S(()=>{"use strict";qb();lc={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function zb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Kb(t,e){let o=Gi(t);if(!o||o.ok!==!0||!Array.isArray(o.result))return{updates:[],nextOffset:e};let n=[],r=e-1;for(let s of o.result){let i=Gi(s);if(!i)continue;let a=zb(i.update_id);a!==void 0&&a>r&&(r=a);let l=Gi(i.message);if(!l)continue;let c=Gi(l.chat),u=zb(c?.id);if(u===void 0||c?.type!=="private")continue;let f=Gi(l.from),d=zb(f?.id)??u,p=f?.is_bot===!0,h=typeof l.text=="string"?l.text:"",y=l.forward_origin!==void 0||l.forward_from!==void 0||l.forward_from_chat!==void 0||l.forward_sender_name!==void 0||l.forward_date!==void 0,g=(()=>{let E=Gi(l.quote)?.text;return typeof E=="string"&&E.trim()!==""?E:void 0})();n.push({chatId:u,fromId:d,text:h,...y?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var U0=S(()=>{"use strict"});var cc,j0=S(()=>{"use strict";cc=class{maxPerWindow;windowMs;stamps=[];constructor(e,o){this.maxPerWindow=e,this.windowMs=o}tryConsume(e){let o=e-this.windowMs;for(;this.stamps.length>0&&this.stamps[0]<=o;)this.stamps.shift();return this.stamps.length>=this.maxPerWindow?!1:(this.stamps.push(e),!0)}get used(){return this.stamps.length}}});function Yb(t){return`connector-${t}-token`}function uc(t){let e=t.trim(),o=e.indexOf(":");return o<=0?`\u2026(${e.length} chars)`:`${e.slice(0,o)}:\u2026(${e.length-o-1} chars)`}function Vb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var H0=S(()=>{"use strict"});var B=S(()=>{"use strict";$E();aS();vS();$w();s0();Wy();f0();I0();xb();Jd();$0();qb();B0();U0();j0();H0()});import{posix as E8}from"node:path";function S8(t){return E8.normalize(t)}function fo(t){let e=S8(t);for(let o of w8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function fv(t){return fo(t).kind==="allow"}var w8,$r=S(()=>{"use strict";w8=[{re:/(?:^|\/|~\/)\.ssh(?:\/|$)/,why:"chaves SSH (~/.ssh)",deny:!0},{re:/(?:^|\/|~\/)\.aws(?:\/|$)/,why:"credenciais AWS (~/.aws)",deny:!0},{re:/(?:^|\/|~\/)\.gnupg(?:\/|$)/,why:"chaves GPG (~/.gnupg)",deny:!0},{re:/(?:~\/|\$\{?HOME\}?\/|\/(?:home|Users)\/[^/]+\/)\.aluy\/rooms(?:\/|$)/,why:"arquivos de sala do Aluy (~/.aluy/rooms)",deny:!0},{re:/~\/\.aluy(?:\/|$)/,why:"estado/credencial do Aluy (~/.aluy)",deny:!0},{re:/(?:^|\/)\.aluy(?:\/(?!agents\/|workflows\/|commands\/)|$)/,why:"estado/credencial do Aluy (.aluy/)",deny:!0},{re:/(?:^|\/|~\/)\.config\/gh\/hosts\.yml$/,why:"token do gh CLI",deny:!0},{re:/(?:^|\/|~\/)\.docker\/config\.json$/,why:"credenciais Docker",deny:!0},{re:/(?:^|\/|~\/)\.kube\/config$/,why:"kubeconfig",deny:!0},{re:/(?:^|\/)id_(?:rsa|ed25519|ecdsa|dsa)\b/,why:"chave privada",deny:!0},{re:/\.pem$|\.p12$|\.pfx$|\.key$/i,why:"material de chave privada",deny:!0},{re:/(?:^|[/\w.-])\.env(?:\.(?!example$|sample$|template$|dist$)[\w.-]+)?$/,why:"arquivo .env (segredos)",deny:!1},{re:/(?:^|\/)[^/]*(?:secret|credential|token|apikey|api_key|password|passwd)[^/]*$/i,why:"arquivo com nome sens\xEDvel (token/secret)",deny:!1}]});var Fv={};Fp(Fv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Pv});import{homedir as c3}from"node:os";import{join as Lv}from"node:path";import{readdirSync as u3,readFileSync as d3,mkdirSync as m3,statSync as f3}from"node:fs";var p3,Pv,h3,g3,Hr,Hm=S(()=>{"use strict";B();p3=448,Pv="workflows",h3=64*1024,g3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Lv(c3(),".aluy");this.dir=Lv(o,Pv)}get workflowsDir(){return this.dir}ensureDir(){try{m3(this.dir,{mode:p3,recursive:!0})}catch{}}load(){let e;try{e=u3(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>=g3)break;let a=this.readOne(i);if(a!==null){if(Ul(a)){s.push(a);continue}n.has(a.name)||(n.add(a.name),r.push(a))}}return{workflows:r,errors:s}}readOne(e){let o=Lv(this.dir,e);try{let n=f3(o);if(!n.isFile()||n.size>h3)return null;let r=d3(o,"utf8");return jl(e,r,"global")}catch{return null}}}});var Nv={};Fp(Nv,{PROJECT_WORKFLOWS_DIRNAMES:()=>Iv,ProjectWorkflowsLoader:()=>qr});import{join as y3}from"node:path";import{readdirSync as b3,readFileSync as v3,statSync as k3}from"node:fs";var Iv,x3,E3,qr,qm=S(()=>{"use strict";B();$r();Iv=[".claude/workflows",".aluy/workflows"],x3=64*1024,E3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Iv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=b3(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>=E3)break;let c=this.readOne(r,s,l);if(c!==null){if(Ul(c)){n.push(c);continue}e.has(c.name)||(e.add(c.name),o.push(c))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(fo(r).kind!=="allow")return null;let s=y3(o,n);try{this.workspace.resolveInside(r);let i=k3(s);if(!i.isFile()||i.size>x3)return null;let a=v3(s,"utf8");return jl(n,a,"project")}catch{return null}}}});var DM=qI((Kge,CM)=>{CM.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Gn="1.0.0-rc.73";B();var q0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
140
|
+
`)}function n2(t,e){return t.length<=e?t:t.slice(0,e-1).trimEnd()+"\u2026"}var F0=S(()=>{"use strict"});var I0=S(()=>{"use strict";km();g0();y0();b0();v0();x0();A0();Yu();O0();F0()});function jb(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(t.trim());if(!e)return null;let o=e[4]?e[4].split(".").map(n=>/^\d+$/.test(n)?Number(n):n):[];return{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),pre:o}}function N0(t,e){let o=jb(t),n=jb(e);if(!o||!n)return null;for(let s of["major","minor","patch"])if(o[s]!==n[s])return o[s]<n[s]?-1:1;if(o.pre.length===0&&n.pre.length===0)return 0;if(o.pre.length===0)return 1;if(n.pre.length===0)return-1;let r=Math.max(o.pre.length,n.pre.length);for(let s=0;s<r;s++){let i=o.pre[s],a=n.pre[s];if(i===void 0)return-1;if(a===void 0)return 1;if(i===a)continue;let 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 Hb(t,e){return N0(t,e)===1}var $0=S(()=>{"use strict"});function Em(t,e,o){if(e.size===0)return{kind:"discard",reason:"allowlist vazia (default fechado)"};if(!e.has(t.conversation))return{kind:"discard",reason:`canal ${t.conversation} n\xE3o-allowlistado`};if(t.senderIsBot===!0)return{kind:"discard",reason:"remetente \xE9 bot (anti-loop, TC-6)"};let n=t.content.trim();if(n==="")return{kind:"discard",reason:"mensagem sem conte\xFAdo"};if(o.authIsForgeable)return{kind:"data",text:n};if(t.provenance.kind==="third-party-relayed")return{kind:"data",text:n};let r=t.provenance.embeddedThirdParty?.trim();return r?{kind:"instruction",text:n,forwardedData:r}:{kind:"instruction",text:n}}var qb=S(()=>{"use strict"});function Wb(t){let e;if(t.forwarded===!0)e={kind:"third-party-relayed"};else{let o=(t.quotedText??"").trim();e=o?{kind:"author-direct",embeddedThirdParty:o}:{kind:"author-direct"}}return{content:t.text,sender:String(t.fromId),conversation:String(t.chatId),provenance:e,...t.isBot===!0?{senderIsBot:!0}:{}}}function Gb(t){let e=new Set;for(let o of t)typeof o=="number"&&Number.isFinite(o)&&Number.isInteger(o)&&e.add(o);return e}var lc,B0=S(()=>{"use strict";qb();lc={id:"telegram",displayName:"Telegram",authIsForgeable:!1}});function zb(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Gi(t){return typeof t=="object"&&t!==null?t:void 0}function Kb(t,e){let o=Gi(t);if(!o||o.ok!==!0||!Array.isArray(o.result))return{updates:[],nextOffset:e};let n=[],r=e-1;for(let s of o.result){let i=Gi(s);if(!i)continue;let a=zb(i.update_id);a!==void 0&&a>r&&(r=a);let l=Gi(i.message);if(!l)continue;let c=Gi(l.chat),u=zb(c?.id);if(u===void 0||c?.type!=="private")continue;let f=Gi(l.from),d=zb(f?.id)??u,p=f?.is_bot===!0,h=typeof l.text=="string"?l.text:"",y=l.forward_origin!==void 0||l.forward_from!==void 0||l.forward_from_chat!==void 0||l.forward_sender_name!==void 0||l.forward_date!==void 0,g=(()=>{let E=Gi(l.quote)?.text;return typeof E=="string"&&E.trim()!==""?E:void 0})();n.push({chatId:u,fromId:d,text:h,...y?{forwarded:!0}:{},...g!==void 0?{quotedText:g}:{},...p?{isBot:!0}:{}})}return{updates:n,nextOffset:r+1}}var U0=S(()=>{"use strict"});var cc,j0=S(()=>{"use strict";cc=class{maxPerWindow;windowMs;stamps=[];constructor(e,o){this.maxPerWindow=e,this.windowMs=o}tryConsume(e){let o=e-this.windowMs;for(;this.stamps.length>0&&this.stamps[0]<=o;)this.stamps.shift();return this.stamps.length>=this.maxPerWindow?!1:(this.stamps.push(e),!0)}get used(){return this.stamps.length}}});function Yb(t){return`connector-${t}-token`}function uc(t){let e=t.trim(),o=e.indexOf(":");return o<=0?`\u2026(${e.length} chars)`:`${e.slice(0,o)}:\u2026(${e.length-o-1} chars)`}function Vb(t,e){let o=e.trim();return o.length<8?t:t.split(o).join("\xABREDACTED\xBB")}var H0=S(()=>{"use strict"});var B=S(()=>{"use strict";$E();aS();vS();$w();s0();Wy();f0();I0();xb();Jd();$0();qb();B0();U0();j0();H0()});import{posix as E8}from"node:path";function S8(t){return E8.normalize(t)}function fo(t){let e=S8(t);for(let o of w8)if(o.re.test(e))return o.deny?{kind:"deny",why:o.why}:{kind:"ask",why:o.why};return{kind:"allow"}}function fv(t){return fo(t).kind==="allow"}var w8,$r=S(()=>{"use strict";w8=[{re:/(?:^|\/|~\/)\.ssh(?:\/|$)/,why:"chaves SSH (~/.ssh)",deny:!0},{re:/(?:^|\/|~\/)\.aws(?:\/|$)/,why:"credenciais AWS (~/.aws)",deny:!0},{re:/(?:^|\/|~\/)\.gnupg(?:\/|$)/,why:"chaves GPG (~/.gnupg)",deny:!0},{re:/(?:~\/|\$\{?HOME\}?\/|\/(?:home|Users)\/[^/]+\/)\.aluy\/rooms(?:\/|$)/,why:"arquivos de sala do Aluy (~/.aluy/rooms)",deny:!0},{re:/~\/\.aluy(?:\/|$)/,why:"estado/credencial do Aluy (~/.aluy)",deny:!0},{re:/(?:^|\/)\.aluy(?:\/(?!agents\/|workflows\/|commands\/)|$)/,why:"estado/credencial do Aluy (.aluy/)",deny:!0},{re:/(?:^|\/|~\/)\.config\/gh\/hosts\.yml$/,why:"token do gh CLI",deny:!0},{re:/(?:^|\/|~\/)\.docker\/config\.json$/,why:"credenciais Docker",deny:!0},{re:/(?:^|\/|~\/)\.kube\/config$/,why:"kubeconfig",deny:!0},{re:/(?:^|\/)id_(?:rsa|ed25519|ecdsa|dsa)\b/,why:"chave privada",deny:!0},{re:/\.pem$|\.p12$|\.pfx$|\.key$/i,why:"material de chave privada",deny:!0},{re:/(?:^|[/\w.-])\.env(?:\.(?!example$|sample$|template$|dist$)[\w.-]+)?$/,why:"arquivo .env (segredos)",deny:!1},{re:/(?:^|\/)[^/]*(?:secret|credential|token|apikey|api_key|password|passwd)[^/]*$/i,why:"arquivo com nome sens\xEDvel (token/secret)",deny:!1}]});var Fv={};Fp(Fv,{UserWorkflowsLoader:()=>Hr,WORKFLOWS_DIRNAME:()=>Pv});import{homedir as c3}from"node:os";import{join as Lv}from"node:path";import{readdirSync as u3,readFileSync as d3,mkdirSync as m3,statSync as f3}from"node:fs";var p3,Pv,h3,g3,Hr,Hm=S(()=>{"use strict";B();p3=448,Pv="workflows",h3=64*1024,g3=256,Hr=class{dir;constructor(e={}){let o=e.baseDir??Lv(c3(),".aluy");this.dir=Lv(o,Pv)}get workflowsDir(){return this.dir}ensureDir(){try{m3(this.dir,{mode:p3,recursive:!0})}catch{}}load(){let e;try{e=u3(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>=g3)break;let a=this.readOne(i);if(a!==null){if(Ul(a)){s.push(a);continue}n.has(a.name)||(n.add(a.name),r.push(a))}}return{workflows:r,errors:s}}readOne(e){let o=Lv(this.dir,e);try{let n=f3(o);if(!n.isFile()||n.size>h3)return null;let r=d3(o,"utf8");return jl(e,r,"global")}catch{return null}}}});var Nv={};Fp(Nv,{PROJECT_WORKFLOWS_DIRNAMES:()=>Iv,ProjectWorkflowsLoader:()=>qr});import{join as y3}from"node:path";import{readdirSync as b3,readFileSync as v3,statSync as k3}from"node:fs";var Iv,x3,E3,qr,qm=S(()=>{"use strict";B();$r();Iv=[".claude/workflows",".aluy/workflows"],x3=64*1024,E3=256,qr=class{workspace;constructor(e){this.workspace=e.workspace}load(){let e=new Set,o=[],n=[];for(let r of Iv){let s;try{s=this.workspace.resolveInside(r)}catch{continue}let i;try{i=b3(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>=E3)break;let c=this.readOne(r,s,l);if(c!==null){if(Ul(c)){n.push(c);continue}e.has(c.name)||(e.add(c.name),o.push(c))}}}return{workflows:o,errors:n}}readOne(e,o,n){let r=`${e}/${n}`;if(fo(r).kind!=="allow")return null;let s=y3(o,n);try{this.workspace.resolveInside(r);let i=k3(s);if(!i.isFile()||i.size>x3)return null;let a=v3(s,"utf8");return jl(n,a,"project")}catch{return null}}}});var DM=qI((Kge,CM)=>{CM.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Gn="1.0.0-rc.74";B();var q0=`aluy \u2014 agente de terminal que roda na sua m\xE1quina, com o seu provider de LLM
|
|
141
141
|
|
|
142
142
|
Uso:
|
|
143
143
|
aluy ["objetivo"] [--plan | --yolo] [--dense] [--tier <tier>] [--lang <pt-BR|en>]
|
|
@@ -531,7 +531,7 @@ Responda APENAS com JSON no formato:
|
|
|
531
531
|
`)}import{Fragment as w9,jsx as Uo,jsxs as Jr}from"react/jsx-runtime";function S9(t){let e=t.sel?"accent":t.sub?"fgDim":"fg",o=t.query.trim().replace(/\s+/g," ").toLowerCase(),n=o?t.path.toLowerCase().indexOf(o):-1;if(n<0||o==="")return Jr(m,{name:e,children:["/",t.path]});let r=t.path.slice(0,n),s=t.path.slice(n,n+o.length),i=t.path.slice(n+o.length);return Jr(w9,{children:[Jr(m,{name:e,children:["/",r]}),Uo(m,{name:"accent",children:s}),Uo(m,{name:e,children:i})]})}function Rf(t){let e=t.query??"",o=t.maxRows!==void 0?WO(t.commands,t.selected,t.maxRows,t.columns):{slice:t.commands,hiddenAbove:0,hiddenBelow:0},n=t.selected-o.hiddenAbove,r=null;return Jr(ya,{flexDirection:"column",children:[Uo(ya,{children:Uo(m,{name:"fgDim",children:"/ para comandos \xB7 \u2191\u2193 navega \xB7 enter executa \xB7 esc fecha"})}),o.hiddenAbove>0&&Uo(ya,{children:Jr(m,{name:"fgDim",children:[" \u2191 ",o.hiddenAbove," acima"]})}),o.slice.map((s,i)=>{let a=i===n,l=ox(s),c=l!==r?l:null;r=l;let u=Tf(s),f=s.kind==="subcommand",d=a?"\u203A ":f?" ":" ";return Jr(x9.Fragment,{children:[c&&Uo(ya,{children:Uo(m,{name:"fgDim",children:c==="usu\xE1rio"?"\u2500\u2500\u2500 seus comandos":c})}),Jr(ya,{children:[Uo(m,{name:a?"accent":"fgDim",children:d}),Uo(S9,{path:u,query:e,sel:a,sub:f}),Uo(E9,{children:" ".repeat(Math.max(1,18-u.length))}),Uo(m,{name:"fgDim",children:nx(s)})]})]},`${l}:${u}`)}),o.hiddenBelow>0&&Uo(ya,{children:Jr(m,{name:"fgDim",children:[" \u2193 ",o.hiddenBelow," mais (refine a busca)"]})})]})}import"react";import{Box as ba,Text as A9}from"ink";import{Fragment as T9,jsx as po,jsxs as cu}from"react/jsx-runtime";function C9(t){let e=t.sel?"accent":"fg",o=new Set(t.matched);if(o.size===0)return po(m,{name:e,children:t.label});let n=[],r=0;for(;r<t.label.length;){let s=o.has(r),i=r;for(;i<t.label.length&&o.has(i)===s;)i++;n.push(po(m,{name:s?"accent":e,children:t.label.slice(r,i)},r)),r=i}return po(T9,{children:n})}function D9(t,e,o){if(t.length<=o)return{start:0,slice:t};let n=e-Math.floor(o/2);return n<0&&(n=0),n+o>t.length&&(n=t.length-o),{start:n,slice:t.slice(n,n+o)}}function Of(t){let{t:e}=he(),o=t.maxRows??8,n=t.query??"",{start:r,slice:s}=D9(t.hits,t.selected,o),i=s.reduce((a,l)=>Math.max(a,l.label.length),0);return cu(ba,{flexDirection:"column",children:[po(ba,{children:po(m,{name:"fgDim",children:e("picker.palette.help")})}),cu(ba,{children:[po(m,{name:"accent",children:"> "}),n===""?po(m,{name:"fgDim",children:e("picker.palette.search")}):po(m,{name:"fg",children:n})]}),t.hits.length===0?po(ba,{children:cu(m,{name:"fgDim",children:[" ",e("picker.palette.empty",{query:n})]})}):s.map((a,l)=>{let u=r+l===t.selected;return cu(ba,{children:[po(m,{name:u?"accent":"fgDim",children:u?"\u203A ":" "}),po(C9,{label:a.label,matched:a.matched,sel:u}),po(A9,{children:" ".repeat(Math.max(1,i-a.label.length+2))}),po(m,{name:"fgDim",children:a.description})]},a.id)}),t.hits.length>s.length&&po(ba,{children:cu(m,{name:"fgDim",children:[" ",e("picker.palette.more",{count:t.hits.length-s.length})]})})]})}import"react";import{Box as uu}from"ink";import{Fragment as O9,jsx as _n,jsxs as Mf}from"react/jsx-runtime";function XO(t,e){if(e<=0||t.length<=e)return t;if(e<=1)return t.slice(0,e);let o="\u2026",n=e-o.length,r=Math.ceil(n/2),s=Math.floor(n/2);return t.slice(0,r)+o+t.slice(t.length-s)}function _9(t){let e=t.sel?"accent":"fg",o=new Set(t.matched);if(o.size===0)return _n(m,{name:e,children:t.path});let n=[],r=0;for(;r<t.path.length;){let s=o.has(r),i=r;for(;i<t.path.length&&o.has(i)===s;)i++;let a=t.path.slice(r,i);n.push(_n(m,{name:s?"accent":e,children:a},r)),r=i}return _n(O9,{children:n})}function R9(t,e,o){if(t.length<=o)return{start:0,slice:t};let n=e-Math.floor(o/2);return n<0&&(n=0),n+o>t.length&&(n=t.length-o),{start:n,slice:t.slice(n,n+o)}}function ix(t){let{t:e}=he(),o=t.columns??80,n=t.maxRows??8,r=Math.max(8,o-4),{start:s,slice:i}=R9(t.hits,t.selected,n);return Mf(uu,{flexDirection:"column",children:[_n(uu,{children:_n(m,{name:"fgDim",children:e("picker.file.help")})}),t.hits.length===0?_n(uu,{children:Mf(m,{name:"fgDim",children:[" ",e("picker.file.empty",{query:t.query??""})]})}):i.map((a,l)=>{let u=s+l===t.selected,f=XO(a.path,r),d=f===a.path;return Mf(uu,{children:[_n(m,{name:u?"accent":"fgDim",children:u?"\u203A ":" "}),d?_n(_9,{path:a.path,matched:a.matched,sel:u}):_n(m,{name:u?"accent":"fg",children:f})]},a.path)}),t.hits.length>i.length&&_n(uu,{children:Mf(m,{name:"fgDim",children:[" ",e("picker.file.more",{count:t.hits.length-i.length})]})})]})}import"react";import{Box as Oe,Text as M9}from"ink";import{Fragment as ax,jsx as ee,jsxs as Ie}from"react/jsx-runtime";var L9={keep:"picker.effort.keep",low:"picker.effort.low",medium:"picker.effort.medium",high:"picker.effort.high",custom:"picker.effort.custom"};function Lf(t){let{t:e}=he();if(t.effortStepOpen)return ee($9,{...t});if(t.customInputOpen)return ee(P9,{...t});let o=t.tiers.length;return Ie(Oe,{flexDirection:"column",children:[ee(Oe,{children:ee(m,{name:"fgDim",children:e("picker.model.help")})}),t.loading?ee(Oe,{children:Ie(m,{name:"fgDim",children:[" ",e("picker.model.loading")]})}):Ie(ax,{children:[t.tiers.map((n,r)=>{let s=r===t.selected,i=n.key===t.currentTier,a=Xv(n),l=Vv(n.costSignal);return Ie(Oe,{children:[ee(m,{name:s?"accent":"fgDim",children:s?"\u203A ":" "}),ee(m,{name:i?"accent":"fgDim",children:i?"\u25CF ":" "}),ee(m,{name:s?"accent":"fg",children:n.displayName}),a!==""&&Ie(ax,{children:[ee(m,{name:"fgDim",children:" \xB7 "}),ee(m,{name:"depth",children:a})]}),Ie(m,{name:"fgDim",children:[" \xB7 ",l]})]},n.key)}),Ie(Oe,{children:[ee(m,{name:t.selected===o?"accent":"fgDim",children:t.selected===o?"\u203A ":" "}),ee(m,{name:t.currentTier==="custom"?"accent":"fgDim",children:t.currentTier==="custom"?"\u25CF ":" "}),ee(m,{name:t.selected===o?"accent":"fg",children:"Custom"}),Ie(m,{name:"fgDim",children:[" \xB7 ",e("picker.model.customLine")]})]},"__custom__")]}),t.usingFallback===!0&&!t.loading&&ee(Oe,{children:Ie(m,{name:"fgDim",children:[" ","\u25CD ",e("picker.model.fallback")]})})]})}function P9(t){return t.customBrowserAvailable===!0?ee(N9,{...t}):ee(U9,{...t})}function F9(t){return t.supportsTools===!0?ee(m,{name:"accent",children:"\u2713 tools"}):t.supportsTools===!1?ee(m,{name:"fgDim",children:"\u2014 tools"}):ee(m,{name:"fgDim",children:"\xB7 tools?"})}function I9(t){let{model:e,highlighted:o}=t.row,n=[e.family,e.context].map(r=>r.trim()).filter(r=>r!=="");return Ie(Oe,{children:[ee(m,{name:o?"accent":"fgDim",children:o?"\u203A ":" "}),ee(m,{name:o?"accent":"fg",children:e.id}),n.length>0&&Ie(ax,{children:[ee(m,{name:"fgDim",children:" "}),ee(m,{name:"depth",children:n.join(" \xB7 ")})]}),ee(M9,{children:" "}),ee(F9,{supportsTools:e.supportsTools})]})}function N9(t){let{t:e}=he(),o=t.customInput??"",n=t.customRows??[],r=t.customFilteredCount??0,s=t.customTotalCount??0,i=t.customToolsOnly===!0,a=t.customNoToolsWarning??null;return Ie(Oe,{flexDirection:"column",children:[ee(Oe,{children:ee(m,{name:"fgDim",children:e("picker.model.browseHelp")})}),Ie(Oe,{children:[ee(m,{name:"accent",children:"filtro \u203A "}),ee(m,{name:"fg",children:o}),ee(m,{name:"accent",children:"\u258F"}),Ie(m,{name:"fgDim",children:[" ",e("picker.model.browseCount",{filtered:r,total:s}),i?e("picker.model.toolsOnlySuffix"):""]})]}),t.customHasMoreAbove===!0&&ee(Oe,{children:Ie(m,{name:"fgDim",children:[" ",e("picker.model.moreAbove")]})}),n.length===0?ee(Oe,{children:Ie(m,{name:"fgDim",children:[" ",e("picker.model.noFilterMatch")]})}):ee(Oe,{flexDirection:"column",children:n.map(l=>ee(I9,{row:l},l.model.id))}),t.customHasMoreBelow===!0&&ee(Oe,{children:Ie(m,{name:"fgDim",children:[" ",e("picker.model.moreBelow")]})}),a!==null&&ee(Oe,{children:Ie(m,{name:"accent",children:[" ",e("picker.model.noTools")]})})]})}function $9(t){let{t:e}=he();if(t.effortCustomOpen===!0)return ee(B9,{...t});let o=t.effortOptions??[],n=t.effortSelected??0,r=t.currentEffort;return Ie(Oe,{flexDirection:"column",children:[ee(Oe,{children:ee(m,{name:"fgDim",children:e("picker.effort.help")})}),o.map((s,i)=>{let a=i===n,l=s.kind==="level"&&s.value===r||s.kind==="keep"&&(r===void 0||r==="");return Ie(Oe,{children:[ee(m,{name:a?"accent":"fgDim",children:a?"\u203A ":" "}),ee(m,{name:l?"accent":"fgDim",children:l?"\u25CF ":" "}),ee(m,{name:a?"accent":"fg",children:e(L9[s.id]??"picker.effort.keep")})]},s.id)})]})}function B9(t){let{t:e}=he(),o=t.effortCustomInput??"",n=t.effortCustomWarn??null;return Ie(Oe,{flexDirection:"column",children:[ee(Oe,{children:ee(m,{name:"fgDim",children:e("picker.effort.customHelp")})}),Ie(Oe,{children:[ee(m,{name:"accent",children:"\u203A "}),ee(m,{name:"fg",children:o}),ee(m,{name:"accent",children:"\u258F"})]}),n!==null&&ee(Oe,{children:Ie(m,{name:"accent",children:[" ",e(n==="empty"?"picker.effort.warnEmpty":"picker.effort.warnTooLong")]})})]})}function U9(t){let{t:e}=he(),o=t.customInput??"",n=t.customSuggestions??[],r=t.customWarnOutOfCatalog===!0;return Ie(Oe,{flexDirection:"column",children:[ee(Oe,{children:ee(m,{name:"fgDim",children:e("picker.model.freeHelp")})}),Ie(Oe,{children:[ee(m,{name:"accent",children:"\u203A "}),ee(m,{name:"fg",children:o}),ee(m,{name:"accent",children:"\u258F"})]}),n.length>0&&ee(Oe,{flexDirection:"column",children:n.map(s=>Ie(Oe,{children:[ee(m,{name:"fgDim",children:" \u25CD "}),ee(m,{name:"depth",children:s})]},s))}),r&&ee(Oe,{children:Ie(m,{name:"accent",children:[" ",e("picker.model.outOfCatalog")]})})]})}import"react";import{Box as mu,Text as eM}from"ink";var lx=15;function cx(t,e=lx){let o;try{o=t.list()}catch{return[]}return o.slice(0,Math.max(0,e))}function JO(t){let e=new Date(t),o=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function j9(t){for(let e of t)if(e.kind==="you"){let o=e.text.replace(/\s+/g," ").trim();return o===""?void 0:o.length>60?o.slice(0,57)+"\u2026":o}}function du(t,e){let o=Uc(t.cwd,e??process.env.HOME??""),n=t.label?.trim();if(n)return`${n} \xB7 ${JO(t.updatedAt)} \xB7 ${o}`;let r=t.title??(t.blocks?j9(t.blocks):void 0)??"(sem objetivo)";return`${JO(t.updatedAt)} \xB7 ${o} \xB7 ${r}`}function H9(t,e){if(t.length===0)return["nenhuma sess\xE3o anterior."];let o=["sess\xF5es anteriores (retome com: /history <id>):",""];for(let n of t){o.push(` ${n.id}`);let r=n.label?.trim()?"\u25CF ":"";o.push(` ${r}${du(n,e)}`)}return o}function QO(t,e){e.switchSession({id:t.id,cwd:t.cwd,tier:t.tier}),e.resetContinuation?.(),e.clearScreen(),e.restoreBlocks(t.blocks);let o=Is(t.blocks);o.length>0&&e.seedHistory(o),t.cwd.trim()!==""&&e.setSessionCwd?.(t.cwd)}function ZO(t,e,o){let n=(t??"").trim();if(n!=="/history"&&!n.startsWith("/history "))return!1;let r=n==="/history"?"":n.slice(9).trim();if(r===""){let i=cx(o.store,o.limit);for(let a of H9(i,o.home))e.write(`[history] ${a}
|
|
532
532
|
`);return!0}let s=o.store.load(r);return s?(o.resume(s),e.write(`[history] sess\xE3o retomada: ${r} (${du(s,o.home)})
|
|
533
533
|
`),!0):(e.write(`[history] sess\xE3o n\xE3o encontrada: ${r}
|
|
534
|
-
`),!0)}function Rn(t,e,o,n){if(n===void 0){if(t.length<=o)return{start:0,slice:t};let p=e-Math.floor(o/2);return p<0&&(p=0),p+o>t.length&&(p=t.length-o),{start:p,slice:t.slice(p,p+o)}}let r=t.length;if(r===0)return{start:0,slice:t};let s=p=>Math.max(1,Math.floor(n(t[p]))),i=0;for(let p=0;p<r;p+=1)i+=s(p);if(i<=o)return{start:0,slice:t};let a=Math.max(0,Math.min(e,r-1)),l=a,c=a+1,u=s(a),f=!0,d=!0;for(;d;){d=!1;let p=()=>l>0&&u+s(l-1)<=o?(l-=1,u+=s(l),!0):!1,h=()=>c<r&&u+s(c)<=o?(u+=s(c),c+=1,!0):!1;d=f?p()||h():h()||p(),f=!f}return{start:l,slice:t.slice(l,c)}}import{Fragment as q9,jsx as Qr,jsxs as fu}from"react/jsx-runtime";function Pf(t){let e=V(),{t:o}=he(),n=e.glyph("sessionDot"),r=Math.max(1,t.maxRows??10),s=t.columns,i=s!==void 0&&s>0?c=>{let u=2+(c.label?.trim()?2:0)+fe(du(c,t.home));return Math.max(1,Math.ceil(u/s))}:void 0,{start:a,slice:l}=Rn(t.sessions,t.selected,r,i);return fu(mu,{flexDirection:"column",children:[Qr(mu,{children:Qr(m,{name:"fgDim",children:o("picker.history.help")})}),t.sessions.length===0?Qr(mu,{children:fu(m,{name:"fgDim",children:[" ",o("picker.history.empty")]})}):l.map((c,u)=>{let d=a+u===t.selected,p=c.label?.trim(),h=p?e.sessionColor(c.labelColor??p):void 0,y={};return h?.color!==void 0&&(y.color=h.color),h?.bold!==void 0&&(y.bold=h.bold),fu(mu,{children:[Qr(m,{name:d?"accent":"fgDim",children:d?"\u203A ":" "}),p&&fu(q9,{children:[Qr(eM,{...y,children:n}),Qr(eM,{children:" "})]}),Qr(m,{name:d?"accent":"fg",children:du(c,t.home)})]},c.id)}),t.sessions.length>l.length&&Qr(mu,{children:fu(m,{name:"fgDim",children:[" ",o("picker.history.more",{count:t.sessions.length-l.length})]})})]})}import"react";import{Box as jo}from"ink";var Ff=["both","conversation","code"];function tM(t,e=30){return[...t].reverse().slice(0,e)}function ux(t){let e=W9(t.ts);return`#${t.ordinal} \xB7 ${e} \xB7 ${t.label}`}function W9(t){let e=new Date(t),o=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${o}:${n}`}import{jsx as Bt,jsxs as Zs}from"react/jsx-runtime";function G9(t){switch(t){case"both":return"picker.rewind.action.both";case"conversation":return"picker.rewind.action.conversation";case"code":return"picker.rewind.action.code"}}function If(t){let{t:e}=he();if(t.phase==="list"){let o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>Math.max(1,Math.ceil((2+fe(ux(a)))/n)):void 0,{start:s,slice:i}=Rn(t.checkpoints,t.selected,o,r);return Zs(jo,{flexDirection:"column",children:[Bt(jo,{children:Bt(m,{name:"fgDim",children:e("picker.rewind.help")})}),t.checkpoints.length===0?Bt(jo,{children:Zs(m,{name:"fgDim",children:[" ",e("picker.rewind.empty")]})}):i.map((a,l)=>{let c=s+l===t.selected;return Zs(jo,{children:[Bt(m,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),Bt(m,{name:c?"accent":"fg",children:ux(a)})]},a.id)}),t.checkpoints.length>i.length&&Bt(jo,{children:Zs(m,{name:"fgDim",children:[" ",e("picker.rewind.more",{count:t.checkpoints.length-i.length})]})})]})}return Zs(jo,{flexDirection:"column",children:[Bt(jo,{children:Bt(m,{name:"fgDim",children:e("picker.rewind.action.help")})}),t.target&&Bt(jo,{children:Bt(m,{name:"fgDim",children:` \u2192 #${t.target.ordinal} \xB7 ${t.target.label}`})}),t.actions.map((o,n)=>{let r=n===t.selected;return Zs(jo,{children:[Bt(m,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),Bt(m,{name:r?"accent":"fg",children:e(G9(o))})]},o)}),t.barrierWarnings&&t.barrierWarnings.length>0&&Zs(jo,{flexDirection:"column",marginTop:1,children:[Bt(jo,{children:Bt(m,{name:"accent",children:`\u26A0 ${e("picker.rewind.barrier.warn")}:`})}),t.barrierWarnings.map((o,n)=>Bt(jo,{children:Bt(m,{name:"fgDim",children:` \xB7 ${o}`})},n))]})]})}import z9 from"react";import{Box as oo,Text as K9}from"ink";import{Fragment as J9,jsx as Me,jsxs as Co}from"react/jsx-runtime";var dx={plan:"PLAN (read-only)",normal:"NORMAL (catraca padrao)",unsafe:"YOLO (aprovacao DESLIGADA)"};function Y9(t){switch(t){case"mode":return"modo de sessao \xB7 enter cicla plan \u2192 normal \u2192 yolo";case"safe-tool":return"tools seguras (leitura) \xB7 enter alterna allow \u21C4 ask";case"grant":return"liberados nesta sessao \xB7 enter REVOGA";case"locked":return"TRAVADO por seguranca \xB7 so via --yolo"}}function V9(t){let{row:e,sel:o}=t,n=Me(m,{name:o?"accent":"fgDim",children:o?"\u203A ":" "});switch(e.kind){case"mode":return Co(oo,{children:[n,Me(m,{name:o?"accent":"fg",children:"modo: "}),Me(m,{name:e.mode==="unsafe"?"danger":o?"accent":"fg",children:dx[e.mode]})]});case"safe-tool":return Co(oo,{children:[n,Me(m,{name:o?"accent":"fg",children:e.tool}),Me(m,{name:"fgDim",children:" = "}),Me(m,{name:e.decision==="allow"?"success":"fgDim",children:e.decision})]});case"grant":return Co(oo,{children:[n,Me(m,{name:"success",children:"\u25CF "}),Me(m,{name:o?"accent":"fg",children:e.grantKey}),Me(m,{name:"fgDim",children:" (enter revoga)"})]});case"locked":{let r=e.category.lock==="deny";return Co(oo,{flexDirection:"column",children:[Co(oo,{children:[n,Me(L,{name:"ask",role:"danger"}),Me(m,{name:"danger",children:" [travado] "}),Me(m,{name:o?"accent":"fg",children:e.category.label}),Co(m,{name:"danger",children:[" \xB7 ",r?"deny (nem --yolo)":"sempre pergunta"]})]}),o&&Me(oo,{paddingLeft:4,children:Me(m,{name:"fgDim",children:e.category.why})})]})}}}function mx(t){let e=Math.max(1,t.maxRows??14),o=t.columns,n=l=>{switch(l.kind){case"mode":return 8+fe(dx[l.mode]);case"safe-tool":return 5+fe(l.tool)+fe(l.decision);case"grant":return 19+fe(l.grantKey);case"locked":return 28+fe(l.category.label)}},r=o!==void 0&&o>0?l=>Math.max(1,Math.ceil(n(l)/o)):void 0,{start:s,slice:i}=Rn(t.rows,t.selected,e,r),a=null;return Co(oo,{flexDirection:"column",children:[Me(oo,{children:Me(m,{name:"fgDim",children:"permissoes \xB7 \u2191\u2193 navega \xB7 enter muda \xB7 esc fecha"})}),Co(oo,{children:[Me(m,{name:"fgDim",children:"modo atual: "}),Me(m,{name:t.mode==="unsafe"?"danger":"fg",children:dx[t.mode]})]}),t.rows.length===0?Me(oo,{children:Me(m,{name:"fgDim",children:" nada a mostrar"})}):Co(J9,{children:[s>0&&Me(oo,{children:Co(m,{name:"fgDim",children:[" \u2191 ",s," acima"]})}),i.map((l,c)=>{let u=s+c,f=l.kind!==a?Y9(l.kind):null;return a=l.kind,Co(z9.Fragment,{children:[f&&Me(oo,{paddingTop:1,children:Co(m,{name:"fgDim",children:["\u2500\u2500\u2500 ",f]})}),Me(V9,{row:l,sel:u===t.selected})]},X9(l,u))}),s+i.length<t.rows.length&&Me(oo,{children:Co(m,{name:"fgDim",children:[" \u2193 ",t.rows.length-(s+i.length)," abaixo"]})})]}),Me(oo,{paddingTop:1,children:Me(K9,{children:" "})}),Me(oo,{children:Me(m,{name:"fgDim",children:"o painel nao relaxa as categorias travadas \u2014 o unico bypass total e --yolo"})})]})}function X9(t,e){switch(t.kind){case"mode":return"mode";case"safe-tool":return`safe:${t.tool}`;case"grant":return`grant:${t.grantKey}`;case"locked":return`locked:${t.category.category}`;default:return`row:${e}`}}import"react";import{Box as fx}from"ink";import{jsx as pu,jsxs as px}from"react/jsx-runtime";function Nf(t){let{t:e}=he();return px(fx,{flexDirection:"column",children:[pu(fx,{children:pu(m,{name:"fgDim",children:e("picker.theme.help")})}),t.themes.map((o,n)=>{let r=n===t.selected,s=o.name===t.currentTheme;return px(fx,{children:[pu(m,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),pu(m,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),pu(m,{name:r?"accent":"fg",children:o.label}),px(m,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.name)})]})}import"react";import{Box as hx}from"ink";import{jsx as hu,jsxs as gx}from"react/jsx-runtime";function $f(t){let{t:e}=he();return gx(hx,{flexDirection:"column",children:[hu(hx,{children:hu(m,{name:"fgDim",children:e("picker.lang.help")})}),t.langs.map((o,n)=>{let r=n===t.selected,s=o.code===t.currentLang;return gx(hx,{children:[hu(m,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),hu(m,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),hu(m,{name:r?"accent":"fg",children:o.label}),gx(m,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.code)})]})}import"react";import{Box as gu}from"ink";import{jsx as Zr,jsxs as yu}from"react/jsx-runtime";function yx(t){let{t:e}=he(),o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>{let l=4+fe(`${a.label} \xB7 ${a.summary}`)+(a.isDefault?2+fe(e("picker.provider.default")):0);return Math.max(1,Math.ceil(l/n))}:void 0,{start:s,slice:i}=Rn(t.providers,t.selected,o,r);return yu(gu,{flexDirection:"column",children:[Zr(gu,{children:Zr(m,{name:"fgDim",children:e("picker.provider.help")})}),t.usingFallback===!0?Zr(gu,{children:Zr(m,{name:"fgDim",children:e("picker.provider.fallback")})}):null,i.map((a,l)=>{let c=s+l===t.selected,u=a.name===t.currentProvider;return yu(gu,{children:[Zr(m,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),Zr(m,{name:u?"accent":"fgDim",children:u?"\u25CF ":" "}),Zr(m,{name:c?"accent":"fg",children:a.label}),yu(m,{name:"fgDim",children:[" \xB7 ",a.summary]}),a.isDefault?yu(m,{name:"fgDim",children:[" \xB7 ",e("picker.provider.default")]}):null]},a.name)}),t.providers.length>i.length&&Zr(gu,{children:yu(m,{name:"fgDim",children:[" ",e("picker.provider.more",{count:t.providers.length-i.length})]})})]})}import"react";import{Box as oM,Text as Q9}from"ink";import{jsx as bx,jsxs as nM}from"react/jsx-runtime";function vx(t){if(t.chips.length===0)return null;let e=t.active??-1;return bx(oM,{flexWrap:"wrap",children:t.chips.map((o,n)=>{let r=n===e;return nM(oM,{marginRight:1,children:[nM(m,{name:r?"accent":"depth",children:[r?"\u203A ":"","@",o.path,o.truncated?"~":""]}),bx(Q9,{children:" "}),bx(m,{name:"fgDim",children:"[\u232B]"})]},o.path)})})}import"react";import{Box as bu,Text as rM}from"ink";import{jsx as rn,jsxs as es}from"react/jsx-runtime";function kx(t){let e=V(),{t:o}=he(),n=t.columns??80,r=t.plan??"assinatura",s=e.glyph("wave").repeat(17);return es(bu,{flexDirection:"column",paddingY:1,children:[rn(qs,{columns:n}),rn(bu,{paddingTop:1,paddingLeft:2,children:rn(m,{name:"fgDim",children:o("boot.tagline")})}),es(bu,{paddingLeft:2,children:[rn(m,{name:"accent",children:s}),t.version!==void 0&&es(m,{name:"fgDim",children:[" v",t.version]})]}),es(bu,{paddingLeft:2,children:[rn(L,{name:"window",role:"fgDim"}),es(m,{name:"fgDim",children:[" ",r," \xB7 "]}),rn(m,{name:"fgDim",children:t.tier}),rn(rM,{children:" "}),rn(m,{name:"fgDim",children:"\xB7 "}),rn(L,{name:"broker",role:"depth"}),es(m,{name:"depth",children:[" ",o("boot.broker")]})]}),t.status!==void 0&&es(bu,{paddingTop:1,paddingLeft:2,children:[rn(Ys,{frame:t.frame??0}),rn(rM,{children:" "}),es(m,{name:"fgDim",children:[t.status,"\u2026"]})]})]})}import"react";import{Box as sM}from"ink";import{jsx as xx,jsxs as Ex}from"react/jsx-runtime";var Z9=['"explique a estrutura deste repo"','"rode os testes e resuma as falhas"',"/help para comandos \xB7 /login conta \xB7 /quit"];function Sx(t){let e=t.suggestions??Z9;return Ex(sM,{flexDirection:"column",children:[xx(m,{name:"fg",children:t.name?`bom te ver de novo, ${t.name}.`:"bom te ver por aqui."}),xx(m,{name:"fgDim",children:"eu leio e edito arquivos e rodo comandos aqui \u2014 sempre te mostrando o efeito exato antes."}),Ex(sM,{paddingTop:1,flexDirection:"column",children:[xx(m,{name:"fgDim",children:"experimente:"}),e.map((o,n)=>Ex(m,{name:"fgDim",children:[" \xB7 ",o]},n))]})]})}import"react";import{jsx as yhe}from"react/jsx-runtime";import"react";import{Box as iM,Text as wx}from"ink";import{jsx as ei,jsxs as Bf}from"react/jsx-runtime";var aM=12;function lM(t,e){return!Number.isFinite(t)||!Number.isFinite(e)||e<=0?0:Math.max(0,Math.min(1,t/e))}function cM(t,e,o,n,r){let s=Math.max(1,Math.trunc(n)),i=Math.max(0,Math.min(1,t)),a=Math.round(i*s);i>0&&a===0&&(a=1),i<1&&a===s&&(a=s-1);let l=e.repeat(a),c=o.repeat(s-a);return r?{filled:l,rest:c}:{filled:`[${l}`,rest:`${c}]`}}function va(t){let e=V(),o=t.role??"accent";if(t.value!==void 0&&t.max!==void 0){let a=lM(t.value,t.max),l=Math.round(a*100),c=e.glyph("barFull"),u=e.glyph("barEmpty"),f=t.width??aM,{filled:d,rest:p}=cM(a,c,u,f,e.unicode);return Bf(iM,{children:[ei(m,{name:o,children:d}),ei(m,{name:"fgDim",children:p}),ei(wx,{children:" "}),Bf(m,{name:o,children:[l,"%"]}),ei(wx,{children:" "}),ei(m,{name:"fgDim",children:t.label})]})}let r=e.spinnerFrames,s=e.animate?r[(t.frame??0)%r.length]:e.glyph("clock"),i=t.elapsedMs!==void 0?Zi(t.elapsedMs):void 0;return Bf(iM,{children:[ei(m,{name:o,children:s}),ei(wx,{children:" "}),Bf(m,{name:"fgDim",children:[t.label,"\u2026",i!==void 0?` ${i}`:""]})]})}import"react";import{Box as eG}from"ink";import{jsx as tG,jsxs as uM}from"react/jsx-runtime";function Ax(t){let{t:e}=he(),o=(t.columns??80)<60,n=e(o?"banner.yolo.narrow":"banner.yolo");return uM(eG,{children:[tG(L,{name:"ask",role:"danger"}),uM(m,{name:"danger",children:[" ",n]})]})}import"react";import{Box as oG}from"ink";import{jsx as dM,jsxs as Cx}from"react/jsx-runtime";var nG={plan:{glyph:"planMode",role:"depth",word:"PLAN",caption:"mode.plan.caption"},normal:{glyph:"normalMode",role:"fgDim",word:"NORMAL",caption:"mode.normal.caption"},unsafe:{glyph:"ask",role:"danger",word:"YOLO",caption:"mode.unsafe.caption"}};function Uf(t){let{t:e}=he();if(t.mode==="unsafe")return dM(Ax,{...t.columns!==void 0?{columns:t.columns}:{}});let o=nG[t.mode],n=(t.columns??80)<60;return Cx(oG,{children:[dM(L,{name:o.glyph,role:o.role}),Cx(m,{name:o.role,children:[" ",e("mode.label")," ",o.word]}),!n&&Cx(m,{name:"fgDim",children:[" \xB7 ",e(o.caption)]})]})}import"react";import{jsx as mM}from"react/jsx-runtime";var rG={idle:"hints.idle",thinking:"hints.thinking",streaming:"hints.streaming",ask:"hints.ask","ask-destructive":"hints.askDestructive",slash:"hints.slash",palette:"hints.palette",budget:"hints.budget",error:"hints.error","work-subagents":"hints.workSubagents","idle-subagents":"hints.idleSubagents"},sG=new Set(["thinking","streaming","work-subagents"]);function vu(t){let{t:e}=he();if(t.armedExit===!0)return mM(m,{name:"accent",children:e("hints.ctrlcAgain")});let o=e(rG[t.state]),n=t.elapsed!==void 0&&t.elapsed!==""&&sG.has(t.state);return mM(m,{name:"fgDim",children:n?`${o} \xB7 ${t.elapsed}`:o})}import"react";import{Box as Dx}from"ink";import{jsx as Tx,jsxs as _x}from"react/jsx-runtime";function jf(t){return _x(Dx,{flexDirection:"column",children:[_x(Dx,{children:[Tx(L,{name:"clock",role:"depth"}),_x(m,{name:"depth",children:[" ",t.title]})]}),Tx(Dx,{flexDirection:"column",paddingLeft:2,children:t.lines.map((e,o)=>Tx(m,{name:"fgDim",children:e},o))})]})}import"react";import{Box as ti,Text as iG}from"ink";import{jsx as sn,jsxs as Ho}from"react/jsx-runtime";var aG=4,lG="shell";function Rx(t){let e=V();if(t.status==="running"){let a=wn(t.liveOutput??"",da).replace(/\n+$/,""),l=t.columns&&t.columns>0?t.columns-aG:0,{text:c,hidden:u}=mr(a,t.maxLines,l);return Ho(ti,{flexDirection:"column",paddingLeft:2,children:[sn(Vs,{glyph:"toolInflight",glyphRole:"depth",label:`rodando $ ${t.command}`,...t.frame!==void 0?{frame:t.frame}:{}}),c.length>0&&Ho(ti,{flexDirection:"column",paddingLeft:2,children:[u>0&&Ho(m,{name:"fgDim",children:["\u2026 (",u," linhas acima)"]}),c.split(`
|
|
534
|
+
`),!0)}function Rn(t,e,o,n){if(n===void 0){if(t.length<=o)return{start:0,slice:t};let p=e-Math.floor(o/2);return p<0&&(p=0),p+o>t.length&&(p=t.length-o),{start:p,slice:t.slice(p,p+o)}}let r=t.length;if(r===0)return{start:0,slice:t};let s=p=>Math.max(1,Math.floor(n(t[p]))),i=0;for(let p=0;p<r;p+=1)i+=s(p);if(i<=o)return{start:0,slice:t};let a=Math.max(0,Math.min(e,r-1)),l=a,c=a+1,u=s(a),f=!0,d=!0;for(;d;){d=!1;let p=()=>l>0&&u+s(l-1)<=o?(l-=1,u+=s(l),!0):!1,h=()=>c<r&&u+s(c)<=o?(u+=s(c),c+=1,!0):!1;d=f?p()||h():h()||p(),f=!f}return{start:l,slice:t.slice(l,c)}}import{Fragment as q9,jsx as Qr,jsxs as fu}from"react/jsx-runtime";function Pf(t){let e=V(),{t:o}=he(),n=e.glyph("sessionDot"),r=Math.max(1,t.maxRows??10),s=t.columns,i=s!==void 0&&s>0?c=>{let u=2+(c.label?.trim()?2:0)+fe(du(c,t.home));return Math.max(1,Math.ceil(u/s))}:void 0,{start:a,slice:l}=Rn(t.sessions,t.selected,r,i);return fu(mu,{flexDirection:"column",children:[Qr(mu,{children:Qr(m,{name:"fgDim",children:o("picker.history.help")})}),t.sessions.length===0?Qr(mu,{children:fu(m,{name:"fgDim",children:[" ",o("picker.history.empty")]})}):l.map((c,u)=>{let d=a+u===t.selected,p=c.label?.trim(),h=p?e.sessionColor(c.labelColor??p):void 0,y={};return h?.color!==void 0&&(y.color=h.color),h?.bold!==void 0&&(y.bold=h.bold),fu(mu,{children:[Qr(m,{name:d?"accent":"fgDim",children:d?"\u203A ":" "}),p&&fu(q9,{children:[Qr(eM,{...y,children:n}),Qr(eM,{children:" "})]}),Qr(m,{name:d?"accent":"fg",children:du(c,t.home)})]},c.id)}),t.sessions.length>l.length&&Qr(mu,{children:fu(m,{name:"fgDim",children:[" ",o("picker.history.more",{count:t.sessions.length-l.length})]})})]})}import"react";import{Box as jo}from"ink";var Ff=["both","conversation","code"];function tM(t,e=30){return[...t].reverse().slice(0,e)}function ux(t){let e=W9(t.ts);return`#${t.ordinal} \xB7 ${e} \xB7 ${t.label}`}function W9(t){let e=new Date(t),o=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${o}:${n}`}import{jsx as Bt,jsxs as Zs}from"react/jsx-runtime";function G9(t){switch(t){case"both":return"picker.rewind.action.both";case"conversation":return"picker.rewind.action.conversation";case"code":return"picker.rewind.action.code"}}function If(t){let{t:e}=he();if(t.phase==="list"){let o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>Math.max(1,Math.ceil((2+fe(ux(a)))/n)):void 0,{start:s,slice:i}=Rn(t.checkpoints,t.selected,o,r);return Zs(jo,{flexDirection:"column",children:[Bt(jo,{children:Bt(m,{name:"fgDim",children:e("picker.rewind.help")})}),t.checkpoints.length===0?Bt(jo,{children:Zs(m,{name:"fgDim",children:[" ",e("picker.rewind.empty")]})}):i.map((a,l)=>{let c=s+l===t.selected;return Zs(jo,{children:[Bt(m,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),Bt(m,{name:c?"accent":"fg",children:ux(a)})]},a.id)}),t.checkpoints.length>i.length&&Bt(jo,{children:Zs(m,{name:"fgDim",children:[" ",e("picker.rewind.more",{count:t.checkpoints.length-i.length})]})})]})}return Zs(jo,{flexDirection:"column",children:[Bt(jo,{children:Bt(m,{name:"fgDim",children:e("picker.rewind.action.help")})}),t.target&&Bt(jo,{children:Bt(m,{name:"fgDim",children:` \u2192 #${t.target.ordinal} \xB7 ${t.target.label}`})}),t.actions.map((o,n)=>{let r=n===t.selected;return Zs(jo,{children:[Bt(m,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),Bt(m,{name:r?"accent":"fg",children:e(G9(o))})]},o)}),t.barrierWarnings&&t.barrierWarnings.length>0&&Zs(jo,{flexDirection:"column",marginTop:1,children:[Bt(jo,{children:Bt(m,{name:"accent",children:`\u26A0 ${e("picker.rewind.barrier.warn")}:`})}),t.barrierWarnings.map((o,n)=>Bt(jo,{children:Bt(m,{name:"fgDim",children:` \xB7 ${o}`})},n))]})]})}import z9 from"react";import{Box as oo,Text as K9}from"ink";import{Fragment as J9,jsx as Me,jsxs as Co}from"react/jsx-runtime";var dx={plan:"PLAN (read-only)",normal:"NORMAL (catraca padr\xE3o)",unsafe:"YOLO (aprova\xE7\xE3o DESLIGADA)"};function Y9(t){switch(t){case"mode":return"modo de sess\xE3o \xB7 enter cicla plan \u2192 normal \u2192 yolo";case"safe-tool":return"tools seguras (leitura) \xB7 enter alterna allow \u21C4 ask";case"grant":return"liberados nesta sess\xE3o \xB7 enter REVOGA";case"locked":return"TRAVADO por seguran\xE7a \xB7 s\xF3 via --yolo"}}function V9(t){let{row:e,sel:o}=t,n=Me(m,{name:o?"accent":"fgDim",children:o?"\u203A ":" "});switch(e.kind){case"mode":return Co(oo,{children:[n,Me(m,{name:o?"accent":"fg",children:"modo: "}),Me(m,{name:e.mode==="unsafe"?"danger":o?"accent":"fg",children:dx[e.mode]})]});case"safe-tool":return Co(oo,{children:[n,Me(m,{name:o?"accent":"fg",children:e.tool}),Me(m,{name:"fgDim",children:" = "}),Me(m,{name:e.decision==="allow"?"success":"fgDim",children:e.decision})]});case"grant":return Co(oo,{children:[n,Me(m,{name:"success",children:"\u25CF "}),Me(m,{name:o?"accent":"fg",children:e.grantKey}),Me(m,{name:"fgDim",children:" (enter revoga)"})]});case"locked":{let r=e.category.lock==="deny";return Co(oo,{flexDirection:"column",children:[Co(oo,{children:[n,Me(L,{name:"ask",role:"danger"}),Me(m,{name:"danger",children:" [travado] "}),Me(m,{name:o?"accent":"fg",children:e.category.label}),Co(m,{name:"danger",children:[" \xB7 ",r?"deny (nem --yolo)":"sempre pergunta"]})]}),o&&Me(oo,{paddingLeft:4,children:Me(m,{name:"fgDim",children:e.category.why})})]})}}}function mx(t){let e=Math.max(1,t.maxRows??14),o=t.columns,n=l=>{switch(l.kind){case"mode":return 8+fe(dx[l.mode]);case"safe-tool":return 5+fe(l.tool)+fe(l.decision);case"grant":return 19+fe(l.grantKey);case"locked":return 28+fe(l.category.label)}},r=o!==void 0&&o>0?l=>Math.max(1,Math.ceil(n(l)/o)):void 0,{start:s,slice:i}=Rn(t.rows,t.selected,e,r),a=null;return Co(oo,{flexDirection:"column",children:[Me(oo,{children:Me(m,{name:"fgDim",children:"permissoes \xB7 \u2191\u2193 navega \xB7 enter muda \xB7 esc fecha"})}),Co(oo,{children:[Me(m,{name:"fgDim",children:"modo atual: "}),Me(m,{name:t.mode==="unsafe"?"danger":"fg",children:dx[t.mode]})]}),t.rows.length===0?Me(oo,{children:Me(m,{name:"fgDim",children:" nada a mostrar"})}):Co(J9,{children:[s>0&&Me(oo,{children:Co(m,{name:"fgDim",children:[" \u2191 ",s," acima"]})}),i.map((l,c)=>{let u=s+c,f=l.kind!==a?Y9(l.kind):null;return a=l.kind,Co(z9.Fragment,{children:[f&&Me(oo,{paddingTop:1,children:Co(m,{name:"fgDim",children:["\u2500\u2500\u2500 ",f]})}),Me(V9,{row:l,sel:u===t.selected})]},X9(l,u))}),s+i.length<t.rows.length&&Me(oo,{children:Co(m,{name:"fgDim",children:[" \u2193 ",t.rows.length-(s+i.length)," abaixo"]})})]}),Me(oo,{paddingTop:1,children:Me(K9,{children:" "})}),Me(oo,{children:Me(m,{name:"fgDim",children:"o painel n\xE3o relaxa as categorias travadas \u2014 o \xFAnico bypass total \xE9 --yolo"})})]})}function X9(t,e){switch(t.kind){case"mode":return"mode";case"safe-tool":return`safe:${t.tool}`;case"grant":return`grant:${t.grantKey}`;case"locked":return`locked:${t.category.category}`;default:return`row:${e}`}}import"react";import{Box as fx}from"ink";import{jsx as pu,jsxs as px}from"react/jsx-runtime";function Nf(t){let{t:e}=he();return px(fx,{flexDirection:"column",children:[pu(fx,{children:pu(m,{name:"fgDim",children:e("picker.theme.help")})}),t.themes.map((o,n)=>{let r=n===t.selected,s=o.name===t.currentTheme;return px(fx,{children:[pu(m,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),pu(m,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),pu(m,{name:r?"accent":"fg",children:o.label}),px(m,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.name)})]})}import"react";import{Box as hx}from"ink";import{jsx as hu,jsxs as gx}from"react/jsx-runtime";function $f(t){let{t:e}=he();return gx(hx,{flexDirection:"column",children:[hu(hx,{children:hu(m,{name:"fgDim",children:e("picker.lang.help")})}),t.langs.map((o,n)=>{let r=n===t.selected,s=o.code===t.currentLang;return gx(hx,{children:[hu(m,{name:r?"accent":"fgDim",children:r?"\u203A ":" "}),hu(m,{name:s?"accent":"fgDim",children:s?"\u25CF ":" "}),hu(m,{name:r?"accent":"fg",children:o.label}),gx(m,{name:"fgDim",children:[" \xB7 ",o.summary]})]},o.code)})]})}import"react";import{Box as gu}from"ink";import{jsx as Zr,jsxs as yu}from"react/jsx-runtime";function yx(t){let{t:e}=he(),o=Math.max(1,t.maxRows??10),n=t.columns,r=n!==void 0&&n>0?a=>{let l=4+fe(`${a.label} \xB7 ${a.summary}`)+(a.isDefault?2+fe(e("picker.provider.default")):0);return Math.max(1,Math.ceil(l/n))}:void 0,{start:s,slice:i}=Rn(t.providers,t.selected,o,r);return yu(gu,{flexDirection:"column",children:[Zr(gu,{children:Zr(m,{name:"fgDim",children:e("picker.provider.help")})}),t.usingFallback===!0?Zr(gu,{children:Zr(m,{name:"fgDim",children:e("picker.provider.fallback")})}):null,i.map((a,l)=>{let c=s+l===t.selected,u=a.name===t.currentProvider;return yu(gu,{children:[Zr(m,{name:c?"accent":"fgDim",children:c?"\u203A ":" "}),Zr(m,{name:u?"accent":"fgDim",children:u?"\u25CF ":" "}),Zr(m,{name:c?"accent":"fg",children:a.label}),yu(m,{name:"fgDim",children:[" \xB7 ",a.summary]}),a.isDefault?yu(m,{name:"fgDim",children:[" \xB7 ",e("picker.provider.default")]}):null]},a.name)}),t.providers.length>i.length&&Zr(gu,{children:yu(m,{name:"fgDim",children:[" ",e("picker.provider.more",{count:t.providers.length-i.length})]})})]})}import"react";import{Box as oM,Text as Q9}from"ink";import{jsx as bx,jsxs as nM}from"react/jsx-runtime";function vx(t){if(t.chips.length===0)return null;let e=t.active??-1;return bx(oM,{flexWrap:"wrap",children:t.chips.map((o,n)=>{let r=n===e;return nM(oM,{marginRight:1,children:[nM(m,{name:r?"accent":"depth",children:[r?"\u203A ":"","@",o.path,o.truncated?"~":""]}),bx(Q9,{children:" "}),bx(m,{name:"fgDim",children:"[\u232B]"})]},o.path)})})}import"react";import{Box as bu,Text as rM}from"ink";import{jsx as rn,jsxs as es}from"react/jsx-runtime";function kx(t){let e=V(),{t:o}=he(),n=t.columns??80,r=t.plan??"assinatura",s=e.glyph("wave").repeat(17);return es(bu,{flexDirection:"column",paddingY:1,children:[rn(qs,{columns:n}),rn(bu,{paddingTop:1,paddingLeft:2,children:rn(m,{name:"fgDim",children:o("boot.tagline")})}),es(bu,{paddingLeft:2,children:[rn(m,{name:"accent",children:s}),t.version!==void 0&&es(m,{name:"fgDim",children:[" v",t.version]})]}),es(bu,{paddingLeft:2,children:[rn(L,{name:"window",role:"fgDim"}),es(m,{name:"fgDim",children:[" ",r," \xB7 "]}),rn(m,{name:"fgDim",children:t.tier}),rn(rM,{children:" "}),rn(m,{name:"fgDim",children:"\xB7 "}),rn(L,{name:"broker",role:"depth"}),es(m,{name:"depth",children:[" ",o("boot.broker")]})]}),t.status!==void 0&&es(bu,{paddingTop:1,paddingLeft:2,children:[rn(Ys,{frame:t.frame??0}),rn(rM,{children:" "}),es(m,{name:"fgDim",children:[t.status,"\u2026"]})]})]})}import"react";import{Box as sM}from"ink";import{jsx as xx,jsxs as Ex}from"react/jsx-runtime";var Z9=['"explique a estrutura deste repo"','"rode os testes e resuma as falhas"',"/help para comandos \xB7 /login conta \xB7 /quit"];function Sx(t){let e=t.suggestions??Z9;return Ex(sM,{flexDirection:"column",children:[xx(m,{name:"fg",children:t.name?`bom te ver de novo, ${t.name}.`:"bom te ver por aqui."}),xx(m,{name:"fgDim",children:"eu leio e edito arquivos e rodo comandos aqui \u2014 sempre te mostrando o efeito exato antes."}),Ex(sM,{paddingTop:1,flexDirection:"column",children:[xx(m,{name:"fgDim",children:"experimente:"}),e.map((o,n)=>Ex(m,{name:"fgDim",children:[" \xB7 ",o]},n))]})]})}import"react";import{jsx as yhe}from"react/jsx-runtime";import"react";import{Box as iM,Text as wx}from"ink";import{jsx as ei,jsxs as Bf}from"react/jsx-runtime";var aM=12;function lM(t,e){return!Number.isFinite(t)||!Number.isFinite(e)||e<=0?0:Math.max(0,Math.min(1,t/e))}function cM(t,e,o,n,r){let s=Math.max(1,Math.trunc(n)),i=Math.max(0,Math.min(1,t)),a=Math.round(i*s);i>0&&a===0&&(a=1),i<1&&a===s&&(a=s-1);let l=e.repeat(a),c=o.repeat(s-a);return r?{filled:l,rest:c}:{filled:`[${l}`,rest:`${c}]`}}function va(t){let e=V(),o=t.role??"accent";if(t.value!==void 0&&t.max!==void 0){let a=lM(t.value,t.max),l=Math.round(a*100),c=e.glyph("barFull"),u=e.glyph("barEmpty"),f=t.width??aM,{filled:d,rest:p}=cM(a,c,u,f,e.unicode);return Bf(iM,{children:[ei(m,{name:o,children:d}),ei(m,{name:"fgDim",children:p}),ei(wx,{children:" "}),Bf(m,{name:o,children:[l,"%"]}),ei(wx,{children:" "}),ei(m,{name:"fgDim",children:t.label})]})}let r=e.spinnerFrames,s=e.animate?r[(t.frame??0)%r.length]:e.glyph("clock"),i=t.elapsedMs!==void 0?Zi(t.elapsedMs):void 0;return Bf(iM,{children:[ei(m,{name:o,children:s}),ei(wx,{children:" "}),Bf(m,{name:"fgDim",children:[t.label,"\u2026",i!==void 0?` ${i}`:""]})]})}import"react";import{Box as eG}from"ink";import{jsx as tG,jsxs as uM}from"react/jsx-runtime";function Ax(t){let{t:e}=he(),o=(t.columns??80)<60,n=e(o?"banner.yolo.narrow":"banner.yolo");return uM(eG,{children:[tG(L,{name:"ask",role:"danger"}),uM(m,{name:"danger",children:[" ",n]})]})}import"react";import{Box as oG}from"ink";import{jsx as dM,jsxs as Cx}from"react/jsx-runtime";var nG={plan:{glyph:"planMode",role:"depth",word:"PLAN",caption:"mode.plan.caption"},normal:{glyph:"normalMode",role:"fgDim",word:"NORMAL",caption:"mode.normal.caption"},unsafe:{glyph:"ask",role:"danger",word:"YOLO",caption:"mode.unsafe.caption"}};function Uf(t){let{t:e}=he();if(t.mode==="unsafe")return dM(Ax,{...t.columns!==void 0?{columns:t.columns}:{}});let o=nG[t.mode],n=(t.columns??80)<60;return Cx(oG,{children:[dM(L,{name:o.glyph,role:o.role}),Cx(m,{name:o.role,children:[" ",e("mode.label")," ",o.word]}),!n&&Cx(m,{name:"fgDim",children:[" \xB7 ",e(o.caption)]})]})}import"react";import{jsx as mM}from"react/jsx-runtime";var rG={idle:"hints.idle",thinking:"hints.thinking",streaming:"hints.streaming",ask:"hints.ask","ask-destructive":"hints.askDestructive",slash:"hints.slash",palette:"hints.palette",budget:"hints.budget",error:"hints.error","work-subagents":"hints.workSubagents","idle-subagents":"hints.idleSubagents"},sG=new Set(["thinking","streaming","work-subagents"]);function vu(t){let{t:e}=he();if(t.armedExit===!0)return mM(m,{name:"accent",children:e("hints.ctrlcAgain")});let o=e(rG[t.state]),n=t.elapsed!==void 0&&t.elapsed!==""&&sG.has(t.state);return mM(m,{name:"fgDim",children:n?`${o} \xB7 ${t.elapsed}`:o})}import"react";import{Box as Dx}from"ink";import{jsx as Tx,jsxs as _x}from"react/jsx-runtime";function jf(t){return _x(Dx,{flexDirection:"column",children:[_x(Dx,{children:[Tx(L,{name:"clock",role:"depth"}),_x(m,{name:"depth",children:[" ",t.title]})]}),Tx(Dx,{flexDirection:"column",paddingLeft:2,children:t.lines.map((e,o)=>Tx(m,{name:"fgDim",children:e},o))})]})}import"react";import{Box as ti,Text as iG}from"ink";import{jsx as sn,jsxs as Ho}from"react/jsx-runtime";var aG=4,lG="shell";function Rx(t){let e=V();if(t.status==="running"){let a=wn(t.liveOutput??"",da).replace(/\n+$/,""),l=t.columns&&t.columns>0?t.columns-aG:0,{text:c,hidden:u}=mr(a,t.maxLines,l);return Ho(ti,{flexDirection:"column",paddingLeft:2,children:[sn(Vs,{glyph:"toolInflight",glyphRole:"depth",label:`rodando $ ${t.command}`,...t.frame!==void 0?{frame:t.frame}:{}}),c.length>0&&Ho(ti,{flexDirection:"column",paddingLeft:2,children:[u>0&&Ho(m,{name:"fgDim",children:["\u2026 (",u," linhas acima)"]}),c.split(`
|
|
535
535
|
`).map((f,d)=>sn(ti,{children:sn(m,{name:"fgDim",children:f})},d))]})]})}let o=t.status==="err",n=t.status==="blocked",r=n?"bloqueado":o?"erro":"ok",s=t.output??"";return Ho(ti,{flexDirection:"column",paddingLeft:2,children:[Ho(ti,{children:[n?sn(L,{name:"err",role:"danger"}):sn(L,{name:"tool",role:"depth"}),Ho(m,{name:"fg",children:[" ",lG," "]}),sn(m,{name:"accent",children:"$ "}),sn(m,{name:"fg",children:t.command}),sn(iG,{children:" "}),n||o?sn(L,{name:"err",role:"danger"}):sn(L,{name:"ok",role:"success"}),Ho(m,{name:n||o?"danger":"fgDim",children:[" ",r]})]}),s.trim()!==""&&Ho(ti,{flexDirection:"column",paddingLeft:2,children:[Ho(m,{name:"fgDim",children:[e.box.topLeft," sa\xEDda ",e.box.horizontal.repeat(8)]}),s.split(`
|
|
536
536
|
`).map((i,a)=>Ho(ti,{children:[Ho(m,{name:"fgDim",children:[e.box.vertical," "]}),sn(m,{name:n||o?"danger":"fg",children:i})]},a)),Ho(m,{name:"fgDim",children:[e.box.bottomLeft," ",r," ",e.box.horizontal.repeat(4)]})]})]})}import"react";import{Box as Ox,Text as fM}from"ink";import{jsx as On,jsxs as ka}from"react/jsx-runtime";function cG(t){if(t.status==="running")return"rodando";if(t.status==="done")return"pronto";if(t.status==="cancelled")return"parado";switch(t.stop){case"timeout":return"timeout";case"limit":return"teto";default:return"falhou"}}function uG(t){let e=t.child,o=cG(e),n=e.status==="running"?On(L,{name:"clock",role:"depth"}):e.status==="done"?On(L,{name:"ok",role:"success"}):e.status==="cancelled"?On(L,{name:"err",role:"fgDim"}):On(L,{name:"err",role:"danger"}),r=e.status==="done"?"success":e.status==="fail"?"danger":"fgDim";return ka(Ox,{paddingLeft:2,children:[ka(m,{name:"accent",children:["[",e.label,"]"]}),On(fM,{children:" "}),n,On(fM,{children:" "}),On(m,{name:r,children:o}),e.summary!==void 0&&e.status!=="running"&&ka(m,{name:"fgDim",children:[" \xB7 ",e.summary]})]})}function Mx(t){let e=t.childrenStatus,o=e.length,n=e.filter(s=>s.status==="running").length,r=n>0?` (${n} rodando)`:"";return ka(Ox,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[ka(Ox,{children:[On(L,{name:"subagents",role:"accent"}),ka(m,{name:"fg",children:[" ",o," sub-agente",o===1?"":"s",":"]}),r!==""&&On(m,{name:"fgDim",children:r})]}),e.map((s,i)=>On(uG,{child:s},`${s.label}:${i}`))]})}import"react";import{Box as xa,Text as Lx}from"ink";import{jsx as ho,jsxs as ts}from"react/jsx-runtime";function dG(t){switch(t){case"pending":return"testando";case"ok":return"ok";case"warn":return"aviso";default:return"falha"}}function mG(t){let e=V(),o=t.check,n=dG(o.status),r,s;if(o.status==="pending"){let i=e.spinnerFrames,a=e.animate?i[(t.frame??0)%i.length]:e.glyph("clock");r=ho(m,{name:"accent",children:a}),s="fgDim"}else o.status==="ok"?(r=ho(L,{name:"ok",role:"success"}),s="success"):o.status==="warn"?(r=ho(L,{name:"ask",role:"accent"}),s="accent"):(r=ho(L,{name:"err",role:"danger"}),s="danger");return ts(xa,{flexDirection:"column",children:[ts(xa,{children:[ho(Lx,{children:" "}),r,ho(Lx,{children:" "}),ts(m,{name:"fg",children:[o.label,":"]}),ho(Lx,{children:" "}),o.detail!==void 0&&o.detail!==""?ho(m,{name:s,children:o.detail}):ts(m,{name:s,children:[n,"\u2026"]})]}),o.status!=="pending"&&o.status!=="ok"&&o.fix!==void 0&&ho(xa,{paddingLeft:4,children:ts(m,{name:"fgDim",children:["\u2192 ",o.fix]})})]})}function Px(t){let e=t.checks,o=e.filter(s=>s.status==="pending").length,n=o>0?` (${o} testando)`:"",r=t.frame??0;return ts(xa,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[ts(xa,{children:[ho(L,{name:"clock",role:"accent"}),ho(m,{name:"fg",children:" doctor \u2014 diagn\xF3stico"}),n!==""&&ho(m,{name:"fgDim",children:n})]}),e.map(s=>ho(mG,{check:s,frame:r},s.id)),t.summary!==void 0&&ho(xa,{paddingTop:1,children:ts(m,{name:"fgDim",children:["resumo: ",t.summary]})})]})}import"react";import{Box as Ut,Text as Hf}from"ink";import{jsx as Se,jsxs as Qe}from"react/jsx-runtime";var Fx={thinking:"pensando",tool:"rodando tool",asking:"aguardando confirma\xE7\xE3o",done:"conclu\xEDdo",cancelled:"parado",failed:"falhou"};function pM(t){switch(t){case"done":return"success";case"cancelled":return"fgDim";case"failed":return"danger";default:return"accent"}}function Ix(t){let e=[`${Dt(t.tokens)} tokens`];return t.toolCalls>0&&e.push(`${t.toolCalls} tools`),e.push(Io(t.durationMs)),e.join(" \xB7 ")}function fG(t){let e=t.node,o=e.kind==="root"?0:2,n=t.focused?"\u25B8":" ";return Qe(Ut,{paddingLeft:o,children:[Qe(m,{name:t.focused?"accent":"fgDim",children:[n," "]}),Qe(m,{name:"accent",children:["[",e.label,"]"]}),Se(Hf,{children:" "}),Se(m,{name:pM(e.phase),children:Fx[e.phase]}),Qe(m,{name:"fgDim",children:[" \xB7 ",Ix(e.accounting)]})]})}function pG(t){let{t:e}=he(),o=t.progress,n=o.max>1,r=o.subcyclesTotal>0,s=`${e("flowtree.subcycles")} ${o.subcyclesDone}/${o.subcyclesTotal}`;return n?Qe(Ut,{flexDirection:"column",children:[Se(Ut,{children:Qe(m,{name:"accent",children:["\u21BB ",e("flowtree.cycle")," ",o.iteration,"/",o.max]})}),Qe(Ut,{paddingLeft:2,children:[Se(m,{name:"fgDim",children:"\u2514 "}),r&&Qe(m,{name:"fgDim",children:[s," \xB7 "]}),Qe(m,{name:"accent",children:[e("flowtree.turn")," ",o.iteration]})]})]}):Qe(Ut,{children:[Qe(m,{name:"accent",children:["\u21BB ",e("flowtree.cycle")]}),r&&Qe(m,{name:"fgDim",children:[" \xB7 ",s]})]})}function hG(t){let e=Math.max(1,t.maxRows??10),o=t.columns,n=o!==void 0&&o>0?i=>{let l=(i.kind==="root"?0:2)+fe(` [${i.label}] ${Fx[i.phase]} \xB7 ${Ix(i.accounting)}`);return Math.max(1,Math.ceil(l/o))}:void 0,{start:r,slice:s}=Rn(t.overview,t.selected,e,n);return Qe(Ut,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[t.cycleProgress!==void 0&&Se(pG,{progress:t.cycleProgress}),Qe(Ut,{children:[Se(L,{name:"subagents",role:"accent"}),Se(m,{name:"fg",children:" \xE1rvore de fluxos \u2014 ver \xB7 parar \xB7 interagir"})]}),s.map((i,a)=>Se(fG,{node:i,focused:r+a===t.selected},i.id)),t.overview.length>s.length&&Se(Ut,{children:Qe(m,{name:"fgDim",children:[" \u2026 ",t.overview.length-s.length," n\xF3s a mais (\u2191\u2193 rola)"]})}),Se(Ut,{paddingTop:1,children:Se(m,{name:"fgDim",children:"\u2191\u2193 navega \xB7 enter: ver \xB7 p: parar este \xB7 P: parar todos \xB7 i: interagir \xB7 esc: fecha"})})]})}function gG(t){let e=t.activity,o=[];return e.durationMs!==void 0&&o.push(Io(e.durationMs)),(e.added!==void 0||e.removed!==void 0)&&o.push(`+${e.added??0}/\u2212${e.removed??0}`),e.tokens!==void 0&&o.push(`${Dt(e.tokens)} tok`),Qe(Ut,{flexDirection:"column",paddingLeft:2,children:[Qe(Ut,{children:[e.running?Se(L,{name:"clock",role:"depth"}):e.ok?Se(L,{name:"ok",role:"success"}):Se(L,{name:"err",role:"danger"}),Se(Hf,{children:" "}),Se(m,{name:"fg",children:e.tool}),e.target!==""&&Qe(m,{name:"fgDim",children:[" ",e.target]}),Se(Hf,{children:" "}),Se(m,{name:e.running?"fgDim":e.ok?"success":"danger",children:e.summary&&e.summary!==""?e.summary:e.running?"rodando":e.ok?"ok":"erro"}),o.length>0&&Qe(m,{name:"fgDim",children:[" \xB7 ",o.join(" \xB7 ")]})]}),e.running&&e.tail!==void 0&&e.tail!==""&&Se(Ut,{paddingLeft:4,children:Se(m,{name:"fgDim",children:e.tail})})]})}function yG(t){let e=t.node;return Qe(Ut,{flexDirection:"column",paddingLeft:2,paddingBottom:1,children:[Qe(Ut,{children:[Se(L,{name:"subagents",role:"accent"}),Se(m,{name:"fg",children:" "}),Qe(m,{name:"accent",children:["[",e.label,"]"]}),Se(Hf,{children:" "}),Se(m,{name:pM(e.phase),children:Fx[e.phase]}),Qe(m,{name:"fgDim",children:[" \xB7 ",Ix(e.accounting)]})]}),e.recent.length===0?Se(Ut,{paddingLeft:2,children:Se(m,{name:"fgDim",children:"sem atividade recente."})}):e.recent.map((o,n)=>Se(gG,{activity:o},`${o.tool}:${n}`)),Se(Ut,{paddingTop:1,children:Se(m,{name:"fgDim",children:"p: parar este \xB7 i: interagir \xB7 esc/enter: volta \xE0 \xE1rvore"})})]})}function Nx(t){return t.drillIn?Se(yG,{node:t.drillIn}):Se(hG,{...t})}import"react";import{Box as ln,Text as ni}from"ink";function $x({onlyFirst:t=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,t?void 0:"g")}var bG=$x();function ku(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(bG,"")}var hM=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],gM=12288,yM=65510,bM=[12288,12288,65281,65376,65504,65510];var vM=4352,kM=262141,Bx=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var qf=(t,e)=>{let o=0,n=Math.floor(t.length/2)-1;for(;o<=n;){let r=Math.floor((o+n)/2),s=r*2;if(e<t[s])n=r-1;else if(e>t[s+1])o=r+1;else return!0}return!1};var xM=19968,[xG,EG]=SG(Bx);function SG(t){let e=t[0],o=t[1];for(let n=0;n<t.length;n+=2){let r=t[n],s=t[n+1];if(xM>=r&&xM<=s)return[r,s];s-r>o-e&&(e=r,o=s)}return[e,o]}var EM=t=>t<161||t>1114109?!1:qf(hM,t),SM=t=>t<gM||t>yM?!1:qf(bM,t);var wM=t=>t>=xG&&t<=EG?!0:t<vM||t>kM?!1:qf(Bx,t);function wG(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function AM(t,{ambiguousAsWide:e=!1}={}){return wG(t),SM(t)||wM(t)||e&&EM(t)?2:1}var TM=GI(DM(),1),AG=new Intl.Segmenter,CG=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function oi(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:o=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=ku(t)),t.length===0)return 0;let r=0,s={ambiguousAsWide:!o};for(let{segment:i}of AG.segment(t)){let a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!CG.test(i)){if((0,TM.default)().test(i)){r+=2;continue}r+=AM(a,s)}}return r}var _M=(t=0)=>e=>`\x1B[${e+t}m`,RM=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,OM=(t=0)=>(e,o,n)=>`\x1B[${38+t};2;${e};${o};${n}m`,ze={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Jge=Object.keys(ze.modifier),DG=Object.keys(ze.color),TG=Object.keys(ze.bgColor),Qge=[...DG,...TG];function _G(){let t=new Map;for(let[e,o]of Object.entries(ze)){for(let[n,r]of Object.entries(o))ze[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},o[n]=ze[n],t.set(r[0],r[1]);Object.defineProperty(ze,e,{value:o,enumerable:!1})}return Object.defineProperty(ze,"codes",{value:t,enumerable:!1}),ze.color.close="\x1B[39m",ze.bgColor.close="\x1B[49m",ze.color.ansi=_M(),ze.color.ansi256=RM(),ze.color.ansi16m=OM(),ze.bgColor.ansi=_M(10),ze.bgColor.ansi256=RM(10),ze.bgColor.ansi16m=OM(10),Object.defineProperties(ze,{rgbToAnsi256:{value(e,o,n){return e===o&&o===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(o/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!o)return[0,0,0];let[n]=o;n.length===3&&(n=[...n].map(s=>s+s).join(""));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>ze.rgbToAnsi256(...ze.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let o,n,r;if(e>=232)o=((e-232)*10+8)/255,n=o,r=o;else{e-=16;let a=e%36;o=Math.floor(e/36)/5,n=Math.floor(a/6)/5,r=a%6/5}let s=Math.max(o,n,r)*2;if(s===0)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(o));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,o,n)=>ze.ansi256ToAnsi(ze.rgbToAnsi256(e,o,n)),enumerable:!1},hexToAnsi:{value:e=>ze.ansi256ToAnsi(ze.hexToAnsi256(e)),enumerable:!1}}),ze}var RG=_G(),MM=RG;var Gf=new Set(["\x1B","\x9B"]),OG=39,jx="\x07",FM="[",MG="]",IM="m",Wf=`${MG}8;;`,LM=t=>`${Gf.values().next().value}${FM}${t}${IM}`,PM=t=>`${Gf.values().next().value}${Wf}${t}${jx}`,LG=t=>t.split(" ").map(e=>oi(e)),Ux=(t,e,o)=>{let n=[...e],r=!1,s=!1,i=oi(ku(t.at(-1)));for(let[a,l]of n.entries()){let c=oi(l);if(i+c<=o?t[t.length-1]+=l:(t.push(l),i=0),Gf.has(l)&&(r=!0,s=n.slice(a+1,a+1+Wf.length).join("")===Wf),r){s?l===jx&&(r=!1,s=!1):l===IM&&(r=!1);continue}i+=c,i===o&&a<n.length-1&&(t.push(""),i=0)}!i&&t.at(-1).length>0&&t.length>1&&(t[t.length-2]+=t.pop())},PG=t=>{let e=t.split(" "),o=e.length;for(;o>0&&!(oi(e[o-1])>0);)o--;return o===e.length?t:e.slice(0,o).join(" ")+e.slice(o).join("")},FG=(t,e,o={})=>{if(o.trim!==!1&&t.trim()==="")return"";let n="",r,s,i=LG(t),a=[""];for(let[f,d]of t.split(" ").entries()){o.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let p=oi(a.at(-1));if(f!==0&&(p>=e&&(o.wordWrap===!1||o.trim===!1)&&(a.push(""),p=0),(p>0||o.trim===!1)&&(a[a.length-1]+=" ",p++)),o.hard&&i[f]>e){let h=e-p,y=1+Math.floor((i[f]-h-1)/e);Math.floor((i[f]-1)/e)<y&&a.push(""),Ux(a,d,e);continue}if(p+i[f]>e&&p>0&&i[f]>0){if(o.wordWrap===!1&&p<e){Ux(a,d,e);continue}a.push("")}if(p+i[f]>e&&o.wordWrap===!1){Ux(a,d,e);continue}a[a.length-1]+=d}o.trim!==!1&&(a=a.map(f=>PG(f)));let l=a.join(`
|
|
537
537
|
`),c=[...l],u=0;for(let[f,d]of c.entries()){if(n+=d,Gf.has(d)){let{groups:h}=new RegExp(`(?:\\${FM}(?<code>\\d+)m|\\${Wf}(?<uri>.*)${jx})`).exec(l.slice(u))||{groups:{}};if(h.code!==void 0){let y=Number.parseFloat(h.code);r=y===OG?void 0:y}else h.uri!==void 0&&(s=h.uri.length===0?void 0:h.uri)}let p=MM.codes.get(Number(r));c[f+1]===`
|
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.74",
|
|
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",
|