@dahawa/hawa-code 1.38.1 → 1.38.2
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/cli.js +3 -3
- package/hands.js +3 -3
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -488,7 +488,7 @@ ${a.content}`).join(`
|
|
|
488
488
|
|
|
489
489
|
`)}`;return[this.createReminderMessage("recalled_memories","general","medium",s,o,!0)]}getMentionReminders(){let t=Date.now(),r=5e3,n=[],o=[];for(let[i,s]of this.reminderCache.entries())this.isMentionReminder(s)&&(t-s.timestamp<=r?n.push(s):o.push(i));return o.forEach(i=>this.reminderCache.delete(i)),n}isMentionReminder(t){return["agent_mention","file_mention","ask_model_mention"].includes(t.type)}generateFileChangeReminder(t){let{agentId:r,filePath:n,reminder:o}=t;if(!o)return null;let i=Date.now(),s=`file_changed_${r}_${n}_${i}`;return this.sessionState.remindersSent.has(s)?null:(this.sessionState.remindersSent.add(s),this.createReminderMessage("file_changed","general","medium",o,i))}createReminderMessage(t,r,n,o,i,s=!0){return{role:"system",content:`<system-reminder>
|
|
490
490
|
${o}
|
|
491
|
-
</system-reminder>`,isMeta:!0,timestamp:i,type:t,priority:n,category:r,foot:s}}getTodoStateHash(t){return t.map(r=>`${r.id}:${r.status}`).sort().join("|")}clearTodoReminders(t){let r=t||"default";for(let n of this.sessionState.remindersSent)n.startsWith(`todo_updated_${r}_`)&&this.sessionState.remindersSent.delete(n)}setupEventDispatcher(){this.addEventListener("session:startup",t=>{this.resetSession(),this.sessionState.sessionStartTime=Date.now(),this.sessionState.contextPresent=Object.keys(t.context||{}).length>0,Me("system_reminder_session_startup",{agentId:t.agentId||"default",contextKeys:Object.keys(t.context||{}).join(","),messageCount:String(t.messages||0),timestamp:String(t.timestamp||Date.now())})}),this.addEventListener("file:read",t=>{this.sessionState.lastFileAccess=Date.now()}),this.addEventListener("file:edited",t=>{}),this.addEventListener("agent:mentioned",t=>{this.createMentionReminder({type:"agent_mention",key:`agent_mention_${t.agentType}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST use the ${Xr} tool with subagent_type="${t.agentType}" to delegate this task to the specified agent. Provide a detailed, self-contained task description that fully captures the user's intent for the ${t.agentType} agent to execute.`,timestamp:t.timestamp})}),this.addEventListener("file:mentioned",t=>{this.createMentionReminder({type:"file_mention",key:`file_mention_${t.filePath}_${t.timestamp}`,category:"general",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST read the entire content of the file at path: ${t.filePath} using the Read tool to understand the full context before proceeding with the user's request.`,timestamp:t.timestamp})}),this.addEventListener("ask-model:mentioned",t=>{this.createMentionReminder({type:"ask_model_mention",key:`ask_model_mention_${t.modelName}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.modelName}. You MUST use the AskExpertModelTool to consult this specific model for expert opinions and analysis. Provide the user's question or context clearly to get the most relevant response from ${t.modelName}.`,timestamp:t.timestamp})})}addEventListener(t,r){this.eventDispatcher.has(t)||this.eventDispatcher.set(t,[]),this.eventDispatcher.get(t).push(r)}emitEvent(t,r){(this.eventDispatcher.get(t)||[]).forEach(o=>{try{o(r)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}createMentionReminder(t){if(!this.sessionState.remindersSent.has(t.key)){this.sessionState.remindersSent.add(t.key);let r=this.createReminderMessage(t.type,t.category,t.priority,t.content,t.timestamp);this.reminderCache.set(t.key,r)}}resetSession(){this.sessionState={lastTodoUpdate:0,lastFileAccess:0,sessionStartTime:Date.now(),remindersSent:new Set,contextPresent:!1,reminderCount:0,config:{...this.sessionState.config}},this.reminderCache.clear()}updateConfig(t){this.sessionState.config={...this.sessionState.config,...t}}getSessionState(){return{...this.sessionState}}},qG=new nqe,oqe=async(e=!1,t)=>await qG.generateReminders(e,t),zfo=e=>qG.generateFileChangeReminder(e),Hd=(e,t)=>qG.emitEvent(e,t),sN=()=>qG.resetSession(),Wfo=()=>qG.getSessionState()});import{readFileSync as vrr,existsSync as Yge}from"fs";import{join as Eqe,extname as Qmo,resolve as Crr,dirname as Gmo}from"path";import{fileURLToPath as Hmo}from"url";function Rrr(){let e=Gmo(Hmo(import.meta.url));return[Crr(e,"webServer"),Crr(e,"client")]}function Drr(e,t){let n=new URL(e.url||"/",`http://${e.headers.host}`).pathname;if(t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){t.writeHead(204),t.end();return}if(n.startsWith("/api/")){Vmo(n,e,t);return}if(n==="/debug"){Ymo(t);return}zmo(n,t)}function Ymo(e){let r=Rrr().map(n=>({dir:n,exists:Yge(n),hasIndex:Yge(Eqe(n,"index.html"))}));zG(e,200,{cwd:process.cwd(),staticDirs:r,nodeVersion:process.version})}function Vmo(e,t,r){let n=()=>Promise.resolve().then(()=>(hz(),Vge)).then(i=>i.webServerService);if(r.setHeader("Content-Type","application/json; charset=utf-8"),e==="/api/status"){n().then(i=>{zG(r,200,{running:i.isRunning(),url:i.getUrl(),agentCount:i.getAgents().length,uptime:process.uptime()})});return}if(e==="/api/agents"){n().then(i=>{zG(r,200,i.getAgents())});return}if(e==="/api/messages"){n().then(i=>{zG(r,200,i.getAllMessages())});return}let o=e.match(/^\/api\/agents\/([^/]+)\/messages$/);if(o){let i=decodeURIComponent(o[1]);n().then(s=>{zG(r,200,s.getMessagesForAgent(i))});return}zG(r,404,{error:"Not Found"})}function zmo(e,t){(e==="/"||e==="/index.html")&&(e="/index.html");let r=Rrr();if(Irr(e,r,t))return;let o=$mo[e];if(o){for(let i of o)if(i!==e&&Irr(i,r,t))return}for(let i of r){let s=Eqe(i,"index.html");if(Yge(s))try{let a=vrr(s);t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end(a);return}catch{}}t.writeHead(404,{"Content-Type":"text/plain"}),t.end("Not Found")}function Irr(e,t,r){for(let n of t){let o=Eqe(n,e);if(Yge(o)){let i=Qmo(o),s=qmo[i]||"application/octet-stream";try{let a=vrr(o);return r.writeHead(200,{"Content-Type":s}),r.end(a),!0}catch{}}}return!1}function zG(e,t,r){e.writeHead(t,{"Content-Type":"application/json; charset=utf-8"}),e.end(JSON.stringify(r))}var qmo,$mo,Nrr=Q(()=>{qmo={".html":"text/html; charset=utf-8",".js":"application/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".ico":"image/x-icon"};$mo={"/style.css":["/style.css","/styles/terminal.css","/terminal.css"]}});var Vge={};ra(Vge,{webServerService:()=>Ez});import*as Orr from"http";function xrr(e){return!e||e==="defalt"||e==="default"?"main":e}var _z,Sqe,Ez,hz=Q(()=>{_z=G(vHe(),1);Ll();zr();Be();Nrr();Sqe=class{httpServer=null;wss=null;clients=new Map;unsubscribers=[];running=!1;port=3210;host="127.0.0.1";agents=new Map;messageCache=new Map;throttleTimers=new Map;THROTTLE_MS=50;isRunning(){return this.running}getPort(){return this.port}getHost(){return this.host}getUrl(){return`http://${this.host}:${this.port}`}async start(){if(this.running)return;let t=Lt().webServer;return this.port=t?.port||3210,this.host=t?.host||"127.0.0.1",this.agents.has("main")||this.agents.set("main",{id:"main",name:"Main",type:"main",status:"running",startedAt:Date.now()}),this.httpServer=Orr.createServer((r,n)=>{Drr(r,n)}),this.wss=new _z.WebSocketServer({server:this.httpServer,path:"/ws"}),this.wss.on("connection",r=>{let n={sentCounts:new Map};this.clients.set(r,n),be("WebServer: \u65B0\u5BA2\u6237\u7AEF\u8FDE\u63A5"),this.sendSnapshot(r,n),r.on("message",o=>{try{JSON.parse(o.toString()).type==="ping"&&r.send(JSON.stringify({type:"pong"}))}catch{}}),r.on("close",()=>{this.clients.delete(r),be("WebServer: \u5BA2\u6237\u7AEF\u65AD\u5F00")}),r.on("error",o=>{he("WebServer WS error:",o),this.clients.delete(r)})}),this.subscribeToMessages(),new Promise((r,n)=>{let o=(i,s)=>{this.httpServer.once("error",a=>{a.code==="EADDRINUSE"&&s>0?(be(`WebServer: \u7AEF\u53E3 ${i} \u88AB\u5360\u7528\uFF0C\u5C1D\u8BD5 ${i+1}`),o(i+1,s-1)):n(a)}),this.httpServer.listen(i,this.host,()=>{this.port=i,this.running=!0,be(`WebServer started at http://${this.host}:${i}`),r()})};o(this.port,10)})}async stop(){if(this.running){this.unsubscribers.forEach(t=>t()),this.unsubscribers=[];for(let t of this.throttleTimers.values())clearTimeout(t);this.throttleTimers.clear();for(let[t]of this.clients)t.close();return this.clients.clear(),new Promise(t=>{this.wss?.close(()=>{this.httpServer?.close(()=>{this.running=!1,this.httpServer=null,this.wss=null,be("WebServer stopped"),t()})})})}}subscribeToMessages(){let t=an.on("webserver:message",n=>{let o=xrr(n.agentId),{messages:i}=n;this.messageCache.set(o,i),this.throttledSendDelta(o)}),r=an.on("webserver:agent_status",n=>{let o=xrr(n.agentId),{status:i,agentType:s,agentName:a,description:c}=n;if(i==="started")this.agents.set(o,{id:o,name:a||o,type:s||"unknown",status:"started",description:c,startedAt:Date.now()});else if(i==="ended"){let u=this.agents.get(o);u&&(u.status="ended")}else{let u=this.agents.get(o);u&&(u.status=i)}let l={type:"agent_status",agentId:o,payload:{status:i,agentType:s,agentName:a,description:c}};this.broadcastRaw(JSON.stringify(l))});this.unsubscribers.push(t,r)}throttledSendDelta(t){if(!this.throttleTimers.has(t)){let r=setTimeout(()=>{this.throttleTimers.delete(t),this.sendDeltaToAllClients(t)},this.THROTTLE_MS);this.throttleTimers.set(t,r)}}sendDeltaToAllClients(t){let r=this.messageCache.get(t)||[];for(let[n,o]of this.clients){if(n.readyState!==_z.WebSocket.OPEN)continue;let i=o.sentCounts.get(t)||0;if(r.length>i){let s=r.slice(i),a={type:"messages_delta",agentId:t,messages:s};n.send(JSON.stringify(a)),o.sentCounts.set(t,r.length)}}}broadcastRaw(t){for(let[r]of this.clients)r.readyState===_z.WebSocket.OPEN&&r.send(t)}sendSnapshot(t,r){let n={};for(let[i,s]of this.messageCache)n[i]=s,r.sentCounts.set(i,s.length);let o={type:"snapshot",payload:{agents:Array.from(this.agents.values()),messages:n}};t.send(JSON.stringify(o))}getAgents(){return Array.from(this.agents.values())}getMessagesForAgent(t){return this.messageCache.get(t)||[]}getAllMessages(){let t={};for(let[r,n]of this.messageCache)t[r]=n;return t}},Ez=new Sqe});var Wge=S((nis,Lrr)=>{var Tqe=[],Prr=0,Bp=(e,t)=>{Prr>=t&&Tqe.push(e)};Bp.WARN=1;Bp.INFO=2;Bp.DEBUG=3;Bp.reset=()=>{Tqe=[]};Bp.setDebugLevel=e=>{Prr=e};Bp.warn=e=>Bp(e,Bp.WARN);Bp.info=e=>Bp(e,Bp.INFO);Bp.debug=e=>Bp(e,Bp.DEBUG);Bp.debugMessages=()=>Tqe;Lrr.exports=Bp});var Urr=S((ois,Frr)=>{"use strict";Frr.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Grr=S((iis,Qrr)=>{"use strict";var Kmo=Urr();Qrr.exports=e=>typeof e=="string"?e.replace(Kmo(),""):e});var qrr=S((sis,bqe)=>{"use strict";var Hrr=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);bqe.exports=Hrr;bqe.exports.default=Hrr});var Yrr=S((ais,$rr)=>{"use strict";$rr.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var zrr=S((cis,yqe)=>{"use strict";var Jmo=Grr(),Zmo=qrr(),Xmo=Yrr(),Vrr=e=>{if(typeof e!="string"||e.length===0||(e=Jmo(e),e.length===0))return 0;e=e.replace(Xmo()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=Zmo(n)?2:1)}return t};yqe.exports=Vrr;yqe.exports.default=Vrr});var Cqe=S((lis,Jrr)=>{var Wrr=zrr();function jge(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function kb(e){let t=jge();return(""+e).replace(t,"").split(`
|
|
491
|
+
</system-reminder>`,isMeta:!0,timestamp:i,type:t,priority:n,category:r,foot:s}}getTodoStateHash(t){return t.map(r=>`${r.id}:${r.status}`).sort().join("|")}clearTodoReminders(t){let r=t||"default";for(let n of this.sessionState.remindersSent)n.startsWith(`todo_updated_${r}_`)&&this.sessionState.remindersSent.delete(n)}setupEventDispatcher(){this.addEventListener("session:startup",t=>{this.resetSession(),this.sessionState.sessionStartTime=Date.now(),this.sessionState.contextPresent=Object.keys(t.context||{}).length>0,Me("system_reminder_session_startup",{agentId:t.agentId||"default",contextKeys:Object.keys(t.context||{}).join(","),messageCount:String(t.messages||0),timestamp:String(t.timestamp||Date.now())})}),this.addEventListener("file:read",t=>{this.sessionState.lastFileAccess=Date.now()}),this.addEventListener("file:edited",t=>{}),this.addEventListener("agent:mentioned",t=>{this.createMentionReminder({type:"agent_mention",key:`agent_mention_${t.agentType}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST use the ${Xr} tool with subagent_type="${t.agentType}" to delegate this task to the specified agent. Provide a detailed, self-contained task description that fully captures the user's intent for the ${t.agentType} agent to execute.`,timestamp:t.timestamp})}),this.addEventListener("file:mentioned",t=>{this.createMentionReminder({type:"file_mention",key:`file_mention_${t.filePath}_${t.timestamp}`,category:"general",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST read the entire content of the file at path: ${t.filePath} using the Read tool to understand the full context before proceeding with the user's request.`,timestamp:t.timestamp})}),this.addEventListener("ask-model:mentioned",t=>{this.createMentionReminder({type:"ask_model_mention",key:`ask_model_mention_${t.modelName}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.modelName}. You MUST use the AskExpertModelTool to consult this specific model for expert opinions and analysis. Provide the user's question or context clearly to get the most relevant response from ${t.modelName}.`,timestamp:t.timestamp})})}addEventListener(t,r){this.eventDispatcher.has(t)||this.eventDispatcher.set(t,[]),this.eventDispatcher.get(t).push(r)}emitEvent(t,r){(this.eventDispatcher.get(t)||[]).forEach(o=>{try{o(r)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}createMentionReminder(t){if(!this.sessionState.remindersSent.has(t.key)){this.sessionState.remindersSent.add(t.key);let r=this.createReminderMessage(t.type,t.category,t.priority,t.content,t.timestamp);this.reminderCache.set(t.key,r)}}resetSession(){this.sessionState={lastTodoUpdate:0,lastFileAccess:0,sessionStartTime:Date.now(),remindersSent:new Set,contextPresent:!1,reminderCount:0,config:{...this.sessionState.config}},this.reminderCache.clear()}updateConfig(t){this.sessionState.config={...this.sessionState.config,...t}}getSessionState(){return{...this.sessionState}}},qG=new nqe,oqe=async(e=!1,t)=>await qG.generateReminders(e,t),zfo=e=>qG.generateFileChangeReminder(e),Hd=(e,t)=>qG.emitEvent(e,t),sN=()=>qG.resetSession(),Wfo=()=>qG.getSessionState()});import{readFileSync as vrr,existsSync as Yge}from"fs";import{join as Eqe,extname as Qmo,resolve as Crr,dirname as Gmo}from"path";import{fileURLToPath as Hmo}from"url";function Rrr(){let e=Gmo(Hmo(import.meta.url));return[Crr(e,"webServer"),Crr(e,"client")]}function Drr(e,t){let n=new URL(e.url||"/",`http://${e.headers.host}`).pathname;if(t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){t.writeHead(204),t.end();return}if(n.startsWith("/api/")){Vmo(n,e,t);return}if(n==="/debug"){Ymo(t);return}zmo(n,t)}function Ymo(e){let r=Rrr().map(n=>({dir:n,exists:Yge(n),hasIndex:Yge(Eqe(n,"index.html"))}));zG(e,200,{cwd:process.cwd(),staticDirs:r,nodeVersion:process.version})}function Vmo(e,t,r){let n=()=>Promise.resolve().then(()=>(hz(),Vge)).then(i=>i.webServerService);if(r.setHeader("Content-Type","application/json; charset=utf-8"),e==="/api/status"){n().then(i=>{zG(r,200,{running:i.isRunning(),url:i.getUrl(),agentCount:i.getAgents().length,uptime:process.uptime()})});return}if(e==="/api/agents"){n().then(i=>{zG(r,200,i.getAgents())});return}if(e==="/api/messages"){n().then(i=>{zG(r,200,i.getAllMessages())});return}let o=e.match(/^\/api\/agents\/([^/]+)\/messages$/);if(o){let i=decodeURIComponent(o[1]);n().then(s=>{zG(r,200,s.getMessagesForAgent(i))});return}zG(r,404,{error:"Not Found"})}function zmo(e,t){(e==="/"||e==="/index.html")&&(e="/index.html");let r=Rrr();if(Irr(e,r,t))return;let o=$mo[e];if(o){for(let i of o)if(i!==e&&Irr(i,r,t))return}for(let i of r){let s=Eqe(i,"index.html");if(Yge(s))try{let a=vrr(s);t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end(a);return}catch{}}t.writeHead(404,{"Content-Type":"text/plain"}),t.end("Not Found")}function Irr(e,t,r){for(let n of t){let o=Eqe(n,e);if(Yge(o)){let i=Qmo(o),s=qmo[i]||"application/octet-stream";try{let a=vrr(o);return r.writeHead(200,{"Content-Type":s}),r.end(a),!0}catch{}}}return!1}function zG(e,t,r){e.writeHead(t,{"Content-Type":"application/json; charset=utf-8"}),e.end(JSON.stringify(r))}var qmo,$mo,Nrr=Q(()=>{qmo={".html":"text/html; charset=utf-8",".js":"application/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".ico":"image/x-icon"};$mo={"/style.css":["/style.css","/styles/terminal.css","/terminal.css"]}});var Vge={};ra(Vge,{webServerService:()=>Ez});import*as Orr from"http";function xrr(e){return!e||e==="defalt"||e==="default"?"main":e}var _z,Sqe,Ez,hz=Q(()=>{_z=G(vHe(),1);Ll();zr();Be();Nrr();Sqe=class{httpServer=null;wss=null;clients=new Map;unsubscribers=[];running=!1;port=3210;host="127.0.0.1";agents=new Map;messageCache=new Map;throttleTimers=new Map;THROTTLE_MS=50;isRunning(){return this.running}getPort(){return this.port}getHost(){return this.host}getUrl(){return`http://${this.host}:${this.port}`}async start(){if(this.running)return;let t=Lt().webServer;return this.port=t?.port||3210,this.host=t?.host||"127.0.0.1",this.agents.has("main")||this.agents.set("main",{id:"main",name:"Main",type:"main",status:"running",startedAt:Date.now()}),this.subscribeToMessages(),new Promise((r,n)=>{let o=()=>{let s=Orr.createServer((c,l)=>{Drr(c,l)}),a=new _z.WebSocketServer({server:s,path:"/ws"});return a.on("error",()=>{}),a.on("connection",c=>{let l={sentCounts:new Map};this.clients.set(c,l),be("WebServer: \u65B0\u5BA2\u6237\u7AEF\u8FDE\u63A5"),this.sendSnapshot(c,l),c.on("message",u=>{try{JSON.parse(u.toString()).type==="ping"&&c.send(JSON.stringify({type:"pong"}))}catch{}}),c.on("close",()=>{this.clients.delete(c),be("WebServer: \u5BA2\u6237\u7AEF\u65AD\u5F00")}),c.on("error",u=>{he("WebServer WS error:",u),this.clients.delete(c)})}),{httpServer:s,wss:a}},i=(s,a)=>{let{httpServer:c,wss:l}=o();c.once("error",u=>{u.code==="EADDRINUSE"&&a>0?(be(`WebServer: \u7AEF\u53E3 ${s} \u88AB\u5360\u7528\uFF0C\u5C1D\u8BD5 ${s+1}`),c.close(),l.close(),i(s+1,a-1)):n(u)}),c.listen(s,this.host,()=>{this.httpServer=c,this.wss=l,this.port=s,this.running=!0,be(`WebServer started at http://${this.host}:${s}`),r()})};i(this.port,100)})}async stop(){if(this.running){this.unsubscribers.forEach(t=>t()),this.unsubscribers=[];for(let t of this.throttleTimers.values())clearTimeout(t);this.throttleTimers.clear();for(let[t]of this.clients)t.close();return this.clients.clear(),new Promise(t=>{this.wss?.close(()=>{this.httpServer?.close(()=>{this.running=!1,this.httpServer=null,this.wss=null,be("WebServer stopped"),t()})})})}}subscribeToMessages(){let t=an.on("webserver:message",n=>{let o=xrr(n.agentId),{messages:i}=n;this.messageCache.set(o,i),this.throttledSendDelta(o)}),r=an.on("webserver:agent_status",n=>{let o=xrr(n.agentId),{status:i,agentType:s,agentName:a,description:c}=n;if(i==="started")this.agents.set(o,{id:o,name:a||o,type:s||"unknown",status:"started",description:c,startedAt:Date.now()});else if(i==="ended"){let u=this.agents.get(o);u&&(u.status="ended")}else{let u=this.agents.get(o);u&&(u.status=i)}let l={type:"agent_status",agentId:o,payload:{status:i,agentType:s,agentName:a,description:c}};this.broadcastRaw(JSON.stringify(l))});this.unsubscribers.push(t,r)}throttledSendDelta(t){if(!this.throttleTimers.has(t)){let r=setTimeout(()=>{this.throttleTimers.delete(t),this.sendDeltaToAllClients(t)},this.THROTTLE_MS);this.throttleTimers.set(t,r)}}sendDeltaToAllClients(t){let r=this.messageCache.get(t)||[];for(let[n,o]of this.clients){if(n.readyState!==_z.WebSocket.OPEN)continue;let i=o.sentCounts.get(t)||0;if(r.length>i){let s=r.slice(i),a={type:"messages_delta",agentId:t,messages:s};n.send(JSON.stringify(a)),o.sentCounts.set(t,r.length)}}}broadcastRaw(t){for(let[r]of this.clients)r.readyState===_z.WebSocket.OPEN&&r.send(t)}sendSnapshot(t,r){let n={};for(let[i,s]of this.messageCache)n[i]=s,r.sentCounts.set(i,s.length);let o={type:"snapshot",payload:{agents:Array.from(this.agents.values()),messages:n}};t.send(JSON.stringify(o))}getAgents(){return Array.from(this.agents.values())}getMessagesForAgent(t){return this.messageCache.get(t)||[]}getAllMessages(){let t={};for(let[r,n]of this.messageCache)t[r]=n;return t}},Ez=new Sqe});var Wge=S((nis,Lrr)=>{var Tqe=[],Prr=0,Bp=(e,t)=>{Prr>=t&&Tqe.push(e)};Bp.WARN=1;Bp.INFO=2;Bp.DEBUG=3;Bp.reset=()=>{Tqe=[]};Bp.setDebugLevel=e=>{Prr=e};Bp.warn=e=>Bp(e,Bp.WARN);Bp.info=e=>Bp(e,Bp.INFO);Bp.debug=e=>Bp(e,Bp.DEBUG);Bp.debugMessages=()=>Tqe;Lrr.exports=Bp});var Urr=S((ois,Frr)=>{"use strict";Frr.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Grr=S((iis,Qrr)=>{"use strict";var Kmo=Urr();Qrr.exports=e=>typeof e=="string"?e.replace(Kmo(),""):e});var qrr=S((sis,bqe)=>{"use strict";var Hrr=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);bqe.exports=Hrr;bqe.exports.default=Hrr});var Yrr=S((ais,$rr)=>{"use strict";$rr.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var zrr=S((cis,yqe)=>{"use strict";var Jmo=Grr(),Zmo=qrr(),Xmo=Yrr(),Vrr=e=>{if(typeof e!="string"||e.length===0||(e=Jmo(e),e.length===0))return 0;e=e.replace(Xmo()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=Zmo(n)?2:1)}return t};yqe.exports=Vrr;yqe.exports.default=Vrr});var Cqe=S((lis,Jrr)=>{var Wrr=zrr();function jge(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function kb(e){let t=jge();return(""+e).replace(t,"").split(`
|
|
492
492
|
`).reduce(function(o,i){return Wrr(i)>o?Wrr(i):o},0)}function Sz(e,t){return Array(t+1).join(e)}function ego(e,t,r,n){let o=kb(e);if(t+1>=o){let i=t-o;switch(n){case"right":{e=Sz(r,i)+e;break}case"center":{let s=Math.ceil(i/2),a=i-s;e=Sz(r,a)+e+Sz(r,s);break}default:{e=e+Sz(r,i);break}}}return e}var WG={};function Tz(e,t,r){t="\x1B["+t+"m",r="\x1B["+r+"m",WG[t]={set:e,to:!0},WG[r]={set:e,to:!1},WG[e]={on:t,off:r}}Tz("bold",1,22);Tz("italics",3,23);Tz("underline",4,24);Tz("inverse",7,27);Tz("strikethrough",9,29);function jrr(e,t){let r=t[1]?parseInt(t[1].split(";")[0]):0;if(r>=30&&r<=39||r>=90&&r<=97){e.lastForegroundAdded=t[0];return}if(r>=40&&r<=49||r>=100&&r<=107){e.lastBackgroundAdded=t[0];return}if(r===0){for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&delete e[o];return}let n=WG[t[0]];n&&(e[n.set]=n.to)}function tgo(e){let t=jge(!0),r=t.exec(e),n={};for(;r!==null;)jrr(n,r),r=t.exec(e);return n}function Krr(e,t){let r=e.lastBackgroundAdded,n=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){e[o]&&(t+=WG[o].off)}),r&&r!="\x1B[49m"&&(t+="\x1B[49m"),n&&n!="\x1B[39m"&&(t+="\x1B[39m"),t}function rgo(e,t){let r=e.lastBackgroundAdded,n=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){e[o]&&(t=WG[o].on+t)}),r&&r!="\x1B[49m"&&(t=r+t),n&&n!="\x1B[39m"&&(t=n+t),t}function ngo(e,t){if(e.length===kb(e))return e.substr(0,t);for(;kb(e)>t;)e=e.slice(0,-1);return e}function ogo(e,t){let r=jge(!0),n=e.split(jge()),o=0,i=0,s="",a,c={};for(;i<t;){a=r.exec(e);let l=n[o];if(o++,i+kb(l)>t&&(l=ngo(l,t-i)),s+=l,i+=kb(l),i<t){if(!a)break;s+=a[0],jrr(c,a)}}return Krr(c,s)}function igo(e,t,r){if(r=r||"\u2026",kb(e)<=t)return e;t-=kb(r);let o=ogo(e,t);o+=r;let i="\x1B]8;;\x07";return e.includes(i)&&!o.includes(i)&&(o+=i),o}function sgo(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function ago(e,t){e=e||{},t=t||sgo();let r=Object.assign({},t,e);return r.chars=Object.assign({},t.chars,e.chars),r.style=Object.assign({},t.style,e.style),r}function cgo(e,t){let r=[],n=t.split(/(\s+)/g),o=[],i=0,s;for(let a=0;a<n.length;a+=2){let c=n[a],l=i+kb(c);i>0&&s&&(l+=s.length),l>e?(i!==0&&r.push(o.join("")),o=[c],i=kb(c)):(o.push(s||"",c),i=l),s=n[a+1]}return i&&r.push(o.join("")),r}function lgo(e,t){let r=[],n="";function o(s,a){for(n.length&&a&&(n+=a),n+=s;n.length>e;)r.push(n.slice(0,e)),n=n.slice(e)}let i=t.split(/(\s+)/g);for(let s=0;s<i.length;s+=2)o(i[s],s&&i[s-1]);return n.length&&r.push(n),r}function ugo(e,t,r=!0){let n=[];t=t.split(`
|
|
493
493
|
`);let o=r?cgo:lgo;for(let i=0;i<t.length;i++)n.push.apply(n,o(e,t[i]));return n}function dgo(e){let t={},r=[];for(let n=0;n<e.length;n++){let o=rgo(t,e[n]);t=tgo(o);let i=Object.assign({},t);r.push(Krr(i,o))}return r}function pgo(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}Jrr.exports={strlen:kb,repeat:Sz,pad:ego,truncate:igo,mergeOptions:ago,wordWrap:ugo,colorizeLines:dgo,hyperlink:pgo}});var tnr=S((uis,enr)=>{var Xrr={};enr.exports=Xrr;var Zrr={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Zrr).forEach(function(e){var t=Zrr[e],r=Xrr[e]=[];r.open="\x1B["+t[0]+"m",r.close="\x1B["+t[1]+"m"})});var nnr=S((dis,rnr)=>{"use strict";rnr.exports=function(e,t){t=t||process.argv;var r=t.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",o=t.indexOf(n+e);return o!==-1&&(r===-1?!0:o<r)}});var inr=S((pis,onr)=>{"use strict";var fgo=se("os"),AS=nnr(),Mf=process.env,jG=void 0;AS("no-color")||AS("no-colors")||AS("color=false")?jG=!1:(AS("color")||AS("colors")||AS("color=true")||AS("color=always"))&&(jG=!0);"FORCE_COLOR"in Mf&&(jG=Mf.FORCE_COLOR.length===0||parseInt(Mf.FORCE_COLOR,10)!==0);function mgo(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ggo(e){if(jG===!1)return 0;if(AS("color=16m")||AS("color=full")||AS("color=truecolor"))return 3;if(AS("color=256"))return 2;if(e&&!e.isTTY&&jG!==!0)return 0;var t=jG?1:0;if(process.platform==="win32"){var r=fgo.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Mf)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in Mf})||Mf.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Mf)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Mf.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Mf){var n=parseInt((Mf.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Mf.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Mf.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Mf.TERM)||"COLORTERM"in Mf?1:(Mf.TERM==="dumb",t)}function Iqe(e){var t=ggo(e);return mgo(t)}onr.exports={supportsColor:Iqe,stdout:Iqe(process.stdout),stderr:Iqe(process.stderr)}});var anr=S((fis,snr)=>{snr.exports=function(t,r){var n="";t=t||"Run the trap, drop the bass",t=t.split("");var o={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(i){i=i.toLowerCase();var s=o[i]||[" "],a=Math.floor(Math.random()*s.length);typeof o[i]<"u"?n+=o[i][a]:n+=i}),n}});var lnr=S((mis,cnr)=>{cnr.exports=function(t,r){t=t||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},o=[].concat(n.up,n.down,n.mid);function i(c){var l=Math.floor(Math.random()*c);return l}function s(c){var l=!1;return o.filter(function(u){l=u===c}),l}function a(c,l){var u="",d,p;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",c=c.split("");for(p in c)if(!s(p)){switch(u=u+c[p],d={up:0,down:0,mid:0},l.size){case"mini":d.up=i(8),d.mid=i(2),d.down=i(8);break;case"maxi":d.up=i(16)+3,d.mid=i(4)+1,d.down=i(64)+3;break;default:d.up=i(8)+1,d.mid=i(6)/2,d.down=i(8)+1;break}var f=["up","mid","down"];for(var A in f)for(var h=f[A],_=0;_<=d[h];_++)l[h]&&(u=u+n[h][i(n[h].length)])}return u}return a(t,r)}});var dnr=S((gis,unr)=>{unr.exports=function(e){return function(t,r,n){if(t===" ")return t;switch(r%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var fnr=S((Ais,pnr)=>{pnr.exports=function(e){return function(t,r,n){return r%2===0?t:e.inverse(t)}}});var gnr=S((his,mnr)=>{mnr.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(r,n,o){return r===" "?r:e[t[n++%t.length]](r)}}});var hnr=S((_is,Anr)=>{Anr.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,o){return r===" "?r:e[t[Math.round(Math.random()*(t.length-2))]](r)}}});var ynr=S((Sis,bnr)=>{var Uo={};bnr.exports=Uo;Uo.themes={};var Ago=se("util"),WM=Uo.styles=tnr(),Enr=Object.defineProperties,hgo=new RegExp(/[\r\n]+/g);Uo.supportsColor=inr().supportsColor;typeof Uo.enabled>"u"&&(Uo.enabled=Uo.supportsColor()!==!1);Uo.enable=function(){Uo.enabled=!0};Uo.disable=function(){Uo.enabled=!1};Uo.stripColors=Uo.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var Eis=Uo.stylize=function(t,r){if(!Uo.enabled)return t+"";var n=WM[r];return!n&&r in Uo?Uo[r](t):n.open+t+n.close},_go=/[|\\{}()[\]^$+*?.]/g,Ego=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(_go,"\\$&")};function Snr(e){var t=function r(){return Tgo.apply(r,arguments)};return t._styles=e,t.__proto__=Sgo,t}var Tnr=(function(){var e={};return WM.grey=WM.gray,Object.keys(WM).forEach(function(t){WM[t].closeRe=new RegExp(Ego(WM[t].close),"g"),e[t]={get:function(){return Snr(this._styles.concat(t))}}}),e})(),Sgo=Enr(function(){},Tnr);function Tgo(){var e=Array.prototype.slice.call(arguments),t=e.map(function(s){return s!=null&&s.constructor===String?s:Ago.inspect(s)}).join(" ");if(!Uo.enabled||!t)return t;for(var r=t.indexOf(`
|
|
494
494
|
`)!=-1,n=this._styles,o=n.length;o--;){var i=WM[n[o]];t=i.open+t.replace(i.closeRe,i.open)+i.close,r&&(t=t.replace(hgo,function(s){return i.close+s+i.open}))}return t}Uo.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(r){Uo[r]=function(n){if(typeof e[r]=="object"){var o=n;for(var i in e[r])o=Uo[e[r][i]](o);return o}return Uo[e[r]](n)}})(t)};function bgo(){var e={};return Object.keys(Tnr).forEach(function(t){e[t]={get:function(){return Snr([t])}}}),e}var ygo=function(t,r){var n=r.split("");return n=n.map(t),n.join("")};Uo.trap=anr();Uo.zalgo=lnr();Uo.maps={};Uo.maps.america=dnr()(Uo);Uo.maps.zebra=fnr()(Uo);Uo.maps.rainbow=gnr()(Uo);Uo.maps.random=hnr()(Uo);for(_nr in Uo.maps)(function(e){Uo[e]=function(t){return ygo(Uo.maps[e],t)}})(_nr);var _nr;Enr(Uo,bgo())});var Inr=S((Tis,Cnr)=>{var Cgo=ynr();Cnr.exports=Cgo});var Nnr=S((bis,Kge)=>{var{info:Igo,debug:Dnr}=Wge(),hA=Cqe(),Rqe=class e{constructor(t){this.setOptions(t),this.x=null,this.y=null}setOptions(t){["boolean","number","bigint","string"].indexOf(typeof t)!==-1&&(t={content:""+t}),t=t||{},this.options=t;let r=t.content;if(["boolean","number","bigint","string"].indexOf(typeof r)!==-1)this.content=String(r);else if(!r)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof r);this.colSpan=t.colSpan||1,this.rowSpan=t.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(t,r){this.cells=r;let n=this.options.chars||{},o=t.chars,i=this.chars={};Rgo.forEach(function(c){vqe(n,o,c,i)}),this.truncate=this.options.truncate||t.truncate;let s=this.options.style=this.options.style||{},a=t.style;vqe(s,a,"padding-left",this),vqe(s,a,"padding-right",this),this.head=s.head||a.head,this.border=s.border||a.border,this.fixedWidth=t.colWidths[this.x],this.lines=this.computeLines(t),this.desiredWidth=hA.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(t){let r=t.wordWrap||t.textWrap,{wordWrap:n=r}=this.options;if(this.fixedWidth&&n){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;for(;s<this.colSpan;)this.fixedWidth+=t.colWidths[this.x+s],s++}let{wrapOnWordBoundary:o=!0}=t,{wrapOnWordBoundary:i=o}=this.options;return this.wrapLines(hA.wordWrap(this.fixedWidth,this.content,i))}return this.wrapLines(this.content.split(`
|
|
@@ -676,7 +676,7 @@ globstar while`,t,p,r,f,A),this.matchOne(t.slice(p),r.slice(f),n))return this.de
|
|
|
676
676
|
`)),RFn(e,o,{encoding:r,flush:!0})}var XQt=new cle.default({fetchMethod:e=>BFn(e),ttl:300*1e3,ttlAutopurge:!1,max:1e3});async function aGt(e){let t=L$(e);return XQt.get(t)||XQt.fetchMethod?.(t)}async function BFn(e){let t=new AbortController;setTimeout(()=>{t.abort()},1e3);let r=await Xwt(e,t.signal,15),n=0;for(let o of r)pw(o)==="CRLF"&&n++;return n>3?"CRLF":"LF"}function cGt(e,t,r){if(e.has(t))return e.get(t);let n=r();return e.set(t,n),n}var kFn=new cle.default({fetchMethod:e=>lGt(e),ttl:300*1e3,ttlAutopurge:!1,max:1e3});function Rm(e){let t=L$(e);return cGt(kFn,t,()=>lGt(t))}function lGt(e){let r=Buffer.alloc(4096),n;try{n=eGt(e,"r");let o=tGt(n,r,0,4096,0);return o===0?"utf8":o>=2&&r[0]===255&&r[1]===254?"utf16le":o>=3&&r[0]===239&&r[1]===187&&r[2]===191||r.slice(0,o).toString("utf8").length>0?"utf8":"ascii"}catch(o){return Re(`Error detecting encoding for file ${e}: ${o}`),"utf8"}finally{n&&rGt(n)}}var PFn=new cle.default({fetchMethod:e=>uGt(e),ttl:300*1e3,ttlAutopurge:!1,max:1e3});function pw(e){let t=L$(e);return cGt(PFn,t,()=>uGt(t))}function uGt(e,t="utf8"){try{if(!nGt(e).isFile())return"LF";let n=Buffer.alloc(4096),o=eGt(e,"r"),i=tGt(o,n,0,4096,0);rGt(o);let s=n.toString(t,0,i),a=0,c=0;for(let l=0;l<s.length;l++)s[l]===`
|
|
677
677
|
`&&(l>0&&s[l-1]==="\r"?a++:c++);return a>c?"CRLF":"LF"}catch(r){return Re(`Error detecting line endings for file ${e}: ${r}`),"LF"}}function BBe(e){let t=oGt(e)?e:L$(Fe(),e);return t.endsWith(" AM.png")?t.replace(" AM.png","\u202FAM.png"):t.endsWith(" PM.png")?t.replace(" PM.png","\u202FPM.png"):t}function kBe(e){return e?oGt(e)?e:L$(Fe(),e):void 0}function dGt(e){try{let t=kBe(e),r=t?OFn(Fe(),t):void 0;return{absolutePath:t,relativePath:r}}catch(t){return he("getAbsoluteAndRelativePaths error ",t),{absolutePath:null,relativePath:null}}}function ule(e){try{let t=wFn(e),r=KQt(e,JQt(e));if(!DFn(t))return;let i=NFn(t).filter(s=>KQt(s,JQt(s))===r&&MFn(t,s)!==e)[0];return i||void 0}catch(t){Re(`Error finding similar file for ${e}: ${t}`);return}}function PBe(){let e=process.env.HAWA_CODE_COMPACT_LINE_PREFIX;return!(e==="0"||e==="false")}function cD({content:e,startLine:t}){if(!e)return"";let r=e.split(/\r?\n/);return PBe()?r.map((n,o)=>`${o+t} ${n}`).join(`
|
|
678
678
|
`):r.map((n,o)=>{let i=String(o+t);return i.length>=6?`${i}\u2192${n}`:`${i.padStart(6," ")}\u2192${n}`}).join(`
|
|
679
|
-
`)}function pGt(e){try{let t=xFn(e),r=t.readSync();return t.closeSync(),r===null}catch(t){return Re(`Error checking directory: ${t}`),!1}}$e();function oD(){let e=Qn();e.hasCompletedProjectOnboarding||xi({...e,hasCompletedProjectOnboarding:!0})}function QFn(){let e=hr();bo({...e,lastReleaseNotesSeen:MACRO.VERSION})}function LBe({workspaceDir:e}){let r=!Qn().hasCompletedProjectOnboarding,o=hr().lastReleaseNotesSeen,i=[];(!o||(0,fGt.gt)(MACRO.VERSION,o))&&(i=Dce[MACRO.VERSION]||[]);let s=i.length>0;if(Hi.useEffect(()=>{s&&!r&&QFn()},[s,r]),!r&&!s)return null;let a=LFn(FFn(e,_i)),c=pGt(e),l=!a&&!c,u=_U.isEnabled&&!hr().shiftEnterKeyBindingInstalled,d=X();return Hi.createElement(D,{flexDirection:"column",gap:1,padding:1,paddingBottom:0},r&&Hi.createElement(Hi.Fragment,null,Hi.createElement(I,{color:d.secondaryText},"Tips for getting started:"),Hi.createElement(vd,{children:[]},(()=>{let p=[];return c&&p.push(Hi.createElement(vd.Item,{key:"workspace"},Hi.createElement(I,{color:d.secondaryText},"Ask ",Je," to create a new app or clone a repository."))),l&&p.push(Hi.createElement(vd.Item,{key:"claudemd"},Hi.createElement(I,{color:d.secondaryText},"Run ",Hi.createElement(I,{color:d.text},"/init")," to create a",_i," file with instructions for Hawa code."))),u&&p.push(Hi.createElement(vd.Item,{key:"terminal"},Hi.createElement(I,{color:d.secondaryText},"Run ",Hi.createElement(I,{color:d.text},"/terminal-setup"),Hi.createElement(I,{bold:!1}," to set up terminal integration")))),p.push(Hi.createElement(vd.Item,{key:"questions"},Hi.createElement(I,{color:d.secondaryText},"Ask ",Je," questions about your codebase."))),p.push(Hi.createElement(vd.Item,{key:"changes"},Hi.createElement(I,{color:d.secondaryText},"Ask ",Je," to implement changes to your codebase."))),p})())),!r&&s&&Hi.createElement(D,{borderColor:X().secondaryBorder,flexDirection:"column",marginRight:1},Hi.createElement(D,{flexDirection:"column",gap:0},Hi.createElement(D,{marginBottom:1},Hi.createElement(I,null,"\u{1F195} What's new in v",MACRO.VERSION,":")),Hi.createElement(D,{flexDirection:"column",marginLeft:1},i.map((p,f)=>Hi.createElement(I,{key:f,color:X().secondaryText},"\u2022 ",p))))),e===UFn()&&Hi.createElement(I,{color:X().warning},"Note: You have launched ",Hi.createElement(I,{bold:!0},Je)," in your home directory. For the best experience, launch it in a project directory instead."))}var BU=G(ce(),1);var MU=G(ce(),1);var F$=G(ce(),1);function FBe({isFocused:e,isSelected:t,smallPointer:r,children:n}){let{styles:o}=is("Select");return F$.default.createElement(D,{...o.option({isFocused:e})},e&&F$.default.createElement(I,{...o.focusIndicator()},r?en.triangleDownSmall:en.pointer),F$.default.createElement(I,{...o.label({isFocused:e,isSelected:t})},n),t&&F$.default.createElement(I,{...o.selectedIndicator()},en.tick))}var Dm=G(ce(),1);import{isDeepStrictEqual as GFn}from"node:util";var U$=class extends Map{first;constructor(t){let r=[],n,o,i=0;for(let s of t){let a={...s,previous:o,next:void 0,index:i};o&&(o.next=a),n||=a;let c="value"in s?s.value:UBe(s);r.push([c,a]),i++,o=a}super(r),this.first=n}};var HFn=(e,t)=>{switch(t.type){case"focus-next-option":{if(!e.focusedValue)return e;let r=e.optionMap.get(e.focusedValue);if(!r)return e;let n=r.next;for(;n&&!("value"in n);)n=n.next;if(!n)return e;if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let i=Math.min(e.optionMap.size,e.visibleToIndex+1),s=i-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:s,visibleToIndex:i}}case"focus-previous-option":{if(!e.focusedValue)return e;let r=e.optionMap.get(e.focusedValue);if(!r)return e;let n=r.previous;for(;n&&!("value"in n);)n=n.previous;if(!n)return e;if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let i=Math.max(0,e.visibleFromIndex-1),s=i+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:i,visibleToIndex:s}}case"select-focused-option":return{...e,previousValue:e.value,value:e.focusedValue};case"reset":return t.state;case"set-focus":return{...e,focusedValue:t.value}}},QBe=e=>e.flatMap(t=>{if("options"in t){let r=QBe(t.options),n=r.flatMap(i=>"value"in i?i.value:[]);return[...t.header!==void 0?[{header:t.header,optionValues:n}]:[],...r]}return t}),mGt=({visibleOptionCount:e,defaultValue:t,options:r})=>{let n=QBe(r),o=typeof e=="number"?Math.min(e,n.length):n.length,i=new U$(n),s=i.first,a=s&&"value"in s?s.value:void 0;return{optionMap:i,visibleOptionCount:o,focusedValue:a,visibleFromIndex:0,visibleToIndex:o,previousValue:t,value:t}},GBe=({visibleOptionCount:e=5,options:t,defaultValue:r,onChange:n,onFocus:o,focusValue:i})=>{let s=QBe(t),[a,c]=(0,Dm.useReducer)(HFn,{visibleOptionCount:e,defaultValue:r,options:t},mGt),[l,u]=(0,Dm.useState)(s);s!==l&&!GFn(s,l)&&(c({type:"reset",state:mGt({visibleOptionCount:e,defaultValue:r,options:t})}),u(s));let d=(0,Dm.useCallback)(()=>{c({type:"focus-next-option"})},[]),p=(0,Dm.useCallback)(()=>{c({type:"focus-previous-option"})},[]),f=(0,Dm.useCallback)(()=>{c({type:"select-focused-option"})},[]),A=(0,Dm.useMemo)(()=>s.map((h,_)=>({...h,index:_})).slice(a.visibleFromIndex,a.visibleToIndex),[s,a.visibleFromIndex,a.visibleToIndex]);return(0,Dm.useEffect)(()=>{a.value&&a.previousValue!==a.value&&n?.(a.value)},[a.previousValue,a.value,t,n]),(0,Dm.useEffect)(()=>{a.focusedValue&&o?.(a.focusedValue)},[a.focusedValue,o]),(0,Dm.useEffect)(()=>{i&&c({type:"set-focus",value:i})},[i]),{focusedValue:a.focusedValue,visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex,value:a.value,visibleOptions:A,focusNextOption:d,focusPreviousOption:p,selectFocusedOption:f}};var HBe=({isDisabled:e=!1,state:t})=>{Nt((r,n)=>{n.downArrow&&t.focusNextOption(),n.upArrow&&t.focusPreviousOption(),n.return&&t.selectFocusedOption()},{isActive:!e})};var UBe=e=>`HEADER-${e.optionValues.join(",")}`;function $C({isDisabled:e=!1,visibleOptionCount:t=5,highlightText:r,options:n,defaultValue:o,onChange:i,onFocus:s,focusValue:a}){let c=GBe({visibleOptionCount:t,options:n,defaultValue:o,onChange:i,onFocus:s,focusValue:a});HBe({isDisabled:e,state:c});let{styles:l}=is("Select");return MU.default.createElement(D,{...l.container()},c.visibleOptions.map(u=>{let d="value"in u?u.value:UBe(u),p=!e&&c.focusedValue!==void 0&&("value"in u?c.focusedValue===u.value:u.optionValues.includes(c.focusedValue)),f=!!c.value&&("value"in u?c.value===u.value:u.optionValues.includes(c.value)),A="header"in u,h="label"in u?u.label:u.header,_=h;if(r&&h.includes(r)){let T=h.indexOf(r);_=MU.default.createElement(MU.default.Fragment,null,h.slice(0,T),MU.default.createElement(I,{...l.highlightedText()},r),h.slice(T+r.length))}return MU.default.createElement(FBe,{key:d,isFocused:p,isSelected:f,smallPointer:A},_)}))}function gGt({onDone:e}){return Nt((t,r)=>{(r.ctrl&&(t==="c"||t==="d")||r.escape)&&e()}),BU.default.createElement(D,{flexDirection:"column",borderStyle:"round",padding:1,borderColor:X().secondaryBorder},BU.default.createElement(D,{marginBottom:1,flexDirection:"column"},BU.default.createElement(I,{bold:!0},"You've spent $5 this session.")),BU.default.createElement(D,null,BU.default.createElement($C,{options:[{value:"ok",label:"Got it, thanks!"}],onChange:e})))}var Mn=G(ce(),1),Er=G(ce(),1);var Ef=G(ce(),1);$e();Mr();$e();Be();import qFn from"os";import $Fn from"path";import Q$ from"fs";var YFn={sources:{},routing:{}};function _Gt(){let e=qFn.homedir();return $Fn.join(e,lo,"config.json")}function AGt(){try{let e=_Gt();if(!Q$.existsSync(e))return YFn;let t=Q$.readFileSync(e,"utf-8"),r=JSON.parse(t);return r.sources&&r.routing?r:VFn(r)}catch(e){throw Re(e),e}}function VFn(e){let t={},r={};for(let[n,o]of Object.entries(e))if(o?.enable===!0&&o?.env){let i=o.env,s=n;t[s]={base_url:i.BASE_URL||"",auth_token:i.AUTH_TOKEN||"",api_type:i.API_TYPE||"anthropic",models:[]},i.MODEL&&(r.MODEL=[{source:s,model:i.MODEL,weight:100}],t[s].models.push(i.MODEL)),i.SMALL_FAST_MODEL&&(r.SMALL_FAST_MODEL=[{source:s,model:i.SMALL_FAST_MODEL,weight:100}],t[s].models.includes(i.SMALL_FAST_MODEL)||t[s].models.push(i.SMALL_FAST_MODEL));break}return{sources:t,routing:r}}function hGt(e){if(e.length===0)throw new Error("No items to select from");if(e.length===1)return e[0];let t=e.reduce((n,o)=>n+(o.weight??100),0),r=Math.random()*t;for(let n of e){let o=n.weight??100;if(r-=o,r<=0)return n}return e[e.length-1]}var qBe=class{config;constructor(){try{this.config=AGt()}catch(t){console.log(t)}}reload(){this.config=AGt()}getConfig(){return this.config}hasModelRouting(){return!!(this.config.routing?.MODEL&&this.config.routing.MODEL.length>0)}getModelRoutingModels(){let t=this.config.routing?.MODEL;return!t||t.length===0?[]:t.map(r=>r.model)}hasSmallFastModelRouting(){return!!(this.config.routing?.SMALL_FAST_MODEL&&this.config.routing.SMALL_FAST_MODEL.length>0)}getModel(){let t=this.config.routing?.MODEL;if(!t||t.length===0)throw new Error("No MODEL routing configuration found");let r=hGt(t);return`${r.source}__${r.model}`}getSmallFastModel(){let t=this.config.routing?.SMALL_FAST_MODEL;if(!t||t.length===0)throw new Error("No SMALL_FAST_MODEL routing configuration found");let r=hGt(t);return`${r.source}__${r.model}`}getSourceConfig(t){return this.config.sources?.[t]}parseModelKey(t){let r=t.indexOf("__");return r===-1?{source:"",model:t}:{source:t.slice(0,r),model:t.slice(r+2)}}getModelSourceConfig(t){let{source:r}=this.parseModelKey(t);if(r)return this.getSourceConfig(r)}setModelRouting(t){this.config.routing.MODEL=t,this.saveConfig()}setSmallFastModelRouting(t){this.config.routing.SMALL_FAST_MODEL=t,this.saveConfig()}getAvailableModels(){let t=[];for(let[r,n]of Object.entries(this.config.sources||{}))for(let o of n.models||[])t.push(`${r}__${o}`);return t}saveConfig(){try{let t=_Gt(),r={};if(Q$.existsSync(t)){let o=Q$.readFileSync(t,"utf-8");r=JSON.parse(o)}let n={...r,sources:this.config.sources,routing:this.config.routing};Q$.writeFileSync(t,JSON.stringify(n,null,2))}catch(t){Re(t)}}},Wo=new qBe;var zFn="1.38.1",JT={VERSION:zFn,PACKAGE_URL:"@dahawa/hawa-code",README_URL:"https://github.com/italking/hawa-code",ISSUES_EXPLAINER:"report the issue at https://github.com/italking/hawa-code/issues"};var $Be=46,EGt=["(\u2740\u2579\u25E1\u2579)","(\u25D5\u072B\u25D5)","\u239D(\u25D5u\u25D5)\u23A0","\u10DA(\u25C9\u25DE\u0C6A\u25DF\u25C9 )\u10DA","(\xB4\u25C9\u203F\u25C9\uFF40)","\u0E01\u0E47\u0295\u2022\u0361\u1D25\u2022\u0294 \u0E01\u0E49","\uFF0F/( \u25D5\u203F\u203F\u25D5 )\uFF3C"];function dle({isDefaultModel:e=!1}){let t=Math.max($Be,Fe().length+12),r=X(),n=EGt[Math.floor(Math.random()*EGt.length)];return Ef.createElement(D,{flexDirection:"column"},Ef.createElement(D,{flexDirection:"column",gap:1,paddingLeft:1,width:"100%"},Ef.createElement(I,null,Ef.createElement(I,null,n)," Welcome to"," ",Ef.createElement(I,{bold:!0},Je),Ef.createElement(I,{color:r.secondaryText}," v",JT.VERSION)),Ef.createElement(Ef.Fragment,null,Ef.createElement(D,{paddingLeft:2,flexDirection:"column",gap:1},Ef.createElement(I,{color:r.secondaryText,italic:!0},"/help for help"),Ef.createElement(I,{color:r.secondaryText},"cwd: ",Fe()),Ef.createElement(I,{color:r.secondaryText},"model: ",Wo.getConfig().routing.MODEL?.map(o=>`${o.source}__${o.model}`).join(", ")??"N/A"),Ef.createElement(I,{color:r.secondaryText},"small fast model: ",Wo.getConfig().routing.SMALL_FAST_MODEL?.map(o=>`${o.source}__${o.model}`).join(", ")??"N/A")))))}var HS=G(ce(),1);Be();var H7=G(ce(),1);import{randomUUID as FS}from"crypto";var SGt=()=>[],TGt=()=>{};function bGt(e){SGt=e}function ple(){return SGt}function yGt(e){TGt=e}function CGt(){return TGt}Be();Sr();Mr();Be();$e();import{existsSync as zC,readdirSync as A3n,statSync as h3n}from"fs";import{join as dD,relative as _3n}from"path";import{homedir as J9t}from"os";import{platform as E3n}from"process";import{readFile as pD}from"fs/promises";Mr();ZT();zr();import{join as XFn,sep as eUn}from"path";function Sf(){if(!Nm())return!1;try{let e=Lt();if(e.autoMemory?.teamMemoryEnabled!==void 0)return e.autoMemory.teamMemoryEnabled}catch{}return!1}function xm(){return(XFn(Fe(),".hcode","team-memory")+eUn).normalize("NFC")}function LU(e){let t=e.normalize("NFC"),r=xm();return t.startsWith(r)}var Z9t=G(Cle(),1);Zo();var z9t=G(Cle(),1);Mr();$e();Be();vm();import{readFile as Y9t}from"fs/promises";import{existsSync as cke,readdirSync as p3n,statSync as f3n}from"fs";import{join as lke,relative as W9t}from"path";import{homedir as m3n}from"os";function V9t(e){try{let t=(0,z9t.default)(e),r=t.data.paths,n=[];return typeof r=="string"?n=r.split(",").map(o=>o.trim()).filter(Boolean):Array.isArray(r)&&(n=r.filter(o=>typeof o=="string")),{paths:n,content:t.content.trim()}}catch(t){return Re(t),{paths:[],content:e.trim()}}}function g3n(e,t){return t.length===0?!0:t.some(r=>{try{return Dd(e,r,{matchBase:!0,dot:!0})}catch(n){return Re(n),!1}})}function uke(e){let t=[];try{if(!cke(e))return t;let r=p3n(e);for(let n of r){let o=lke(e,n),i=f3n(o);i.isDirectory()?t.push(...uke(o)):i.isFile()&&n.endsWith(".md")&&t.push(o)}}catch(r){Re(r)}return t}async function j9t(){let e=[];try{let t=lke(m3n(),lo,"rules");if(cke(t)){let r=uke(t);for(let n of r)try{let o=await Y9t(n,"utf-8"),{paths:i,content:s}=V9t(o);i.length>0&&e.push({filePath:n,content:s,paths:i,isProjectRule:!1})}catch(o){Re(o)}}}catch(t){Re(t)}try{let t=lke(Fe(),lo,"rules");if(cke(t)){let r=uke(t);for(let n of r)try{let o=await Y9t(n,"utf-8"),{paths:i,content:s}=V9t(o);i.length>0&&e.push({filePath:W9t(Fe(),n),content:s,paths:i,isProjectRule:!0})}catch(o){Re(o)}}}catch(t){Re(t)}return e}function K9t(e,t){e=lae(e);let r=lae(Fe()),n=e.startsWith(r)?W9t(r,e):e;return t.filter(o=>g3n(n,o.paths))}var S3n=`# hawaCodeMd
|
|
679
|
+
`)}function pGt(e){try{let t=xFn(e),r=t.readSync();return t.closeSync(),r===null}catch(t){return Re(`Error checking directory: ${t}`),!1}}$e();function oD(){let e=Qn();e.hasCompletedProjectOnboarding||xi({...e,hasCompletedProjectOnboarding:!0})}function QFn(){let e=hr();bo({...e,lastReleaseNotesSeen:MACRO.VERSION})}function LBe({workspaceDir:e}){let r=!Qn().hasCompletedProjectOnboarding,o=hr().lastReleaseNotesSeen,i=[];(!o||(0,fGt.gt)(MACRO.VERSION,o))&&(i=Dce[MACRO.VERSION]||[]);let s=i.length>0;if(Hi.useEffect(()=>{s&&!r&&QFn()},[s,r]),!r&&!s)return null;let a=LFn(FFn(e,_i)),c=pGt(e),l=!a&&!c,u=_U.isEnabled&&!hr().shiftEnterKeyBindingInstalled,d=X();return Hi.createElement(D,{flexDirection:"column",gap:1,padding:1,paddingBottom:0},r&&Hi.createElement(Hi.Fragment,null,Hi.createElement(I,{color:d.secondaryText},"Tips for getting started:"),Hi.createElement(vd,{children:[]},(()=>{let p=[];return c&&p.push(Hi.createElement(vd.Item,{key:"workspace"},Hi.createElement(I,{color:d.secondaryText},"Ask ",Je," to create a new app or clone a repository."))),l&&p.push(Hi.createElement(vd.Item,{key:"claudemd"},Hi.createElement(I,{color:d.secondaryText},"Run ",Hi.createElement(I,{color:d.text},"/init")," to create a",_i," file with instructions for Hawa code."))),u&&p.push(Hi.createElement(vd.Item,{key:"terminal"},Hi.createElement(I,{color:d.secondaryText},"Run ",Hi.createElement(I,{color:d.text},"/terminal-setup"),Hi.createElement(I,{bold:!1}," to set up terminal integration")))),p.push(Hi.createElement(vd.Item,{key:"questions"},Hi.createElement(I,{color:d.secondaryText},"Ask ",Je," questions about your codebase."))),p.push(Hi.createElement(vd.Item,{key:"changes"},Hi.createElement(I,{color:d.secondaryText},"Ask ",Je," to implement changes to your codebase."))),p})())),!r&&s&&Hi.createElement(D,{borderColor:X().secondaryBorder,flexDirection:"column",marginRight:1},Hi.createElement(D,{flexDirection:"column",gap:0},Hi.createElement(D,{marginBottom:1},Hi.createElement(I,null,"\u{1F195} What's new in v",MACRO.VERSION,":")),Hi.createElement(D,{flexDirection:"column",marginLeft:1},i.map((p,f)=>Hi.createElement(I,{key:f,color:X().secondaryText},"\u2022 ",p))))),e===UFn()&&Hi.createElement(I,{color:X().warning},"Note: You have launched ",Hi.createElement(I,{bold:!0},Je)," in your home directory. For the best experience, launch it in a project directory instead."))}var BU=G(ce(),1);var MU=G(ce(),1);var F$=G(ce(),1);function FBe({isFocused:e,isSelected:t,smallPointer:r,children:n}){let{styles:o}=is("Select");return F$.default.createElement(D,{...o.option({isFocused:e})},e&&F$.default.createElement(I,{...o.focusIndicator()},r?en.triangleDownSmall:en.pointer),F$.default.createElement(I,{...o.label({isFocused:e,isSelected:t})},n),t&&F$.default.createElement(I,{...o.selectedIndicator()},en.tick))}var Dm=G(ce(),1);import{isDeepStrictEqual as GFn}from"node:util";var U$=class extends Map{first;constructor(t){let r=[],n,o,i=0;for(let s of t){let a={...s,previous:o,next:void 0,index:i};o&&(o.next=a),n||=a;let c="value"in s?s.value:UBe(s);r.push([c,a]),i++,o=a}super(r),this.first=n}};var HFn=(e,t)=>{switch(t.type){case"focus-next-option":{if(!e.focusedValue)return e;let r=e.optionMap.get(e.focusedValue);if(!r)return e;let n=r.next;for(;n&&!("value"in n);)n=n.next;if(!n)return e;if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let i=Math.min(e.optionMap.size,e.visibleToIndex+1),s=i-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:s,visibleToIndex:i}}case"focus-previous-option":{if(!e.focusedValue)return e;let r=e.optionMap.get(e.focusedValue);if(!r)return e;let n=r.previous;for(;n&&!("value"in n);)n=n.previous;if(!n)return e;if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let i=Math.max(0,e.visibleFromIndex-1),s=i+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:i,visibleToIndex:s}}case"select-focused-option":return{...e,previousValue:e.value,value:e.focusedValue};case"reset":return t.state;case"set-focus":return{...e,focusedValue:t.value}}},QBe=e=>e.flatMap(t=>{if("options"in t){let r=QBe(t.options),n=r.flatMap(i=>"value"in i?i.value:[]);return[...t.header!==void 0?[{header:t.header,optionValues:n}]:[],...r]}return t}),mGt=({visibleOptionCount:e,defaultValue:t,options:r})=>{let n=QBe(r),o=typeof e=="number"?Math.min(e,n.length):n.length,i=new U$(n),s=i.first,a=s&&"value"in s?s.value:void 0;return{optionMap:i,visibleOptionCount:o,focusedValue:a,visibleFromIndex:0,visibleToIndex:o,previousValue:t,value:t}},GBe=({visibleOptionCount:e=5,options:t,defaultValue:r,onChange:n,onFocus:o,focusValue:i})=>{let s=QBe(t),[a,c]=(0,Dm.useReducer)(HFn,{visibleOptionCount:e,defaultValue:r,options:t},mGt),[l,u]=(0,Dm.useState)(s);s!==l&&!GFn(s,l)&&(c({type:"reset",state:mGt({visibleOptionCount:e,defaultValue:r,options:t})}),u(s));let d=(0,Dm.useCallback)(()=>{c({type:"focus-next-option"})},[]),p=(0,Dm.useCallback)(()=>{c({type:"focus-previous-option"})},[]),f=(0,Dm.useCallback)(()=>{c({type:"select-focused-option"})},[]),A=(0,Dm.useMemo)(()=>s.map((h,_)=>({...h,index:_})).slice(a.visibleFromIndex,a.visibleToIndex),[s,a.visibleFromIndex,a.visibleToIndex]);return(0,Dm.useEffect)(()=>{a.value&&a.previousValue!==a.value&&n?.(a.value)},[a.previousValue,a.value,t,n]),(0,Dm.useEffect)(()=>{a.focusedValue&&o?.(a.focusedValue)},[a.focusedValue,o]),(0,Dm.useEffect)(()=>{i&&c({type:"set-focus",value:i})},[i]),{focusedValue:a.focusedValue,visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex,value:a.value,visibleOptions:A,focusNextOption:d,focusPreviousOption:p,selectFocusedOption:f}};var HBe=({isDisabled:e=!1,state:t})=>{Nt((r,n)=>{n.downArrow&&t.focusNextOption(),n.upArrow&&t.focusPreviousOption(),n.return&&t.selectFocusedOption()},{isActive:!e})};var UBe=e=>`HEADER-${e.optionValues.join(",")}`;function $C({isDisabled:e=!1,visibleOptionCount:t=5,highlightText:r,options:n,defaultValue:o,onChange:i,onFocus:s,focusValue:a}){let c=GBe({visibleOptionCount:t,options:n,defaultValue:o,onChange:i,onFocus:s,focusValue:a});HBe({isDisabled:e,state:c});let{styles:l}=is("Select");return MU.default.createElement(D,{...l.container()},c.visibleOptions.map(u=>{let d="value"in u?u.value:UBe(u),p=!e&&c.focusedValue!==void 0&&("value"in u?c.focusedValue===u.value:u.optionValues.includes(c.focusedValue)),f=!!c.value&&("value"in u?c.value===u.value:u.optionValues.includes(c.value)),A="header"in u,h="label"in u?u.label:u.header,_=h;if(r&&h.includes(r)){let T=h.indexOf(r);_=MU.default.createElement(MU.default.Fragment,null,h.slice(0,T),MU.default.createElement(I,{...l.highlightedText()},r),h.slice(T+r.length))}return MU.default.createElement(FBe,{key:d,isFocused:p,isSelected:f,smallPointer:A},_)}))}function gGt({onDone:e}){return Nt((t,r)=>{(r.ctrl&&(t==="c"||t==="d")||r.escape)&&e()}),BU.default.createElement(D,{flexDirection:"column",borderStyle:"round",padding:1,borderColor:X().secondaryBorder},BU.default.createElement(D,{marginBottom:1,flexDirection:"column"},BU.default.createElement(I,{bold:!0},"You've spent $5 this session.")),BU.default.createElement(D,null,BU.default.createElement($C,{options:[{value:"ok",label:"Got it, thanks!"}],onChange:e})))}var Mn=G(ce(),1),Er=G(ce(),1);var Ef=G(ce(),1);$e();Mr();$e();Be();import qFn from"os";import $Fn from"path";import Q$ from"fs";var YFn={sources:{},routing:{}};function _Gt(){let e=qFn.homedir();return $Fn.join(e,lo,"config.json")}function AGt(){try{let e=_Gt();if(!Q$.existsSync(e))return YFn;let t=Q$.readFileSync(e,"utf-8"),r=JSON.parse(t);return r.sources&&r.routing?r:VFn(r)}catch(e){throw Re(e),e}}function VFn(e){let t={},r={};for(let[n,o]of Object.entries(e))if(o?.enable===!0&&o?.env){let i=o.env,s=n;t[s]={base_url:i.BASE_URL||"",auth_token:i.AUTH_TOKEN||"",api_type:i.API_TYPE||"anthropic",models:[]},i.MODEL&&(r.MODEL=[{source:s,model:i.MODEL,weight:100}],t[s].models.push(i.MODEL)),i.SMALL_FAST_MODEL&&(r.SMALL_FAST_MODEL=[{source:s,model:i.SMALL_FAST_MODEL,weight:100}],t[s].models.includes(i.SMALL_FAST_MODEL)||t[s].models.push(i.SMALL_FAST_MODEL));break}return{sources:t,routing:r}}function hGt(e){if(e.length===0)throw new Error("No items to select from");if(e.length===1)return e[0];let t=e.reduce((n,o)=>n+(o.weight??100),0),r=Math.random()*t;for(let n of e){let o=n.weight??100;if(r-=o,r<=0)return n}return e[e.length-1]}var qBe=class{config;constructor(){try{this.config=AGt()}catch(t){console.log(t)}}reload(){this.config=AGt()}getConfig(){return this.config}hasModelRouting(){return!!(this.config.routing?.MODEL&&this.config.routing.MODEL.length>0)}getModelRoutingModels(){let t=this.config.routing?.MODEL;return!t||t.length===0?[]:t.map(r=>r.model)}hasSmallFastModelRouting(){return!!(this.config.routing?.SMALL_FAST_MODEL&&this.config.routing.SMALL_FAST_MODEL.length>0)}getModel(){let t=this.config.routing?.MODEL;if(!t||t.length===0)throw new Error("No MODEL routing configuration found");let r=hGt(t);return`${r.source}__${r.model}`}getSmallFastModel(){let t=this.config.routing?.SMALL_FAST_MODEL;if(!t||t.length===0)throw new Error("No SMALL_FAST_MODEL routing configuration found");let r=hGt(t);return`${r.source}__${r.model}`}getSourceConfig(t){return this.config.sources?.[t]}parseModelKey(t){let r=t.indexOf("__");return r===-1?{source:"",model:t}:{source:t.slice(0,r),model:t.slice(r+2)}}getModelSourceConfig(t){let{source:r}=this.parseModelKey(t);if(r)return this.getSourceConfig(r)}setModelRouting(t){this.config.routing.MODEL=t,this.saveConfig()}setSmallFastModelRouting(t){this.config.routing.SMALL_FAST_MODEL=t,this.saveConfig()}getAvailableModels(){let t=[];for(let[r,n]of Object.entries(this.config.sources||{}))for(let o of n.models||[])t.push(`${r}__${o}`);return t}saveConfig(){try{let t=_Gt(),r={};if(Q$.existsSync(t)){let o=Q$.readFileSync(t,"utf-8");r=JSON.parse(o)}let n={...r,sources:this.config.sources,routing:this.config.routing};Q$.writeFileSync(t,JSON.stringify(n,null,2))}catch(t){Re(t)}}},Wo=new qBe;var zFn="1.38.2",JT={VERSION:zFn,PACKAGE_URL:"@dahawa/hawa-code",README_URL:"https://github.com/italking/hawa-code",ISSUES_EXPLAINER:"report the issue at https://github.com/italking/hawa-code/issues"};var $Be=46,EGt=["(\u2740\u2579\u25E1\u2579)","(\u25D5\u072B\u25D5)","\u239D(\u25D5u\u25D5)\u23A0","\u10DA(\u25C9\u25DE\u0C6A\u25DF\u25C9 )\u10DA","(\xB4\u25C9\u203F\u25C9\uFF40)","\u0E01\u0E47\u0295\u2022\u0361\u1D25\u2022\u0294 \u0E01\u0E49","\uFF0F/( \u25D5\u203F\u203F\u25D5 )\uFF3C"];function dle({isDefaultModel:e=!1}){let t=Math.max($Be,Fe().length+12),r=X(),n=EGt[Math.floor(Math.random()*EGt.length)];return Ef.createElement(D,{flexDirection:"column"},Ef.createElement(D,{flexDirection:"column",gap:1,paddingLeft:1,width:"100%"},Ef.createElement(I,null,Ef.createElement(I,null,n)," Welcome to"," ",Ef.createElement(I,{bold:!0},Je),Ef.createElement(I,{color:r.secondaryText}," v",JT.VERSION)),Ef.createElement(Ef.Fragment,null,Ef.createElement(D,{paddingLeft:2,flexDirection:"column",gap:1},Ef.createElement(I,{color:r.secondaryText,italic:!0},"/help for help"),Ef.createElement(I,{color:r.secondaryText},"cwd: ",Fe()),Ef.createElement(I,{color:r.secondaryText},"model: ",Wo.getConfig().routing.MODEL?.map(o=>`${o.source}__${o.model}`).join(", ")??"N/A"),Ef.createElement(I,{color:r.secondaryText},"small fast model: ",Wo.getConfig().routing.SMALL_FAST_MODEL?.map(o=>`${o.source}__${o.model}`).join(", ")??"N/A")))))}var HS=G(ce(),1);Be();var H7=G(ce(),1);import{randomUUID as FS}from"crypto";var SGt=()=>[],TGt=()=>{};function bGt(e){SGt=e}function ple(){return SGt}function yGt(e){TGt=e}function CGt(){return TGt}Be();Sr();Mr();Be();$e();import{existsSync as zC,readdirSync as A3n,statSync as h3n}from"fs";import{join as dD,relative as _3n}from"path";import{homedir as J9t}from"os";import{platform as E3n}from"process";import{readFile as pD}from"fs/promises";Mr();ZT();zr();import{join as XFn,sep as eUn}from"path";function Sf(){if(!Nm())return!1;try{let e=Lt();if(e.autoMemory?.teamMemoryEnabled!==void 0)return e.autoMemory.teamMemoryEnabled}catch{}return!1}function xm(){return(XFn(Fe(),".hcode","team-memory")+eUn).normalize("NFC")}function LU(e){let t=e.normalize("NFC"),r=xm();return t.startsWith(r)}var Z9t=G(Cle(),1);Zo();var z9t=G(Cle(),1);Mr();$e();Be();vm();import{readFile as Y9t}from"fs/promises";import{existsSync as cke,readdirSync as p3n,statSync as f3n}from"fs";import{join as lke,relative as W9t}from"path";import{homedir as m3n}from"os";function V9t(e){try{let t=(0,z9t.default)(e),r=t.data.paths,n=[];return typeof r=="string"?n=r.split(",").map(o=>o.trim()).filter(Boolean):Array.isArray(r)&&(n=r.filter(o=>typeof o=="string")),{paths:n,content:t.content.trim()}}catch(t){return Re(t),{paths:[],content:e.trim()}}}function g3n(e,t){return t.length===0?!0:t.some(r=>{try{return Dd(e,r,{matchBase:!0,dot:!0})}catch(n){return Re(n),!1}})}function uke(e){let t=[];try{if(!cke(e))return t;let r=p3n(e);for(let n of r){let o=lke(e,n),i=f3n(o);i.isDirectory()?t.push(...uke(o)):i.isFile()&&n.endsWith(".md")&&t.push(o)}}catch(r){Re(r)}return t}async function j9t(){let e=[];try{let t=lke(m3n(),lo,"rules");if(cke(t)){let r=uke(t);for(let n of r)try{let o=await Y9t(n,"utf-8"),{paths:i,content:s}=V9t(o);i.length>0&&e.push({filePath:n,content:s,paths:i,isProjectRule:!1})}catch(o){Re(o)}}}catch(t){Re(t)}try{let t=lke(Fe(),lo,"rules");if(cke(t)){let r=uke(t);for(let n of r)try{let o=await Y9t(n,"utf-8"),{paths:i,content:s}=V9t(o);i.length>0&&e.push({filePath:W9t(Fe(),n),content:s,paths:i,isProjectRule:!0})}catch(o){Re(o)}}}catch(t){Re(t)}return e}function K9t(e,t){e=lae(e);let r=lae(Fe()),n=e.startsWith(r)?W9t(r,e):e;return t.filter(o=>g3n(n,o.paths))}var S3n=`# hawaCodeMd
|
|
680
680
|
Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.`;function T3n(e="default"){let r=Ye.getSessionContext(e).getData("matchedPathRules");return!r||r.length===0?"":r.map(o=>{let i=o.isProjectRule?"project instructions, checked into the codebase":"user's private global instructions for all projects";return`Contents of ${o.filePath} (${i}):
|
|
681
681
|
|
|
682
682
|
${o.content}`}).join(`
|
|
@@ -775,7 +775,7 @@ Stack trace: `+d.stack)),new Response(c.body,{status:a.status,statusText:a.statu
|
|
|
775
775
|
Total duration (API): ${tS(qm.totalAPIDuration)}
|
|
776
776
|
Total duration (wall): ${tS(djt())}`)}function pjt(){(0,ujt.useEffect)(()=>{let e=()=>{process.stdout.write(`
|
|
777
777
|
`+jQe()+`
|
|
778
|
-
`);let t=Qn();xi({...t,lastCost:qm.totalCost,lastAPIDuration:qm.totalAPIDuration,lastDuration:djt(),lastSessionId:NE})};return process.on("exit",e),()=>{process.off("exit",e)}},[])}function lno(e,t){return Math.round(e*t)/t}Be();$e();$e();var KQe="1.38.
|
|
778
|
+
`);let t=Qn();xi({...t,lastCost:qm.totalCost,lastAPIDuration:qm.totalAPIDuration,lastDuration:djt(),lastSessionId:NE})};return process.on("exit",e),()=>{process.off("exit",e)}},[])}function lno(e,t){return Math.round(e*t)/t}Be();$e();$e();var KQe="1.38.2";globalThis.MACRO={VERSION:KQe,PACKAGE_URL:`@dahawa/${Gi}`,README_URL:"https://github.com/italking/hawa-code",ISSUES_EXPLAINER:"report the issue at https://github.com/italking/hawa-code/issues"};var ufe=process.env.HAWA_CODE_USER_AGENT||`${Gi}/${KQe} (${process.env.USER_TYPE})`;Be();Be();Sr();function xp(e){let t=[];return e.filter(r=>r.type!=="progress"&&r.type!=="reminder").forEach(r=>{switch(r.type){case"user":{let n=gp(t);if(n?.type==="user"){t[t.length-1]=fno(n,r);return}t.push(r);return}case"assistant":t.push(r);return;case"insert":{let n=gp(t);n?.type==="user"&&(t[t.length-1]=uno(n,r));return}}}),t}function uno(e,t){return{...e,message:{...e.message,content:pno(e.message.content,dno(t.content.content))}}}function dno(e){return`
|
|
779
779
|
<system-reminder>
|
|
780
780
|
The user sent the following message:
|
|
781
781
|
${e}
|
package/hands.js
CHANGED
|
@@ -484,7 +484,7 @@ ${a.content}`).join(`
|
|
|
484
484
|
|
|
485
485
|
`)}`;return[this.createReminderMessage("recalled_memories","general","medium",s,i,!0)]}getMentionReminders(){let t=Date.now(),r=5e3,n=[],i=[];for(let[o,s]of this.reminderCache.entries())this.isMentionReminder(s)&&(t-s.timestamp<=r?n.push(s):i.push(o));return i.forEach(o=>this.reminderCache.delete(o)),n}isMentionReminder(t){return["agent_mention","file_mention","ask_model_mention"].includes(t.type)}generateFileChangeReminder(t){let{agentId:r,filePath:n,reminder:i}=t;if(!i)return null;let o=Date.now(),s=`file_changed_${r}_${n}_${o}`;return this.sessionState.remindersSent.has(s)?null:(this.sessionState.remindersSent.add(s),this.createReminderMessage("file_changed","general","medium",i,o))}createReminderMessage(t,r,n,i,o,s=!0){return{role:"system",content:`<system-reminder>
|
|
486
486
|
${i}
|
|
487
|
-
</system-reminder>`,isMeta:!0,timestamp:o,type:t,priority:n,category:r,foot:s}}getTodoStateHash(t){return t.map(r=>`${r.id}:${r.status}`).sort().join("|")}clearTodoReminders(t){let r=t||"default";for(let n of this.sessionState.remindersSent)n.startsWith(`todo_updated_${r}_`)&&this.sessionState.remindersSent.delete(n)}setupEventDispatcher(){this.addEventListener("session:startup",t=>{this.resetSession(),this.sessionState.sessionStartTime=Date.now(),this.sessionState.contextPresent=Object.keys(t.context||{}).length>0,dt("system_reminder_session_startup",{agentId:t.agentId||"default",contextKeys:Object.keys(t.context||{}).join(","),messageCount:String(t.messages||0),timestamp:String(t.timestamp||Date.now())})}),this.addEventListener("file:read",t=>{this.sessionState.lastFileAccess=Date.now()}),this.addEventListener("file:edited",t=>{}),this.addEventListener("agent:mentioned",t=>{this.createMentionReminder({type:"agent_mention",key:`agent_mention_${t.agentType}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST use the ${Ar} tool with subagent_type="${t.agentType}" to delegate this task to the specified agent. Provide a detailed, self-contained task description that fully captures the user's intent for the ${t.agentType} agent to execute.`,timestamp:t.timestamp})}),this.addEventListener("file:mentioned",t=>{this.createMentionReminder({type:"file_mention",key:`file_mention_${t.filePath}_${t.timestamp}`,category:"general",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST read the entire content of the file at path: ${t.filePath} using the Read tool to understand the full context before proceeding with the user's request.`,timestamp:t.timestamp})}),this.addEventListener("ask-model:mentioned",t=>{this.createMentionReminder({type:"ask_model_mention",key:`ask_model_mention_${t.modelName}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.modelName}. You MUST use the AskExpertModelTool to consult this specific model for expert opinions and analysis. Provide the user's question or context clearly to get the most relevant response from ${t.modelName}.`,timestamp:t.timestamp})})}addEventListener(t,r){this.eventDispatcher.has(t)||this.eventDispatcher.set(t,[]),this.eventDispatcher.get(t).push(r)}emitEvent(t,r){(this.eventDispatcher.get(t)||[]).forEach(i=>{try{i(r)}catch(o){console.error(`Error in event listener for ${t}:`,o)}})}createMentionReminder(t){if(!this.sessionState.remindersSent.has(t.key)){this.sessionState.remindersSent.add(t.key);let r=this.createReminderMessage(t.type,t.category,t.priority,t.content,t.timestamp);this.reminderCache.set(t.key,r)}}resetSession(){this.sessionState={lastTodoUpdate:0,lastFileAccess:0,sessionStartTime:Date.now(),remindersSent:new Set,contextPresent:!1,reminderCount:0,config:{...this.sessionState.config}},this.reminderCache.clear()}updateConfig(t){this.sessionState.config={...this.sessionState.config,...t}}getSessionState(){return{...this.sessionState}}},kR=new z1e,Y1e=async(e=!1,t)=>await kR.generateReminders(e,t),qKr=e=>kR.generateFileChangeReminder(e),ul=(e,t)=>kR.emitEvent(e,t),MR=()=>kR.resetSession(),GKr=()=>kR.getSessionState()});import{readFileSync as zpt,existsSync as wJ}from"fs";import{join as X1e,extname as CJr,resolve as Gpt,dirname as SJr}from"path";import{fileURLToPath as IJr}from"url";function Ypt(){let e=SJr(IJr(import.meta.url));return[Gpt(e,"webServer"),Gpt(e,"client")]}function jpt(e,t){let n=new URL(e.url||"/",`http://${e.headers.host}`).pathname;if(t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){t.writeHead(204),t.end();return}if(n.startsWith("/api/")){xJr(n,e,t);return}if(n==="/debug"){DJr(t);return}wJr(n,t)}function DJr(e){let r=Ypt().map(n=>({dir:n,exists:wJ(n),hasIndex:wJ(X1e(n,"index.html"))}));QR(e,200,{cwd:process.cwd(),staticDirs:r,nodeVersion:process.version})}function xJr(e,t,r){let n=()=>Promise.resolve().then(()=>(eSe(),Wpt)).then(o=>o.webServerService);if(r.setHeader("Content-Type","application/json; charset=utf-8"),e==="/api/status"){n().then(o=>{QR(r,200,{running:o.isRunning(),url:o.getUrl(),agentCount:o.getAgents().length,uptime:process.uptime()})});return}if(e==="/api/agents"){n().then(o=>{QR(r,200,o.getAgents())});return}if(e==="/api/messages"){n().then(o=>{QR(r,200,o.getAllMessages())});return}let i=e.match(/^\/api\/agents\/([^/]+)\/messages$/);if(i){let o=decodeURIComponent(i[1]);n().then(s=>{QR(r,200,s.getMessagesForAgent(o))});return}QR(r,404,{error:"Not Found"})}function wJr(e,t){(e==="/"||e==="/index.html")&&(e="/index.html");let r=Ypt();if($pt(e,r,t))return;let i=vJr[e];if(i){for(let o of i)if(o!==e&&$pt(o,r,t))return}for(let o of r){let s=X1e(o,"index.html");if(wJ(s))try{let a=zpt(s);t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end(a);return}catch{}}t.writeHead(404,{"Content-Type":"text/plain"}),t.end("Not Found")}function $pt(e,t,r){for(let n of t){let i=X1e(n,e);if(wJ(i)){let o=CJr(i),s=TJr[o]||"application/octet-stream";try{let a=zpt(i);return r.writeHead(200,{"Content-Type":s}),r.end(a),!0}catch{}}}return!1}function QR(e,t,r){e.writeHead(t,{"Content-Type":"application/json; charset=utf-8"}),e.end(JSON.stringify(r))}var TJr,vJr,Vpt=U(()=>{TJr={".html":"text/html; charset=utf-8",".js":"application/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".ico":"image/x-icon"};vJr={"/style.css":["/style.css","/styles/terminal.css","/terminal.css"]}});var Wpt={};Zs(Wpt,{webServerService:()=>MU});import*as Jpt from"http";function Kpt(e){return!e||e==="defalt"||e==="default"?"main":e}var kU,tSe,MU,eSe=U(()=>{kU=ne(p1e(),1);Vu();Dr();He();Vpt();tSe=class{httpServer=null;wss=null;clients=new Map;unsubscribers=[];running=!1;port=3210;host="127.0.0.1";agents=new Map;messageCache=new Map;throttleTimers=new Map;THROTTLE_MS=50;isRunning(){return this.running}getPort(){return this.port}getHost(){return this.host}getUrl(){return`http://${this.host}:${this.port}`}async start(){if(this.running)return;let t=ur().webServer;return this.port=t?.port||3210,this.host=t?.host||"127.0.0.1",this.agents.has("main")||this.agents.set("main",{id:"main",name:"Main",type:"main",status:"running",startedAt:Date.now()}),this.httpServer=Jpt.createServer((r,n)=>{jpt(r,n)}),this.wss=new kU.WebSocketServer({server:this.httpServer,path:"/ws"}),this.wss.on("connection",r=>{let n={sentCounts:new Map};this.clients.set(r,n),Se("WebServer: \u65B0\u5BA2\u6237\u7AEF\u8FDE\u63A5"),this.sendSnapshot(r,n),r.on("message",i=>{try{JSON.parse(i.toString()).type==="ping"&&r.send(JSON.stringify({type:"pong"}))}catch{}}),r.on("close",()=>{this.clients.delete(r),Se("WebServer: \u5BA2\u6237\u7AEF\u65AD\u5F00")}),r.on("error",i=>{le("WebServer WS error:",i),this.clients.delete(r)})}),this.subscribeToMessages(),new Promise((r,n)=>{let i=(o,s)=>{this.httpServer.once("error",a=>{a.code==="EADDRINUSE"&&s>0?(Se(`WebServer: \u7AEF\u53E3 ${o} \u88AB\u5360\u7528\uFF0C\u5C1D\u8BD5 ${o+1}`),i(o+1,s-1)):n(a)}),this.httpServer.listen(o,this.host,()=>{this.port=o,this.running=!0,Se(`WebServer started at http://${this.host}:${o}`),r()})};i(this.port,10)})}async stop(){if(this.running){this.unsubscribers.forEach(t=>t()),this.unsubscribers=[];for(let t of this.throttleTimers.values())clearTimeout(t);this.throttleTimers.clear();for(let[t]of this.clients)t.close();return this.clients.clear(),new Promise(t=>{this.wss?.close(()=>{this.httpServer?.close(()=>{this.running=!1,this.httpServer=null,this.wss=null,Se("WebServer stopped"),t()})})})}}subscribeToMessages(){let t=Sn.on("webserver:message",n=>{let i=Kpt(n.agentId),{messages:o}=n;this.messageCache.set(i,o),this.throttledSendDelta(i)}),r=Sn.on("webserver:agent_status",n=>{let i=Kpt(n.agentId),{status:o,agentType:s,agentName:a,description:u}=n;if(o==="started")this.agents.set(i,{id:i,name:a||i,type:s||"unknown",status:"started",description:u,startedAt:Date.now()});else if(o==="ended"){let c=this.agents.get(i);c&&(c.status="ended")}else{let c=this.agents.get(i);c&&(c.status=o)}let l={type:"agent_status",agentId:i,payload:{status:o,agentType:s,agentName:a,description:u}};this.broadcastRaw(JSON.stringify(l))});this.unsubscribers.push(t,r)}throttledSendDelta(t){if(!this.throttleTimers.has(t)){let r=setTimeout(()=>{this.throttleTimers.delete(t),this.sendDeltaToAllClients(t)},this.THROTTLE_MS);this.throttleTimers.set(t,r)}}sendDeltaToAllClients(t){let r=this.messageCache.get(t)||[];for(let[n,i]of this.clients){if(n.readyState!==kU.WebSocket.OPEN)continue;let o=i.sentCounts.get(t)||0;if(r.length>o){let s=r.slice(o),a={type:"messages_delta",agentId:t,messages:s};n.send(JSON.stringify(a)),i.sentCounts.set(t,r.length)}}}broadcastRaw(t){for(let[r]of this.clients)r.readyState===kU.WebSocket.OPEN&&r.send(t)}sendSnapshot(t,r){let n={};for(let[o,s]of this.messageCache)n[o]=s,r.sentCounts.set(o,s.length);let i={type:"snapshot",payload:{agents:Array.from(this.agents.values()),messages:n}};t.send(JSON.stringify(i))}getAgents(){return Array.from(this.agents.values())}getMessagesForAgent(t){return this.messageCache.get(t)||[]}getAllMessages(){let t={};for(let[r,n]of this.messageCache)t[r]=n;return t}},MU=new tSe});var NJ=b((WAi,nmt)=>{var rSe=[],rmt=0,Hl=(e,t)=>{rmt>=t&&rSe.push(e)};Hl.WARN=1;Hl.INFO=2;Hl.DEBUG=3;Hl.reset=()=>{rSe=[]};Hl.setDebugLevel=e=>{rmt=e};Hl.warn=e=>Hl(e,Hl.WARN);Hl.info=e=>Hl(e,Hl.INFO);Hl.debug=e=>Hl(e,Hl.DEBUG);Hl.debugMessages=()=>rSe;nmt.exports=Hl});var omt=b((KAi,imt)=>{"use strict";imt.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var amt=b((JAi,smt)=>{"use strict";var RJr=omt();smt.exports=e=>typeof e=="string"?e.replace(RJr(),""):e});var lmt=b((ZAi,nSe)=>{"use strict";var umt=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);nSe.exports=umt;nSe.exports.default=umt});var dmt=b((XAi,cmt)=>{"use strict";cmt.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var pmt=b((egi,iSe)=>{"use strict";var OJr=amt(),kJr=lmt(),MJr=dmt(),fmt=e=>{if(typeof e!="string"||e.length===0||(e=OJr(e),e.length===0))return 0;e=e.replace(MJr()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=kJr(n)?2:1)}return t};iSe.exports=fmt;iSe.exports.default=fmt});var oSe=b((tgi,hmt)=>{var mmt=pmt();function RJ(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function lh(e){let t=RJ();return(""+e).replace(t,"").split(`
|
|
487
|
+
</system-reminder>`,isMeta:!0,timestamp:o,type:t,priority:n,category:r,foot:s}}getTodoStateHash(t){return t.map(r=>`${r.id}:${r.status}`).sort().join("|")}clearTodoReminders(t){let r=t||"default";for(let n of this.sessionState.remindersSent)n.startsWith(`todo_updated_${r}_`)&&this.sessionState.remindersSent.delete(n)}setupEventDispatcher(){this.addEventListener("session:startup",t=>{this.resetSession(),this.sessionState.sessionStartTime=Date.now(),this.sessionState.contextPresent=Object.keys(t.context||{}).length>0,dt("system_reminder_session_startup",{agentId:t.agentId||"default",contextKeys:Object.keys(t.context||{}).join(","),messageCount:String(t.messages||0),timestamp:String(t.timestamp||Date.now())})}),this.addEventListener("file:read",t=>{this.sessionState.lastFileAccess=Date.now()}),this.addEventListener("file:edited",t=>{}),this.addEventListener("agent:mentioned",t=>{this.createMentionReminder({type:"agent_mention",key:`agent_mention_${t.agentType}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST use the ${Ar} tool with subagent_type="${t.agentType}" to delegate this task to the specified agent. Provide a detailed, self-contained task description that fully captures the user's intent for the ${t.agentType} agent to execute.`,timestamp:t.timestamp})}),this.addEventListener("file:mentioned",t=>{this.createMentionReminder({type:"file_mention",key:`file_mention_${t.filePath}_${t.timestamp}`,category:"general",priority:"high",content:`The user mentioned @${t.originalMention}. You MUST read the entire content of the file at path: ${t.filePath} using the Read tool to understand the full context before proceeding with the user's request.`,timestamp:t.timestamp})}),this.addEventListener("ask-model:mentioned",t=>{this.createMentionReminder({type:"ask_model_mention",key:`ask_model_mention_${t.modelName}_${t.timestamp}`,category:"task",priority:"high",content:`The user mentioned @${t.modelName}. You MUST use the AskExpertModelTool to consult this specific model for expert opinions and analysis. Provide the user's question or context clearly to get the most relevant response from ${t.modelName}.`,timestamp:t.timestamp})})}addEventListener(t,r){this.eventDispatcher.has(t)||this.eventDispatcher.set(t,[]),this.eventDispatcher.get(t).push(r)}emitEvent(t,r){(this.eventDispatcher.get(t)||[]).forEach(i=>{try{i(r)}catch(o){console.error(`Error in event listener for ${t}:`,o)}})}createMentionReminder(t){if(!this.sessionState.remindersSent.has(t.key)){this.sessionState.remindersSent.add(t.key);let r=this.createReminderMessage(t.type,t.category,t.priority,t.content,t.timestamp);this.reminderCache.set(t.key,r)}}resetSession(){this.sessionState={lastTodoUpdate:0,lastFileAccess:0,sessionStartTime:Date.now(),remindersSent:new Set,contextPresent:!1,reminderCount:0,config:{...this.sessionState.config}},this.reminderCache.clear()}updateConfig(t){this.sessionState.config={...this.sessionState.config,...t}}getSessionState(){return{...this.sessionState}}},kR=new z1e,Y1e=async(e=!1,t)=>await kR.generateReminders(e,t),qKr=e=>kR.generateFileChangeReminder(e),ul=(e,t)=>kR.emitEvent(e,t),MR=()=>kR.resetSession(),GKr=()=>kR.getSessionState()});import{readFileSync as zpt,existsSync as wJ}from"fs";import{join as X1e,extname as CJr,resolve as Gpt,dirname as SJr}from"path";import{fileURLToPath as IJr}from"url";function Ypt(){let e=SJr(IJr(import.meta.url));return[Gpt(e,"webServer"),Gpt(e,"client")]}function jpt(e,t){let n=new URL(e.url||"/",`http://${e.headers.host}`).pathname;if(t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){t.writeHead(204),t.end();return}if(n.startsWith("/api/")){xJr(n,e,t);return}if(n==="/debug"){DJr(t);return}wJr(n,t)}function DJr(e){let r=Ypt().map(n=>({dir:n,exists:wJ(n),hasIndex:wJ(X1e(n,"index.html"))}));QR(e,200,{cwd:process.cwd(),staticDirs:r,nodeVersion:process.version})}function xJr(e,t,r){let n=()=>Promise.resolve().then(()=>(eSe(),Wpt)).then(o=>o.webServerService);if(r.setHeader("Content-Type","application/json; charset=utf-8"),e==="/api/status"){n().then(o=>{QR(r,200,{running:o.isRunning(),url:o.getUrl(),agentCount:o.getAgents().length,uptime:process.uptime()})});return}if(e==="/api/agents"){n().then(o=>{QR(r,200,o.getAgents())});return}if(e==="/api/messages"){n().then(o=>{QR(r,200,o.getAllMessages())});return}let i=e.match(/^\/api\/agents\/([^/]+)\/messages$/);if(i){let o=decodeURIComponent(i[1]);n().then(s=>{QR(r,200,s.getMessagesForAgent(o))});return}QR(r,404,{error:"Not Found"})}function wJr(e,t){(e==="/"||e==="/index.html")&&(e="/index.html");let r=Ypt();if($pt(e,r,t))return;let i=vJr[e];if(i){for(let o of i)if(o!==e&&$pt(o,r,t))return}for(let o of r){let s=X1e(o,"index.html");if(wJ(s))try{let a=zpt(s);t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end(a);return}catch{}}t.writeHead(404,{"Content-Type":"text/plain"}),t.end("Not Found")}function $pt(e,t,r){for(let n of t){let i=X1e(n,e);if(wJ(i)){let o=CJr(i),s=TJr[o]||"application/octet-stream";try{let a=zpt(i);return r.writeHead(200,{"Content-Type":s}),r.end(a),!0}catch{}}}return!1}function QR(e,t,r){e.writeHead(t,{"Content-Type":"application/json; charset=utf-8"}),e.end(JSON.stringify(r))}var TJr,vJr,Vpt=U(()=>{TJr={".html":"text/html; charset=utf-8",".js":"application/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".ico":"image/x-icon"};vJr={"/style.css":["/style.css","/styles/terminal.css","/terminal.css"]}});var Wpt={};Zs(Wpt,{webServerService:()=>MU});import*as Jpt from"http";function Kpt(e){return!e||e==="defalt"||e==="default"?"main":e}var kU,tSe,MU,eSe=U(()=>{kU=ne(p1e(),1);Vu();Dr();He();Vpt();tSe=class{httpServer=null;wss=null;clients=new Map;unsubscribers=[];running=!1;port=3210;host="127.0.0.1";agents=new Map;messageCache=new Map;throttleTimers=new Map;THROTTLE_MS=50;isRunning(){return this.running}getPort(){return this.port}getHost(){return this.host}getUrl(){return`http://${this.host}:${this.port}`}async start(){if(this.running)return;let t=ur().webServer;return this.port=t?.port||3210,this.host=t?.host||"127.0.0.1",this.agents.has("main")||this.agents.set("main",{id:"main",name:"Main",type:"main",status:"running",startedAt:Date.now()}),this.subscribeToMessages(),new Promise((r,n)=>{let i=()=>{let s=Jpt.createServer((u,l)=>{jpt(u,l)}),a=new kU.WebSocketServer({server:s,path:"/ws"});return a.on("error",()=>{}),a.on("connection",u=>{let l={sentCounts:new Map};this.clients.set(u,l),Se("WebServer: \u65B0\u5BA2\u6237\u7AEF\u8FDE\u63A5"),this.sendSnapshot(u,l),u.on("message",c=>{try{JSON.parse(c.toString()).type==="ping"&&u.send(JSON.stringify({type:"pong"}))}catch{}}),u.on("close",()=>{this.clients.delete(u),Se("WebServer: \u5BA2\u6237\u7AEF\u65AD\u5F00")}),u.on("error",c=>{le("WebServer WS error:",c),this.clients.delete(u)})}),{httpServer:s,wss:a}},o=(s,a)=>{let{httpServer:u,wss:l}=i();u.once("error",c=>{c.code==="EADDRINUSE"&&a>0?(Se(`WebServer: \u7AEF\u53E3 ${s} \u88AB\u5360\u7528\uFF0C\u5C1D\u8BD5 ${s+1}`),u.close(),l.close(),o(s+1,a-1)):n(c)}),u.listen(s,this.host,()=>{this.httpServer=u,this.wss=l,this.port=s,this.running=!0,Se(`WebServer started at http://${this.host}:${s}`),r()})};o(this.port,100)})}async stop(){if(this.running){this.unsubscribers.forEach(t=>t()),this.unsubscribers=[];for(let t of this.throttleTimers.values())clearTimeout(t);this.throttleTimers.clear();for(let[t]of this.clients)t.close();return this.clients.clear(),new Promise(t=>{this.wss?.close(()=>{this.httpServer?.close(()=>{this.running=!1,this.httpServer=null,this.wss=null,Se("WebServer stopped"),t()})})})}}subscribeToMessages(){let t=Sn.on("webserver:message",n=>{let i=Kpt(n.agentId),{messages:o}=n;this.messageCache.set(i,o),this.throttledSendDelta(i)}),r=Sn.on("webserver:agent_status",n=>{let i=Kpt(n.agentId),{status:o,agentType:s,agentName:a,description:u}=n;if(o==="started")this.agents.set(i,{id:i,name:a||i,type:s||"unknown",status:"started",description:u,startedAt:Date.now()});else if(o==="ended"){let c=this.agents.get(i);c&&(c.status="ended")}else{let c=this.agents.get(i);c&&(c.status=o)}let l={type:"agent_status",agentId:i,payload:{status:o,agentType:s,agentName:a,description:u}};this.broadcastRaw(JSON.stringify(l))});this.unsubscribers.push(t,r)}throttledSendDelta(t){if(!this.throttleTimers.has(t)){let r=setTimeout(()=>{this.throttleTimers.delete(t),this.sendDeltaToAllClients(t)},this.THROTTLE_MS);this.throttleTimers.set(t,r)}}sendDeltaToAllClients(t){let r=this.messageCache.get(t)||[];for(let[n,i]of this.clients){if(n.readyState!==kU.WebSocket.OPEN)continue;let o=i.sentCounts.get(t)||0;if(r.length>o){let s=r.slice(o),a={type:"messages_delta",agentId:t,messages:s};n.send(JSON.stringify(a)),i.sentCounts.set(t,r.length)}}}broadcastRaw(t){for(let[r]of this.clients)r.readyState===kU.WebSocket.OPEN&&r.send(t)}sendSnapshot(t,r){let n={};for(let[o,s]of this.messageCache)n[o]=s,r.sentCounts.set(o,s.length);let i={type:"snapshot",payload:{agents:Array.from(this.agents.values()),messages:n}};t.send(JSON.stringify(i))}getAgents(){return Array.from(this.agents.values())}getMessagesForAgent(t){return this.messageCache.get(t)||[]}getAllMessages(){let t={};for(let[r,n]of this.messageCache)t[r]=n;return t}},MU=new tSe});var NJ=b((WAi,nmt)=>{var rSe=[],rmt=0,Hl=(e,t)=>{rmt>=t&&rSe.push(e)};Hl.WARN=1;Hl.INFO=2;Hl.DEBUG=3;Hl.reset=()=>{rSe=[]};Hl.setDebugLevel=e=>{rmt=e};Hl.warn=e=>Hl(e,Hl.WARN);Hl.info=e=>Hl(e,Hl.INFO);Hl.debug=e=>Hl(e,Hl.DEBUG);Hl.debugMessages=()=>rSe;nmt.exports=Hl});var omt=b((KAi,imt)=>{"use strict";imt.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var amt=b((JAi,smt)=>{"use strict";var RJr=omt();smt.exports=e=>typeof e=="string"?e.replace(RJr(),""):e});var lmt=b((ZAi,nSe)=>{"use strict";var umt=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);nSe.exports=umt;nSe.exports.default=umt});var dmt=b((XAi,cmt)=>{"use strict";cmt.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var pmt=b((egi,iSe)=>{"use strict";var OJr=amt(),kJr=lmt(),MJr=dmt(),fmt=e=>{if(typeof e!="string"||e.length===0||(e=OJr(e),e.length===0))return 0;e=e.replace(MJr()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=kJr(n)?2:1)}return t};iSe.exports=fmt;iSe.exports.default=fmt});var oSe=b((tgi,hmt)=>{var mmt=pmt();function RJ(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function lh(e){let t=RJ();return(""+e).replace(t,"").split(`
|
|
488
488
|
`).reduce(function(i,o){return mmt(o)>i?mmt(o):i},0)}function FU(e,t){return Array(t+1).join(e)}function FJr(e,t,r,n){let i=lh(e);if(t+1>=i){let o=t-i;switch(n){case"right":{e=FU(r,o)+e;break}case"center":{let s=Math.ceil(o/2),a=o-s;e=FU(r,a)+e+FU(r,s);break}default:{e=e+FU(r,o);break}}}return e}var LR={};function QU(e,t,r){t="\x1B["+t+"m",r="\x1B["+r+"m",LR[t]={set:e,to:!0},LR[r]={set:e,to:!1},LR[e]={on:t,off:r}}QU("bold",1,22);QU("italics",3,23);QU("underline",4,24);QU("inverse",7,27);QU("strikethrough",9,29);function Amt(e,t){let r=t[1]?parseInt(t[1].split(";")[0]):0;if(r>=30&&r<=39||r>=90&&r<=97){e.lastForegroundAdded=t[0];return}if(r>=40&&r<=49||r>=100&&r<=107){e.lastBackgroundAdded=t[0];return}if(r===0){for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&delete e[i];return}let n=LR[t[0]];n&&(e[n.set]=n.to)}function QJr(e){let t=RJ(!0),r=t.exec(e),n={};for(;r!==null;)Amt(n,r),r=t.exec(e);return n}function gmt(e,t){let r=e.lastBackgroundAdded,n=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(i){e[i]&&(t+=LR[i].off)}),r&&r!="\x1B[49m"&&(t+="\x1B[49m"),n&&n!="\x1B[39m"&&(t+="\x1B[39m"),t}function LJr(e,t){let r=e.lastBackgroundAdded,n=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(i){e[i]&&(t=LR[i].on+t)}),r&&r!="\x1B[49m"&&(t=r+t),n&&n!="\x1B[39m"&&(t=n+t),t}function PJr(e,t){if(e.length===lh(e))return e.substr(0,t);for(;lh(e)>t;)e=e.slice(0,-1);return e}function UJr(e,t){let r=RJ(!0),n=e.split(RJ()),i=0,o=0,s="",a,u={};for(;o<t;){a=r.exec(e);let l=n[i];if(i++,o+lh(l)>t&&(l=PJr(l,t-o)),s+=l,o+=lh(l),o<t){if(!a)break;s+=a[0],Amt(u,a)}}return gmt(u,s)}function HJr(e,t,r){if(r=r||"\u2026",lh(e)<=t)return e;t-=lh(r);let i=UJr(e,t);i+=r;let o="\x1B]8;;\x07";return e.includes(o)&&!i.includes(o)&&(i+=o),i}function qJr(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function GJr(e,t){e=e||{},t=t||qJr();let r=Object.assign({},t,e);return r.chars=Object.assign({},t.chars,e.chars),r.style=Object.assign({},t.style,e.style),r}function $Jr(e,t){let r=[],n=t.split(/(\s+)/g),i=[],o=0,s;for(let a=0;a<n.length;a+=2){let u=n[a],l=o+lh(u);o>0&&s&&(l+=s.length),l>e?(o!==0&&r.push(i.join("")),i=[u],o=lh(u)):(i.push(s||"",u),o=l),s=n[a+1]}return o&&r.push(i.join("")),r}function zJr(e,t){let r=[],n="";function i(s,a){for(n.length&&a&&(n+=a),n+=s;n.length>e;)r.push(n.slice(0,e)),n=n.slice(e)}let o=t.split(/(\s+)/g);for(let s=0;s<o.length;s+=2)i(o[s],s&&o[s-1]);return n.length&&r.push(n),r}function YJr(e,t,r=!0){let n=[];t=t.split(`
|
|
489
489
|
`);let i=r?$Jr:zJr;for(let o=0;o<t.length;o++)n.push.apply(n,i(e,t[o]));return n}function jJr(e){let t={},r=[];for(let n=0;n<e.length;n++){let i=LJr(t,e[n]);t=QJr(i);let o=Object.assign({},t);r.push(gmt(o,i))}return r}function VJr(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}hmt.exports={strlen:lh,repeat:FU,pad:FJr,truncate:HJr,mergeOptions:GJr,wordWrap:YJr,colorizeLines:jJr,hyperlink:VJr}});var bmt=b((rgi,ymt)=>{var _mt={};ymt.exports=_mt;var Emt={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Emt).forEach(function(e){var t=Emt[e],r=_mt[e]=[];r.open="\x1B["+t[0]+"m",r.close="\x1B["+t[1]+"m"})});var Smt=b((ngi,Cmt)=>{"use strict";Cmt.exports=function(e,t){t=t||process.argv;var r=t.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",i=t.indexOf(n+e);return i!==-1&&(r===-1?!0:i<r)}});var Tmt=b((igi,Imt)=>{"use strict";var WJr=ie("os"),_A=Smt(),Ec=process.env,PR=void 0;_A("no-color")||_A("no-colors")||_A("color=false")?PR=!1:(_A("color")||_A("colors")||_A("color=true")||_A("color=always"))&&(PR=!0);"FORCE_COLOR"in Ec&&(PR=Ec.FORCE_COLOR.length===0||parseInt(Ec.FORCE_COLOR,10)!==0);function KJr(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function JJr(e){if(PR===!1)return 0;if(_A("color=16m")||_A("color=full")||_A("color=truecolor"))return 3;if(_A("color=256"))return 2;if(e&&!e.isTTY&&PR!==!0)return 0;var t=PR?1:0;if(process.platform==="win32"){var r=WJr.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ec)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Ec})||Ec.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ec)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ec.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ec){var n=parseInt((Ec.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ec.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ec.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ec.TERM)||"COLORTERM"in Ec?1:(Ec.TERM==="dumb",t)}function sSe(e){var t=JJr(e);return KJr(t)}Imt.exports={supportsColor:sSe,stdout:sSe(process.stdout),stderr:sSe(process.stderr)}});var Dmt=b((ogi,vmt)=>{vmt.exports=function(t,r){var n="";t=t||"Run the trap, drop the bass",t=t.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var wmt=b((sgi,xmt)=>{xmt.exports=function(t,r){t=t||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var l=Math.floor(Math.random()*u);return l}function s(u){var l=!1;return i.filter(function(c){l=c===u}),l}function a(u,l){var c="",f,A;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(A in u)if(!s(A)){switch(c=c+u[A],f={up:0,down:0,mid:0},l.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var m=["up","mid","down"];for(var g in m)for(var E=m[g],_=0;_<=f[E];_++)l[E]&&(c=c+n[E][o(n[E].length)])}return c}return a(t,r)}});var Nmt=b((agi,Bmt)=>{Bmt.exports=function(e){return function(t,r,n){if(t===" ")return t;switch(r%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var Omt=b((ugi,Rmt)=>{Rmt.exports=function(e){return function(t,r,n){return r%2===0?t:e.inverse(t)}}});var Mmt=b((lgi,kmt)=>{kmt.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:e[t[n++%t.length]](r)}}});var Qmt=b((cgi,Fmt)=>{Fmt.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:e[t[Math.round(Math.random()*(t.length-2))]](r)}}});var Gmt=b((fgi,qmt)=>{var On={};qmt.exports=On;On.themes={};var ZJr=ie("util"),jT=On.styles=bmt(),Pmt=Object.defineProperties,XJr=new RegExp(/[\r\n]+/g);On.supportsColor=Tmt().supportsColor;typeof On.enabled>"u"&&(On.enabled=On.supportsColor()!==!1);On.enable=function(){On.enabled=!0};On.disable=function(){On.enabled=!1};On.stripColors=On.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var dgi=On.stylize=function(t,r){if(!On.enabled)return t+"";var n=jT[r];return!n&&r in On?On[r](t):n.open+t+n.close},eZr=/[|\\{}()[\]^$+*?.]/g,tZr=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(eZr,"\\$&")};function Umt(e){var t=function r(){return nZr.apply(r,arguments)};return t._styles=e,t.__proto__=rZr,t}var Hmt=(function(){var e={};return jT.grey=jT.gray,Object.keys(jT).forEach(function(t){jT[t].closeRe=new RegExp(tZr(jT[t].close),"g"),e[t]={get:function(){return Umt(this._styles.concat(t))}}}),e})(),rZr=Pmt(function(){},Hmt);function nZr(){var e=Array.prototype.slice.call(arguments),t=e.map(function(s){return s!=null&&s.constructor===String?s:ZJr.inspect(s)}).join(" ");if(!On.enabled||!t)return t;for(var r=t.indexOf(`
|
|
490
490
|
`)!=-1,n=this._styles,i=n.length;i--;){var o=jT[n[i]];t=o.open+t.replace(o.closeRe,o.open)+o.close,r&&(t=t.replace(XJr,function(s){return o.close+s+o.open}))}return t}On.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(r){On[r]=function(n){if(typeof e[r]=="object"){var i=n;for(var o in e[r])i=On[e[r][o]](i);return i}return On[e[r]](n)}})(t)};function iZr(){var e={};return Object.keys(Hmt).forEach(function(t){e[t]={get:function(){return Umt([t])}}}),e}var oZr=function(t,r){var n=r.split("");return n=n.map(t),n.join("")};On.trap=Dmt();On.zalgo=wmt();On.maps={};On.maps.america=Nmt()(On);On.maps.zebra=Omt()(On);On.maps.rainbow=Mmt()(On);On.maps.random=Qmt()(On);for(Lmt in On.maps)(function(e){On[e]=function(t){return oZr(On.maps[e],t)}})(Lmt);var Lmt;Pmt(On,iZr())});var zmt=b((pgi,$mt)=>{var sZr=Gmt();$mt.exports=sZr});var Wmt=b((mgi,OJ)=>{var{info:aZr,debug:Vmt}=NJ(),xf=oSe(),uSe=class e{constructor(t){this.setOptions(t),this.x=null,this.y=null}setOptions(t){["boolean","number","bigint","string"].indexOf(typeof t)!==-1&&(t={content:""+t}),t=t||{},this.options=t;let r=t.content;if(["boolean","number","bigint","string"].indexOf(typeof r)!==-1)this.content=String(r);else if(!r)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof r);this.colSpan=t.colSpan||1,this.rowSpan=t.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(t,r){this.cells=r;let n=this.options.chars||{},i=t.chars,o=this.chars={};lZr.forEach(function(u){aSe(n,i,u,o)}),this.truncate=this.options.truncate||t.truncate;let s=this.options.style=this.options.style||{},a=t.style;aSe(s,a,"padding-left",this),aSe(s,a,"padding-right",this),this.head=s.head||a.head,this.border=s.border||a.border,this.fixedWidth=t.colWidths[this.x],this.lines=this.computeLines(t),this.desiredWidth=xf.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(t){let r=t.wordWrap||t.textWrap,{wordWrap:n=r}=this.options;if(this.fixedWidth&&n){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;for(;s<this.colSpan;)this.fixedWidth+=t.colWidths[this.x+s],s++}let{wrapOnWordBoundary:i=!0}=t,{wrapOnWordBoundary:o=i}=this.options;return this.wrapLines(xf.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
|
|
@@ -752,7 +752,7 @@ data: ${JSON.stringify($)}
|
|
|
752
752
|
[Search queries used: ${r.groundingMetadata.webSearchQueries.join(", ")}]`}));let i={id:`msg_${Math.random().toString(36).slice(2)}`,type:"message",role:"assistant",model:t.modelVersion||"gemini",content:n,stop_reason:r.finishReason?r.finishReason==="STOP"&&n.some(o=>o.type==="tool_use")?"tool_use":this.mapGeminiFinishReason(r.finishReason):"end_turn",stop_sequence:null,usage:{input_tokens:t.usageMetadata?.promptTokenCount||0,output_tokens:t.usageMetadata?.candidatesTokenCount||0}};return this.logger&&this.logger.debug({result:i},"Conversion complete, final Anthropic response"),i}catch{throw bFr(`Provider error: ${JSON.stringify(t)}`,500,"provider_error")}}mapGeminiFinishReason(t){switch(t){case"STOP":return"end_turn";case"MAX_TOKENS":return"max_tokens";case"SAFETY":case"RECITATION":return"stop_sequence";default:return"end_turn"}}},c0e=new l0e;var klt=ne(Blt(),1);function mA(e){return e?typeof e.entries=="function"?Object.fromEntries(e.entries()):{...e}:{}}function Rlt(e){let t=String(e?.["x-thinking-level"]??"medium").toLowerCase();return["off","low","medium","high"].includes(t)?t:"medium"}function Mzr(e,t){if(t==="off"){delete e.reasoning;return}e.reasoning={effort:t}}function Fzr(e,t){if(t==="off"){delete e.reasoning;return}e.reasoning={effort:t,summary:"auto"}}function Qzr(e,t="chat"){let r={request:{},response:{},openai:{request:{},response:{}}};return r.request.model=e.request.body.model,r.request.messages=e.request.body.messages,r.request.system=e.request.body.system,r.response.content=e.response.body.content,t==="responses"?(r.openai.request.model=e.openai.request.body.model,r.openai.request.input=e.openai.request.body.input,r.openai.response.output=e.openai.response.body?.output):(r.openai.request.model=e.openai.request.body.model,r.openai.request.messages=e.openai.request.body.messages,r.openai.response.choices=e.openai.response.body.choices),r}function oU(e,t,r){EG(t,e),_G(t,Qzr(e,r),r)}function AR(e){let t=[],r=e.getReader(),n,i=new Promise(u=>n=u),o=!1,s=()=>{o||(o=!0,n(Buffer.concat(t).toString("utf8")))};return{stream:new ReadableStream({async pull(u){try{let{done:l,value:c}=await r.read();if(l){u.close(),s();return}t.push(c),u.enqueue(c)}catch(l){u.error(l),s()}},cancel(u){r.cancel(u).catch(()=>{}),s()}}),done:i}}function sU(e){let t=new Headers(e);return t.delete("content-encoding"),t.delete("content-length"),t.delete("transfer-encoding"),t}function LCe(e,t,r,n,i){let o;try{o={type:"error",error:{type:"api_error",message:JSON.parse(i).error?.message??`${e}: ${n}`,code:`${t}_${r}_ERROR`}}}catch{o={type:"error",error:{type:"api_error",message:`${e}: ${n}`,code:`${t}_${r}_ERROR`}}}return new Response(JSON.stringify(o),{status:r,statusText:n,headers:{"Content-Type":"application/json"}})}var Olt=["/v1/messages"];function PCe(e){let t;try{typeof e=="string"?t=new vT(e):e instanceof vT?t=e:t=new vT(e.url)}catch{return""}let r=t.pathname;for(let n of Olt){let i=r.indexOf(n);if(i!==-1)return t.origin+r.slice(0,i)}return t.origin}function NK(e,t){let r=typeof e=="string"?e:e instanceof vT?e.toString():e.url,n;try{n=new vT(r).pathname}catch{return!1}return Olt.some(i=>n.includes(i))&&(t.method==="POST"||t.method==="post")}function Lzr(e){return async(t,r)=>{if(!NK(t,r))return e(t,r);let n=JSON.parse(r.body),i=await OV.transformRequestOut(n),o=PCe(t)+"/chat/completions",s=mA(r.headers),a=s.authorization??s.Authorization??"";Mzr(i,Rlt(s));let u=await e(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify(i),signal:r.signal});if(!u.ok){let _=await u.text();return le(`OpenAI Chat Completions API error: ${u.status}`,{url:o,errorResponse:_}),LCe("OpenAI Chat Completions API error","OPENROUTER",u.status,u.statusText,_)}let l=n.stream===!0,c=s["x-agent-id"],f={request:{url:o,method:r.method,headers:s,body:n},response:{status:u.status,statusText:u.statusText,headers:mA(u.headers)},openai:{request:{body:i},response:{}}};if(!l){let _=await u.text(),C=new Response(_,{status:u.status,statusText:u.statusText,headers:sU(u.headers)}),S=await OV.transformResponseIn(C,n),T=await S.text();try{oU({...f,openai:{...f.openai,response:{body:JSON.parse(_)}},response:{...f.response,body:JSON.parse(T)}},c)}catch(x){le("\u65E5\u5FD7\u89E3\u6790\u9519\u8BEF(Chat \u975E\u6D41\u5F0F):",x)}return new Response(T,{status:S.status,statusText:S.statusText,headers:S.headers})}let A=AR(u.body),m=new Response(A.stream,{status:u.status,statusText:u.statusText,headers:sU(u.headers)}),g=await OV.transformResponseIn(m,n),E=AR(g.body);return Promise.all([A.done,E.done]).then(async([_,C])=>{try{oU({...f,openai:{...f.openai,response:{body:await iet(_)}},response:{...f.response,body:await JL(C)}},c)}catch(S){le("\u65E5\u5FD7\u89E3\u6790\u9519\u8BEF(Chat \u6D41\u5F0F):"+S?.stack)}}).catch(_=>le("\u65E5\u5FD7\u805A\u5408\u9519\u8BEF(Chat):"+_)),new Response(E.stream,{status:g.status,statusText:g.statusText,headers:g.headers})}}function Pzr(e){return async(t,r)=>{if(!NK(t,r))return e(t,r);let n=JSON.parse(r.body),i=await kV.transformRequestOut(n),o=mA(r.headers);Fzr(i,Rlt(o));let s=JSON.stringify(i),u=PCe(t)+"/responses",l=o.authorization??o.Authorization??"";if(!l)return new Response(JSON.stringify({type:"error",error:{type:"api_error",message:"Missing Authorization header",code:"RESPONSES_AUTH_MISSING"}}),{status:401,headers:{"Content-Type":"application/json"}});let c=await e(u,{method:"POST",headers:{"Content-Type":"application/json",Authorization:l,"x-api-key":l.replace(/^Bearer\s+/i,"").trim()},body:s,signal:r.signal});if(!c.ok){let S=await c.text();return le(`OpenAI Responses API error: ${c.status} ${c.statusText}`,{url:u,status:c.status,errorResponse:S}),LCe("OpenAI Responses API error","RESPONSES",c.status,c.statusText,S)}let f=n.stream===!0,A=o["x-agent-id"],m={request:{url:u,method:r.method,headers:o,body:n},response:{status:c.status,statusText:c.statusText,headers:mA(c.headers)},openai:{request:{body:i},response:{}}};if(!f){let S=await c.text(),T=new Response(S,{status:c.status,statusText:c.statusText,headers:sU(c.headers)}),x=await kV.transformResponseIn(T,n),O=await x.text();try{oU({...m,openai:{...m.openai,response:{body:JSON.parse(S)}},response:{...m.response,body:JSON.parse(O)}},A,"responses")}catch(q){le("\u65E5\u5FD7\u89E3\u6790\u9519\u8BEF(Responses \u975E\u6D41\u5F0F):",q)}return new Response(O,{status:x.status,statusText:x.statusText,headers:x.headers})}let g=AR(c.body),E=new Response(g.stream,{status:c.status,statusText:c.statusText,headers:sU(c.headers)}),_=await kV.transformResponseIn(E,n),C=AR(_.body);return Promise.all([g.done,C.done]).then(async([S,T])=>{try{oU({...m,openai:{...m.openai,response:{body:await net(S)}},response:{...m.response,body:await JL(T)}},A,"responses")}catch(x){le("\u65E5\u5FD7\u89E3\u6790\u9519\u8BEF(Responses \u6D41\u5F0F):"+x?.stack)}}).catch(S=>le("\u65E5\u5FD7\u805A\u5408\u9519\u8BEF(Responses):"+S)),new Response(C.stream,{status:_.status,statusText:_.statusText,headers:_.headers})}}function Uzr(e){return async(t,r)=>{if(!NK(t,r))return e(t,r);let n=JSON.parse(r.body),i=mA(r.headers),o=await c0e.transformRequestOut(n),s=JSON.stringify(o),a=PCe(t)+`/models/${n.model}:streamGenerateContent?alt=sse`,u=i.authorization??i.Authorization??"",l;try{l=await e(a,{method:"POST",headers:{"Content-Type":"application/json","x-goog-api-key":String(u).replace(/^Bearer\s+/i,"").trim()},body:s,signal:r.signal})}catch(C){throw le("gemini request error:",C),C}if(!l.ok){let C=await l.text();return le(`Gemini API error response: ${l.status} ${l.statusText}`,{url:a,status:l.status,errorResponse:C}),LCe("Gemini API error","Gemini",l.status,l.statusText,C)}let c=n.stream===!0,f=i["x-agent-id"],A={request:{url:a,method:r.method,headers:mA(r.headers),body:n},response:{status:l.status,statusText:l.statusText,headers:mA(l.headers)},openai:{request:{body:o},response:{}}},m=AR(l.body),g=new Response(m.stream,{status:l.status,statusText:l.statusText,headers:sU(l.headers)}),E=await c0e.transformResponseIn(g),_=AR(E.body);return Promise.all([m.done,_.done]).then(async([C,S])=>{try{let T=c?oet(C):JSON.parse(C),x=c?await JL(S):JSON.parse(S);oU({...A,openai:{...A.openai,response:{body:T}},response:{...A.response,body:x}},f)}catch(T){le("\u65E5\u5FD7\u89E3\u6790\u9519\u8BEF(Gemini):"+T?.stack)}}).catch(C=>le("\u65E5\u5FD7\u805A\u5408\u9519\u8BEF(Gemini):"+C)),new Response(_.stream,{status:E.status,statusText:E.statusText,headers:E.headers})}}function Hzr(e){return async(t,r)=>{if(!NK(t,r))return e(t,r);let n=r.body;if(r.body)try{let f=JSON.parse(r.body);n=JSON.stringify(f)}catch{}let i=mA(r.headers);["1","true"].includes(String(process.env.HAWA_CODE_X_API_KEY_DISABLED??"").toLowerCase())&&(delete i["x-api-key"],delete i["X-API-Key"]),["1","true"].includes(String(process.env.HAWA_CODE_AUTH_DISABLED??"").toLowerCase())&&(delete i.authorization,delete i.Authorization),delete i["content-length"];let a=await e(t,{method:r.method,headers:i,body:n,signal:r.signal});if(!a.ok){let f=await a.text();le(`API error response: ${a.status} ${a.statusText}`,{url:typeof t=="string"?t:t instanceof vT?t.toString():t.url,status:a.status,errorResponse:f});let A;try{let m=JSON.parse(f);A={type:"error",error:{type:"api_error",message:m.error?.message||m.message||`API error: ${a.statusText}`,code:m.error?.code||m.code||`API_${a.status}_ERROR`}},m.error?.details&&(A.error.details=m.error.details)}catch{A={type:"error",error:{type:"api_error",message:`API error: ${a.statusText}`,code:`API_${a.status}_ERROR`}}}return new Response(JSON.stringify(A),{status:a.status,statusText:a.statusText,headers:{"Content-Type":"application/json"}})}let u=a.clone(),l=!(Object.hasOwn(JSON.parse(n),"stream")&&!JSON.parse(n).stream),c={request:{url:typeof t=="string"?t:t instanceof vT?t.toString():t.url,method:r.method,headers:mA(r.headers),body:JSON.parse(n)},response:{status:a.status,statusText:a.statusText,headers:mA(a.headers)}};return(async()=>{if(l){let m=await a.text();c.response.body=await JL(m)}else c.response.body=await a.json();let A=mA(r.headers)["x-agent-id"];EG(A,c),_G(A,{request:c.request.body.messages,response:c.response.body.content})})().catch(f=>le(`\u65E5\u5FD7\u89E3\u6790\u9519\u8BEF:
|
|
753
753
|
Stack trace: `+f.stack)),new Response(u.body,{status:a.status,statusText:a.statusText,headers:a.headers})}}var QCe=null,Nlt=!1;function qzr(){if(Nlt)return QCe;Nlt=!0;let e=process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.https_proxy||process.env.http_proxy;return e&&(QCe=new klt.ProxyAgent({uri:e}),Gt(`[proxy] using proxy: ${e}`)),QCe}function Gzr(){let e=qzr();return e?((t,r={})=>global.fetch(t,{...r,dispatcher:e})):global.fetch}function RK(e){let t=e||process.env.API_TYPE,r=Gzr();switch(t){case"openai":return Lzr(r);case"openai-responses":return Pzr(r);case"gemini":return Uzr(r);default:return Hzr(r)}}var jzr=ne(be(),1);function Mlt(e,t){let r=[],n=Math.max(1,Math.floor(t)),i="",o=0;for(let s of e){let a=$zr(s);i&&o+a>n?(r.push(i),i=s,o=a):(i+=s,o+=a)}return i&&r.push(i),r}function $zr(e){if(e===" ")return 4;let t=e.codePointAt(0);return t===void 0||t===0||t<32||t>=127&&t<160||zzr(t)?0:Yzr(t)?2:1}function zzr(e){return e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071}function Yzr(e){return e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744&&e<=128591||e>=129280&&e<=129535||e>=131072&&e<=262141)}function AA(e){if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),n=(e%6e4/1e3).toFixed(1);return t>0?`${t}h ${r}m ${n}s`:r>0?`${r}m ${n}s`:`${n}s`}function iC(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e).toLowerCase()}He();Vu();var v0={totalCost:0,totalAPIDuration:0,startTime:Date.now(),inputTokens:0,outputTokens:0};function OK(e,t){v0.totalCost+=e,v0.totalAPIDuration+=t}function kK(e,t){v0.inputTokens+=e,v0.outputTokens+=t,Sn.emit("token:change",{inputTokens:v0.inputTokens,outputTokens:v0.outputTokens})}function Vzr(){return Date.now()-v0.startTime}function Wzr(e){return`$${e>.5?Kzr(e,100).toFixed(2):e.toFixed(4)}`}function Flt(){return yr.grey(`Total cost: ${Wzr(v0.totalCost)}
|
|
754
754
|
Total duration (API): ${AA(v0.totalAPIDuration)}
|
|
755
|
-
Total duration (wall): ${AA(Vzr())}`)}function Kzr(e,t){return Math.round(e*t)/t}He();Pe();Pe();var UCe="1.38.
|
|
755
|
+
Total duration (wall): ${AA(Vzr())}`)}function Kzr(e,t){return Math.round(e*t)/t}He();Pe();Pe();var UCe="1.38.2";globalThis.MACRO={VERSION:UCe,PACKAGE_URL:`@dahawa/${Ao}`,README_URL:"https://github.com/italking/hawa-code",ISSUES_EXPLAINER:"report the issue at https://github.com/italking/hawa-code/issues"};var MK=process.env.HAWA_CODE_USER_AGENT||`${Ao}/${UCe} (${process.env.USER_TYPE})`;import{randomUUID as N_}from"crypto";var Jzr=()=>[],Zzr=()=>{};function FK(){return Jzr}function Qlt(){return Zzr}He();ir();Nr();He();Pe();import{existsSync as B0,readdirSync as yWr,statSync as bWr}from"fs";import{join as aC,relative as CWr}from"path";import{homedir as uft}from"os";import{platform as SWr}from"process";import{readFile as uC}from"fs/promises";Nr();D0();Dr();import{join as nYr,sep as iYr}from"path";function $p(){if(!Gp())return!1;try{let e=ur();if(e.autoMemory?.teamMemoryEnabled!==void 0)return e.autoMemory.teamMemoryEnabled}catch{}return!1}function vf(){return(nYr(Le(),".hcode","team-memory")+iYr).normalize("NFC")}function qCe(e){let t=e.normalize("NFC"),r=vf();return t.startsWith(r)}var lft=ne(WK(),1);xi();var ift=ne(WK(),1);Nr();Pe();He();ad();import{readFile as rft}from"fs/promises";import{existsSync as o1e,readdirSync as gWr,statSync as hWr}from"fs";import{join as s1e,relative as oft}from"path";import{homedir as EWr}from"os";function nft(e){try{let t=(0,ift.default)(e),r=t.data.paths,n=[];return typeof r=="string"?n=r.split(",").map(i=>i.trim()).filter(Boolean):Array.isArray(r)&&(n=r.filter(i=>typeof i=="string")),{paths:n,content:t.content.trim()}}catch(t){return we(t),{paths:[],content:e.trim()}}}function _Wr(e,t){return t.length===0?!0:t.some(r=>{try{return tl(e,r,{matchBase:!0,dot:!0})}catch(n){return we(n),!1}})}function a1e(e){let t=[];try{if(!o1e(e))return t;let r=gWr(e);for(let n of r){let i=s1e(e,n),o=hWr(i);o.isDirectory()?t.push(...a1e(i)):o.isFile()&&n.endsWith(".md")&&t.push(i)}}catch(r){we(r)}return t}async function sft(){let e=[];try{let t=s1e(EWr(),dn,"rules");if(o1e(t)){let r=a1e(t);for(let n of r)try{let i=await rft(n,"utf-8"),{paths:o,content:s}=nft(i);o.length>0&&e.push({filePath:n,content:s,paths:o,isProjectRule:!1})}catch(i){we(i)}}}catch(t){we(t)}try{let t=s1e(Le(),dn,"rules");if(o1e(t)){let r=a1e(t);for(let n of r)try{let i=await rft(n,"utf-8"),{paths:o,content:s}=nft(i);o.length>0&&e.push({filePath:oft(Le(),n),content:s,paths:o,isProjectRule:!0})}catch(i){we(i)}}}catch(t){we(t)}return e}function aft(e,t){e=AY(e);let r=AY(Le()),n=e.startsWith(r)?oft(r,e):e;return t.filter(i=>_Wr(n,i.paths))}var IWr=`# hawaCodeMd
|
|
756
756
|
Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.`;function TWr(e="default"){let r=Ge.getSessionContext(e).getData("matchedPathRules");return!r||r.length===0?"":r.map(i=>{let o=i.isProjectRule?"project instructions, checked into the codebase":"user's private global instructions for all projects";return`Contents of ${i.filePath} (${o}):
|
|
757
757
|
|
|
758
758
|
${i.content}`}).join(`
|
|
@@ -1015,7 +1015,7 @@ try {
|
|
|
1015
1015
|
`],{encoding:"utf8",maxBuffer:jAt,stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function xXr(){try{let e=VU("where",["pwsh.exe"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim().split(/\r?\n/)[0];if(e)return e}catch{}return"powershell.exe"}var wXr="[Image pasted]";function JAt(e){return function(t){return(new Map(e).get(t)??(()=>{}))(t)}}function XAt({value:e,onChange:t,onSubmit:r,onExit:n,onExitMessage:i,onMessage:o,onHistoryUp:s,onHistoryDown:a,onHistoryReset:u,mask:l="",multiline:c=!1,cursorChar:f,invert:A,columns:m,onImagePaste:g,disableCursorMovementForUpDownKeys:E=!1,externalOffset:_,onOffsetChange:C}){let S=_,T=C,x=jU.fromText(e,m,S),[O,q]=(0,ZAt.useState)(null);function $(){O&&(clearTimeout(O),q(null),o?.(!1))}let H=YT(ce=>{$(),i?.(ce,"Ctrl-C")},()=>n?.(),()=>{e&&(t(""),u?.())}),M=YT(ce=>{$(),o?.(!!e&&ce,"Press Escape again to clear")},()=>{e&&t("")});function Y(){return jU.fromText("",m,0)}let z=YT(ce=>i?.(ce,"Ctrl-D"),()=>n?.());function fe(){return $(),x.text===""?(z(),x):x.del()}function me(){if(l)return x;let ce=KAt();return ce===null?(WAt()&&(o?.(!0,VAt),$(),q(setTimeout(()=>{o?.(!1)},4e3))),x):(g?.(ce),x.insert(wXr))}let F=JAt([["a",()=>x.startOfLine()],["b",()=>x.left()],["c",H],["d",fe],["e",()=>x.endOfLine()],["f",()=>x.right()],["h",()=>($(),x.backspace())],["k",()=>x.deleteToLineEnd()],["l",()=>Y()],["n",()=>ee()],["p",()=>ae()],["u",()=>x.deleteToLineStart()],["v",me],["w",()=>x.deleteWordBefore()],["o",me]]),ue=JAt([["b",()=>x.prevWord()],["f",()=>x.nextWord()],["d",()=>x.deleteWordAfter()]]);function Ae(ce){if(c&&x.offset>0&&x.text[x.offset-1]==="\\")return x.backspace().insert(`
|
|
1016
1016
|
`);if(ce.meta)return x.insert(`
|
|
1017
1017
|
`);r?.(e)}function ae(){if(E)return s?.(),x;let ce=x.up();return ce.equals(x)&&s?.(),ce}function ee(){if(E)return a?.(),x;let ce=x.down();return ce.equals(x)&&a?.(),ce}function ve(ce,$e){if($e.tab)return;if($e.backspace||$e.delete||ce==="\b"||ce==="\x7F"||ce==="\b"){let K=x.backspace();x.equals(K)||(T(K.offset),x.text!==K.text&&t(K.text));return}if(!$e.ctrl&&!$e.meta&&ce.length>1){let K=x.insert(ce);x.equals(K)||(T(K.offset),x.text!==K.text&&t(K.text));return}let _e=Ie($e)(ce);_e&&(x.equals(_e)||(T(_e.offset),x.text!==_e.text&&t(_e.text)))}function Ie(ce){if(ce.backspace||ce.delete)return $(),()=>x.backspace();switch(!0){case ce.escape:return M;case(ce.leftArrow&&(ce.ctrl||ce.meta||"fn"in ce&&ce.fn)):return()=>x.prevWord();case(ce.rightArrow&&(ce.ctrl||ce.meta||"fn"in ce&&ce.fn)):return()=>x.nextWord();case ce.ctrl:return F;case("home"in ce&&ce.home):return()=>x.startOfLine();case("end"in ce&&ce.end):return()=>x.endOfLine();case ce.pageDown:return()=>x.endOfLine();case ce.pageUp:return()=>x.startOfLine();case ce.meta:return ue;case ce.return:return()=>Ae(ce);case ce.upArrow:return ae;case ce.downArrow:return ee;case ce.leftArrow:return()=>x.left();case ce.rightArrow:return()=>x.right()}return function($e){switch(!0){case($e=="\x1B[H"||$e=="\x1B[1~"):return x.startOfLine();case($e=="\x1B[F"||$e=="\x1B[4~"):return x.endOfLine();case($e==="\b"||$e==="\x7F"||$e==="\b"):return $(),x.backspace();default:return x.insert($e.replace(/\r/g,`
|
|
1018
|
-
`))}}}return{onInput:ve,renderedValue:x.render(f,l,A),offset:S,setOffset:T}}function WU({value:e,placeholder:t="",focus:r=!0,mask:n,multiline:i=!1,highlightPastedText:o=!1,showCursor:s=!0,onChange:a,onSubmit:u,onExit:l,onHistoryUp:c,onHistoryDown:f,onExitMessage:A,onMessage:m,onHistoryReset:g,columns:E,onImagePaste:_,onPaste:C,isDimmed:S=!1,disableCursorMovementForUpDownKeys:T=!1,cursorOffset:x,onChangeCursorOffset:O}){let{onInput:q,renderedValue:$}=XAt({value:e,onChange:a,onSubmit:u,onExit:l,onExitMessage:A,onMessage:m,onHistoryReset:g,onHistoryUp:c,onHistoryDown:f,focus:r,mask:n,multiline:i,cursorChar:s?" ":"",highlightPastedText:o,invert:ue=>yr.bgHex("#ffffff").hex("#000000")(ue),themeText:ue=>yr.hex(Ee().text)(ue),columns:E,onImagePaste:_,disableCursorMovementForUpDownKeys:T,externalOffset:x,onOffsetChange:O}),[H,M]=bSe.default.useState({chunks:[],timeoutId:null}),Y=ue=>(ue&&clearTimeout(ue),setTimeout(()=>{M(({chunks:Ae})=>{let ae=Ae.join("");return Promise.resolve().then(()=>C(ae)),{chunks:[],timeoutId:null}})},100));ar((ue,Ae)=>{if(C&&(ue.length>10||H.timeoutId)){M(({chunks:ae,timeoutId:ee})=>({chunks:[...ae,ue],timeoutId:Y(ee)}));return}q(ue,Ae)},{isActive:r});let fe=t?yr.hex(Ee().secondaryText)(t):void 0,me=ue=>yr.bgHex("#ffffff").hex("#000000")(ue);s&&r&&(fe=t.length>0?me(t[0])+yr.hex(Ee().secondaryText)(t.slice(1)):me(" "));let F=e.length==0&&t;return bSe.default.createElement(v,{wrap:"truncate-end",dimColor:S},F?fe:$)}var CSe=ne(be(),1),KU=ne(be(),1);hU();Vu();xi();$T();Dr();var egt=process.platform==="darwin"?["\xB7","\u2722","\u2733","\u2217","\u273B","\u273D"]:["\xB7","\u2722","*","\u2217","\u273B","\u273D"];function JT(){let e=[...egt,...[...egt].reverse()],[t,r]=(0,KU.useState)(0);return(0,KU.useEffect)(()=>{let n=setInterval(()=>{r(i=>(i+1)%e.length)},120);return()=>clearInterval(n)},[e.length]),CSe.createElement(N,{flexWrap:"nowrap",height:1,width:2},CSe.createElement(v,{color:Ee().claude},e[t]))}xi();function fC(){return Ge.getSessionContext().window_size?{...Ge.getSessionContext().window_size}:{columns:process.stdout.columns||80,rows:process.stdout.rows||24}}Pe();import{homedir as o3}from"os";import{join as XR}from"path";import{existsSync as s3,mkdirSync as Ght,appendFileSync as qht,readFileSync as $ht,constants as vrn,writeFileSync as Drn,unlinkSync as zht,statSync as xrn}from"fs";import{platform as Yht}from"process";He();import{accessSync as wrn}from"fs";He();var ubi=ne(GSe(),1);var Trn="1.38.
|
|
1018
|
+
`))}}}return{onInput:ve,renderedValue:x.render(f,l,A),offset:S,setOffset:T}}function WU({value:e,placeholder:t="",focus:r=!0,mask:n,multiline:i=!1,highlightPastedText:o=!1,showCursor:s=!0,onChange:a,onSubmit:u,onExit:l,onHistoryUp:c,onHistoryDown:f,onExitMessage:A,onMessage:m,onHistoryReset:g,columns:E,onImagePaste:_,onPaste:C,isDimmed:S=!1,disableCursorMovementForUpDownKeys:T=!1,cursorOffset:x,onChangeCursorOffset:O}){let{onInput:q,renderedValue:$}=XAt({value:e,onChange:a,onSubmit:u,onExit:l,onExitMessage:A,onMessage:m,onHistoryReset:g,onHistoryUp:c,onHistoryDown:f,focus:r,mask:n,multiline:i,cursorChar:s?" ":"",highlightPastedText:o,invert:ue=>yr.bgHex("#ffffff").hex("#000000")(ue),themeText:ue=>yr.hex(Ee().text)(ue),columns:E,onImagePaste:_,disableCursorMovementForUpDownKeys:T,externalOffset:x,onOffsetChange:O}),[H,M]=bSe.default.useState({chunks:[],timeoutId:null}),Y=ue=>(ue&&clearTimeout(ue),setTimeout(()=>{M(({chunks:Ae})=>{let ae=Ae.join("");return Promise.resolve().then(()=>C(ae)),{chunks:[],timeoutId:null}})},100));ar((ue,Ae)=>{if(C&&(ue.length>10||H.timeoutId)){M(({chunks:ae,timeoutId:ee})=>({chunks:[...ae,ue],timeoutId:Y(ee)}));return}q(ue,Ae)},{isActive:r});let fe=t?yr.hex(Ee().secondaryText)(t):void 0,me=ue=>yr.bgHex("#ffffff").hex("#000000")(ue);s&&r&&(fe=t.length>0?me(t[0])+yr.hex(Ee().secondaryText)(t.slice(1)):me(" "));let F=e.length==0&&t;return bSe.default.createElement(v,{wrap:"truncate-end",dimColor:S},F?fe:$)}var CSe=ne(be(),1),KU=ne(be(),1);hU();Vu();xi();$T();Dr();var egt=process.platform==="darwin"?["\xB7","\u2722","\u2733","\u2217","\u273B","\u273D"]:["\xB7","\u2722","*","\u2217","\u273B","\u273D"];function JT(){let e=[...egt,...[...egt].reverse()],[t,r]=(0,KU.useState)(0);return(0,KU.useEffect)(()=>{let n=setInterval(()=>{r(i=>(i+1)%e.length)},120);return()=>clearInterval(n)},[e.length]),CSe.createElement(N,{flexWrap:"nowrap",height:1,width:2},CSe.createElement(v,{color:Ee().claude},e[t]))}xi();function fC(){return Ge.getSessionContext().window_size?{...Ge.getSessionContext().window_size}:{columns:process.stdout.columns||80,rows:process.stdout.rows||24}}Pe();import{homedir as o3}from"os";import{join as XR}from"path";import{existsSync as s3,mkdirSync as Ght,appendFileSync as qht,readFileSync as $ht,constants as vrn,writeFileSync as Drn,unlinkSync as zht,statSync as xrn}from"fs";import{platform as Yht}from"process";He();import{accessSync as wrn}from"fs";He();var ubi=ne(GSe(),1);var Trn="1.38.2",i3={VERSION:Trn,PACKAGE_URL:"@dahawa/hawa-code",README_URL:"https://github.com/italking/hawa-code",ISSUES_EXPLAINER:"report the issue at https://github.com/italking/hawa-code/issues"};Pe();var XT=XR(wI,".update.lock"),Brn=300*1e3;function jht(){try{if(s3(wI)||Ght(wI,{recursive:!0}),s3(XT)){let e=xrn(XT);if(Date.now()-e.mtimeMs<Brn)return!1;try{zht(XT)}catch(r){return we(`Failed to remove stale lock file: ${r}`),!1}}return Drn(XT,`${process.pid}`,"utf8"),!0}catch(e){return we(`Failed to acquire lock: ${e}`),!1}}function Vht(){try{s3(XT)&&$ht(XT,"utf8")===`${process.pid}`&&zht(XT)}catch(e){we(`Failed to release lock: ${e}`)}}async function $Se(){try{let e=await Kn("npm -g config get prefix");if(e.code!==0)return we("Failed to check npm permissions"),{hasPermissions:!1,npmPrefix:null};let t=e.stdout.trim(),r=!1;try{wrn(t,vrn.W_OK),r=!0}catch{r=!1}return r?{hasPermissions:!0,npmPrefix:t}:(we("Insufficient permissions for global npm install."),{hasPermissions:!1,npmPrefix:t})}catch(e){return we(`Failed to verify npm global install permissions: ${e}`),{hasPermissions:!1,npmPrefix:null}}}async function Wht(e){if(!jht())throw dt("tengu_auto_updater_prefix_lock_contention",{pid:String(process.pid),currentVersion:i3.VERSION,prefix:e}),new Error("Another process is currently setting up npm prefix");try{s3(e)||Ght(e,{recursive:!0});let t=await Kn(`npm -g config set prefix ${e}`);if(t.code!==0)throw new Error(`Failed to set npm prefix: ${t.stderr}`);let r=`
|
|
1019
1019
|
# npm global path
|
|
1020
1020
|
export PATH="${e}/bin:$PATH"
|
|
1021
1021
|
`;if(Yht==="win32"){let n=await Kn(`setx PATH "${process.env.PATH};${e}"`);if(n.code!==0)throw new Error(`Failed to update PATH on Windows: ${n.stderr}`)}else{let n=[XR(o3(),".bashrc"),XR(o3(),".bash_profile"),XR(o3(),".zshrc"),XR(o3(),".config","fish","config.fish")];for(let i of n)if(s3(i))try{if(!$ht(i,"utf8").includes(e)){if(i.includes("fish")){let s=`
|