@aiiware/aii 0.16.33 → 0.16.34

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/bin/aii +11 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -9,7 +9,7 @@ An autonomous AI assistant that lives in your terminal. Ask it anything — it r
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <strong>npm:</strong> <code>@aiiware/aii</code> · <strong>Version:</strong> 0.16.33 · <strong>Node.js:</strong> >= 18
12
+ <strong>npm:</strong> <code>@aiiware/aii</code> · <strong>Version:</strong> 0.16.34 · <strong>Node.js:</strong> >= 18
13
13
  </p>
14
14
 
15
15
  ---
package/bin/aii CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @aiiware/aii v0.16.33
3
+ * @aiiware/aii v0.16.34
4
4
  *
5
5
  * AI-powered CLI assistant for terminal productivity
6
6
  *
@@ -194,7 +194,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
194
194
  `)+`\r
195
195
  \r
196
196
  `+r)}function Xa(t,e,r,n,s,i){if(t.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,Xa),t.emit("wsClientError",o,r,e)}else Em(r,n,s,i)}});var _pe,Epe,ype,Spe,bpe,Tpe,I9,wpe,zi,$C=k(()=>{_pe=Rt(S9(),1),Epe=Rt(uE(),1),ype=Rt(Yc(),1),Spe=Rt(AC(),1),bpe=Rt(RC(),1),Tpe=Rt(LC(),1),I9=Rt(fE(),1),wpe=Rt(D9(),1),zi=I9.default});var M9={};Ie(M9,{configureLogger:()=>gE,debug:()=>V,error:()=>O9,formatError:()=>_E,info:()=>R9,logger:()=>M,success:()=>x9,warn:()=>N9});function gE(t){ym={...ym,...t}}function Sm(t){return ym.emojis?t+" ":""}function Ja(t,e){return ym.colors?e(t):t}function V(t,...e){ym.debug&&console.debug(Ja(`[DEBUG] ${t}`,p.gray),...e)}function R9(t,...e){console.log(t,...e)}function N9(t,...e){console.warn(Ja(`${Sm("\u26A0\uFE0F")}${t}`,p.yellow),...e)}function O9(t,...e){console.error(Ja(`${Sm("\u274C")}${t}`,p.red),...e)}function x9(t,...e){console.log(Ja(`${Sm("\u2705")}${t}`,p.green),...e)}function _E(t){let e=[];return e.push(Ja(`${Sm("\u274C")}${t.message}`,p.red)),t.suggestions&&t.suggestions.length>0&&(e.push(""),e.push(Ja(`${Sm("\u{1F4A1}")}Solutions:`,p.yellow)),t.suggestions.forEach((r,n)=>{e.push(Ja(` ${n+1}. ${r}`,p.gray))})),e.join(`
197
- `)}var Cpe,ym,M,_t=k(()=>{"use strict";ve();Cpe={debug:!1,colors:!0,emojis:!0},ym={...Cpe};M={debug:V,info:R9,warn:N9,error:O9,success:x9,formatError:_E,configure:gE}});function P9(t){return typeof t=="number"&&Number.isInteger(t)&&t>0?t:1}function EE(t,e){if(typeof t!="object"||t===null)return{kind:"malformed",reason:"frame is not an object"};let r=t.type;return typeof r!="string"?{kind:"malformed",reason:'frame has no string "type"'}:e.has(r)?{kind:"ok",frame:t}:{kind:"unknown",type:r,protocolVersion:P9(t.protocol_version)}}function UC(t){return t==null||typeof t=="object"}function SE(t){switch(t.type){case"tool_request":return UC(t.input);case"mcp_tool_request":return UC(t.params);case"tool_batch_request":{let e=t.tools;return e==null||Array.isArray(e)&&e.every(r=>r==null||typeof r=="object"&&UC(r.input))}default:return!0}}function bE(t){return P9(t)>2?"hard":"compatible"}function TE(t){return`This Aii Server speaks protocol v${t}, but your CLI speaks v2. Some responses may not work correctly. Update with: aii upgrade`}var L9,F9,yE,BC=k(()=>{"use strict";L9=new Set(["token","complete","error","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),F9=new Set(["session_started","turn_ready","token","iteration_tokens_usage","tool_request","tool_batch_request","tool_status","complete","error","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),yE=new Set(["tool_request","tool_batch_request","mcp_tool_request"])});var $9={};Ie($9,{MCPConfigManager:()=>or,MCP_CATALOG:()=>Za});import*as Qn from"fs";import*as wE from"path";import*as GC from"os";var Za,or,el=k(()=>{"use strict";Za={github:{name:"GitHub",description:"GitHub API integration for repos, issues, PRs, and more",command:"npx",args:["-y","@modelcontextprotocol/server-github"],env:{GITHUB_PERSONAL_ACCESS_TOKEN:"${GITHUB_TOKEN}"},category:"development"},filesystem:{name:"Filesystem",description:"Read/write files on the local filesystem",command:"npx",args:["-y","@modelcontextprotocol/server-filesystem",GC.homedir()],category:"system"},"brave-search":{name:"Brave Search",description:"Web search using Brave Search API",command:"npx",args:["-y","@brave/brave-search-mcp-server"],env:{BRAVE_API_KEY:"${BRAVE_API_KEY}"},category:"search"},sqlite:{name:"SQLite",description:"Query SQLite databases",command:"uvx",args:["mcp-server-sqlite","--db-path","./database.db"],category:"database"},postgres:{name:"PostgreSQL",description:"Query PostgreSQL databases",command:"npx",args:["-y","@anthropic/mcp-server-postgres"],env:{DATABASE_URL:"${DATABASE_URL}"},category:"database"},"chrome-devtools":{name:"Chrome DevTools",description:"Control Chrome browser via DevTools protocol",command:"npx",args:["chrome-devtools-mcp@latest"],category:"browser"},memory:{name:"Memory",description:"Persistent memory storage for conversation context",command:"npx",args:["-y","@modelcontextprotocol/server-memory"],category:"utility"},puppeteer:{name:"Puppeteer",description:"Browser automation with Puppeteer",command:"npx",args:["-y","@anthropic/mcp-server-puppeteer"],category:"browser"}},or=class{configPath;constructor(e){this.configPath=e||wE.join(GC.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let e=wE.dirname(this.configPath);Qn.existsSync(e)||Qn.mkdirSync(e,{recursive:!0})}loadConfig(){if(!Qn.existsSync(this.configPath))return{mcpServers:{}};try{let e=Qn.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(e){try{return this.ensureConfigDir(),Qn.writeFileSync(this.configPath,JSON.stringify(e,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!Qn.existsSync(this.configPath))return!0;try{let e=this.configPath+".backup";return Qn.copyFileSync(this.configPath,e),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var Xc={};Ie(Xc,{ClientMCPExecutor:()=>zC});import{Client as vpe}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as kpe}from"@modelcontextprotocol/sdk/client/stdio.js";var zC,Jc=k(()=>{"use strict";el();_t();zC=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new or}async initialize(){if(this.initialized)return!0;try{let r=this.configManager.loadConfig().mcpServers||{};V(`Initializing MCP executor with ${Object.keys(r).length} servers`);for(let[n,s]of Object.entries(r)){if(s.enabled===!1){V(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,s)}catch(i){V(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,V(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(e){return V(`Failed to initialize MCP executor: ${e}`),!1}}async connectToServer(e,r){let n=r.command,s=Array.isArray(r.args)?r.args:[r.args||""],i={...process.env};if(r.env)for(let[u,d]of Object.entries(r.env)){let m=String(d).replace(/\$\{(\w+)\}/g,(f,h)=>process.env[h]||"");i[u]=m}V(`Connecting to MCP server: ${e}`),V(` command: ${n}`),V(` args: ${JSON.stringify(s)}`);let o=new kpe({command:n,args:s,env:i,stderr:"pipe"}),a=new vpe({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await a.connect(o);let c=(await a.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:e}));this.connections.set(e,{client:a,transport:o,tools:c});for(let u of c)this.toolToServer.set(u.name,e);V(`Connected to ${e}: discovered ${c.length} tools`)}async handleQueryTools(e){let r=e.request_id||"unknown";V(`Handling mcp_query_tools request: ${r}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let s=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return V(`Found ${s.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:r,success:!0,tools:s}}catch(n){return V(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:r,success:!1,error:String(n),tools:[]}}}async handleToolExecution(e){let r=e.request_id||"unknown",n=e.tool_name,s=e.arguments||{};if(V(`Handling mcp_tool_request: ${r} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:r,success:!1,error:"Missing tool_name in request"};this.initialized||await this.initialize();try{let i=this.toolToServer.get(n);if(!i)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let o=this.connections.get(i);if(!o)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Server '${i}' not connected`};let a=await Promise.race([o.client.callTool({name:n,arguments:s}),new Promise((c,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),l=this.makeContentSerializable(a.content);return V(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:r,success:!a.isError,content:l,server_name:i,error:a.isError?"Tool returned error":void 0}}catch(i){return V(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:r,success:!1,error:String(i)}}}makeContentSerializable(e){if(e==null)return null;if(Array.isArray(e))return e.map(r=>this.makeContentSerializable(r));if(typeof e=="object"){let r=e;if(r.type==="text"&&typeof r.text=="string")return{type:"text",text:r.text};if(r.type==="image")return{type:"image",data:r.data,mimeType:r.mimeType};let n={};for(let[s,i]of Object.entries(r))n[s]=this.makeContentSerializable(i);return n}return e}async shutdown(){V("Shutting down MCP executor");for(let[e,r]of this.connections)try{await r.client.close(),V(`Closed connection to ${e}`)}catch(n){V(`Error closing ${e}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var Y9=b((l6e,$pe)=>{$pe.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var XC=b((c6e,W9)=>{"use strict";var RE=Object.assign({},Y9()),j9=Object.keys(RE);Object.defineProperty(RE,"random",{get(){let t=Math.floor(Math.random()*j9.length),e=j9[t];return RE[e]}});W9.exports=RE});function rl({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var NE=k(()=>{});var Z9=b((C6e,J9)=>{J9.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Qpe,Xpe,Jpe,Zpe,eme,tme,rme,nl,xE,Wo,cv=k(()=>{"use strict";ve();Qpe={name:"classic",label:"Classic",description:"Aii jellyfish blue-purple (default)",accentColorName:"#3B82F6",userInputTextColorName:"#93C5FD",colors:{accent:p.hex("#3B82F6"),userInput:p.hex("#3B82F6"),userInputText:p.hex("#93C5FD"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#A855F7"),link:p.hex("#3B82F6").underline,heading:p.hex("#A855F7").bold,filePath:p.hex("#3B82F6"),indicator:p.hex("#3B82F6")}},Xpe={name:"brand",label:"Brand",description:"aiiware.com official palette",accentColorName:"#4E6BF5",userInputTextColorName:"#A5B4FC",colors:{accent:p.hex("#4E6BF5"),userInput:p.hex("#4E6BF5"),userInputText:p.hex("#A5B4FC"),success:p.hex("#28CA41"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#4E6BF5"),link:p.hex("#4E6BF5").underline,heading:p.hex("#4E6BF5").bold,filePath:p.hex("#4E6BF5"),indicator:p.hex("#4E6BF5")}},Jpe={name:"teal",label:"Teal",description:"Original teal accent",accentColorName:"#00BCD4",userInputTextColorName:"#67E8F9",colors:{accent:p.hex("#00BCD4"),userInput:p.hex("#00BCD4"),userInputText:p.hex("#67E8F9"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#00BCD4"),link:p.hex("#00BCD4").underline,heading:p.hex("#00BCD4").bold,filePath:p.hex("#00BCD4"),indicator:p.hex("#00BCD4")}},Zpe={name:"indigo",label:"Indigo",description:"Bright periwinkle-blue",accentColorName:"#6B8AFF",userInputTextColorName:"#A5B4FC",colors:{accent:p.hex("#6B8AFF"),userInput:p.hex("#6B8AFF"),userInputText:p.hex("#A5B4FC"),success:p.hex("#28CA41"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#6B8AFF"),link:p.hex("#6B8AFF").underline,heading:p.hex("#6B8AFF").bold,filePath:p.hex("#6B8AFF"),indicator:p.hex("#6B8AFF")}},eme={name:"forest",label:"Forest",description:"Natural green",accentColorName:"#22C55E",userInputTextColorName:"#86EFAC",colors:{accent:p.hex("#22C55E"),userInput:p.hex("#22C55E"),userInputText:p.hex("#86EFAC"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#22C55E"),link:p.hex("#22C55E").underline,heading:p.hex("#22C55E").bold,filePath:p.hex("#22C55E"),indicator:p.hex("#22C55E")}},tme={name:"amber",label:"Amber",description:"Warm orange-gold",accentColorName:"#F59E0B",userInputTextColorName:"#FCD34D",colors:{accent:p.hex("#F59E0B"),userInput:p.hex("#F59E0B"),userInputText:p.hex("#FCD34D"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#F59E0B"),link:p.hex("#F59E0B").underline,heading:p.hex("#F59E0B").bold,filePath:p.hex("#F59E0B"),indicator:p.hex("#F59E0B")}},rme={name:"grayscale",label:"Grayscale",description:"Accessible, no colors",accentColorName:"white",userInputTextColorName:"#CBD5E1",colors:{accent:p.reset,userInput:p.reset,userInputText:p.hex("#CBD5E1"),success:p.reset,warning:p.reset,error:p.bold,muted:p.dim,dim:p.dim,code:p.reset,link:p.underline,heading:p.bold,filePath:p.reset,indicator:p.bold}},nl={classic:Qpe,brand:Xpe,teal:Jpe,indigo:Zpe,forest:eme,amber:tme,grayscale:rme},xE="classic",Wo=["classic","brand","teal","indigo","forest","amber","grayscale"]});var sl={};Ie(sl,{ThemeManager:()=>qi,getAccentColorName:()=>Ae,getThemeColors:()=>H,getUserInputTextColorName:()=>eu});function H(){return qi.getInstance().getColors()}function Ae(){return qi.getInstance().getAccentColorName()}function eu(){return qi.getInstance().getUserInputTextColorName()}var qi,Vo=k(()=>{"use strict";cv();qi=class t{static instance=null;activeTheme;constructor(){this.activeTheme=nl[xE]}static getInstance(){return t.instance||(t.instance=new t),t.instance}getTheme(){return this.activeTheme}getColors(){return this.activeTheme.colors}getThemeName(){return this.activeTheme.name}setTheme(e){let r=nl[e];if(!r){let n=Wo.join(", ");throw new Error(`Unknown theme: "${e}". Available themes: ${n}`)}this.activeTheme=r}isValidTheme(e){return e in nl}getAvailableThemes(){return Wo.map(e=>nl[e])}getAccentColorName(){return this.activeTheme.accentColorName}getUserInputTextColorName(){return this.activeTheme.userInputTextColorName}reset(){this.activeTheme=nl[xE]}}});var ft=k(()=>{"use strict";cv();Vo()});import{resolve as nme}from"path";function sme(){let t=process.env.TERM??"",e=process.env.TERM_PROGRAM??"",r=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",s=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return e==="iTerm.app"||e==="Hyper"||e==="vscode"||e==="WezTerm"||e==="Alacritty"||n||s||t.includes("xterm-256color")||t.includes("screen-256color")||t.includes("tmux")||t==="xterm-kitty"||r==="truecolor"?!0:!(t==="dumb"||!process.stdout.isTTY)}function wm(){return uv===null&&(uv=sme()),uv}function ime(){return process.platform==="darwin"?"Cmd":"Ctrl"}function n5(){return r5||!wm()?"":(r5=!0,` (${ime()}+Click to open)`)}function ome(t,e){return wm()?`\x1B]8;;${e}\x07${t}\x1B]8;;\x07`:t}function s5(t,e){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;r&&t.startsWith(r)&&(n="~"+t.slice(r.length));let s=e?`${n}:${e}`:n;if(!wm())return H().filePath(s);let i=H().accent(s),a=`file://${nme(t)}`;return e!==void 0&&e>0&&(a+=`#L${e}`),ome(i,a)}var uv,r5,i5=k(()=>{"use strict";ft();uv=null,r5=!1});var c5={};Ie(c5,{VERSION:()=>il,colors:()=>F,formatCode:()=>hme,formatPath:()=>vm,getActionIndicator:()=>fme,padEndAnsi:()=>yme,printAction:()=>ame,printDivider:()=>l5,printError:()=>pme,printExitSummary:()=>dv,printHeader:()=>mme,printSuccess:()=>ume,printToolComplete:()=>lme,printToolFailed:()=>cme,printToolResultCompact:()=>tu,printWarning:()=>dme,shortenPath:()=>_me});function Cm(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z]:\\/.test(t)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(t)||/^src\//.test(t)||/^lib\//.test(t)||/^test[s]?\//.test(t)}function ame(t,e,r=console.log){let n=Cm(e)?vm(e):F.filePath(e);r(F.dim("\u25CB ")+p.bold(t)+" "+n)}function lme(t,e,r=console.log){let n=Cm(e)?vm(e):F.filePath(e);r(F.success("\u2713 ")+p.bold(t)+" "+n)}function cme(t,e,r,n=console.log){let s=Cm(e)?vm(e):F.filePath(e);n(F.error("\u2717 ")+p.bold(t)+" "+s),r&&n(F.dim(" \u2192 ")+F.error(r))}function tu(t,e,r=!0,n,s=console.log){let i=r?F.success("\u25CF"):F.error("\u25CF"),o=60,a=e.length>o?e.slice(0,o-3)+"...":e;if(Cm(e)){let u=e.match(/:(\d+)$/),d=u?parseInt(u[1],10):void 0,m=u?e.replace(/:(\d+)$/,""):e;a=vm(m,d)}s(`${i} ${p.bold(t)}(${a})`);let l=Cm(e)?F.dim(n5()):"",c=!l&&!o5?F.dim(" (ctrl+o to expand)"):"";if(c&&(o5=!0),n){let u=r?F.dim:F.error;s(u(`\u2514 ${n}`)+l+c)}else{let u=r?"(No content)":"(Error)",d=r?F.dim:F.error;s(d(`\u2514 ${u}`)+l+c)}}function ume(t){console.log(F.success("\u2713 ")+t)}function dme(t){console.log(F.warning("\u26A0 ")+t)}function pme(t){console.log(F.error("\u2717 ")+t)}function l5(t=60){console.log(F.dim("\u2500".repeat(t)))}function mme(t){console.log(F.logo(t)),l5(t.length)}function fme(t){return F.thinking(`[${t}]`)}function vm(t,e){if(wm())return s5(t,e);let r=process.env.HOME??process.env.USERPROFILE??"",n=t;return r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),e&&(n+=`:${e}`),F.filePath(n)}function hme(t){return F.code(t)}function gme(){return process.stdout.columns||80}function _me(t,e=40){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;if(r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),n.length<=e)return n;let s=n.split("/").filter(o=>o.length>0);if(s.length>=2){let o=s.slice(-2).join("/");if(o.length<=e-4)return".../"+o}return".../"+(s[s.length-1]||s[s.length-2])}function Eme(t){return t.replace(/\x1b\[[0-9;]*m/g,"").length}function yme(t,e){let r=Eme(t),n=Math.max(0,e-r);return t+" ".repeat(n)}function Sme(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return r>0?`${e}m ${r}s`:`${e}m`}function a5(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function dv(t){let e=gme(),r=Math.min(e-2,76),n=r-4,s=(m,f)=>{let h=m.replace(/\x1b\[[0-9;]*m/g,"").length;return m+" ".repeat(Math.max(0,f-h))},i=m=>F.border("\u2502")+" "+s(m,n)+" "+F.border("\u2502"),o=(m,f,h,g)=>{let _=Math.floor(n/2),E=F.dim(m.padEnd(15))+f,S=F.dim(h.padEnd(15))+g;return i(s(E,_)+S)},a=Sme(t.durationSeconds),l=a5(t.tokensIn),c=a5(t.tokensOut),u=`$${t.totalCost.toFixed(4)}`,d=`${t.provider}/${t.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(F.border("\u250C"+"\u2500".repeat(r-2)+"\u2510")),console.log(i(F.logo("Session complete. \u{1FABC}"))),console.log(F.border("\u251C"+"\u2500".repeat(r-2)+"\u2524")),console.log(i(F.logo("Session Summary"))),console.log(i(F.dim("\u2500".repeat(15)))),console.log(o("Duration",a,"Tool Calls",t.toolCalls.toString())),console.log(o("Turns",t.turns.toString(),"Files Modified",t.filesModified.toString())),console.log(i("")),console.log(i(F.logo("Token Usage"))),console.log(i(F.dim("\u2500".repeat(11)))),console.log(o("Input",l,"Output",c)),console.log(i(F.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(F.dim("Model: ")+F.model(d))),console.log(F.border("\u2514"+"\u2500".repeat(r-2)+"\u2518")),console.log("")}var il,F,o5,ar=k(()=>{"use strict";ve();i5();ft();il="0.16.33",F={get logo(){return H().accent.bold},get prompt(){return H().accent.bold},get model(){return H().accent},get success(){return H().success},get warning(){return H().warning},get error(){return H().error},get thinking(){return H().dim},get filePath(){return H().filePath},get code(){return H().code},get muted(){return H().muted},get dim(){return H().dim},get safe(){return H().success},get risky(){return H().warning},get destructive(){return H().error},get border(){return H().accent},get bannerBorder(){return H().accent}};o5=!1});var Jn,ru,pv=k(()=>{"use strict";Jn={maxConcurrent:5,maxIterations:100,timeout:3e5,autoBackgroundTimeout:12e4,compressionLevel:"medium",permissionMode:"default"},ru={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var ME,mv=k(()=>{"use strict";ME=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
197
+ `)}var Cpe,ym,M,_t=k(()=>{"use strict";ve();Cpe={debug:!1,colors:!0,emojis:!0},ym={...Cpe};M={debug:V,info:R9,warn:N9,error:O9,success:x9,formatError:_E,configure:gE}});function P9(t){return typeof t=="number"&&Number.isInteger(t)&&t>0?t:1}function EE(t,e){if(typeof t!="object"||t===null)return{kind:"malformed",reason:"frame is not an object"};let r=t.type;return typeof r!="string"?{kind:"malformed",reason:'frame has no string "type"'}:e.has(r)?{kind:"ok",frame:t}:{kind:"unknown",type:r,protocolVersion:P9(t.protocol_version)}}function UC(t){return t==null||typeof t=="object"}function SE(t){switch(t.type){case"tool_request":return UC(t.input);case"mcp_tool_request":return UC(t.params);case"tool_batch_request":{let e=t.tools;return e==null||Array.isArray(e)&&e.every(r=>r==null||typeof r=="object"&&UC(r.input))}default:return!0}}function bE(t){return P9(t)>2?"hard":"compatible"}function TE(t){return`This Aii Server speaks protocol v${t}, but your CLI speaks v2. Some responses may not work correctly. Update with: aii upgrade`}var L9,F9,yE,BC=k(()=>{"use strict";L9=new Set(["token","complete","error","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),F9=new Set(["session_started","turn_ready","token","iteration_tokens_usage","tool_request","tool_batch_request","tool_status","complete","error","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),yE=new Set(["tool_request","tool_batch_request","mcp_tool_request"])});var $9={};Ie($9,{MCPConfigManager:()=>or,MCP_CATALOG:()=>Za});import*as Qn from"fs";import*as wE from"path";import*as GC from"os";var Za,or,el=k(()=>{"use strict";Za={github:{name:"GitHub",description:"GitHub API integration for repos, issues, PRs, and more",command:"npx",args:["-y","@modelcontextprotocol/server-github"],env:{GITHUB_PERSONAL_ACCESS_TOKEN:"${GITHUB_TOKEN}"},category:"development"},filesystem:{name:"Filesystem",description:"Read/write files on the local filesystem",command:"npx",args:["-y","@modelcontextprotocol/server-filesystem",GC.homedir()],category:"system"},"brave-search":{name:"Brave Search",description:"Web search using Brave Search API",command:"npx",args:["-y","@brave/brave-search-mcp-server"],env:{BRAVE_API_KEY:"${BRAVE_API_KEY}"},category:"search"},sqlite:{name:"SQLite",description:"Query SQLite databases",command:"uvx",args:["mcp-server-sqlite","--db-path","./database.db"],category:"database"},postgres:{name:"PostgreSQL",description:"Query PostgreSQL databases",command:"npx",args:["-y","@anthropic/mcp-server-postgres"],env:{DATABASE_URL:"${DATABASE_URL}"},category:"database"},"chrome-devtools":{name:"Chrome DevTools",description:"Control Chrome browser via DevTools protocol",command:"npx",args:["chrome-devtools-mcp@latest"],category:"browser"},memory:{name:"Memory",description:"Persistent memory storage for conversation context",command:"npx",args:["-y","@modelcontextprotocol/server-memory"],category:"utility"},puppeteer:{name:"Puppeteer",description:"Browser automation with Puppeteer",command:"npx",args:["-y","@anthropic/mcp-server-puppeteer"],category:"browser"}},or=class{configPath;constructor(e){this.configPath=e||wE.join(GC.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let e=wE.dirname(this.configPath);Qn.existsSync(e)||Qn.mkdirSync(e,{recursive:!0})}loadConfig(){if(!Qn.existsSync(this.configPath))return{mcpServers:{}};try{let e=Qn.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(e){try{return this.ensureConfigDir(),Qn.writeFileSync(this.configPath,JSON.stringify(e,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!Qn.existsSync(this.configPath))return!0;try{let e=this.configPath+".backup";return Qn.copyFileSync(this.configPath,e),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var Xc={};Ie(Xc,{ClientMCPExecutor:()=>zC});import{Client as vpe}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as kpe}from"@modelcontextprotocol/sdk/client/stdio.js";var zC,Jc=k(()=>{"use strict";el();_t();zC=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new or}async initialize(){if(this.initialized)return!0;try{let r=this.configManager.loadConfig().mcpServers||{};V(`Initializing MCP executor with ${Object.keys(r).length} servers`);for(let[n,s]of Object.entries(r)){if(s.enabled===!1){V(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,s)}catch(i){V(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,V(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(e){return V(`Failed to initialize MCP executor: ${e}`),!1}}async connectToServer(e,r){let n=r.command,s=Array.isArray(r.args)?r.args:[r.args||""],i={...process.env};if(r.env)for(let[u,d]of Object.entries(r.env)){let m=String(d).replace(/\$\{(\w+)\}/g,(f,h)=>process.env[h]||"");i[u]=m}V(`Connecting to MCP server: ${e}`),V(` command: ${n}`),V(` args: ${JSON.stringify(s)}`);let o=new kpe({command:n,args:s,env:i,stderr:"pipe"}),a=new vpe({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await a.connect(o);let c=(await a.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:e}));this.connections.set(e,{client:a,transport:o,tools:c});for(let u of c)this.toolToServer.set(u.name,e);V(`Connected to ${e}: discovered ${c.length} tools`)}async handleQueryTools(e){let r=e.request_id||"unknown";V(`Handling mcp_query_tools request: ${r}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let s=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return V(`Found ${s.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:r,success:!0,tools:s}}catch(n){return V(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:r,success:!1,error:String(n),tools:[]}}}async handleToolExecution(e){let r=e.request_id||"unknown",n=e.tool_name,s=e.arguments||{};if(V(`Handling mcp_tool_request: ${r} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:r,success:!1,error:"Missing tool_name in request"};this.initialized||await this.initialize();try{let i=this.toolToServer.get(n);if(!i)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let o=this.connections.get(i);if(!o)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Server '${i}' not connected`};let a=await Promise.race([o.client.callTool({name:n,arguments:s}),new Promise((c,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),l=this.makeContentSerializable(a.content);return V(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:r,success:!a.isError,content:l,server_name:i,error:a.isError?"Tool returned error":void 0}}catch(i){return V(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:r,success:!1,error:String(i)}}}makeContentSerializable(e){if(e==null)return null;if(Array.isArray(e))return e.map(r=>this.makeContentSerializable(r));if(typeof e=="object"){let r=e;if(r.type==="text"&&typeof r.text=="string")return{type:"text",text:r.text};if(r.type==="image")return{type:"image",data:r.data,mimeType:r.mimeType};let n={};for(let[s,i]of Object.entries(r))n[s]=this.makeContentSerializable(i);return n}return e}async shutdown(){V("Shutting down MCP executor");for(let[e,r]of this.connections)try{await r.client.close(),V(`Closed connection to ${e}`)}catch(n){V(`Error closing ${e}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var Y9=b((l6e,$pe)=>{$pe.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var XC=b((c6e,W9)=>{"use strict";var RE=Object.assign({},Y9()),j9=Object.keys(RE);Object.defineProperty(RE,"random",{get(){let t=Math.floor(Math.random()*j9.length),e=j9[t];return RE[e]}});W9.exports=RE});function rl({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var NE=k(()=>{});var Z9=b((C6e,J9)=>{J9.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Qpe,Xpe,Jpe,Zpe,eme,tme,rme,nl,xE,Wo,cv=k(()=>{"use strict";ve();Qpe={name:"classic",label:"Classic",description:"Aii jellyfish blue-purple (default)",accentColorName:"#3B82F6",userInputTextColorName:"#93C5FD",colors:{accent:p.hex("#3B82F6"),userInput:p.hex("#3B82F6"),userInputText:p.hex("#93C5FD"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#A855F7"),link:p.hex("#3B82F6").underline,heading:p.hex("#A855F7").bold,filePath:p.hex("#3B82F6"),indicator:p.hex("#3B82F6")}},Xpe={name:"brand",label:"Brand",description:"aiiware.com official palette",accentColorName:"#4E6BF5",userInputTextColorName:"#A5B4FC",colors:{accent:p.hex("#4E6BF5"),userInput:p.hex("#4E6BF5"),userInputText:p.hex("#A5B4FC"),success:p.hex("#28CA41"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#4E6BF5"),link:p.hex("#4E6BF5").underline,heading:p.hex("#4E6BF5").bold,filePath:p.hex("#4E6BF5"),indicator:p.hex("#4E6BF5")}},Jpe={name:"teal",label:"Teal",description:"Original teal accent",accentColorName:"#00BCD4",userInputTextColorName:"#67E8F9",colors:{accent:p.hex("#00BCD4"),userInput:p.hex("#00BCD4"),userInputText:p.hex("#67E8F9"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#00BCD4"),link:p.hex("#00BCD4").underline,heading:p.hex("#00BCD4").bold,filePath:p.hex("#00BCD4"),indicator:p.hex("#00BCD4")}},Zpe={name:"indigo",label:"Indigo",description:"Bright periwinkle-blue",accentColorName:"#6B8AFF",userInputTextColorName:"#A5B4FC",colors:{accent:p.hex("#6B8AFF"),userInput:p.hex("#6B8AFF"),userInputText:p.hex("#A5B4FC"),success:p.hex("#28CA41"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#6B8AFF"),link:p.hex("#6B8AFF").underline,heading:p.hex("#6B8AFF").bold,filePath:p.hex("#6B8AFF"),indicator:p.hex("#6B8AFF")}},eme={name:"forest",label:"Forest",description:"Natural green",accentColorName:"#22C55E",userInputTextColorName:"#86EFAC",colors:{accent:p.hex("#22C55E"),userInput:p.hex("#22C55E"),userInputText:p.hex("#86EFAC"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#22C55E"),link:p.hex("#22C55E").underline,heading:p.hex("#22C55E").bold,filePath:p.hex("#22C55E"),indicator:p.hex("#22C55E")}},tme={name:"amber",label:"Amber",description:"Warm orange-gold",accentColorName:"#F59E0B",userInputTextColorName:"#FCD34D",colors:{accent:p.hex("#F59E0B"),userInput:p.hex("#F59E0B"),userInputText:p.hex("#FCD34D"),success:p.hex("#22C55E"),warning:p.hex("#EAB308"),error:p.hex("#EF4444"),muted:p.hex("#94A3B8"),dim:p.dim,code:p.hex("#F59E0B"),link:p.hex("#F59E0B").underline,heading:p.hex("#F59E0B").bold,filePath:p.hex("#F59E0B"),indicator:p.hex("#F59E0B")}},rme={name:"grayscale",label:"Grayscale",description:"Accessible, no colors",accentColorName:"white",userInputTextColorName:"#CBD5E1",colors:{accent:p.reset,userInput:p.reset,userInputText:p.hex("#CBD5E1"),success:p.reset,warning:p.reset,error:p.bold,muted:p.dim,dim:p.dim,code:p.reset,link:p.underline,heading:p.bold,filePath:p.reset,indicator:p.bold}},nl={classic:Qpe,brand:Xpe,teal:Jpe,indigo:Zpe,forest:eme,amber:tme,grayscale:rme},xE="classic",Wo=["classic","brand","teal","indigo","forest","amber","grayscale"]});var sl={};Ie(sl,{ThemeManager:()=>qi,getAccentColorName:()=>Ae,getThemeColors:()=>H,getUserInputTextColorName:()=>eu});function H(){return qi.getInstance().getColors()}function Ae(){return qi.getInstance().getAccentColorName()}function eu(){return qi.getInstance().getUserInputTextColorName()}var qi,Vo=k(()=>{"use strict";cv();qi=class t{static instance=null;activeTheme;constructor(){this.activeTheme=nl[xE]}static getInstance(){return t.instance||(t.instance=new t),t.instance}getTheme(){return this.activeTheme}getColors(){return this.activeTheme.colors}getThemeName(){return this.activeTheme.name}setTheme(e){let r=nl[e];if(!r){let n=Wo.join(", ");throw new Error(`Unknown theme: "${e}". Available themes: ${n}`)}this.activeTheme=r}isValidTheme(e){return e in nl}getAvailableThemes(){return Wo.map(e=>nl[e])}getAccentColorName(){return this.activeTheme.accentColorName}getUserInputTextColorName(){return this.activeTheme.userInputTextColorName}reset(){this.activeTheme=nl[xE]}}});var ft=k(()=>{"use strict";cv();Vo()});import{resolve as nme}from"path";function sme(){let t=process.env.TERM??"",e=process.env.TERM_PROGRAM??"",r=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",s=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return e==="iTerm.app"||e==="Hyper"||e==="vscode"||e==="WezTerm"||e==="Alacritty"||n||s||t.includes("xterm-256color")||t.includes("screen-256color")||t.includes("tmux")||t==="xterm-kitty"||r==="truecolor"?!0:!(t==="dumb"||!process.stdout.isTTY)}function wm(){return uv===null&&(uv=sme()),uv}function ime(){return process.platform==="darwin"?"Cmd":"Ctrl"}function n5(){return r5||!wm()?"":(r5=!0,` (${ime()}+Click to open)`)}function ome(t,e){return wm()?`\x1B]8;;${e}\x07${t}\x1B]8;;\x07`:t}function s5(t,e){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;r&&t.startsWith(r)&&(n="~"+t.slice(r.length));let s=e?`${n}:${e}`:n;if(!wm())return H().filePath(s);let i=H().accent(s),a=`file://${nme(t)}`;return e!==void 0&&e>0&&(a+=`#L${e}`),ome(i,a)}var uv,r5,i5=k(()=>{"use strict";ft();uv=null,r5=!1});var c5={};Ie(c5,{VERSION:()=>il,colors:()=>F,formatCode:()=>hme,formatPath:()=>vm,getActionIndicator:()=>fme,padEndAnsi:()=>yme,printAction:()=>ame,printDivider:()=>l5,printError:()=>pme,printExitSummary:()=>dv,printHeader:()=>mme,printSuccess:()=>ume,printToolComplete:()=>lme,printToolFailed:()=>cme,printToolResultCompact:()=>tu,printWarning:()=>dme,shortenPath:()=>_me});function Cm(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z]:\\/.test(t)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(t)||/^src\//.test(t)||/^lib\//.test(t)||/^test[s]?\//.test(t)}function ame(t,e,r=console.log){let n=Cm(e)?vm(e):F.filePath(e);r(F.dim("\u25CB ")+p.bold(t)+" "+n)}function lme(t,e,r=console.log){let n=Cm(e)?vm(e):F.filePath(e);r(F.success("\u2713 ")+p.bold(t)+" "+n)}function cme(t,e,r,n=console.log){let s=Cm(e)?vm(e):F.filePath(e);n(F.error("\u2717 ")+p.bold(t)+" "+s),r&&n(F.dim(" \u2192 ")+F.error(r))}function tu(t,e,r=!0,n,s=console.log){let i=r?F.success("\u25CF"):F.error("\u25CF"),o=60,a=e.length>o?e.slice(0,o-3)+"...":e;if(Cm(e)){let u=e.match(/:(\d+)$/),d=u?parseInt(u[1],10):void 0,m=u?e.replace(/:(\d+)$/,""):e;a=vm(m,d)}s(`${i} ${p.bold(t)}(${a})`);let l=Cm(e)?F.dim(n5()):"",c=!l&&!o5?F.dim(" (ctrl+o to expand)"):"";if(c&&(o5=!0),n){let u=r?F.dim:F.error;s(u(`\u2514 ${n}`)+l+c)}else{let u=r?"(No content)":"(Error)",d=r?F.dim:F.error;s(d(`\u2514 ${u}`)+l+c)}}function ume(t){console.log(F.success("\u2713 ")+t)}function dme(t){console.log(F.warning("\u26A0 ")+t)}function pme(t){console.log(F.error("\u2717 ")+t)}function l5(t=60){console.log(F.dim("\u2500".repeat(t)))}function mme(t){console.log(F.logo(t)),l5(t.length)}function fme(t){return F.thinking(`[${t}]`)}function vm(t,e){if(wm())return s5(t,e);let r=process.env.HOME??process.env.USERPROFILE??"",n=t;return r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),e&&(n+=`:${e}`),F.filePath(n)}function hme(t){return F.code(t)}function gme(){return process.stdout.columns||80}function _me(t,e=40){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;if(r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),n.length<=e)return n;let s=n.split("/").filter(o=>o.length>0);if(s.length>=2){let o=s.slice(-2).join("/");if(o.length<=e-4)return".../"+o}return".../"+(s[s.length-1]||s[s.length-2])}function Eme(t){return t.replace(/\x1b\[[0-9;]*m/g,"").length}function yme(t,e){let r=Eme(t),n=Math.max(0,e-r);return t+" ".repeat(n)}function Sme(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return r>0?`${e}m ${r}s`:`${e}m`}function a5(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function dv(t){let e=gme(),r=Math.min(e-2,76),n=r-4,s=(m,f)=>{let h=m.replace(/\x1b\[[0-9;]*m/g,"").length;return m+" ".repeat(Math.max(0,f-h))},i=m=>F.border("\u2502")+" "+s(m,n)+" "+F.border("\u2502"),o=(m,f,h,g)=>{let _=Math.floor(n/2),E=F.dim(m.padEnd(15))+f,S=F.dim(h.padEnd(15))+g;return i(s(E,_)+S)},a=Sme(t.durationSeconds),l=a5(t.tokensIn),c=a5(t.tokensOut),u=`$${t.totalCost.toFixed(4)}`,d=`${t.provider}/${t.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(F.border("\u250C"+"\u2500".repeat(r-2)+"\u2510")),console.log(i(F.logo("Session complete. \u{1FABC}"))),console.log(F.border("\u251C"+"\u2500".repeat(r-2)+"\u2524")),console.log(i(F.logo("Session Summary"))),console.log(i(F.dim("\u2500".repeat(15)))),console.log(o("Duration",a,"Tool Calls",t.toolCalls.toString())),console.log(o("Turns",t.turns.toString(),"Files Modified",t.filesModified.toString())),console.log(i("")),console.log(i(F.logo("Token Usage"))),console.log(i(F.dim("\u2500".repeat(11)))),console.log(o("Input",l,"Output",c)),console.log(i(F.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(F.dim("Model: ")+F.model(d))),console.log(F.border("\u2514"+"\u2500".repeat(r-2)+"\u2518")),console.log("")}var il,F,o5,ar=k(()=>{"use strict";ve();i5();ft();il="0.16.34",F={get logo(){return H().accent.bold},get prompt(){return H().accent.bold},get model(){return H().accent},get success(){return H().success},get warning(){return H().warning},get error(){return H().error},get thinking(){return H().dim},get filePath(){return H().filePath},get code(){return H().code},get muted(){return H().muted},get dim(){return H().dim},get safe(){return H().success},get risky(){return H().warning},get destructive(){return H().error},get border(){return H().accent},get bannerBorder(){return H().accent}};o5=!1});var Jn,ru,pv=k(()=>{"use strict";Jn={maxConcurrent:5,maxIterations:100,timeout:3e5,autoBackgroundTimeout:12e4,compressionLevel:"medium",permissionMode:"default"},ru={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var ME,mv=k(()=>{"use strict";ME=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
198
198
 
199
199
  ## Core Capabilities
200
200
  You have access to these tools for codebase exploration:
@@ -956,7 +956,7 @@ The subagent runs its own ReAct loop with tools (read files, search code, run co
956
956
  Create ${e.projectConfigPath||".aii/hooks.json"} to add custom hooks.`;let r=[];r.push("\u{1FA9D} Configured Hooks:"),r.push("");let n=new Map;for(let s of e.hooks)n.has(s.event)||n.set(s.event,[]),n.get(s.event).push(s);for(let[s,i]of n){let o=e.disabledEvents.includes(s)?" (DISABLED)":"";r.push(` ${Ay[s]}${o}:`);for(let a of i){let l=a.enabled?"":" [disabled]",c=a.tools.length>0?` (tools: ${a.tools.join(", ")})`:"";a.type==="script"?r.push(` \u2022 Script: ${a.command}${c}${l}`):r.push(` \u2022 Prompt: ${a.prompt}${c}${l}`)}r.push("")}return(this.stopHookActive||this.iterationCount>0)&&r.push(`State: iteration=${this.iterationCount}, stopHookActive=${this.stopHookActive}`),r.join(`
957
957
  `)}mergePersonaHooks(e,r=null){this.personaHooks.clear();let n=e?.hooks;if(!(!n||typeof n!="object")){for(let[s,i]of Object.entries(n))if(Array.isArray(i)){let o=r?i.map(a=>({...a,_persona:r})):i;this.personaHooks.set(s,o)}}}clearPersonaHooks(){this.personaHooks.clear()}reload(){if(this.projectPath){let e={iterationCount:this.iterationCount,stopHookActive:this.stopHookActive,disabledEvents:new Set(this.disabledEvents)};this.initialize(this.projectPath),this.iterationCount=e.iterationCount,this.stopHookActive=e.stopHookActive,this.disabledEvents=e.disabledEvents,M.debug("Reloaded hook configuration")}}}});var Fu,P$=k(()=>{"use strict";cr();xu();Lu();Fu=class extends Be{name="TaskUpdate";get description(){return"Update a task's status or fields. Call to mark tasks in_progress before starting work and completed after finishing. Keep exactly ONE task in_progress at a time (unless tasks have different owners)."}permissionLevel="SAFE";inputSchema={type:"object",properties:{id:{type:"string",description:'Task ID to update (e.g., "task-1")'},status:{type:"string",description:"New status: pending, in_progress, or completed",enum:["pending","in_progress","completed"]},subject:{type:"string",description:"Updated task title"},description:{type:"string",description:"Updated description"},activeForm:{type:"string",description:"Updated spinner text"},owner:{type:"string",description:"Subagent name"},blockedBy:{type:"array",description:"Task IDs this depends on"}},required:["id"]};async execute(e,r){let n=e._callId||`taskupdate_${Date.now()}`,s=this.validateRequired(e,["id"]);if(s)return this.error(n,s);let i=e.id,o=es(),a=o.getTask(i);if(!a)return this.error(n,`Task not found: "${i}"`);let l={};e.status!==void 0&&(l.status=e.status),e.subject!==void 0&&(l.subject=e.subject),e.description!==void 0&&(l.description=e.description),e.activeForm!==void 0&&(l.activeForm=e.activeForm),e.owner!==void 0&&(l.owner=e.owner),e.blockedBy!==void 0&&(l.blockedBy=e.blockedBy);let c=o.updateTask(i,l);if(!c)return this.error(n,"Circular dependency detected. Remove the blockedBy to proceed.");let u=JSON.stringify({success:!0});return e.status==="completed"&&c.previousStatus!=="completed"&&mn.getInstance().fire("TaskCompleted",{session_id:r.session.id,cwd:r.cwd,transcript_path:"",task_id:i,subject:a.subject,owner:a.owner}).catch(()=>{}),e.status==="completed"&&es().consecutiveCompletions>=3&&(u+=`
958
958
 
959
- [System] Consider verifying your recent changes (e.g., run tests) before continuing.`,es().resetConsecutiveCompletions()),this.success(n,u)}formatAction(e){let r=e.id??"",n=e.status??"";return n?`${r} \u2192 ${n}`:r}}});var $u,L$=k(()=>{"use strict";cr();xu();$u=class extends Be{name="TaskList";get description(){return"List all current tasks with their status. Read-only \u2014 use to check progress when context is long."}permissionLevel="SAFE";inputSchema={type:"object",properties:{}};async execute(e,r){let n=e._callId||`tasklist_${Date.now()}`,s=es().getTasks();return this.success(n,JSON.stringify({tasks:s}))}formatAction(){let e=es().getTasks().length;return`${e} task${e!==1?"s":""}`}}});var fA=k(()=>{"use strict";R$();P$();L$()});function F$(t){return(t||24)-1}function ff(t){return Math.max(0,(t??24)-1)}function Iy(t,e){return Math.min(t,e)}function $$(t,e){return t.length>e?t.slice(t.length-e):t}function U$(t,e,r){return Math.min(Math.max(t,e),ff(r))}var B$=k(()=>{"use strict"});function Ry(t){return t.replace(/\x1b\[[0-9;:<=>?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]|\x1b/g,e=>/^\x1b\[[0-9;:<=>?]*[ -/]*m$/.test(e)?e:"").replace(/[\x00-\x08\x0b-\x1a\x1c-\x1f\x7f]/g,"")}function hf(t){return Ry(t).replace(/[\r\n\t]+/g," ")}function tge(t,e){if(t.length<=e)return t;if(e<=3)return t.slice(0,Math.max(0,e));let r=e-3,n=Math.ceil(r/2),s=r-n,i=t.length-n-s;return[...t.slice(0,n),"",` ... ${i} lines hidden ...`,"",...t.slice(t.length-s)]}function G$(t,e){if(e<=0)return"";if(t.length<=e)return t;let r=0,n="",s=0,i=!1,o=!1;for(;s<t.length;){if(t[s]==="\x1B"){let a=/^\x1b\[[0-9;:<=>?]*[ -/]*[@-~]/.exec(t.slice(s));if(a){n+=a[0],o=!0,s+=a[0].length;continue}}if(r>=e){i=!0;break}n+=t[s],r++,s++}return i&&o&&!n.endsWith("\x1B[0m")&&(n+="\x1B[0m"),n}function Y$(t,e,r,n,s){let o=`-- [${`${e+1}/${r}`}] ${hf(t.toolName)}(${hf(t.target)}) -- (ctrl+o to close, up/down to navigate) --`,a="-".repeat(48),l=Ry(t.output).split(`
959
+ [System] Consider verifying your recent changes (e.g., run tests) before continuing.`,es().resetConsecutiveCompletions()),this.success(n,u)}formatAction(e){let r=e.id??"",n=e.status??"";return n?`${r} \u2192 ${n}`:r}}});var $u,L$=k(()=>{"use strict";cr();xu();$u=class extends Be{name="TaskList";get description(){return"List all current tasks with their status. Read-only \u2014 use to check progress when context is long."}permissionLevel="SAFE";inputSchema={type:"object",properties:{}};async execute(e,r){let n=e._callId||`tasklist_${Date.now()}`,s=es().getTasks();return this.success(n,JSON.stringify({tasks:s}))}formatAction(){let e=es().getTasks().length;return`${e} task${e!==1?"s":""}`}}});var fA=k(()=>{"use strict";R$();P$();L$()});function F$(t){return(t||24)-1}function ff(t){return Math.max(0,(t??24)-1)}function Iy(t,e){return Math.min(t,e)}function $$(t,e){return t.length>e?t.slice(t.length-e):t}function U$(t,e,r){return Math.min(Math.max(t,e),ff(r))}var B$=k(()=>{"use strict"});function Ry(t){return(t??"").replace(/\x1b\[[0-9;:<=>?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]|\x1b/g,e=>/^\x1b\[[0-9;:<=>?]*[ -/]*m$/.test(e)?e:"").replace(/[\x00-\x08\x0b-\x1a\x1c-\x1f\x7f]/g,"")}function hf(t){return Ry(t).replace(/[\r\n\t]+/g," ")}function tge(t,e){if(t.length<=e)return t;if(e<=3)return t.slice(0,Math.max(0,e));let r=e-3,n=Math.ceil(r/2),s=r-n,i=t.length-n-s;return[...t.slice(0,n),"",` ... ${i} lines hidden ...`,"",...t.slice(t.length-s)]}function G$(t,e){if(e<=0)return"";if(t.length<=e)return t;let r=0,n="",s=0,i=!1,o=!1;for(;s<t.length;){if(t[s]==="\x1B"){let a=/^\x1b\[[0-9;:<=>?]*[ -/]*[@-~]/.exec(t.slice(s));if(a){n+=a[0],o=!0,s+=a[0].length;continue}}if(r>=e){i=!0;break}n+=t[s],r++,s++}return i&&o&&!n.endsWith("\x1B[0m")&&(n+="\x1B[0m"),n}function Y$(t,e,r,n,s){let o=`-- [${`${e+1}/${r}`}] ${hf(t.toolName)}(${hf(t.target)}) -- (ctrl+o to close, up/down to navigate) --`,a="-".repeat(48),l=Ry(t.output).split(`
960
960
  `);if(l.length>50){let c=l.length-25-25;l=[...l.slice(0,25),"",` ... ${c} lines hidden ...`,"",...l.slice(l.length-25)]}return l=tge(l,Math.max(1,n-2)),l=l.map(c=>G$(c,s)),[G$(o,s),...l,a].join(`
961
961
  `)}var z$,q$,H$,Ny=k(()=>{"use strict";z$="\x1B[?1049h\x1B[H",q$="\x1B[?1049l",H$="\x1B[2J\x1B[H"});var W$={};Ie(W$,{getUIStore:()=>ct,useUIStore:()=>ts});import{create as rge}from"zustand";var j$,ts,ct,gf=k(()=>{"use strict";j$={mode:"welcome",agentMode:"normal",status:"",isThinking:!1,isStreaming:!1,currentIteration:0,iterationStartTime:Date.now(),iterationTokens:0,contextPercent:0,contextLevel:"normal",contextTokens:0,contextLimit:2e5,sessionCost:0,provider:"",model:"",openrouterProvider:"",projectPath:process.cwd(),branch:void 0,worktreeName:void 0,baseBranch:void 0,soulName:"",personaName:"",toolsCount:0,mcpServersCount:0,mcpFailedCount:0,contextFilesCount:0,skillsCount:0,sessionStartTime:Date.now(),agentExecMs:0,agentTurnStartTime:null,renderEpoch:0,loopMode:!1,loopStartTime:null,loopMaxIterations:0,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0,loopPaused:!1,loopPauseUntil:null,loopDurationSeconds:0},ts=rge(t=>({...j$,setMode:e=>t({mode:e}),setAgentMode:e=>t({agentMode:e}),setStatus:e=>t({status:e}),setThinking:e=>t({isThinking:e}),setStreaming:e=>t(r=>{if(e&&!r.agentTurnStartTime)return{isStreaming:e,agentTurnStartTime:Date.now()};if(!e&&r.agentTurnStartTime){let n=Date.now()-r.agentTurnStartTime;return{isStreaming:e,agentExecMs:r.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:e}}),incrementIteration:()=>t(e=>({currentIteration:e.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:e=>t(r=>({iterationTokens:r.iterationTokens+e})),setIterationTokens:e=>t({iterationTokens:e}),updateContext:(e,r)=>{let n=r>0?Math.round(e/r*100):0,s=n>=90?"critical":n>=70?"warning":"normal";t({contextTokens:e,contextLimit:r,contextPercent:n,contextLevel:s})},updateSession:e=>t(e),updateResources:e=>t(e),setLoopMode:e=>t(e?{loopMode:e}:{loopMode:e,loopStartTime:null,loopMaxIterations:0,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0,loopPaused:!1,loopPauseUntil:null,loopDurationSeconds:0}),startLoop:(e,r)=>t({loopStartTime:e,loopMaxIterations:r,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0}),updateLoopStats:(e,r,n,s)=>t({loopTotalInputTokens:e,loopTotalOutputTokens:r,loopCost:n,loopToolCalls:s}),setLoopIteration:e=>t({loopCurrentIteration:e}),setLoopPaused:(e,r)=>t({loopPaused:e,loopPauseUntil:r}),setLoopDurationSeconds:e=>t({loopDurationSeconds:e}),incrementRenderEpoch:()=>t(e=>({renderEpoch:e.renderEpoch+1})),reset:()=>t(j$)})),ct=ts.getState});function EA(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Z$(t){El=t}function ut(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(hn.caret,"$1"),r=r.replace(s,o),n},getRegex:()=>new RegExp(r,e)};return n}function oi(t,e){if(e){if(hn.escapeTest.test(t))return t.replace(hn.escapeReplace,K$)}else if(hn.escapeTestNoEncode.test(t))return t.replace(hn.escapeReplaceNoEncode,K$);return t}function Q$(t){try{t=encodeURI(t).replace(hn.percentDecode,"%")}catch{return null}return t}function X$(t,e){let r=t.replace(hn.findPipe,(i,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(hn.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(hn.slashPipe,"|");return n}function Ef(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n;){let i=t.charAt(n-s-1);if(i===e&&!r)s++;else if(i!==e&&r)s++;else break}return t.slice(0,n-s)}function Lge(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function J$(t,e,r,n,s){let i=e.href,o=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function Fge(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
962
962
  `).map(i=>{let o=i.match(r.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=s.length?i.slice(s.length):i}).join(`
@@ -1067,9 +1067,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ce=$,_e=B);let Se={cod
1067
1067
  `),getCurrentLine:()=>{let r=e();return r.lines[r.cursorLine]},reset:()=>t(_W)})),ud=Rl.getState});var wI={};Ie(wI,{getCommandMenuStore:()=>J1,useCommandMenuStore:()=>Ol});import{create as Rke}from"zustand";function Nke(t,e){let r=e.startsWith("/")?e.slice(1).toLowerCase():e.toLowerCase();return r?t.filter(n=>!!(n.name.toLowerCase().startsWith(r)||n.aliases?.some(s=>s.toLowerCase().startsWith(r)))):t}var EW,Ol,J1,Z1=k(()=>{"use strict";EW={isVisible:!1,filter:"",selectedIndex:0,commands:[],filteredCommands:[]};Ol=Rke((t,e)=>({...EW,show:()=>{t(r=>({isVisible:!0,selectedIndex:0,filter:"",filteredCommands:r.commands}))},hide:()=>{t({isVisible:!1,filter:"",selectedIndex:0})},setFilter:r=>{t(n=>{let s=Nke(n.commands,r);return{filter:r,filteredCommands:s,selectedIndex:0}})},moveUp:()=>{t(r=>r.filteredCommands.length===0?r:{selectedIndex:(r.selectedIndex-1+r.filteredCommands.length)%r.filteredCommands.length})},moveDown:()=>{t(r=>r.filteredCommands.length===0?r:{selectedIndex:(r.selectedIndex+1)%r.filteredCommands.length})},setCommands:r=>{t({commands:r,filteredCommands:r,selectedIndex:0})},getSelected:()=>{let r=e();return r.filteredCommands[r.selectedIndex]??null},reset:()=>t(EW)})),J1=Ol.getState});import{jsx as Qt,jsxs as dd}from"react/jsx-runtime";import{Box as mo,Text as Ar}from"ink";function SW({version:t,width:e=90}){let r=Math.min(e,90),n=r-5,s=Math.floor(n*.42),i=n-s,o=` \u{1FABC} Aii CLI v${t} `;return dd(mo,{flexDirection:"column",width:r,children:[dd(mo,{children:[Qt(Ar,{color:Ae(),children:"\u250C\u2500"}),Qt(Ar,{bold:!0,children:o}),dd(Ar,{color:Ae(),children:["\u2500".repeat(Math.max(0,r-4-o.length)),"\u2500\u2510"]})]}),dd(mo,{children:[Qt(Ar,{color:Ae(),children:"\u2502"}),Qt(Ar,{children:" "}),Qt(mo,{width:s,children:Qt(Ar,{children:" "})}),Qt(Ar,{color:Ae(),children:"\u2502"}),Qt(Ar,{children:" "}),Qt(mo,{width:i,children:Qt(Ar,{color:Ae(),children:"Tips for getting started"})}),Qt(Ar,{color:Ae(),children:"\u2502"})]}),[0,1,2,3,4,5].map(a=>dd(mo,{children:[Qt(Ar,{color:Ae(),children:"\u2502"}),Qt(Ar,{children:" "}),Qt(mo,{width:s,children:a<6&&Qt(Oke,{index:a})}),Qt(Ar,{color:Ae(),children:"\u2502"}),Qt(Ar,{children:" "}),Qt(mo,{width:i,children:a<yW.length&&Qt(Ar,{dimColor:a===2,children:yW[a]})}),Qt(Ar,{color:Ae(),children:"\u2502"})]},a)),Qt(mo,{children:dd(Ar,{color:Ae(),children:["\u2514","\u2500".repeat(r-2),"\u2518"]})})]})}function Oke({index:t}){let e=[" \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u255A\u2550\u255D \u255A\u2550\u255D","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2557 \u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551","\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];return Qt(Ar,{bold:!0,color:Ae(),children:e[t]||""})}var yW,bW=k(()=>{"use strict";ft();yW=["Ask questions, edit files, or run commands.","Be specific for the best results.","/help for more information."]});function xke(t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=196608&&t<=201551||t>=63744&&t<=64255||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=12784&&t<=12799||t>=44032&&t<=55215||t>=4352&&t<=4607||t>=12592&&t<=12687||t>=65280&&t<=65519&&(t>=65281&&t<=65376||t>=65504&&t<=65510)||t>=12288&&t<=12351||t>=12800&&t<=13055||t>=13056&&t<=13311||t>=127744&&t<=129535||t>=129536&&t<=129791||t>=128512&&t<=128591||t>=128640&&t<=128767||t>=129648&&t<=129791||t>=9984&&t<=10175||t>=9728&&t<=9983}function Mke(t){return t<32&&t!==9||t===127||t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t===8203||t===8204||t===8205||t===65279||t>=65024&&t<=65039||t>=917760&&t<=917999}function fi(t){let e=t.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,""),r=0;for(let n of e){let s=n.codePointAt(0)??0;Mke(s)||(xke(s)?r+=2:r+=1)}return r}function Zf(t,e){if(e<=0)return"";let r=0,n="";for(let s of t){let i=fi(s);if(r+i>e)break;n+=s,r+=i}return n}var CI=k(()=>{"use strict"});import{jsxs as vI,jsx as eS,Fragment as Pke}from"react/jsx-runtime";import{Box as Lke,Text as eh}from"ink";function TW({content:t,cursorCol:e,hasCursor:r,maxWidth:n,showLineNumber:s=!1,lineNumber:i=1}){let o=Array.from(t),a=o.slice(0,e).join(""),l=o[e]||" ",c=o.slice(e+1).join(""),u=n??process.stdout.columns??80,d=a,m=l,f=c;if(fi(a)+fi(l)+fi(c)>u-4){let g=u-8,_=fi(a),E=fi(c);if(_>g/2){let S=Math.floor(g/2);d="..."+Zf(a.split("").reverse().join(""),S).split("").reverse().join("")}E>g/2&&(f=Zf(c,Math.floor(g/2))+"...")}return vI(Lke,{children:[s&&vI(eh,{dimColor:!0,children:[String(i).padStart(3," ")," "]}),r?vI(Pke,{children:[eS(eh,{color:eu(),children:d}),eS(eh,{backgroundColor:Ae(),color:"black",children:m}),eS(eh,{color:eu(),children:f})]}):eS(eh,{color:eu(),children:t})]})}var wW=k(()=>{"use strict";CI();ft()});import{jsxs as xl,jsx as da}from"react/jsx-runtime";import{Box as th,Text as fo}from"ink";function kI({lines:t,cursorLine:e,cursorCol:r,prompt:n="> ",isFocused:s=!0,queuedCount:i,loopPaused:o,width:a}){let l=a??(process.stdout.columns||80),c=l-4,u=t.length===1&&t[0]==="";return xl(th,{flexDirection:"column",width:l,children:[da(th,{children:xl(fo,{dimColor:!0,children:["\u250C","\u2500".repeat(l-2),"\u2510"]})}),u?(()=>{let d=(i??0)>0?`${i} message${i>1?"s":""} queued \u2014 will send after current turn`:o?$ke:Fke,m=s?1:0,h=n.length+m+1+d.length,g=Math.max(0,c-h);return xl(th,{children:[da(fo,{dimColor:!0,children:"\u2502 "}),da(fo,{color:Ae(),children:n}),s&&da(fo,{backgroundColor:Ae(),color:"black",children:" "}),xl(fo,{dimColor:!0,children:[" ",d," ".repeat(g)," \u2502"]})]})})():t.map((d,m)=>{let h=m===0?n:"... ",g=s&&m===e,_=c-h.length,E=fi(d),S=Array.from(d),C=g&&r>=S.length?1:0,w=_-C,v,A;E>w?(v=Zf(d,w-3)+"...",A=fi(v)):(v=d,A=E);let R=Array.from(v),L=Math.min(r,R.length),q;g&&L>=R.length?q=A+1:q=A;let K=Math.max(0,_-q);return xl(th,{width:l,children:[da(fo,{dimColor:!0,children:"\u2502 "}),da(fo,{color:Ae(),children:h}),da(TW,{content:v,cursorCol:L,hasCursor:g,maxWidth:_}),xl(fo,{dimColor:!0,children:[" ".repeat(K)," \u2502"]})]},m)}),da(th,{children:xl(fo,{dimColor:!0,children:["\u2514","\u2500".repeat(l-2),"\u2518"]})})]})}var Fke,$ke,CW=k(()=>{"use strict";wW();CI();ft();Fke="Ask Aii to build anything... (/ commands, Ctrl+J new line, Ctrl+L clear)",$ke="Type /resume to continue, /stop to end, /pause <duration> to adjust"});function pd(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:t.toString()}function tS(t){return t===0?"$0.00":t>=1?`$${t.toFixed(2)}`:t>=.01?`$${t.toFixed(4)}`:`$${t.toFixed(6)}`}function rh(t){let e=t,r=Math.floor(e/31536e3);e%=31536e3;let n=Math.floor(e/86400);e%=86400;let s=Math.floor(e/3600);e%=3600;let i=Math.floor(e/60);e%=60;let o=[];return r>0&&o.push(`${r}y`),n>0&&o.push(`${n}d`),s>0&&o.push(`${s}h`),i>0&&o.push(`${i}m`),(e>0||o.length===0)&&o.push(`${e}s`),o.slice(0,2).join(" ")}var vW=k(()=>{"use strict"});import{jsx as Ue,jsxs as Xt,Fragment as hi}from"react/jsx-runtime";import Uke,{useState as Bke,useEffect as Gke}from"react";import{Box as rS,Text as De}from"ink";function zke(t,e=40){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;if(r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),n.length<=e)return n;let s=n.split("/").filter(o=>o.length>0);if(s.length>=2){let o=s.slice(-2).join("/");if(o.length<=e-4)return".../"+o}return".../"+(s[s.length-1]||s[s.length-2])}function qke(t){switch(t){case"bypass":return"red";case"auto":case"acceptEdits":return"yellow";case"dontAsk":return"magenta";case"plan":return"cyan";case"normal":default:return"green"}}function Hke(t){switch(t){case"critical":return"red";case"warning":return"yellow";default:return"green"}}var Yke,AI,kW=k(()=>{"use strict";ft();vW();Yke="\u25CF",AI=Uke.memo(function({projectPath:e,branch:r,worktreeName:n,baseBranch:s,mode:i,contextPercent:o=0,contextLevel:a="normal",contextTokens:l,contextLimit:c,sessionCost:u,subagentTokens:d,subagentCost:m,memoryMB:f,sessionDuration:h,agentExecTime:g,loopStats:_,width:E=80}){let S=zke(e),T=qke(i),C=Hke(a),w=Ae(),v=i.charAt(0).toUpperCase()+i.slice(1),[A,R]=Bke(0);Gke(()=>{if(!_)return;let q=setInterval(()=>R(K=>K+1),1e3);return()=>clearInterval(q)},[_?.startTime]);let L=A%2===0?"green":"#6B7280";return Xt(rS,{width:E,justifyContent:"space-between",children:[Xt(rS,{children:[Ue(De,{dimColor:!0,children:S}),n?Xt(hi,{children:[Ue(De,{dimColor:!0,children:" ("}),Ue(De,{color:"green",children:s||"main"}),Ue(De,{dimColor:!0,children:" \u2190 "}),Xt(De,{color:"magenta",children:["wt:",n]}),Ue(De,{dimColor:!0,children:")"})]}):r?Xt(hi,{children:[Ue(De,{dimColor:!0,children:" ("}),Ue(De,{color:"green",children:r}),Ue(De,{dimColor:!0,children:")"})]}):null]}),_?Xt(rS,{children:[_.paused?_.agentBusy?Ue(De,{color:"yellow",children:"\u23F8 Pausing..."}):Ue(De,{color:"red",children:"\u23F8 Paused"}):Xt(hi,{children:[Ue(De,{color:L,children:"\u25CF"}),Ue(De,{color:"green",children:" Loop"})]}),Ue(De,{dimColor:!0,children:" | "}),Xt(De,{color:w,children:["#",_.currentIteration]}),Ue(De,{dimColor:!0,children:" | "}),Ue(De,{color:w,children:pd(_.totalInputTokens)}),Ue(De,{dimColor:!0,children:" in / "}),Ue(De,{color:w,children:pd(_.totalOutputTokens)}),Ue(De,{dimColor:!0,children:" out"}),Ue(De,{dimColor:!0,children:" | "}),Xt(De,{color:"yellow",children:["~",tS(_.totalCost)]}),f!==void 0&&Xt(hi,{children:[Ue(De,{dimColor:!0,children:" | "}),Xt(De,{dimColor:!0,children:[f.toFixed(1)," MB"]})]}),Ue(De,{dimColor:!0,children:" | "}),Ue(De,{color:w,children:rh(Math.floor((Date.now()-_.startTime)/1e3))}),_.durationSeconds>0&&Xt(De,{dimColor:!0,children:["/",rh(_.durationSeconds)]})]}):Xt(rS,{children:[Xt(De,{color:C,children:[Yke," "]}),Ue(De,{color:T,children:v}),Ue(De,{dimColor:!0,children:" | "}),Xt(De,{color:C,children:[o,"%"]}),l!==void 0&&c!==void 0&&Xt(hi,{children:[Ue(De,{dimColor:!0,children:" \xB7 "}),Ue(De,{color:w,children:pd(l)}),Ue(De,{dimColor:!0,children:"/"}),Ue(De,{color:w,children:pd(c)})]}),u!==void 0&&Xt(hi,{children:[Ue(De,{dimColor:!0,children:" | "}),Ue(De,{color:"yellow",children:tS(u)})]}),d!==void 0&&d>0&&Xt(hi,{children:[Ue(De,{dimColor:!0,children:" + "}),Ue(De,{color:w,dimColor:!0,children:"sub:"}),Ue(De,{color:w,dimColor:!0,children:pd(d)}),m!==void 0&&m>0&&Xt(hi,{children:[Ue(De,{color:w,dimColor:!0,children:" \xB7 "}),Ue(De,{color:w,dimColor:!0,children:tS(m)})]})]}),f!==void 0&&Xt(hi,{children:[Ue(De,{dimColor:!0,children:" | "}),Xt(De,{dimColor:!0,children:[f.toFixed(1)," MB"]})]}),(g!==void 0||h!==void 0)&&Xt(hi,{children:[Ue(De,{dimColor:!0,children:" | "}),g!==void 0&&Ue(De,{color:Ae(),children:rh(g)}),g!==void 0&&h!==void 0&&Ue(De,{dimColor:!0,children:"/"}),h!==void 0&&Ue(De,{dimColor:!0,children:rh(h)})]})]})]})})});import{jsx as jke}from"react/jsx-runtime";import{Text as Wke}from"ink";function Vke(t){let e=[];if(t.personaName&&e.push(`\u{1FABC} ${t.personaName}`),t.modelName&&e.push(t.modelName),t.tools&&t.tools>0&&e.push(`${t.tools} tool${t.tools>1?"s":""}`),t.mcpServers&&t.mcpServers>0){let r=t.mcpFailedCount&&t.mcpFailedCount>0?` (${t.mcpFailedCount} failed)`:"";e.push(`${t.mcpServers} MCP${r}`)}return t.skills&&t.skills>0&&e.push(`${t.skills} skill${t.skills>1?"s":""}`),t.contextFiles&&t.contextFiles>0&&e.push(`${t.contextFiles} context file${t.contextFiles>1?"s":""}`),e}function DI({soulName:t,personaName:e,modelName:r,tools:n=0,mcpServers:s=0,mcpFailedCount:i=0,contextFiles:o=0,skills:a=0}){let l=Vke({soulName:t,personaName:e,modelName:r,tools:n,mcpServers:s,mcpFailedCount:i,skills:a,contextFiles:o});return l.length===0?null:jke(Wke,{dimColor:!0,children:l.join(" | ")})}var AW=k(()=>{"use strict"});import{jsx as nS,jsxs as Kke}from"react/jsx-runtime";import Qke,{useState as DW,useEffect as IW,useRef as II}from"react";import{Box as Xke,Text as sS}from"ink";var iS,RW,NW=k(()=>{"use strict";ft();iS=["Thinking","Pondering","Reasoning","Contemplating","Deliberating","Mulling","Considering","Reflecting","Processing","Analyzing","Computing","Synthesizing","Evaluating","Examining","Crunching","Boogieing","Grooving","Jamming","Vibing","Cooking","Brewing","Conjuring","Crafting","Weaving","Spinning","Percolating","Simmering","Marinating","Fermenting","Distilling","Churning","Whipping up","Stirring","Mixing","Blending"],RW=Qke.memo(function({status:e,isActive:r=!0,elapsedSeconds:n,tokensGenerated:s,showInterruptHint:i=!0,resetKey:o}){let a=II(!0),[l,c]=DW(()=>iS[Math.floor(Math.random()*iS.length)]),u=II(Date.now()),[d,m]=DW(0),f=II(Date.now());if(IW(()=>{u.current=Date.now(),m(0),a.current=!0;let T=Date.now();T-f.current>=5e3&&(f.current=T,c(iS[Math.floor(Math.random()*iS.length)]))},[o]),IW(()=>{if(!r||n!==void 0)return;u.current=Date.now();let T=setInterval(()=>{a.current=!a.current,m(Math.floor((Date.now()-u.current)/1e3))},1e3);return()=>clearInterval(T)},[r,n,o]),!r)return null;let h=n??d,_=e&&!e.match(/^(Generating|Thinking|Processing)\.{0,3}$/i)?e:`${l}...`,E=[];i&&E.push("esc to interrupt"),h>0&&E.push(`${h}s`),s!==void 0&&s>0&&E.push(`+ ${s} tokens`);let S=E.length>0?` (${E.join(" \u2022 ")})`:"";return Kke(Xke,{children:[nS(sS,{color:a.current?Ae():"gray",children:"\u25CF"}),nS(sS,{children:" "}),nS(sS,{color:Ae(),children:_}),nS(sS,{dimColor:!0,children:S})]})})});import{jsx as RI,jsxs as Jke}from"react/jsx-runtime";import Zke,{useRef as NI,useMemo as eAe}from"react";import{Box as OW,Text as xW}from"ink";var tAe,MW,PW=k(()=>{"use strict";Q1();tAe=150,MW=Zke.memo(function({content:e,isStreaming:r=!1,width:n,enableMarkdown:s=!0,maxVisibleLines:i}){let o=n??(process.stdout.columns||80),a=NI(0),l=NI(""),c=NI(""),d=eAe(()=>{if(!e)return"";if(!s)return e;if(r){let h=Date.now();return(h-a.current>=tAe||!l.current)&&(l.current=pi(e),a.current=h,c.current=e),l.current}return l.current=pi(e),c.current=e,l.current},[e,s,r]).split(`
1068
1068
  `),m=0;for(;d.length>1&&d[d.length-1]==="";)d.pop(),m++;m>0&&d.length>0&&d.push("");let f=i&&d.length>i?d.slice(-i):d;return RI(OW,{flexDirection:"column",width:o,children:f.map((h,g)=>Jke(OW,{children:[RI(xW,{children:h}),r&&g===f.length-1&&RI(xW,{backgroundColor:"white",color:"black",children:" "})]},g))})})});import{create as rAe}from"zustand";function Ml(t){return t.nodes.some(e=>e.status==="running"||e.status==="pending")}function MI(t){return t.nodes.length>0&&t.nodes.every(e=>e.status==="done"||e.status==="failed"||e.status==="timeout")}function OI(){ih||(ih=setTimeout(xI,nAe))}function xI(){if(ih&&(clearTimeout(ih),ih=null),nh.size===0&&oS.size===0&&sh.size===0)return;let t=new Map(nh),e=new Map(oS),r=new Map(sh);nh.clear(),oS.clear(),sh.clear(),Kr.setState(n=>({nodes:n.nodes.map(s=>{let i=s,o=t.get(s.agentId);o&&(i={...i,toolUses:i.toolUses+o});let a=e.get(s.agentId);a&&(i={...i,tokens:a});let l=r.get(s.agentId);if(l){let c=i.streamingContent+l;i={...i,streamingContent:c.length>LW?c.slice(-LW):c}}return i===s?s:i})})),r.size>0&&Kr.setState(n=>{let s=new Map(n.transcripts);for(let i of n.nodes)r.has(i.agentId)&&(s.delete(i.agentId),s.set(i.agentId,{agentName:i.agentName,prompt:i.prompt,content:i.streamingContent,status:i.status,startedAt:i.startedAt,completedAt:i.completedAt,toolUses:i.toolUses,toolCalls:i.toolCalls,tokens:i.tokens}));for(;s.size>sAe;){let i=s.keys().next().value;if(i===void 0)break;s.delete(i)}return{transcripts:s}})}var nAe,LW,sAe,FW,nh,oS,sh,ih,Kr,Ps,pa=k(()=>{"use strict";nAe=200,LW=5e4,sAe=50,FW=200,nh=new Map,oS=new Map,sh=new Map,ih=null;Kr=rAe((t,e)=>({nodes:[],expanded:!1,runningBackgroundCount:0,transcripts:new Map,addNode:(r,n,s,i=!1,o)=>{t(a=>({nodes:[...a.nodes,{agentId:r,agentName:n,prompt:s,status:"running",startedAt:Date.now(),toolUses:0,toolCalls:[],tokens:{input:0,output:0},duration:0,streamingContent:"",background:i,provider:o}],expanded:!0}))},addToolCall:(r,n,s)=>{t(i=>({nodes:i.nodes.map(o=>{if(o.agentId!==r)return o;let a=[...o.toolCalls,{tool:n,summary:s}];return{...o,toolCalls:a.length>FW?a.slice(-FW):a}})}))},updateNodeToolUses:r=>{nh.set(r,(nh.get(r)??0)+1),OI()},updateNodeTokens:(r,n)=>{oS.set(r,{input:n.input,output:n.output}),OI()},appendStreamingContent:(r,n)=>{sh.set(r,(sh.get(r)??"")+n),OI()},completeNode:(r,n)=>{t(s=>{let i=s.nodes.map(a=>{if(a.agentId!==r)return a;let l=n.error?.includes("timed out")?"timeout":n.success?"done":"failed";return{...a,status:l,completedAt:Date.now(),duration:n.duration,tokens:n.tokens,error:n.error}}),o=i.every(a=>a.status==="done"||a.status==="failed"||a.status==="timeout");return{nodes:i,expanded:o?!1:s.expanded}})},toggleExpanded:()=>{t(r=>({expanded:!r.expanded}))},incrementRunningBackground:()=>{t(r=>({runningBackgroundCount:r.runningBackgroundCount+1}))},decrementRunningBackground:()=>{t(r=>({runningBackgroundCount:Math.max(0,r.runningBackgroundCount-1)}))},snapshotAndClear:()=>{xI();let r=e().nodes.slice();return t({nodes:[],expanded:!1}),r},pruneTranscripts:()=>{t(r=>{if(r.transcripts.size===0)return r;let n=new Set(r.nodes.map(i=>i.agentId)),s=new Map;for(let[i,o]of r.transcripts)n.has(i)&&s.set(i,o);return{transcripts:s}})},clear:()=>{xI(),t({nodes:[],expanded:!1,runningBackgroundCount:0,transcripts:new Map})}})),Ps=Kr.getState});function aS(t){if(!t.error)return null;let e=t.error,r=t.provider??"provider";if(iAe.some(s=>s.test(e)))return`Auth failed for ${r}`;if(oAe.some(s=>s.test(e)))return"Rate limited \u2014 too many concurrent requests";if(t.status==="timeout")return`Timed out after ${t.duration?Math.round(t.duration/1e3):"?"}s`;if(/cancell?ed/i.test(e))return"Cancelled by user";if(t.status==="failed"&&t.toolUses===0)return"Model may not support tool calling";let n=e.split(`
1069
1069
  `)[0];return n.length>60?n.slice(0,57)+"...":n}function $W(t){if(t.status!=="failed"&&t.status!=="timeout"||!t.error)return null;let e=t.error.toLowerCase();return t.status==="timeout"?"The model took too long. Try a faster model or simpler prompt.":e.includes("rate limit")||e.includes("429")||e.includes("too many requests")?"Wait a moment and try again, or switch provider with /model.":e.includes("empty response")||e.includes("empty content")?"Try again or switch to a more capable model with /model.":e.includes("unauthorized")||e.includes("invalid api key")||e.includes("401")?"Check your API key with /config or switch provider with /model.":"Try again or check /model for available models."}var iAe,oAe,PI=k(()=>{"use strict";iAe=[/invalid.api.key/i,/incorrect.api.key/i,/authentication.*(error|failed)/i,/api.key.*not valid/i,/unauthorized/i,/\b401\b/,/no credits remaining/i],oAe=[/rate.limit/i,/\b429\b/,/too many requests/i]});import{jsxs as vt,jsx as dr}from"react/jsx-runtime";import zW from"react";import{Box as ho,Text as st}from"ink";import{useShallow as aAe}from"zustand/react/shallow";function qW(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function HW(t,e=35){return t.length<=e?t:t.slice(0,e-3)+"..."}function YW(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)}function jW(t,e){let r=e??Date.now(),n=Math.round((r-t)/1e3);if(n<60)return`${n}s`;let s=Math.floor(n/60),i=n%60;return`${s}m${i}s`}function dAe({node:t,isLast:e}){let r=t.status==="running"||t.status==="pending",n=e?" ":`${uAe} `,s=r?` (${jW(t.startedAt)})`:"",i,o;switch(t.status){case"running":case"pending":i="cyan",o="Running";break;case"done":i="green",o="Done";break;case"failed":i="red",o="Failed";break;case"timeout":i="yellow",o="Timeout";break}let a=t.status==="failed"||t.status==="timeout"?aS(t):null,l=t.status==="failed"||t.status==="timeout"?$W(t):null;return vt(ho,{flexDirection:"column",children:[vt(st,{children:[vt(st,{dimColor:!0,children:[" ",n,"\u2514 "]}),dr(st,{color:i,children:o}),a&&vt(st,{dimColor:!0,children:[" \u2014 ",a]}),s&&dr(st,{dimColor:!0,children:s})]}),l&&vt(st,{dimColor:!0,children:[" ","Tip: ",l]})]})}function BW({toolCalls:t,expanded:e}){if(t.length===0)return null;let r=e?t:t.slice(0,UW),n=e?0:Math.max(0,t.length-UW);return vt(ho,{flexDirection:"column",children:[r.map((s,i)=>vt(st,{dimColor:!0,children:[" ",i===0?"\u2514 ":" ",s.tool,s.summary?`(${s.summary})`:""]},i)),n>0&&vt(st,{dimColor:!0,children:[" ","+",n," more tool uses (ctrl+o to expand)"]})]})}function GW({node:t,isLast:e}){let r=e?cAe:lAe,n=[];n.push(`${t.toolUses} tool use${t.toolUses!==1?"s":""}`);let s=t.tokens.input+t.tokens.output;s>0&&n.push(`${qW(s)} tokens`);let i=n.join(lS);return vt(ho,{flexDirection:"column",children:[vt(st,{children:[vt(st,{dimColor:!0,children:[" ",r," "]}),dr(st,{bold:!0,children:YW(t.agentName)}),dr(st,{dimColor:!0,children:" ("}),dr(st,{children:HW(t.prompt)}),dr(st,{dimColor:!0,children:")"}),vt(st,{dimColor:!0,children:[lS,i]})]}),dr(dAe,{node:t,isLast:e})]})}var lAe,cAe,uAe,lS,UW,LI,WW,VW=k(()=>{"use strict";pa();PI();ft();lAe="\u251C\u2500",cAe="\u2514\u2500",uAe="\u2502",lS=" \xB7 ";UW=3;LI=zW.memo(function(){let{nodes:e,expanded:r}=Kr(aAe(i=>({nodes:i.nodes,expanded:i.expanded})));if(e.length===0)return null;let n=Ml({nodes:e,expanded:r}),s=MI({nodes:e,expanded:r});if(n){let i=e.filter(o=>o.status==="running"||o.status==="pending").length;return vt(ho,{flexDirection:"column",children:[vt(st,{children:[dr(st,{color:Ae(),children:" \u25CF "}),vt(st,{children:["Running ",i," agent",i!==1?"s":"","..."]}),vt(st,{dimColor:!0,children:[" (ctrl+o to ",r?"collapse":"expand",")"]})]}),r&&e.map((o,a)=>vt(ho,{flexDirection:"column",children:[dr(GW,{node:o,isLast:a===e.length-1}),dr(BW,{toolCalls:o.toolCalls,expanded:!1})]},o.agentId))]})}return s?vt(ho,{flexDirection:"column",children:[vt(st,{children:[dr(st,{color:"green",children:" \u25CF "}),vt(st,{children:[e.length," agent",e.length!==1?"s":""," finished"]}),vt(st,{dimColor:!0,children:[" (ctrl+o to ",r?"collapse":"expand",")"]})]}),r&&e.map((i,o)=>vt(ho,{flexDirection:"column",children:[dr(GW,{node:i,isLast:o===e.length-1}),dr(BW,{toolCalls:i.toolCalls,expanded:!1})]},i.agentId))]}):null}),WW=zW.memo(function({width:e}){let r=Kr(C=>C.expanded),n=Kr(C=>C.transcripts),s=Kr(C=>C.nodes);if(!r)return null;let i="",o="",a="",l="done",c=Date.now(),u,d=0,m={input:0,output:0},f=s.find(C=>C.status==="running"&&C.streamingContent);if(f)i=f.agentName,o=f.prompt,a=f.streamingContent,l=f.status,c=f.startedAt,u=f.completedAt,d=f.toolUses,m=f.tokens;else if(n.size>0){let C=Array.from(n.values()),w=C[C.length-1];i=w.agentName,o=w.prompt,a=w.content,l=w.status,c=w.startedAt,u=w.completedAt,d=w.toolUses,m=w.tokens}if(!a)return null;let h=Math.max(5,(process.stdout.rows||24)-8),_=a.split(`
1070
- `).slice(-h),E=m.input+m.output,S=jW(c,u),T=l==="done"||l==="failed"||l==="timeout";return vt(ho,{flexDirection:"column",width:e,children:[vt(st,{children:[dr(st,{color:T?"green":Ae(),children:" \u25CF "}),dr(st,{bold:!0,children:YW(i)}),vt(st,{dimColor:!0,children:[" (",HW(o,50),")"]})]}),vt(st,{children:[dr(st,{dimColor:!0,children:" \u2514 "}),dr(st,{color:T?"green":"cyan",children:T?"Done":"Running"}),vt(st,{dimColor:!0,children:[" (",d," tool uses",lS,qW(E)," tokens",lS,S,")"]})]}),dr(ho,{flexDirection:"column",children:_.map((C,w)=>dr(st,{children:C},w))}),dr(st,{dimColor:!0,children:"Showing detailed transcript \xB7 ctrl+o to toggle"})]})})});import{create as pAe}from"zustand";var mAe,KW,as,Pl,md=k(()=>{"use strict";mAe=50,KW=5e4,as=pAe((t,e)=>({results:[],peekOpen:!1,peekIndex:-1,maxResults:mAe,addResult:r=>{t(n=>{let s=r.output.length>KW?r.output.slice(0,KW)+`
1070
+ `).slice(-h),E=m.input+m.output,S=jW(c,u),T=l==="done"||l==="failed"||l==="timeout";return vt(ho,{flexDirection:"column",width:e,children:[vt(st,{children:[dr(st,{color:T?"green":Ae(),children:" \u25CF "}),dr(st,{bold:!0,children:YW(i)}),vt(st,{dimColor:!0,children:[" (",HW(o,50),")"]})]}),vt(st,{children:[dr(st,{dimColor:!0,children:" \u2514 "}),dr(st,{color:T?"green":"cyan",children:T?"Done":"Running"}),vt(st,{dimColor:!0,children:[" (",d," tool uses",lS,qW(E)," tokens",lS,S,")"]})]}),dr(ho,{flexDirection:"column",children:_.map((C,w)=>dr(st,{children:C},w))}),dr(st,{dimColor:!0,children:"Showing detailed transcript \xB7 ctrl+o to toggle"})]})})});import{create as pAe}from"zustand";var mAe,KW,as,Pl,md=k(()=>{"use strict";mAe=50,KW=5e4,as=pAe((t,e)=>({results:[],peekOpen:!1,peekIndex:-1,maxResults:mAe,addResult:r=>{t(n=>{let s=r.output??"",i=s.length>KW?s.slice(0,KW)+`
1071
1071
 
1072
- [Truncated: ${r.output.length} chars total]`:r.output,i=[...n.results,{...r,output:s,timestamp:Date.now()}];return i.length>n.maxResults&&i.shift(),{results:i,peekIndex:i.length-1}})},togglePeek:()=>{let r=e();r.results.length!==0&&t({peekOpen:!r.peekOpen})},closePeek:()=>t({peekOpen:!1}),navigatePeek:r=>{let n=e();if(n.results.length===0)return;let s=r==="prev"?-1:1,i=(n.peekIndex+s+n.results.length)%n.results.length;t({peekIndex:i})},clear:()=>t({results:[],peekOpen:!1,peekIndex:-1})})),Pl=as.getState});import{jsxs as JW,jsx as ZW}from"react/jsx-runtime";import{Box as hAe,Text as FI}from"ink";function eV(){let t=as(u=>u.results),e=as(u=>u.peekOpen),r=as(u=>u.peekIndex);if(!e||t.length===0||r<0)return null;let n=t[r];if(!n)return null;let s=Ry(n.output).split(`
1072
+ [Truncated: ${s.length} chars total]`:s,o=[...n.results,{...r,toolName:r.toolName??"",target:r.target??"",output:i,timestamp:Date.now()}];return o.length>n.maxResults&&o.shift(),{results:o,peekIndex:o.length-1}})},togglePeek:()=>{let r=e();r.results.length!==0&&t({peekOpen:!r.peekOpen})},closePeek:()=>t({peekOpen:!1}),navigatePeek:r=>{let n=e();if(n.results.length===0)return;let s=r==="prev"?-1:1,i=(n.peekIndex+s+n.results.length)%n.results.length;t({peekIndex:i})},clear:()=>t({results:[],peekOpen:!1,peekIndex:-1})})),Pl=as.getState});import{jsxs as JW,jsx as ZW}from"react/jsx-runtime";import{Box as hAe,Text as FI}from"ink";function eV(){let t=as(u=>u.results),e=as(u=>u.peekOpen),r=as(u=>u.peekIndex);if(!e||t.length===0||r<0)return null;let n=t[r];if(!n)return null;let s=Ry(n.output).split(`
1073
1073
  `),i=s.length,o=`${r+1}/${t.length}`,a=hf(n.toolName),l=hf(n.target),c;if(i>50){let u=s.slice(0,25),d=s.slice(-25),m=i-25-25;c=[...u,"",` ... ${m} lines hidden ...`,"",...d]}else c=s;return JW(hAe,{flexDirection:"column",paddingLeft:2,children:[JW(FI,{dimColor:!0,children:["-- ","[",o,"] ",a,"(",l,") -- (ctrl+o to close, up/down to navigate) --"]}),c.map((u,d)=>ZW(FI,{children:u},d)),ZW(FI,{dimColor:!0,children:"-".repeat(48)})]})}var tV=k(()=>{"use strict";md();Ny()});import{jsx as Qr,jsxs as cS}from"react/jsx-runtime";import{Box as uS,Text as Xr}from"ink";function rV({commands:t,selectedIndex:e,isVisible:r,maxItems:n=8,menuWidth:s}){let i=process.stdout.columns||80,o=s??Math.min(100,Math.max(60,Math.floor(i*.5)));if(!r||t.length===0)return null;let a=t.length,l=0;e>=n&&(l=e-n+1);let c=Math.min(l+n,a),u=t.slice(l,c),d=a>n,m=o-2,f=t.filter(T=>T.type!=="skill").length,h=t.filter(T=>T.type==="skill").length,g=h>0?` Commands (${f}) + Skills (${h}) `:` Commands (${a}) `,_=Math.max(0,m-g.length-2),E="\u2191\u2193 navigate \u2022 Enter select \u2022 Esc cancel",S=Math.max(0,m-E.length-2);return cS(uS,{flexDirection:"column",children:[Qr(Xr,{color:Ae(),children:"\u250C\u2500"+g+"\u2500".repeat(_)+"\u2500\u2510"}),u.map((T,C)=>{let v=l+C===e,A=T.type==="skill",R=`/${T.name}`,L=A?" [skill]":"",q=m-R.length-L.length-3,K=T.description.length>q?T.description.slice(0,q-1)+"\u2026":T.description,Y=` ${R}${L} ${K}`,G=Y.length,x=Math.max(0,m-G);return v?cS(uS,{children:[Qr(Xr,{color:Ae(),children:"\u2502"}),Qr(Xr,{backgroundColor:Ae(),color:"black",children:Y+" ".repeat(x)}),Qr(Xr,{color:Ae(),children:"\u2502"})]},T.name):cS(uS,{children:[Qr(Xr,{color:Ae(),children:"\u2502"}),Qr(Xr,{children:" "}),Qr(Xr,{color:Ae(),children:R}),A&&Qr(Xr,{dimColor:!0,children:L}),Qr(Xr,{dimColor:!0,children:" "+K}),Qr(Xr,{children:" ".repeat(x)}),Qr(Xr,{color:Ae(),children:"\u2502"})]},T.name)}),d&&(()=>{let T=l>0?"\u25B2":" ",C=c<a?"\u25BC":" ",w=` ${T} ${e+1}/${a} ${C}`,v=Math.max(0,m-w.length);return cS(uS,{children:[Qr(Xr,{color:Ae(),children:"\u2502"}),Qr(Xr,{dimColor:!0,children:w}),Qr(Xr,{children:" ".repeat(v)}),Qr(Xr,{color:Ae(),children:"\u2502"})]})})(),Qr(Xr,{color:Ae(),children:"\u2514\u2500"+E+"\u2500".repeat(S)+"\u2500\u2518"})]})}var nV=k(()=>{"use strict";ft()});import{jsxs as oh,jsx as gAe}from"react/jsx-runtime";import{useEffect as sV,useRef as iV,useState as oV}from"react";import{Box as _Ae,Text as dS}from"ink";function EAe(t){let e=Math.max(0,Math.floor(t/1e3)),r=Math.floor(e/60),n=e%60;return r>0?`${r}m ${n}s`:`${n}s`}var $I,yAe,aV,lV=k(()=>{"use strict";mi();$I=10;yAe=({toast:t})=>{let e=kr(l=>l.clearToast),r=iV(null),n=iV(null),[s,i]=oV($I),[o,a]=oV("");return sV(()=>{if(!t.expiresAt){a("");return}let l=()=>{let u=t.expiresAt-Date.now();u<=0?a("\u2014 resumes now"):a(`\u2014 resumes in ${EAe(u)}`)};l();let c=setInterval(l,1e3);return()=>clearInterval(c)},[t.expiresAt]),sV(()=>(r.current&&(clearTimeout(r.current),r.current=null),n.current&&(clearInterval(n.current),n.current=null),t.persistent||(i($I),n.current=setInterval(()=>{i(l=>Math.max(0,l-1))},1e3),r.current=setTimeout(()=>{e(t.id),r.current=null,n.current&&(clearInterval(n.current),n.current=null)},$I*1e3)),()=>{r.current&&(clearTimeout(r.current),r.current=null),n.current&&(clearInterval(n.current),n.current=null)}),[t.id,t.persistent,e]),oh(dS,{children:[t.text,t.expiresAt&&o?oh(dS,{dimColor:!0,children:[" ",o]}):"",!t.persistent&&!t.expiresAt&&s>0?oh(dS,{dimColor:!0,children:[" \xB7 ",s,"s"]}):""]})},aV=()=>{let t=kr(i=>i.toasts),e=kr(i=>i.visibleToasts),r=kr(i=>i.overflowCount);if(t.length===0)return null;let n=e(),s=r();return oh(_Ae,{flexDirection:"column",children:[n.map(i=>gAe(yAe,{toast:i},i.id)),s>0&&oh(dS,{dimColor:!0,children:[" +",s," more"]})]})}});import{create as SAe}from"zustand";var fd,Pr,hd=k(()=>{"use strict";fd=null,Pr=SAe((t,e)=>({active:!1,startedAt:null,bgAgentCount:0,elapsedSec:0,lastRelease:null,begin:r=>{t({active:!0,startedAt:Date.now(),bgAgentCount:r,elapsedSec:0,lastRelease:null}),fd!==null&&clearInterval(fd),fd=setInterval(()=>{let n=e();!n.active||n.startedAt===null||t({elapsedSec:Math.floor((Date.now()-n.startedAt)/1e3)})},1e3)},release:r=>{fd!==null&&(clearInterval(fd),fd=null),t({active:!1,startedAt:null,bgAgentCount:0,elapsedSec:0,lastRelease:r})},setCount:r=>t({bgAgentCount:r})}))});import{create as bAe}from"zustand";function TAe(t){switch(t){case"done":return cV;case"failed":return uV;case"cancelled":return dV}}var ah,cV,uV,dV,gd,ma,UI,_d=k(()=>{"use strict";ah=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],cV=1e4,uV=15e3,dV=1e4,gd=5;ma=bAe((t,e)=>({rows:[],spinnerFrame:0,timerRef:null,sessionSubagentTokens:0,sessionSubagentCost:0,addRow:r=>{t(n=>({rows:[...n.rows,{...r,elapsedSeconds:0,dismissAt:void 0,resultSummary:void 0}]})),e().startTimer()},incrementToolUses:r=>{t(n=>({rows:n.rows.map(s=>s.agentId===r?{...s,toolUses:s.toolUses+1}:s)}))},updateTokens:(r,n)=>{t(s=>({rows:s.rows.map(i=>i.agentId===r?{...i,tokens:n}:i)}))},addCost:(r,n)=>{t(s=>({rows:s.rows.map(i=>i.agentId!==r?i:{...i,cost:(i.cost??0)+n,hasPricing:!0})}))},completeRow:(r,n,s)=>{let i=Date.now();t(o=>({rows:o.rows.map(a=>a.agentId!==r?a:{...a,status:n,resultSummary:s,completedAt:i,dismissAt:i+TAe(n),elapsedSeconds:Math.floor((i-a.startedAt)/1e3)})}))},markAutoBackgrounded:r=>{t(n=>({rows:n.rows.map(s=>s.agentId===r?{...s,status:"auto-backgrounded",background:!0}:s)}))},tick:()=>{let r=Date.now();t(i=>{let o=i.rows.map(d=>d.status==="auto-backgrounded"?{...d,status:"running",background:!0}:d);o=o.map(d=>d.status==="running"?{...d,elapsedSeconds:Math.floor((r-d.startedAt)/1e3)}:d);let a=o.filter(d=>d.dismissAt!=null&&d.dismissAt<=r);o=o.filter(d=>!d.dismissAt||d.dismissAt>r);let l=0,c=0;for(let d of a)l+=d.tokens,d.cost!==null&&(c+=d.cost);let u=(i.spinnerFrame+1)%ah.length;return{rows:o,spinnerFrame:u,sessionSubagentTokens:i.sessionSubagentTokens+l,sessionSubagentCost:i.sessionSubagentCost+c}});let{rows:n,stopTimer:s}=e();n.length===0&&s()},getVisibleRowCount:()=>{let{rows:r}=e(),n=r.length;return n<=gd?n:gd+1},getSubagentTotals:()=>{let{rows:r,sessionSubagentTokens:n,sessionSubagentCost:s}=e(),i=n,o=s;for(let a of r)i+=a.tokens,a.cost!==null&&(o+=a.cost);return{tokens:i,cost:o}},startTimer:()=>{let{timerRef:r,tick:n}=e();if(r)return;let s=setInterval(n,1e3);t({timerRef:s})},stopTimer:()=>{let{timerRef:r}=e();r&&(clearInterval(r),t({timerRef:null}))},clear:()=>{let{timerRef:r}=e();r&&clearInterval(r),t({rows:[],spinnerFrame:0,timerRef:null,sessionSubagentTokens:0,sessionSubagentCost:0})}})),UI=ma.getState});function pS(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return`${e}m ${r}s`}function pV(t){return t<1e3?`${t} tokens`:`${(t/1e3).toFixed(1)}K tokens`}function mV(t){return t===0?"$0.00":t<.001?`$${t.toFixed(4)}`:t<.01?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`}function fV(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}function hV(t,e){switch(t){case"running":return ah[e%ah.length];case"done":return"\u2713";case"failed":return"\u2717";case"cancelled":return"\u25FC";case"auto-backgrounded":return"\u27F3"}}function gV(t){switch(t){case"running":return"green";case"done":return"green";case"failed":return"red";case"cancelled":return"gray";case"auto-backgrounded":return"yellow"}}var BI=k(()=>{"use strict";_d()});import{jsx as _V,jsxs as wAe}from"react/jsx-runtime";import{Box as CAe,Text as EV}from"ink";function yV(){let t=Pr(s=>s.active),e=Pr(s=>s.elapsedSec),r=Pr(s=>s.bgAgentCount);return t?wAe(CAe,{flexDirection:"column",children:[_V(EV,{dimColor:!0,children:`\u23F3 Waiting for ${r} ${r===1?"background job":"background jobs"}\u2026 \xB7 ${pS(e)} elapsed`}),_V(EV,{dimColor:!0,children:" Press Esc to release \xB7 type to interject"})]}):null}var SV=k(()=>{"use strict";hd();BI()});import{jsx as mS,jsxs as lh}from"react/jsx-runtime";import{Box as vAe,Text as Ll}from"ink";function kAe({row:t,spinnerFrame:e}){let r=hV(t.status,e),n=gV(t.status),s=t.resultSummary??fV(t.prompt,40),o=[pS(t.elapsedSeconds)];return t.toolUses>0&&o.push(`${t.toolUses} tool${t.toolUses===1?"":"s"}`),t.tokens>0&&(o.push(pV(t.tokens)),t.hasPricing&&t.cost!==null&&t.cost>0&&o.push(mV(t.cost))),lh(Ll,{children:[mS(Ll,{color:n,children:r}),lh(Ll,{children:[" ",t.agentName,": "]}),mS(Ll,{dimColor:!0,children:s}),lh(Ll,{children:[" \u2014 ",o.join(" \xB7 ")]})]})}function bV(){let t=ma(s=>s.rows),e=ma(s=>s.spinnerFrame);if(process.env.AII_DEBUG_NO_TOAST==="1"||t.length===0)return null;let r=t.slice(0,gd),n=Math.max(0,t.length-gd);return lh(vAe,{flexDirection:"column",children:[mS(Ll,{children:" "}),r.map(s=>mS(kAe,{row:s,spinnerFrame:e},s.agentId)),n>0&&lh(Ll,{dimColor:!0,children:[" +",n," more (use /tasks to see all)"]})]})}var TV=k(()=>{"use strict";_d();BI()});import{create as AAe}from"zustand";var wV,ch,GI=k(()=>{"use strict";mi();ar();wV=AAe((t,e)=>({pendingNote:null,noteToastId:null,setPendingNote:r=>t({pendingNote:r}),setNoteToastId:r=>t({noteToastId:r}),getPendingNote:()=>e().pendingNote,onNoteInjected:()=>{let r=e().pendingNote,n=e().noteToastId;if(n!==null&&Le().clearToast(n),t({pendingNote:null,noteToastId:null}),r){let s=process.stdout.columns||80,i=Math.floor(s*.618)-15,o=r.replace(/\n/g," "),a=o.length>i?o.slice(0,i)+"\u2026":o;Le().showToast(F.success(`\u25C6 Injected: "${a}"`))}},reset:()=>t({pendingNote:null,noteToastId:null})})),ch=wV.getState});var fS=k(()=>{"use strict";gf();X1();Nl();Z1();pa();mi();GI();_d();xu();md();hd()});import{jsxs as Ed,jsx as Ut}from"react/jsx-runtime";import DAe,{useRef as IAe,useState as RAe,useEffect as NAe}from"react";import{Box as hS,Static as OAe,Text as Fl}from"ink";function xAe(){let t=Kr(e=>e.runningBackgroundCount);if(t===0)return null;try{let e=Re.getInstance();if(!e.isInitialized())return null;let r=e.getActiveAgents().filter(s=>s.background);if(r.length===0)return null;let n=r.map(s=>{let i=Math.round((Date.now()-s.startedAt.getTime())/1e3),o=i<60?`${i}s`:`${Math.floor(i/60)}m${i%60}s`;return`${s.agentName} (${o})`});return Ed(Fl,{dimColor:!0,children:[" ","\u27F3 ",n.join(" \xB7 ")]})}catch{return Ed(Fl,{dimColor:!0,children:[" ","\u27F3 ",t," background agent",t!==1?"s":""," running"]})}}function MAe(){let t=Ol(n=>n.isVisible),e=Ol(n=>n.selectedIndex),r=Ol(n=>n.filteredCommands);return t?Ut(rV,{commands:r,selectedIndex:e,isVisible:t}):null}var CV,vV=k(()=>{"use strict";CW();kW();AW();NW();PW();VW();tV();nV();lV();SV();TV();fS();Nl();_d();mi();pa();md();fa();hd();Xi();CV=DAe.memo(function({permanentContent:e,streamingContent:r,isStreaming:n,isThinking:s,thinkingStatus:i,thinkingElapsedSeconds:o,thinkingTokensGenerated:a,currentIteration:l,iterationStartTime:c,inputLines:u,inputCursorLine:d,inputCursorCol:m,inputFocused:f=!0,resourceCounts:h,statusBar:g,width:_}){let E=_??(process.stdout.columns||80),S=process.stdout.rows||24,T=Kr(Ml),C=n||s||T,w=h&&(h.soulName||h.personaName||h.modelName||h.tools>0||h.mcpServers>0||h.contextFiles>0||h.skills>0),v=Kr(re=>re.nodes.length),A=v>0?1+v*2:0,R=Kr(re=>re.runningBackgroundCount),q=process.env.AII_DEBUG_NO_TOAST==="1"&&v===0&&R>0,K=q?1:0,Y=ma(re=>re.getVisibleRowCount()),G=Y>0?Y+1:0,x=Pr(re=>re.active),P=ma(re=>re.getSubagentTotals()),oe=Rl(re=>re.typeAheadQueue.length),Q=kr(re=>re.toasts.length),se=kr(re=>re.overflowCount()),le=Math.min(Q,Xf)+(se>0?1:0),z=A+K+(n||s?2:0)+(le>0?le+(C?1:0):0)+G+(x?2:0)+(w?2:0)+(2+u.length)+1+2,te=Math.max(3,S-z-1),de=Kr(re=>re.expanded),$=Kr(re=>re.nodes.some(Me=>Me.streamingContent)||re.transcripts.size>0),B=de&&$,X=as(re=>re.peekOpen),W=s||n,[_e,ce]=RAe(W),Se=IAe(null);return NAe(()=>(W?(Se.current&&(clearTimeout(Se.current),Se.current=null),ce(!0)):Se.current=setTimeout(()=>{ce(!1),Se.current=null},500),()=>{Se.current&&clearTimeout(Se.current)}),[W]),B?Ed(hS,{flexDirection:"column",width:E,children:[Ut(LI,{}),Ut(WW,{width:E}),Ed(hS,{flexDirection:"column",children:[w&&Ut(Fl,{children:" "}),w&&h&&Ut(DI,{...h}),Ut(kI,{lines:u,cursorLine:d,cursorCol:m,isFocused:f,width:E}),Ut(AI,{...g,width:E})]})]}):Ed(hS,{flexDirection:"column",width:E,children:[e.length>0&&Ut(OAe,{items:e,children:(re,Me)=>Ut(Fl,{children:re},Me)}),r&&Ut(MW,{content:r,isStreaming:n,width:E,maxVisibleLines:te}),Ut(LI,{}),X&&!uh()&&Ut(eV,{}),q&&Ut(xAe,{}),_e&&Ut(Fl,{children:" "}),Ut(RW,{status:i,isActive:_e,elapsedSeconds:o,tokensGenerated:a,showInterruptHint:!0,resetKey:l}),Q>0&&C&&Ut(Fl,{children:" "}),Ut(aV,{}),Ut(yV,{}),Ut(bV,{}),Ed(hS,{flexDirection:"column",children:[w&&Ut(Fl,{children:" "}),w&&h&&Ut(DI,{soulName:h.soulName,personaName:h.personaName,modelName:h.modelName,tools:h.tools,mcpServers:h.mcpServers,mcpFailedCount:h.mcpFailedCount,contextFiles:h.contextFiles,skills:h.skills}),Ut(kI,{lines:u,cursorLine:d,cursorCol:m,isFocused:f,queuedCount:oe,loopPaused:g.loopStats?.paused,width:E}),Ut(AI,{projectPath:g.projectPath,branch:g.branch,worktreeName:g.worktreeName,baseBranch:g.baseBranch,mode:g.mode,contextPercent:g.contextPercent,contextLevel:g.contextLevel,contextTokens:g.contextTokens,contextLimit:g.contextLimit,sessionCost:g.sessionCost,subagentTokens:P.tokens,subagentCost:P.cost,memoryMB:g.memoryMB,sessionDuration:g.sessionDuration,agentExecTime:g.agentExecTime,loopStats:g.loopStats,width:E}),Ut(MAe,{})]})]})})});import{jsx as ha,jsxs as gS}from"react/jsx-runtime";import{Box as RV,Text as go}from"ink";function FAe(t){let e=t.match(/^(\s*\d+\s*)([+-])(.*)$/);if(e){let[,n,s,i]=e;return{text:s+i,color:s==="+"?kV:AV,backgroundColor:s==="+"?DV:IV,lineNumber:n}}let r=t.match(/^(\s*\d+)(\s{3})(.*)$/);if(r){let[,n,s,i]=r;return{text:" "+s+i,color:zI,lineNumber:n,isContext:!0}}return t.startsWith("+")?{text:t,color:kV,backgroundColor:DV}:t.startsWith("-")?{text:t,color:AV,backgroundColor:IV}:t.startsWith("@@")?{text:t,color:PAe}:t.startsWith("$")?{text:t,color:zI}:{text:t,color:zI,isContext:!0}}function $Ae({line:t,width:e}){let r=FAe(t),n=r.lineNumber?r.lineNumber.length:0,s=Math.max(0,e-n),i=r.text;i.length>s&&(i=i.slice(0,s-3)+"...");let o=r.backgroundColor?i+" ".repeat(Math.max(0,s-i.length)):i;return r.lineNumber?gS(RV,{children:[ha(go,{color:LAe,children:r.lineNumber}),r.backgroundColor?ha(go,{backgroundColor:r.backgroundColor,color:r.color,children:o}):ha(go,{color:r.color,children:o})]}):r.backgroundColor?ha(go,{backgroundColor:r.backgroundColor,color:r.color,children:o}):ha(go,{color:r.color,children:i})}function qI({lines:t,scrollOffset:e=0,maxVisibleLines:r=15,isScrollMode:n=!1,width:s}){let i=s??(process.stdout.columns||80),o=i-4,a=e,l=Math.min(a+r,t.length),c=t.slice(a,l),u=e,d=t.length-l,m=t.length>r;return gS(RV,{flexDirection:"column",width:i,children:[m&&(u>0?gS(go,{color:"yellow",children:["\u2191 ",u," more lines above"]}):ha(go,{children:" "})),c.map((f,h)=>ha($Ae,{line:f,width:o},a+h)),m&&(d>0?gS(go,{color:"yellow",children:["\u2193 +",d," more lines below"]}):ha(go,{children:" "}))]})}var kV,AV,DV,IV,PAe,zI,LAe,NV=k(()=>{"use strict";kV="#A6E22E",AV="#F92672",DV="#243524",IV="#3b2028",PAe="#66D9EF",zI="#F8F8F2",LAe="#75715E"});import{jsxs as HI,jsx as OV}from"react/jsx-runtime";import{Box as MV,Text as xV}from"ink";function UAe({option:t,isSelected:e,isActive:r}){let n=e&&r?">":" ",s=e&&r?"cyan":"white";return HI(MV,{children:[HI(xV,{color:e&&r?"cyan":void 0,children:[n," "]}),HI(xV,{color:s,children:[t.key,". ",t.label]})]})}function LV({options:t,selectedIndex:e,isActive:r=!0}){return OV(MV,{flexDirection:"column",children:t.map((n,s)=>OV(UAe,{option:n,isSelected:s===e,isActive:r},n.key))})}var PV,FV=k(()=>{"use strict";PV=[{key:"1",label:"Yes",value:"yes"},{key:"2",label:"Yes, and don't ask again for this session",value:"session"},{key:"3",label:"No",value:"no"},{key:"4",label:"Provide feedback",value:"feedback"}]});import{jsxs as ls,Fragment as YI,jsx as Zt}from"react/jsx-runtime";import{Box as gi,Text as Lr}from"ink";function $V({toolName:t,description:e,details:r,showDiff:n=!1,options:s=PV,selectedIndex:i,isScrollMode:o=!1,scrollOffset:a=0,maxVisibleDiffLines:l=15,width:c,isResolved:u=!1,result:d,isFeedbackMode:m=!1,feedbackText:f=""}){let h=c??(process.stdout.columns||80),g=r&&r.length>0;if(u&&d){let _=d==="yes"||d==="session"||d==="always",E=_?"\u2713":"\u2717",S=_?"green":"red",T=t==="Edit"||t==="Write";return ls(gi,{flexDirection:"column",children:[ls(gi,{children:[ls(Lr,{color:S,children:[E," "]}),T?Zt(YI,{children:ls(Lr,{bold:!0,children:[t," file"]})}):Zt(Lr,{bold:!0,color:Ae(),children:t}),ls(Lr,{dimColor:!0,children:[": ",e]})]}),g&&n&&ls(gi,{flexDirection:"column",marginTop:1,marginLeft:2,children:[Zt(qI,{lines:r.slice(0,10),maxVisibleLines:10,width:h-4}),r.length>10&&ls(Lr,{dimColor:!0,children:[" ... +",r.length-10," more lines"]})]})]})}return ls(gi,{flexDirection:"column",children:[Zt(Lr,{dimColor:!0,children:"\u2500".repeat(Math.min(h,60))}),Zt(gi,{marginTop:1,children:t==="Edit"||t==="Write"?ls(Lr,{bold:!0,children:[t," file"]}):ls(YI,{children:[Zt(Lr,{bold:!0,color:Ae(),children:"Aii"}),Zt(Lr,{children:" wants to execute "}),Zt(Lr,{bold:!0,children:t})]})}),Zt(gi,{marginLeft:2,children:Zt(Lr,{dimColor:!0,children:e})}),g&&Zt(gi,{flexDirection:"column",marginTop:1,marginLeft:2,children:Zt(qI,{lines:r,scrollOffset:a,maxVisibleLines:l,isScrollMode:o,width:h-4})}),Zt(Lr,{children:" "}),m?ls(YI,{children:[ls(gi,{children:[Zt(Lr,{color:Ae(),children:"> "}),Zt(Lr,{children:f}),Zt(Lr,{color:Ae(),children:"\u2588"})]}),Zt(gi,{marginTop:1,children:Zt(Lr,{dimColor:!0,children:"Type your feedback, then press Enter to submit \u2022 Esc to cancel"})})]}):Zt(LV,{options:s,selectedIndex:i,isActive:!o}),Zt(gi,{marginTop:1,children:Zt(Lr,{dimColor:!0,children:"\u2500".repeat(Math.min(h,60))})})]})}var UV=k(()=>{"use strict";NV();FV();ft()});import{jsx as _i,jsxs as ga}from"react/jsx-runtime";import{Box as $l,Text as Ls}from"ink";function BV({question:t,description:e,options:r,selectedIndex:n,otherMode:s,otherText:i,width:o}){let a=Ae(),l=o??(process.stdout.columns||80);return ga($l,{flexDirection:"column",borderStyle:"round",borderColor:a,paddingX:1,width:l,children:[_i(Ls,{bold:!0,color:a,children:t}),e?_i(Ls,{dimColor:!0,children:e}):null,_i($l,{height:1}),s?ga($l,{flexDirection:"column",children:[_i(Ls,{children:"Other:"}),ga(Ls,{children:[_i(Ls,{color:a,children:"\u2503 "}),_i(Ls,{children:i}),_i(Ls,{color:a,children:"_"})]}),_i($l,{height:1}),_i(Ls,{dimColor:!0,children:"[Enter submit \xB7 Esc back to options]"})]}):ga($l,{flexDirection:"column",children:[r.map((c,u)=>ga($l,{flexDirection:"column",children:[ga(Ls,{color:u===n?a:void 0,children:[u===n?"\u25CF ":"\u25CB ",u+1,". ",c.label]}),c.description?ga(Ls,{dimColor:!0,children:[" ",c.description]}):null]},u)),_i($l,{height:1}),ga(Ls,{dimColor:!0,children:["[\u2191\u2193 navigate \xB7 1-",r.length," jump \xB7 Enter submit \xB7 Esc cancel]"]})]})]})}var GV=k(()=>{"use strict";ft()});function _S(){zV=Date.now()}function qV(){return zV}var zV,ES=k(()=>{"use strict";zV=Date.now()});function HV(t){if(t==="\r")return!0;if(t.length===1){let e=t.charCodeAt(0);return e>=32&&e<=126}return!1}var YV=k(()=>{"use strict"});function jV(t){let{permanentContent:e,frozenCount:r,showWelcome:n,headerKey:s,staticEpoch:i}=t,o=r!==null?e.slice(0,r):e;return[...n&&i===0?[{id:`__header__:welcome:${s}`,type:"welcome",line:""},{id:`__header__:spacer:${s}`,type:"spacer",line:""}]:[],...o.map(a=>({id:a.id,type:"content",line:a.line}))]}var WV=k(()=>{"use strict"});import{useEffect as VV}from"react";function KV(){let t=as(s=>s.peekOpen),e=as(s=>s.peekIndex),r=as(s=>s.results),n=ts(s=>s.renderEpoch);return VV(()=>{if(!uh())return;let s=t&&e>=0?r[e]:void 0;t&&s?jI(Y$(s,e,r.length,process.stdout.rows||24,process.stdout.columns||80)):yS()},[t,e,r,n]),VV(()=>()=>yS(),[]),null}var QV=k(()=>{"use strict";md();fS();fa();Ny()});var tK={};Ie(tK,{App:()=>eK,default:()=>KAe});import{jsx as Fr,jsxs as WI,Fragment as BAe}from"react/jsx-runtime";import GAe,{useEffect as Bl,useCallback as yd,useState as _o,useRef as Jr,useMemo as XV}from"react";import{Box as Sd,Text as VI,Static as zAe}from"ink";import{useShallow as Ul}from"zustand/react/shallow";function qAe({onInterrupt:t}){let e=Jr(t);return e.current=t,Bl(()=>{if(!process.stdin.isTTY)return;process.stdin.resume();let r=n=>{_S();let s=n.toString();if(Pr.getState().active){if(s==="\x1B"){Pr.getState().release("esc");return}s===""?Pr.getState().release("ctrl_c"):HV(s)&&Pr.getState().release("typed")}let o=J1(),a=()=>{let d=ud().getText();d.startsWith("/")&&!d.includes(`
1074
1074
  `)&&!d.includes(" ")?(o.isVisible||o.show(),o.setFilter(d)):o.isVisible&&o.hide()},l=()=>{let d=o.getSelected();if(!d)return!1;let m=ud();m.clear();for(let f of`/${d.name} `)m.insertChar(f);return o.hide(),!0};if(s==="\x1B"){if(o.isVisible){o.hide();return}e.current();return}if(s===""&&process.exit(0),s===""){let d=Pl();if(d.peekOpen){d.closePeek();return}let m=Ps();m.nodes.length>0||m.transcripts.size>0?m.toggleExpanded():d.togglePeek();return}let c=Pl();if(c.peekOpen){if(s==="\x1B[A"){c.navigatePeek("prev");return}if(s==="\x1B[B"){c.navigatePeek("next");return}}let u=ud();if(s===" "){o.isVisible&&l();return}if(s==="\r"){if(o.isVisible){l();return}let d=u.getText().trim();if(!d)return;let m=ct().loopMode;if(d.startsWith("/note ")||d==="/note"||d.startsWith("/now ")||d==="/now"){let h=d.startsWith("/now")?"/now":"/note",g=d.slice(h.length).trim();if(!g){Le().showToast(F.dim("\u25C6 /note requires a message (usage: /note <text>)")),u.clear();return}if(!m){let C=ch();C.noteToastId!==null&&Le().clearToast(C.noteToastId),C.setPendingNote(g);let w=process.stdout.columns||80,v=Math.floor(w*.618)-16,A=g.replace(/\n/g," "),R=A.length>v?A.slice(0,v)+"\u2026":A,L=Le(),q=L.nextId;L.showToast(F.success(`\u25C6 Injecting: "${R}"`),!0),C.setNoteToastId(q),u.clear();return}let _=process.stdout.columns||80,E=Math.floor(_*.618)-16,S=g.replace(/\n/g," "),T=S.length>E?S.slice(0,E)+"\u2026":S;Le().showToast(F.success(`\u25C6 Injecting: "${T}"`),!0),u.enqueueTypeAhead({silent:!0});return}if(m&&(d==="/pause"||d.startsWith("/pause ")||d==="/resume"||d==="/stop")){let h=d.startsWith("/pause")?"Pausing":d==="/resume"?"Resuming":"Stopping";Le().showToast(F.success(`\u25C6 ${h}...`)),u.enqueueTypeAhead({silent:!0});return}u.enqueueTypeAhead();return}if(s===`
1075
1075
  `){o.hide(),u.newLine();return}if(s==="\x7F"||s==="\b"){u.deleteChar(),a();return}if(s==="\x1B[A"){if(o.isVisible){o.moveUp();return}u.moveCursor("up");return}if(s==="\x1B[B"){if(o.isVisible){o.moveDown();return}u.moveCursor("down");return}if(s==="\x1B[C"){u.moveCursor("right");return}if(s==="\x1B[D"){u.moveCursor("left");return}if(s===""){u.undo();return}if(s===""){u.redo();return}if(s===""){u.hasQueuedMessages()&&!u.getText().trim()?u.clearTypeAheadQueue():u.clear(),o.hide();return}if(!s.startsWith("\x1B")){for(let d of Array.from(s))if(d===`
@@ -3483,7 +3483,7 @@ ${f}
3483
3483
  `),e(r.trim());return}else if(i===""){process.stdin.setRawMode(!1),process.stdin.removeListener("data",n),process.stdin.pause(),process.stdout.write(`
3484
3484
  `),e("");return}else i==="\x7F"||i==="\b"?r.length>0&&(r=r.slice(0,-1),process.stdout.write("\b \b")):i>=" "&&(r+=i,process.stdout.write("*"))};process.stdin.on("data",n)})}function GT(t){return new Promise(e=>{let r=fM.createInterface({input:process.stdin,output:process.stdout});r.question(`${t} (y/N): `,n=>{r.close(),e(n.trim().toLowerCase()==="y")})})}var gM=k(()=>{"use strict"});var tie={};Ie(tie,{handleWorktree:()=>cBe});async function cBe(t){let e=t.subcommand??t.args[0]??"list",r=t.subcommand?t.args[0]:t.args[1],n=process.cwd();switch(e){case"create":{op()&&(console.error("Already inside a worktree. Exit first."),process.exit(1));let s=await ip({name:r,projectPath:n});console.log(`Created worktree '${s.name}'`),console.log(` Path: ${s.path}`),console.log(` Branch: ${s.branch}`),console.log(`
3485
3485
  To enter: cd ${s.path}`);break}case"list":{let s=await Ra(n);if(s.length===0){console.log("No worktrees found.");return}console.log(`Worktrees (${s.length}):
3486
- `);for(let i of s){let o=[];i.hasChanges&&o.push("modified"),i.hasCommits&&o.push("commits ahead");let a=o.length>0?` [${o.join(", ")}]`:"";console.log(` ${i.name}${a}`),console.log(` Branch: ${i.branch}`),console.log(` Path: ${i.path}`)}break}case"remove":{r||(console.error("Usage: aii worktree remove <name>"),process.exit(1));let s=await Na(r,n);switch(s.action){case"auto-removed":console.log(`Worktree '${r}' removed (no changes).`);break;case"removed":console.log(`Worktree '${r}' removed.`);break;case"kept":console.log(`Worktree '${r}' kept (${s.reason}).`);break}break}case"clean":{let{removed:s,kept:i}=await pT(n);s.length>0&&console.log(`Removed ${s.length} clean worktree(s): ${s.join(", ")}`),i.length>0&&console.log(`Kept ${i.length} worktree(s) with changes: ${i.join(", ")}`),s.length===0&&i.length===0&&console.log("No worktrees to clean.");break}default:console.error(`Unknown worktree action: ${e}`),console.error("Available: create, list, remove, clean"),process.exit(1)}}var rie=k(()=>{"use strict";Oa()});var sie={};Ie(sie,{handleSoul:()=>uBe});async function uBe(t,e){console.warn(p.yellow("\u26A0 'aii soul' is deprecated. Use 'aii persona' instead."));let r=t.subcommand??t.args[0]??"show";switch(r){case"help":await nie(e);break;case"switch":{let n=t.subcommand?t.args[0]:t.args[1];n||(console.error(p.red("Usage: aii soul switch <name>")),console.error(p.gray(" Examples: aii soul switch doer")),console.error(p.gray(" aii soul switch clawsouls/academic-writer")),process.exit(1)),await dBe(n,e);break}case"show":{let s=(await e.load()).soul??"thinker",i=bi(s);console.log(p.bold("Active soul:"),`${i.owner}/${i.name}`),s!==`${i.owner}/${i.name}`&&console.log(p.gray(` (shorthand: ${s})`));break}default:console.error(p.red(`Unknown soul action: ${r}`)),await nie(e),process.exit(1)}}async function nie(t){let e=["thinker","doer","coder"],r="thinker";try{r=(await t.load()).soul??"thinker"}catch{}console.log(""),console.log(p.yellow(" \u26A0 Soul commands are deprecated. Use persona commands instead.")),console.log(F.logo(" Soul System")),console.log(""),console.log(` Active soul: ${F.model(r)}`),console.log(""),console.log(p.yellow(" BUILT-IN SOULS:"));for(let n of e){let s=n===r?p.green("\u25BA"):" ",i=n==="thinker"?"Patient and collaborative \u2014 thinks out loud, walks through reasoning, and helps you understand the why, not just the what":n==="doer"?"Direct and efficient \u2014 leads with the answer, says it once, says it right, and every sentence earns its place":"Your pair-programming partner \u2014 reads the codebase, references specific lines and symbols, and explains what changed and why";console.log(` ${s} ${F.model(n.padEnd(10))} ${i}`)}console.log(""),console.log(p.yellow(" USAGE:")),console.log(` ${p.green("aii soul")} Show this help`),console.log(` ${p.green("aii soul show")} Show active soul`),console.log(` ${p.green("aii soul switch <name>")} Switch to a different soul`),console.log(""),console.log(p.yellow(" EXAMPLES:")),console.log(p.dim(" aii soul show")),console.log(p.dim(" aii soul switch doer")),console.log(p.dim(" aii soul switch thinker")),console.log(p.dim(" aii soul switch coder")),console.log("")}async function dBe(t,e){let r=iu[t]??t;console.warn(p.yellow(`\u26A0 'aii soul switch' is deprecated. Use 'aii persona use ${r}'`)),/^[a-z0-9/-]+$/.test(t)||(console.error(p.red(`Invalid soul name: "${t}"`)),console.error(p.gray("Names must be lowercase alphanumeric, hyphens, and optional owner/ prefix")),process.exit(1)),await e.load(),await e.set("soul",t);let n=bi(t);console.log(p.green(`Switched soul to: ${n.owner}/${n.name}`)),console.log(p.gray("Takes effect on next session."))}var iie=k(()=>{"use strict";ve();ps();ar();Zn()});var lie={};Ie(lie,{handleUpgrade:()=>pBe});import{execSync as oie}from"node:child_process";async function pBe(t){let e=t.args[0]||null,r="0.16.33",n=e?`${aie}@${e}`:`${aie}@latest`;console.log(""),console.log(e?`Upgrading Aii CLI to v${e}...`:"Upgrading Aii CLI to latest..."),console.log(` Current version: ${r}`),console.log("");try{oie(`npm install -g ${n}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
3486
+ `);for(let i of s){let o=[];i.hasChanges&&o.push("modified"),i.hasCommits&&o.push("commits ahead");let a=o.length>0?` [${o.join(", ")}]`:"";console.log(` ${i.name}${a}`),console.log(` Branch: ${i.branch}`),console.log(` Path: ${i.path}`)}break}case"remove":{r||(console.error("Usage: aii worktree remove <name>"),process.exit(1));let s=await Na(r,n);switch(s.action){case"auto-removed":console.log(`Worktree '${r}' removed (no changes).`);break;case"removed":console.log(`Worktree '${r}' removed.`);break;case"kept":console.log(`Worktree '${r}' kept (${s.reason}).`);break}break}case"clean":{let{removed:s,kept:i}=await pT(n);s.length>0&&console.log(`Removed ${s.length} clean worktree(s): ${s.join(", ")}`),i.length>0&&console.log(`Kept ${i.length} worktree(s) with changes: ${i.join(", ")}`),s.length===0&&i.length===0&&console.log("No worktrees to clean.");break}default:console.error(`Unknown worktree action: ${e}`),console.error("Available: create, list, remove, clean"),process.exit(1)}}var rie=k(()=>{"use strict";Oa()});var sie={};Ie(sie,{handleSoul:()=>uBe});async function uBe(t,e){console.warn(p.yellow("\u26A0 'aii soul' is deprecated. Use 'aii persona' instead."));let r=t.subcommand??t.args[0]??"show";switch(r){case"help":await nie(e);break;case"switch":{let n=t.subcommand?t.args[0]:t.args[1];n||(console.error(p.red("Usage: aii soul switch <name>")),console.error(p.gray(" Examples: aii soul switch doer")),console.error(p.gray(" aii soul switch clawsouls/academic-writer")),process.exit(1)),await dBe(n,e);break}case"show":{let s=(await e.load()).soul??"thinker",i=bi(s);console.log(p.bold("Active soul:"),`${i.owner}/${i.name}`),s!==`${i.owner}/${i.name}`&&console.log(p.gray(` (shorthand: ${s})`));break}default:console.error(p.red(`Unknown soul action: ${r}`)),await nie(e),process.exit(1)}}async function nie(t){let e=["thinker","doer","coder"],r="thinker";try{r=(await t.load()).soul??"thinker"}catch{}console.log(""),console.log(p.yellow(" \u26A0 Soul commands are deprecated. Use persona commands instead.")),console.log(F.logo(" Soul System")),console.log(""),console.log(` Active soul: ${F.model(r)}`),console.log(""),console.log(p.yellow(" BUILT-IN SOULS:"));for(let n of e){let s=n===r?p.green("\u25BA"):" ",i=n==="thinker"?"Patient and collaborative \u2014 thinks out loud, walks through reasoning, and helps you understand the why, not just the what":n==="doer"?"Direct and efficient \u2014 leads with the answer, says it once, says it right, and every sentence earns its place":"Your pair-programming partner \u2014 reads the codebase, references specific lines and symbols, and explains what changed and why";console.log(` ${s} ${F.model(n.padEnd(10))} ${i}`)}console.log(""),console.log(p.yellow(" USAGE:")),console.log(` ${p.green("aii soul")} Show this help`),console.log(` ${p.green("aii soul show")} Show active soul`),console.log(` ${p.green("aii soul switch <name>")} Switch to a different soul`),console.log(""),console.log(p.yellow(" EXAMPLES:")),console.log(p.dim(" aii soul show")),console.log(p.dim(" aii soul switch doer")),console.log(p.dim(" aii soul switch thinker")),console.log(p.dim(" aii soul switch coder")),console.log("")}async function dBe(t,e){let r=iu[t]??t;console.warn(p.yellow(`\u26A0 'aii soul switch' is deprecated. Use 'aii persona use ${r}'`)),/^[a-z0-9/-]+$/.test(t)||(console.error(p.red(`Invalid soul name: "${t}"`)),console.error(p.gray("Names must be lowercase alphanumeric, hyphens, and optional owner/ prefix")),process.exit(1)),await e.load(),await e.set("soul",t);let n=bi(t);console.log(p.green(`Switched soul to: ${n.owner}/${n.name}`)),console.log(p.gray("Takes effect on next session."))}var iie=k(()=>{"use strict";ve();ps();ar();Zn()});var lie={};Ie(lie,{handleUpgrade:()=>pBe});import{execSync as oie}from"node:child_process";async function pBe(t){let e=t.args[0]||null,r="0.16.34",n=e?`${aie}@${e}`:`${aie}@latest`;console.log(""),console.log(e?`Upgrading Aii CLI to v${e}...`:"Upgrading Aii CLI to latest..."),console.log(` Current version: ${r}`),console.log("");try{oie(`npm install -g ${n}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
3487
3487
  Upgrade failed. Try running with sudo or check npm permissions.`),console.error(` Manual: npm install -g ${n}`),process.exit(1)}try{let s=oie("aii --version 2>/dev/null",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).trim();console.log(""),console.log(s===r?`Already up to date (${r})`:`Upgraded: ${r} -> ${s}`)}catch{console.log(""),console.log("Installed. Restart your terminal to use the new version.")}}var aie,cie=k(()=>{"use strict";aie="@aiiware/aii"});var uie={};Ie(uie,{handleSkillCmd:()=>fBe});function mBe(t){return t.userInvocable&&t.modelInvocable?"":t.userInvocable?"(CLI only)":t.modelInvocable?"(agent only)":"(disabled)"}async function fBe(t,e){let r=(t.subcommand??t.args[0]??"help").toLowerCase(),n=t.subcommand?t.args[0]:t.args[1]??null;switch(r){case"list":return hBe();case"info":return gBe(n);case"install":return _Be(n);case"help":default:return EBe()}}async function hBe(){let{SkillManager:t}=await Promise.resolve().then(()=>(Vi(),dl)),e;if(t.hasInstance())e=t.getInstance();else{e=t.getInstance(process.cwd());let i;try{let{PersonaManager:o}=await Promise.resolve().then(()=>(Dt(),Pt)),a=o.getInstance(process.cwd());await a.initialize(),a.isActive()&&(i=a.getActive()?.skillPaths)}catch{}await e.discover(i)}let r=e.getRegistry().getAll();if(r.length===0){console.log("No skills installed."),console.log(" Install one: aii skill install <owner/repo/skill>");return}let n=new Map;for(let i of r){let o=n.get(i.source)||[];o.push(i),n.set(i.source,o)}let s=["project","user","persona-bundled","universal","built-in","plugin","remote"];console.log(""),console.log(" Name Source Invocation Description"),console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let i of s){let o=n.get(i);if(o)for(let a of o){let l=a.name.padEnd(18),c=a.source.padEnd(16),u=mBe(a).padEnd(14),d=(a.description||"").slice(0,34);console.log(` ${l}${c}${u}${d}`)}}console.log("")}async function gBe(t){if(!t){console.log("Usage: aii skill info <name>");return}let{SkillManager:e}=await Promise.resolve().then(()=>(Vi(),dl)),r;if(e.hasInstance())r=e.getInstance();else{r=e.getInstance(process.cwd());let s;try{let{PersonaManager:i}=await Promise.resolve().then(()=>(Dt(),Pt)),o=i.getInstance(process.cwd());await o.initialize(),o.isActive()&&(s=o.getActive()?.skillPaths)}catch{}await r.discover(s)}let n=r.getRegistry().getByName(t);if(!n){let i=r.getRegistry().getAll().map(o=>o.name).join(", ");console.error(`Skill "${t}" not found.`),i&&console.error(`Available skills: ${i}`),process.exit(1)}console.log(""),console.log(` Name: ${n.name}`),console.log(` Source: ${n.source}`),console.log(` Description: ${n.description||"(none)"}`),console.log(` Invocable: ${[n.userInvocable?"user":"",n.modelInvocable?"model":""].filter(Boolean).join(" + ")||"none"}`),n.allowedTools?.length&&console.log(` Tools: ${n.allowedTools.join(" ")}`),console.log(` Path: ${n.path||"(embedded)"}`),console.log("")}async function _Be(t){if(!t){console.log("Usage: aii skill install <owner/repo/skill>");return}let{SkillInstaller:e}=await Promise.resolve().then(()=>(Vm(),ZE)),r=new e({projectRoot:process.cwd()});try{let n=await r.install(t,{scope:"user"});n.success?(console.log(`Installed skill: ${n.skillName}`),n.installPath&&console.log(` Location: ${n.installPath}`)):(console.error(`Failed to install skill: ${n.error||"Unknown error"}`),process.exit(1))}catch(n){let s=n instanceof Error?n.message:String(n);console.error(`Failed to install skill: ${s}`),process.exit(1)}}function EBe(){let t=[""];t.push(p.cyan.bold(" Skill System")),t.push(""),t.push(p.yellow(" USAGE:")),t.push(` ${p.green("aii skill list")} List all available skills`),t.push(` ${p.green("aii skill info <name>")} Show details for a skill`),t.push(` ${p.green("aii skill install <ref>")} Install a skill from GitHub`),t.push(` ${p.green("aii skill help")} Show this help`),t.push(""),t.push(p.yellow(" EXAMPLES:")),t.push(p.dim(" aii skill list")),t.push(p.dim(" aii skill info commit")),t.push(p.dim(" aii skill install aiiware/aii-skills/skills/commit --user")),t.push(""),console.log(t.join(`
3488
3488
  `))}var die=k(()=>{"use strict";ve()});var pie={};Ie(pie,{handlePluginCmd:()=>yBe});async function yBe(t,e){let r=(t.subcommand??t.args[0]??"help").toLowerCase(),n=t.subcommand?t.args[0]:t.args[1]??null,s=t.subcommand?t.args.slice(1):t.args.slice(2);switch(r){case"install":return SBe(n,s);case"uninstall":case"remove":return bBe(n);case"update":return TBe(n);case"list":case"ls":return wBe();case"help":default:return CBe()}}async function SBe(t,e){if(!t){console.log("Usage: aii plugin install <owner/repo>");return}let{PluginInstaller:r}=await Promise.resolve().then(()=>(Zo(),ul)),n=e.includes("--force")||e.includes("-f"),s=t,i;if(t.includes("@")){let a=t.lastIndexOf("@");s=t.slice(0,a),i=t.slice(a+1)}let o=new r({onProgress:a=>console.log(` ${p.dim(a)}`)});try{console.log(""),console.log(` Installing plugin from ${p.cyan(s)}...`),console.log("");let a=await o.install(s,{version:i,force:n});a.success?(console.log(""),console.log(` ${p.green("\u2713")} Plugin ${p.bold(a.pluginName)} v${a.version} installed`),console.log(` ${a.skillCount} skills available (use ${p.cyan("aii skill list")} to see them)`),a.installPath&&console.log(` Stored in ${p.dim(a.installPath)}`),console.log("")):(console.error(` ${p.red("\u2717")} ${a.error||"Unknown error"}`),process.exit(1))}catch(a){let l=a instanceof Error?a.message:String(a);console.error(` ${p.red("\u2717")} Failed to install plugin: ${l}`),process.exit(1)}}async function bBe(t){if(!t){console.log("Usage: aii plugin uninstall <name>");return}let{PluginInstaller:e}=await Promise.resolve().then(()=>(Zo(),ul)),r=new e;try{let n=await r.uninstall(t);n.success?(console.log(""),console.log(` ${p.green("\u2713")} Plugin ${p.bold(t)} uninstalled`),n.skillCount&&console.log(` ${n.skillCount} skills removed`),console.log("")):(console.error(` ${p.red("\u2717")} ${n.error||"Unknown error"}`),process.exit(1))}catch(n){let s=n instanceof Error?n.message:String(n);console.error(` ${p.red("\u2717")} Failed to uninstall plugin: ${s}`),process.exit(1)}}async function TBe(t){if(!t){console.log("Usage: aii plugin update <name>");return}let{PluginInstaller:e}=await Promise.resolve().then(()=>(Zo(),ul)),r=new e({onProgress:n=>console.log(` ${p.dim(n)}`)});try{console.log(""),console.log(` Checking for updates to ${p.cyan(t)}...`);let n=await r.update(t);n.success?(n.error?.includes("already up to date")?console.log(` ${p.green("\u2713")} ${n.error}`):(console.log(` ${p.green("\u2713")} Plugin ${p.bold(t)} updated to v${n.version}`),n.skillCount&&console.log(` ${n.skillCount} skills available`)),console.log("")):(console.error(` ${p.red("\u2717")} ${n.error||"Unknown error"}`),process.exit(1))}catch(n){let s=n instanceof Error?n.message:String(n);console.error(` ${p.red("\u2717")} Failed to update plugin: ${s}`),process.exit(1)}}async function wBe(){let{PluginManager:t}=await Promise.resolve().then(()=>(Hm(),qm)),r=await new t().listInstalled();if(r.length===0){console.log(""),console.log(" No plugins installed."),console.log(` Install one: ${p.cyan("aii plugin install <owner/repo>")}`),console.log("");return}console.log(""),console.log(p.bold(" INSTALLED PLUGINS")),console.log(""),console.log(" Name Version Skills Installed"),console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let n of r){let s=n.name.padEnd(18),i=`v${n.version}`.padEnd(12),o=String(n.skillCount).padEnd(8),a=new Date(n.installedAt).toLocaleDateString();console.log(` ${s}${i}${o}${a}`)}console.log("")}function CBe(){let t=[""];t.push(p.cyan.bold("Plugin System")),t.push(""),t.push(p.yellow("USAGE:")),t.push(` ${p.green("aii plugin install <source>")} Install a plugin from GitHub`),t.push(` ${p.green("aii plugin uninstall <name>")} Uninstall a plugin`),t.push(` ${p.green("aii plugin update <name>")} Update a plugin to latest`),t.push(` ${p.green("aii plugin list")} List installed plugins`),t.push(` ${p.green("aii plugin help")} Show this help`),t.push(""),t.push(p.yellow("EXAMPLES:")),t.push(p.dim(" aii plugin install aiiware/aii-skills")),t.push(p.dim(" aii plugin install aiiware/aii-skills@v0.1.0")),t.push(p.dim(" aii plugin list")),t.push(p.dim(" aii plugin update aii-skills")),t.push(p.dim(" aii plugin uninstall aii-skills")),t.push(""),console.log(t.join(`
3489
3489
  `))}var mie=k(()=>{"use strict";ve()});var fie={};Ie(fie,{handlePersona:()=>kBe});function vBe(t){return process.stdin.isTTY?async({originId:e,event:r,command:n,index:s,total:i})=>{s===1&&(console.log(`
@@ -3506,7 +3506,7 @@ Upgrade failed. Try running with sudo or check npm permissions.`),console.error(
3506
3506
  ${t}
3507
3507
  </context>
3508
3508
 
3509
- ${e}`:e}var Wie="0.16.33",Vie=new Set(["--clean","--standard","--thinking","-v","--verbose","-d","--debug","--model","--openrouter-provider","--host","-y","--yes","--offline","-D","--direct","-i","--interactive","-c","--continue-chat","-n","--new-chat","--auto","--auto-background-timeout","--no-colors","--colors","--no-emojis","--emojis","--no-animations","--animations","--no-streaming","--streaming","--show-tokens","--show-cost","--output-format","--tools","--exclude-tools","-h","--help","-V","--version"]),Kie=new Set(["--model","--openrouter-provider","--host","-c","--continue-chat","--auto-background-timeout","--output-format","--tools","--exclude-tools"]);function Qie(t){let e=[];for(let r=0;r<t.length;r++){if(Vie.has(t[r])){Kie.has(t[r])&&r++;continue}e.push(t[r])}return e}function Xie(){let t=new EP;return t.name("aii").description("AI-powered CLI assistant").version(Wie,"-V, --version","Show version number").helpOption(!1).enablePositionalOptions().argument("[query...]","Natural language query").option("--clean","Clean output mode (just the result)").option("--standard","Standard output mode (result + metrics)").option("--thinking","Thinking mode (full reasoning)").option("-v, --verbose","Verbose output (alias for --thinking)").option("-d, --debug","Debug output").option("--model <model>","Override LLM model (e.g., ollama/llama3.1:8b, deepseek/deepseek-chat)").option("--openrouter-provider <slug>","Pin OpenRouter requests to a specific backend provider").option("--host <host>","API server host:port").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").option("-D, --direct","Direct mode (bypass server intent recognition)").option("-i, --interactive","Interactive chat mode").option("-c, --continue-chat <id>","Continue chat session").option("-n, --new-chat","Force new chat session").option("--auto","Auto mode - auto-approve all actions").option("--auto-background-timeout <seconds>","Auto-convert foreground agents to background after N seconds (0 to disable)","120").option("--no-colors","Disable colored output").option("--no-emojis","Disable emoji icons").option("--no-animations","Disable animations").option("--no-streaming","Disable streaming").option("--show-tokens","Show token usage").option("--show-cost","Show cost estimates").option("--output-format <format>","Output format: json or stream-json (one-shot only)").option("--tools <list>",'Allowlist of tools (comma-separated, e.g., "Read,Bash,Edit")').option("--exclude-tools <list>",'Exclude tools (comma-separated, e.g., "WebSearch,WebFetch")').option("-h, --help","Show help"),t.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),t.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),t.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),t.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),t.command("doctor").description("System health check").action(()=>{}),t.command("install [target...]").description("Install or update Aii CLI, skills, or MCP servers").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("chat").description("Interactive chat mode").action(()=>{}),t.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),t.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),t.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("sessions").description("Manage server sessions (list, info, resume, rename, delete)").argument("[action]","Action: list, info, resume, rename, delete").argument("[args...]","Additional arguments (session ID, name, etc.)").allowUnknownOption().action(()=>{}),t.command("worktree").description("Manage git worktrees for isolated development").argument("[action]","Action: create, list, remove, clean").argument("[name]","Worktree name (for create/remove)").allowUnknownOption().action(()=>{}),t.command("soul").description("Manage agent soul (personality & identity)").argument("[action]","Action: switch, show").argument("[name]","Soul name (for switch)").allowUnknownOption().action(()=>{}),t.command("skill").description("Manage AI skills").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("plugin").description("Manage skill plugins").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("persona").description("Manage workspace personas").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("upgrade").description("Update Aii CLI to latest version").argument("[version]","Target version (default: latest)").action(()=>{}),t.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),t.command("version").description("Show version number").action(()=>{}),t}async function SP(t){let e=Xie();e.exitOverride(),e.configureOutput({writeErr:()=>{}});let r="query",n,s=[];try{e.parse(t),s=e.args;let c=e.args[0];c&&["config","mcp","prompt","stats","history","doctor","install","chat","run","help","version","agent","loop","telegram","sessions","worktree","soul","skill","plugin","persona","upgrade"].includes(c)&&(r=c,n=e.args[1],s=e.args.slice(2))}catch(c){c instanceof _P&&(c.code==="commander.version"||c.code==="commander.helpDisplayed")&&process.exit(0),s=Qie(t.slice(2))}let i=e.opts(),o={clean:i.clean??!1,standard:i.standard??!1,thinking:i.thinking??!1,verbose:i.verbose??!1,debug:i.debug??!1,model:i.model,host:i.host,openrouterProvider:i.openrouterProvider,yes:i.yes??!1,offline:i.offline??!1,direct:i.direct??!1,interactive:i.interactive??!1,continueChat:i.continueChat,newChat:i.newChat??!1,auto:i.auto??!1,quiet:!1,autoBackgroundTimeout:(()=>{let c=parseInt(i.autoBackgroundTimeout??"120",10);return isNaN(c)||c===0?0:Math.max(30,Math.min(600,c))*1e3})(),noColors:!i.colors,noEmojis:!i.emojis,noAnimations:!i.animations,noStreaming:!i.streaming,showTokens:i.showTokens??!1,showCost:i.showCost??!1,outputFormat:i.outputFormat,tools:i.tools,excludeTools:i.excludeTools,help:i.help??!1,version:i.version??!1},a;I0()&&(a=await yP()),(r==="chat"||o.interactive)&&(r="agent"),r==="query"&&!s.length&&!a&&(r="agent");let l;if(r==="query"&&s.length>0)l=s.join(" ");else if(r==="agent"){let c=[];n&&c.push(n),s.length>0&&c.push(...s),c.length>0&&(l=c.join(" "))}return{command:r,subcommand:n,args:s,flags:o,stdinContent:a,query:l}}var ke;(function(t){t[t.LOCAL=1]="LOCAL",t[t.SERVER=2]="SERVER"})(ke||(ke={}));var R0={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function Ua(t,e,r,n){return t.clean?"clean":t.thinking||t.verbose?"thinking":t.standard?"standard":e&&r?.[e]?r[e]:e&&R0[e]?R0[e]:n||R0._default}var bP=[{name:"config",tier:ke.LOCAL},{name:"help",tier:ke.LOCAL},{name:"version",tier:ke.LOCAL},{name:"doctor",tier:ke.LOCAL},{name:"mcp",tier:ke.LOCAL},{name:"prompt",tier:ke.LOCAL},{name:"stats",tier:ke.LOCAL},{name:"history",tier:ke.LOCAL},{name:"query",tier:ke.SERVER},{name:"chat",tier:ke.SERVER},{name:"run",tier:ke.SERVER},{name:"agent",tier:ke.SERVER},{name:"loop",tier:ke.SERVER},{name:"telegram",tier:ke.SERVER},{name:"sessions",tier:ke.SERVER},{name:"install",tier:ke.LOCAL},{name:"worktree",tier:ke.LOCAL},{name:"soul",tier:ke.LOCAL},{name:"skill",tier:ke.LOCAL},{name:"plugin",tier:ke.LOCAL},{name:"persona",tier:ke.LOCAL},{name:"upgrade",tier:ke.LOCAL}];function Jie(t){let e=new Map;for(let r of t){if(!r.name)throw new Error("CLI command descriptor is missing a name");if(r.tier!==ke.LOCAL&&r.tier!==ke.SERVER)throw new Error(`CLI command "${r.name}" has an invalid tier: ${String(r.tier)}`);for(let n of[r.name,...r.aliases??[]]){if(e.has(n))throw new Error(`Duplicate CLI command name/alias: "${n}"`);e.set(n,r)}}return e}var Zie=Jie(bP);function TP(t){return Zie.get(t)?.tier}var N4e=Object.fromEntries(bP.map(t=>[t.name,t.tier]));function N0(t){let e=TP(t.command)??ke.SERVER;switch(t.command){case"config":return eoe(t);case"mcp":return toe(t);case"prompt":return roe(t);case"stats":return noe(t);case"history":return soe(t);case"doctor":return{tier:ke.LOCAL,handler:"doctor",params:{}};case"install":return{tier:ke.LOCAL,handler:"install",params:{}};case"chat":return{tier:ke.SERVER,handler:"chat",params:{continueChat:t.flags.continueChat}};case"run":return ooe(t);case"agent":return{tier:ke.SERVER,handler:"agent",params:{interactive:!t.query}};case"loop":return{tier:ke.SERVER,handler:"loop",params:{}};case"telegram":return{tier:ke.SERVER,handler:"telegram",params:{action:t.subcommand??t.args[0]??"start"}};case"sessions":return{tier:ke.SERVER,handler:"sessions",params:{action:t.subcommand??t.args[0]??"list"}};case"worktree":return{tier:ke.LOCAL,handler:"worktree",params:{action:t.subcommand??t.args[0]??"list",name:t.subcommand?t.args[0]:t.args[1]}};case"soul":return{tier:ke.LOCAL,handler:"soul",params:{action:t.subcommand??t.args[0]??"show",name:t.subcommand?t.args[0]:t.args[1]}};case"skill":return{tier:ke.LOCAL,handler:"skill",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"plugin":return{tier:ke.LOCAL,handler:"plugin",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"persona":return{tier:ke.LOCAL,handler:"persona",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"upgrade":return{tier:ke.LOCAL,handler:"upgrade",params:{version:t.args[0]||null}};case"help":return{tier:ke.LOCAL,handler:"help",params:{command:t.subcommand}};case"version":return{tier:ke.LOCAL,handler:"version",params:{}};case"query":default:return{tier:e,handler:"query",params:{query:t.query,stdinContent:t.stdinContent}}}}function eoe(t){let e=t.subcommand??t.args[0]??"show";return{tier:ke.LOCAL,handler:`config:${e}`,params:{key:t.args[0],value:t.args[1]}}}function toe(t){let e=t.subcommand??t.args[0]??"list";return{tier:ke.LOCAL,handler:`mcp:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function roe(t){let e=t.subcommand??t.args[0]??"list";return{tier:ke.LOCAL,handler:`prompt:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function noe(t){let e=t.subcommand??t.args[0];return{tier:ke.LOCAL,handler:e?`stats:${e}`:"stats",params:{}}}function soe(t){let e=t.subcommand??t.args[0]??"list";return{tier:ke.LOCAL,handler:`history:${e}`,params:{query:t.args[0],id:t.args[0]}}}var ioe=new Set(["--model","--host","--continue-chat","-c"]);function ooe(t){let e=[];t.subcommand&&e.push(t.subcommand);let r=[];for(let s=0;s<t.args.length;s++){let i=t.args[s];if(ioe.has(i)){s++;continue}i.startsWith("-")||r.push(i)}e.push(...r);let n=e.join(" ");return{tier:ke.SERVER,handler:"run",params:{operation:n}}}zt();ve();import{createInterface as i$e}from"readline";import{spawn as o$e}from"child_process";$C();ws();_t();BC();var Ape={timeout:12e4,retries:3,retryDelay:1e3},Xn=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(e){this.options={...Ape,...e}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:e}=await Promise.resolve().then(()=>(Jc(),Xc));this.mcpExecutor=new e,await this.mcpExecutor.initialize(),V(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(e,r){let n=null;for(let s=0;s<this.options.retries;s++)try{return await this.executeWithRetry(e,r)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),V(`Attempt ${s+1} failed: ${n.message}`),n instanceof cm||n.message.includes("Authentication"))throw n;if(s<this.options.retries-1){let o=this.options.retryDelay*Math.pow(2,s);V(`Retrying in ${o}ms...`),await this.sleep(o)}}throw n??new qo("Max retries exceeded")}async executeWithRetry(e,r){return new Promise((n,s)=>{let i=this.buildWebSocketUrl();V(`Connecting to ${i}`);try{this.ws=new zi(i)}catch{let d=new URL(this.options.url);s(new am(d.hostname||"localhost",d.port||"26169"));return}let o=!1,a=null,l=null,c=!1,u=d=>{o||(o=!0,this.cleanup(),s(d))};this.resetActivityTimeout(()=>{o||(this.cleanup(),s(new lm("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{V("WebSocket connected, sending request"),this.ws?.send(JSON.stringify({...e,protocol_version:2}))}),this.ws.on("message",d=>{this.resetActivityTimeout(()=>{o||(this.cleanup(),s(new lm("WebSocket activity",this.options.timeout)))});let m;try{m=JSON.parse(d.toString())}catch(g){let _=d?String(d):"<undefined>";V(`Failed to parse message: ${_}`),u(new Error(`Failed to parse server message: ${g.message}`));return}let f=EE(m,L9);if(f.kind==="malformed"){u(new qo(`Malformed server frame: ${f.reason}`));return}if(f.kind==="unknown"){c||(c=!0,V(`Received an unrecognized frame type '${f.type}'; ignoring`));return}let h=f.frame;if(l===null&&h.protocol_version!==void 0&&(l=bE(h.protocol_version),l==="hard")){u(new qo(TE(h.protocol_version)));return}if(yE.has(h.type)&&!SE(h)){u(new qo(`Malformed ${h.type} payload`));return}this.handleMessage(h,r,g=>{o=!0,a=g,this.cleanup(),n(g)},g=>{o=!0,this.cleanup(),s(g)})}),this.ws.on("error",d=>{if(V(`WebSocket error: ${d.message}`),!o){o=!0,this.cleanup();let m=new URL(this.options.url);s(new am(m.hostname||"localhost",m.port||"26169"))}}),this.ws.on("close",(d,m)=>{V(`WebSocket closed: ${d} ${m.toString()}`),o||(o=!0,this.cleanup(),a?n(a):s(new qo(`Connection closed unexpectedly: ${d}`)))})})}handleMessage(e,r,n,s){switch(e.type){case"token":{let i=e;r?.onToken?.(i.data);break}case"complete":{let i=e,o=i.metadata||{},a=this.convertServerMetadata(i),l={result:i.result,metadata:a,clientSideExecution:o.client_side_execution===!0,userRequest:o.user_request};r?.onComplete?.(l),n(l);break}case"error":{let i=e,o=new cm(i.code,i.message);r?.onError?.(o),s(o);break}case"mcp_query_tools":{V("Received mcp_query_tools request"),this.handleMCPQueryTools(e);break}case"mcp_tool_request":{V("Received mcp_tool_request"),this.handleMCPToolRequest(e);break}default:V(`Unknown message type: ${e.type}`)}}convertServerMetadata(e){let r=e.metadata||{},n,s;r.tokens?(n=r.tokens.input,s=r.tokens.output):(n=r.input_tokens,s=r.output_tokens);let i=r.cost??r.cost_usd,o=r.execution_time??r.total_time;return{function_name:e.function_name,tokens_in:n,tokens_out:s,cost:typeof i=="number"?i:void 0,model:typeof r.model=="string"?r.model:void 0,provider:typeof r.provider=="string"?r.provider:void 0,execution_time:typeof o=="number"?o:void 0}}buildWebSocketUrl(){let e=new URL(this.options.url);return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/ws/execute`}async handleMCPQueryTools(e){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(Jc(),Xc));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let r=await this.mcpExecutor.handleQueryTools(e);this.ws?.send(JSON.stringify(r))}catch(r){let n=r instanceof Error?r.message:String(r),s=r instanceof Error?r.stack:void 0;V(`Error handling mcp_query_tools: ${n}${s?`
3509
+ ${e}`:e}var Wie="0.16.34",Vie=new Set(["--clean","--standard","--thinking","-v","--verbose","-d","--debug","--model","--openrouter-provider","--host","-y","--yes","--offline","-D","--direct","-i","--interactive","-c","--continue-chat","-n","--new-chat","--auto","--auto-background-timeout","--no-colors","--colors","--no-emojis","--emojis","--no-animations","--animations","--no-streaming","--streaming","--show-tokens","--show-cost","--output-format","--tools","--exclude-tools","-h","--help","-V","--version"]),Kie=new Set(["--model","--openrouter-provider","--host","-c","--continue-chat","--auto-background-timeout","--output-format","--tools","--exclude-tools"]);function Qie(t){let e=[];for(let r=0;r<t.length;r++){if(Vie.has(t[r])){Kie.has(t[r])&&r++;continue}e.push(t[r])}return e}function Xie(){let t=new EP;return t.name("aii").description("AI-powered CLI assistant").version(Wie,"-V, --version","Show version number").helpOption(!1).enablePositionalOptions().argument("[query...]","Natural language query").option("--clean","Clean output mode (just the result)").option("--standard","Standard output mode (result + metrics)").option("--thinking","Thinking mode (full reasoning)").option("-v, --verbose","Verbose output (alias for --thinking)").option("-d, --debug","Debug output").option("--model <model>","Override LLM model (e.g., ollama/llama3.1:8b, deepseek/deepseek-chat)").option("--openrouter-provider <slug>","Pin OpenRouter requests to a specific backend provider").option("--host <host>","API server host:port").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").option("-D, --direct","Direct mode (bypass server intent recognition)").option("-i, --interactive","Interactive chat mode").option("-c, --continue-chat <id>","Continue chat session").option("-n, --new-chat","Force new chat session").option("--auto","Auto mode - auto-approve all actions").option("--auto-background-timeout <seconds>","Auto-convert foreground agents to background after N seconds (0 to disable)","120").option("--no-colors","Disable colored output").option("--no-emojis","Disable emoji icons").option("--no-animations","Disable animations").option("--no-streaming","Disable streaming").option("--show-tokens","Show token usage").option("--show-cost","Show cost estimates").option("--output-format <format>","Output format: json or stream-json (one-shot only)").option("--tools <list>",'Allowlist of tools (comma-separated, e.g., "Read,Bash,Edit")').option("--exclude-tools <list>",'Exclude tools (comma-separated, e.g., "WebSearch,WebFetch")').option("-h, --help","Show help"),t.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),t.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),t.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),t.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),t.command("doctor").description("System health check").action(()=>{}),t.command("install [target...]").description("Install or update Aii CLI, skills, or MCP servers").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("chat").description("Interactive chat mode").action(()=>{}),t.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),t.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),t.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("sessions").description("Manage server sessions (list, info, resume, rename, delete)").argument("[action]","Action: list, info, resume, rename, delete").argument("[args...]","Additional arguments (session ID, name, etc.)").allowUnknownOption().action(()=>{}),t.command("worktree").description("Manage git worktrees for isolated development").argument("[action]","Action: create, list, remove, clean").argument("[name]","Worktree name (for create/remove)").allowUnknownOption().action(()=>{}),t.command("soul").description("Manage agent soul (personality & identity)").argument("[action]","Action: switch, show").argument("[name]","Soul name (for switch)").allowUnknownOption().action(()=>{}),t.command("skill").description("Manage AI skills").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("plugin").description("Manage skill plugins").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("persona").description("Manage workspace personas").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("upgrade").description("Update Aii CLI to latest version").argument("[version]","Target version (default: latest)").action(()=>{}),t.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),t.command("version").description("Show version number").action(()=>{}),t}async function SP(t){let e=Xie();e.exitOverride(),e.configureOutput({writeErr:()=>{}});let r="query",n,s=[];try{e.parse(t),s=e.args;let c=e.args[0];c&&["config","mcp","prompt","stats","history","doctor","install","chat","run","help","version","agent","loop","telegram","sessions","worktree","soul","skill","plugin","persona","upgrade"].includes(c)&&(r=c,n=e.args[1],s=e.args.slice(2))}catch(c){c instanceof _P&&(c.code==="commander.version"||c.code==="commander.helpDisplayed")&&process.exit(0),s=Qie(t.slice(2))}let i=e.opts(),o={clean:i.clean??!1,standard:i.standard??!1,thinking:i.thinking??!1,verbose:i.verbose??!1,debug:i.debug??!1,model:i.model,host:i.host,openrouterProvider:i.openrouterProvider,yes:i.yes??!1,offline:i.offline??!1,direct:i.direct??!1,interactive:i.interactive??!1,continueChat:i.continueChat,newChat:i.newChat??!1,auto:i.auto??!1,quiet:!1,autoBackgroundTimeout:(()=>{let c=parseInt(i.autoBackgroundTimeout??"120",10);return isNaN(c)||c===0?0:Math.max(30,Math.min(600,c))*1e3})(),noColors:!i.colors,noEmojis:!i.emojis,noAnimations:!i.animations,noStreaming:!i.streaming,showTokens:i.showTokens??!1,showCost:i.showCost??!1,outputFormat:i.outputFormat,tools:i.tools,excludeTools:i.excludeTools,help:i.help??!1,version:i.version??!1},a;I0()&&(a=await yP()),(r==="chat"||o.interactive)&&(r="agent"),r==="query"&&!s.length&&!a&&(r="agent");let l;if(r==="query"&&s.length>0)l=s.join(" ");else if(r==="agent"){let c=[];n&&c.push(n),s.length>0&&c.push(...s),c.length>0&&(l=c.join(" "))}return{command:r,subcommand:n,args:s,flags:o,stdinContent:a,query:l}}var ke;(function(t){t[t.LOCAL=1]="LOCAL",t[t.SERVER=2]="SERVER"})(ke||(ke={}));var R0={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function Ua(t,e,r,n){return t.clean?"clean":t.thinking||t.verbose?"thinking":t.standard?"standard":e&&r?.[e]?r[e]:e&&R0[e]?R0[e]:n||R0._default}var bP=[{name:"config",tier:ke.LOCAL},{name:"help",tier:ke.LOCAL},{name:"version",tier:ke.LOCAL},{name:"doctor",tier:ke.LOCAL},{name:"mcp",tier:ke.LOCAL},{name:"prompt",tier:ke.LOCAL},{name:"stats",tier:ke.LOCAL},{name:"history",tier:ke.LOCAL},{name:"query",tier:ke.SERVER},{name:"chat",tier:ke.SERVER},{name:"run",tier:ke.SERVER},{name:"agent",tier:ke.SERVER},{name:"loop",tier:ke.SERVER},{name:"telegram",tier:ke.SERVER},{name:"sessions",tier:ke.SERVER},{name:"install",tier:ke.LOCAL},{name:"worktree",tier:ke.LOCAL},{name:"soul",tier:ke.LOCAL},{name:"skill",tier:ke.LOCAL},{name:"plugin",tier:ke.LOCAL},{name:"persona",tier:ke.LOCAL},{name:"upgrade",tier:ke.LOCAL}];function Jie(t){let e=new Map;for(let r of t){if(!r.name)throw new Error("CLI command descriptor is missing a name");if(r.tier!==ke.LOCAL&&r.tier!==ke.SERVER)throw new Error(`CLI command "${r.name}" has an invalid tier: ${String(r.tier)}`);for(let n of[r.name,...r.aliases??[]]){if(e.has(n))throw new Error(`Duplicate CLI command name/alias: "${n}"`);e.set(n,r)}}return e}var Zie=Jie(bP);function TP(t){return Zie.get(t)?.tier}var N4e=Object.fromEntries(bP.map(t=>[t.name,t.tier]));function N0(t){let e=TP(t.command)??ke.SERVER;switch(t.command){case"config":return eoe(t);case"mcp":return toe(t);case"prompt":return roe(t);case"stats":return noe(t);case"history":return soe(t);case"doctor":return{tier:ke.LOCAL,handler:"doctor",params:{}};case"install":return{tier:ke.LOCAL,handler:"install",params:{}};case"chat":return{tier:ke.SERVER,handler:"chat",params:{continueChat:t.flags.continueChat}};case"run":return ooe(t);case"agent":return{tier:ke.SERVER,handler:"agent",params:{interactive:!t.query}};case"loop":return{tier:ke.SERVER,handler:"loop",params:{}};case"telegram":return{tier:ke.SERVER,handler:"telegram",params:{action:t.subcommand??t.args[0]??"start"}};case"sessions":return{tier:ke.SERVER,handler:"sessions",params:{action:t.subcommand??t.args[0]??"list"}};case"worktree":return{tier:ke.LOCAL,handler:"worktree",params:{action:t.subcommand??t.args[0]??"list",name:t.subcommand?t.args[0]:t.args[1]}};case"soul":return{tier:ke.LOCAL,handler:"soul",params:{action:t.subcommand??t.args[0]??"show",name:t.subcommand?t.args[0]:t.args[1]}};case"skill":return{tier:ke.LOCAL,handler:"skill",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"plugin":return{tier:ke.LOCAL,handler:"plugin",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"persona":return{tier:ke.LOCAL,handler:"persona",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"upgrade":return{tier:ke.LOCAL,handler:"upgrade",params:{version:t.args[0]||null}};case"help":return{tier:ke.LOCAL,handler:"help",params:{command:t.subcommand}};case"version":return{tier:ke.LOCAL,handler:"version",params:{}};case"query":default:return{tier:e,handler:"query",params:{query:t.query,stdinContent:t.stdinContent}}}}function eoe(t){let e=t.subcommand??t.args[0]??"show";return{tier:ke.LOCAL,handler:`config:${e}`,params:{key:t.args[0],value:t.args[1]}}}function toe(t){let e=t.subcommand??t.args[0]??"list";return{tier:ke.LOCAL,handler:`mcp:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function roe(t){let e=t.subcommand??t.args[0]??"list";return{tier:ke.LOCAL,handler:`prompt:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function noe(t){let e=t.subcommand??t.args[0];return{tier:ke.LOCAL,handler:e?`stats:${e}`:"stats",params:{}}}function soe(t){let e=t.subcommand??t.args[0]??"list";return{tier:ke.LOCAL,handler:`history:${e}`,params:{query:t.args[0],id:t.args[0]}}}var ioe=new Set(["--model","--host","--continue-chat","-c"]);function ooe(t){let e=[];t.subcommand&&e.push(t.subcommand);let r=[];for(let s=0;s<t.args.length;s++){let i=t.args[s];if(ioe.has(i)){s++;continue}i.startsWith("-")||r.push(i)}e.push(...r);let n=e.join(" ");return{tier:ke.SERVER,handler:"run",params:{operation:n}}}zt();ve();import{createInterface as i$e}from"readline";import{spawn as o$e}from"child_process";$C();ws();_t();BC();var Ape={timeout:12e4,retries:3,retryDelay:1e3},Xn=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(e){this.options={...Ape,...e}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:e}=await Promise.resolve().then(()=>(Jc(),Xc));this.mcpExecutor=new e,await this.mcpExecutor.initialize(),V(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(e,r){let n=null;for(let s=0;s<this.options.retries;s++)try{return await this.executeWithRetry(e,r)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),V(`Attempt ${s+1} failed: ${n.message}`),n instanceof cm||n.message.includes("Authentication"))throw n;if(s<this.options.retries-1){let o=this.options.retryDelay*Math.pow(2,s);V(`Retrying in ${o}ms...`),await this.sleep(o)}}throw n??new qo("Max retries exceeded")}async executeWithRetry(e,r){return new Promise((n,s)=>{let i=this.buildWebSocketUrl();V(`Connecting to ${i}`);try{this.ws=new zi(i)}catch{let d=new URL(this.options.url);s(new am(d.hostname||"localhost",d.port||"26169"));return}let o=!1,a=null,l=null,c=!1,u=d=>{o||(o=!0,this.cleanup(),s(d))};this.resetActivityTimeout(()=>{o||(this.cleanup(),s(new lm("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{V("WebSocket connected, sending request"),this.ws?.send(JSON.stringify({...e,protocol_version:2}))}),this.ws.on("message",d=>{this.resetActivityTimeout(()=>{o||(this.cleanup(),s(new lm("WebSocket activity",this.options.timeout)))});let m;try{m=JSON.parse(d.toString())}catch(g){let _=d?String(d):"<undefined>";V(`Failed to parse message: ${_}`),u(new Error(`Failed to parse server message: ${g.message}`));return}let f=EE(m,L9);if(f.kind==="malformed"){u(new qo(`Malformed server frame: ${f.reason}`));return}if(f.kind==="unknown"){c||(c=!0,V(`Received an unrecognized frame type '${f.type}'; ignoring`));return}let h=f.frame;if(l===null&&h.protocol_version!==void 0&&(l=bE(h.protocol_version),l==="hard")){u(new qo(TE(h.protocol_version)));return}if(yE.has(h.type)&&!SE(h)){u(new qo(`Malformed ${h.type} payload`));return}this.handleMessage(h,r,g=>{o=!0,a=g,this.cleanup(),n(g)},g=>{o=!0,this.cleanup(),s(g)})}),this.ws.on("error",d=>{if(V(`WebSocket error: ${d.message}`),!o){o=!0,this.cleanup();let m=new URL(this.options.url);s(new am(m.hostname||"localhost",m.port||"26169"))}}),this.ws.on("close",(d,m)=>{V(`WebSocket closed: ${d} ${m.toString()}`),o||(o=!0,this.cleanup(),a?n(a):s(new qo(`Connection closed unexpectedly: ${d}`)))})})}handleMessage(e,r,n,s){switch(e.type){case"token":{let i=e;r?.onToken?.(i.data);break}case"complete":{let i=e,o=i.metadata||{},a=this.convertServerMetadata(i),l={result:i.result,metadata:a,clientSideExecution:o.client_side_execution===!0,userRequest:o.user_request};r?.onComplete?.(l),n(l);break}case"error":{let i=e,o=new cm(i.code,i.message);r?.onError?.(o),s(o);break}case"mcp_query_tools":{V("Received mcp_query_tools request"),this.handleMCPQueryTools(e);break}case"mcp_tool_request":{V("Received mcp_tool_request"),this.handleMCPToolRequest(e);break}default:V(`Unknown message type: ${e.type}`)}}convertServerMetadata(e){let r=e.metadata||{},n,s;r.tokens?(n=r.tokens.input,s=r.tokens.output):(n=r.input_tokens,s=r.output_tokens);let i=r.cost??r.cost_usd,o=r.execution_time??r.total_time;return{function_name:e.function_name,tokens_in:n,tokens_out:s,cost:typeof i=="number"?i:void 0,model:typeof r.model=="string"?r.model:void 0,provider:typeof r.provider=="string"?r.provider:void 0,execution_time:typeof o=="number"?o:void 0}}buildWebSocketUrl(){let e=new URL(this.options.url);return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/ws/execute`}async handleMCPQueryTools(e){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(Jc(),Xc));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let r=await this.mcpExecutor.handleQueryTools(e);this.ws?.send(JSON.stringify(r))}catch(r){let n=r instanceof Error?r.message:String(r),s=r instanceof Error?r.stack:void 0;V(`Error handling mcp_query_tools: ${n}${s?`
3510
3510
  ${s}`:""}`),this.ws?.send(JSON.stringify({type:"mcp_query_tools_response",request_id:e.request_id||"unknown",success:!1,error:n,tools:[]}))}}async handleMCPToolRequest(e){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(Jc(),Xc));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let r=await this.mcpExecutor.handleToolExecution(e);this.ws?.send(JSON.stringify(r))}catch(r){V(`Error handling mcp_tool_request: ${r}`),this.ws?.send(JSON.stringify({type:"mcp_tool_response",request_id:e.request_id||"unknown",success:!1,error:String(r)}))}}resetActivityTimeout(e){this.activityTimeout&&clearTimeout(this.activityTimeout),this.activityTimeout=setTimeout(e,this.options.timeout)}cleanup(){if(this.activityTimeout&&(clearTimeout(this.activityTimeout),this.activityTimeout=null),this.ws){try{this.ws.close()}catch(e){V(`WebSocket close error: ${e instanceof Error?e.message:String(e)}`)}this.ws=null}}async shutdownMCP(){this.mcpExecutor&&(await this.mcpExecutor.shutdown(),this.mcpExecutor=null)}disconnect(){this.cleanup()}sleep(e){return new Promise(r=>setTimeout(r,e))}};ve();import OE from"node:process";import H9 from"node:process";import DE from"node:process";var Dpe=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(e,r);!Ipe(s,i)&&n||Object.defineProperty(t,r,i)},Ipe=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Rpe=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},Npe=(t,e)=>`/* Wrapped ${t}*/
3511
3511
  ${e}`,Ope=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xpe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Mpe=(t,e,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=Npe.bind(null,n,e.toString());Object.defineProperty(s,"name",xpe);let{writable:i,enumerable:o,configurable:a}=Ope;Object.defineProperty(t,"toString",{value:s,writable:i,enumerable:o,configurable:a})};function qC(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:n}=t;for(let s of Reflect.ownKeys(e))Dpe(t,e,s,r);return Rpe(t,e),Mpe(t,e,n),t}var vE=new WeakMap,U9=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,s=t.displayName||t.name||"<anonymous>",i=function(...o){if(vE.set(i,++n),n===1)r=t.apply(this,o),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return qC(i,t),vE.set(i,n),i};U9.callCount=t=>{if(!vE.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return vE.get(t)};var B9=U9;var tl=[];tl.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&tl.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&tl.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var kE=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",HC=Symbol.for("signal-exit emitter"),YC=globalThis,Ppe=Object.defineProperty.bind(Object),jC=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(YC[HC])return YC[HC];Ppe(YC,HC,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let i of this.listeners[e])s=i(r,n)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},AE=class{},Lpe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),WC=class extends AE{onExit(){return()=>{}}load(){}unload(){}},VC=class extends AE{#o=KC.platform==="win32"?"SIGINT":"SIGHUP";#r=new jC;#e;#s;#p;#t={};#i=!1;constructor(e){super(),this.#e=e,this.#t={};for(let r of tl)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,i=e;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(s+=i.__signal_exit_emitter__.count),n.length===s){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#o:r;o||e.kill(e.pid,a)}};this.#p=e.reallyExit,this.#s=e.emit}onExit(e,r){if(!kE(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let e of tl)try{let r=this.#t[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#m(e,...r),this.#e.reallyExit=e=>this.#n(e)}}unload(){this.#i&&(this.#i=!1,tl.forEach(e=>{let r=this.#t[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#s,this.#e.reallyExit=this.#p,this.#r.count-=1)}#n(e){return kE(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#p.call(this.#e,this.#e.exitCode)):0}#m(e,...r){let n=this.#s;if(e==="exit"&&kE(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,e,...r)}},KC=globalThis.process,{onExit:G9,load:J3e,unload:Z3e}=Lpe(kE(KC)?new VC(KC):new WC);var z9=DE.stderr.isTTY?DE.stderr:DE.stdout.isTTY?DE.stdout:void 0,Fpe=z9?B9(()=>{G9(()=>{z9.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},q9=Fpe;var IE=!1,Zc={};Zc.show=(t=H9.stderr)=>{t.isTTY&&(IE=!1,t.write("\x1B[?25h"))};Zc.hide=(t=H9.stderr)=>{t.isTTY&&(q9(),IE=!0,t.write("\x1B[?25l"))};Zc.toggle=(t,e)=>{t!==void 0&&(IE=t),IE?Zc.show(e):Zc.hide(e)};var QC=Zc;var Tm=Rt(XC(),1);ve();import ks from"node:process";function JC(){return ks.platform!=="win32"?ks.env.TERM!=="linux":!!ks.env.CI||!!ks.env.WT_SESSION||!!ks.env.TERMINUS_SUBLIME||ks.env.ConEmuTask==="{cmd::Cmder}"||ks.env.TERM_PROGRAM==="Terminus-Sublime"||ks.env.TERM_PROGRAM==="vscode"||ks.env.TERM==="xterm-256color"||ks.env.TERM==="alacritty"||ks.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Upe={info:p.blue("\u2139"),success:p.green("\u2714"),warning:p.yellow("\u26A0"),error:p.red("\u2716")},Bpe={info:p.blue("i"),success:p.green("\u221A"),warning:p.yellow("\u203C"),error:p.red("\xD7")},Gpe=JC()?Upe:Bpe,bm=Gpe;NE();var zpe=rl();function ZC(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(zpe,"")}NE();var qpe=rl();function ev(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(qpe,"")}function V9(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function K9(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function Q9(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function Hpe(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function X9(t,{ambiguousAsWide:e=!1}={}){return Hpe(t),K9(t)||Q9(t)||e&&V9(t)?2:1}var e5=Rt(Z9(),1),Ype=new Intl.Segmenter,jpe=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function tv(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=ev(t)),t.length===0)return 0;let s=0,i={ambiguousAsWide:!r};for(let{segment:o}of Ype.segment(t)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!jpe.test(o)){if((0,e5.default)().test(o)){s+=2;continue}s+=X9(a,i)}}return s}function rv({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import t5 from"node:process";function nv(){let{env:t}=t5,{TERM:e,TERM_PROGRAM:r}=t;return t5.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import Xs from"node:process";var Wpe=3,sv=class{#o=0;start(){this.#o++,this.#o===1&&this.#r()}stop(){if(this.#o<=0)throw new Error("`stop` called more times than `start`");this.#o--,this.#o===0&&this.#e()}#r(){Xs.platform==="win32"||!Xs.stdin.isTTY||(Xs.stdin.setRawMode(!0),Xs.stdin.on("data",this.#s),Xs.stdin.resume())}#e(){Xs.stdin.isTTY&&(Xs.stdin.off("data",this.#s),Xs.stdin.pause(),Xs.stdin.setRawMode(!1))}#s(e){e[0]===Wpe&&Xs.emit("SIGINT")}},Vpe=new sv,iv=Vpe;var Kpe=Rt(XC(),1),ov=class{#o=0;#r=!1;#e=0;#s=-1;#p=0;#t;#i;#n;#m;#h;#c;#u;#d;#g;#a;#l;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:OE.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#h=this.#t.interval,this.#n=this.#t.stream,this.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:rv({stream:this.#n}),this.#u=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,OE.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#c,Object.defineProperty(this,"_linesToClear",{get(){return this.#o},set(r){this.#o=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#s}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#f()}get interval(){return this.#h??this.#i.interval??100}get spinner(){return this.#i}set spinner(e){if(this.#s=-1,this.#h=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=e}else if(!nv())this.#i=Tm.default.line;else if(e===void 0)this.#i=Tm.default.dots;else if(e!=="default"&&Tm.default[e])this.#i=Tm.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#f()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#f()}get suffixText(){return this.#l}set suffixText(e=""){this.#l=e,this.#f()}get isSpinning(){return this.#m!==void 0}#_(e=this.#a,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#E(e=this.#l,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#f(){let e=this.#n.columns??80,r=this.#_(this.#a,"-"),n=this.#E(this.#l,"-"),s=" ".repeat(this.#d)+r+"--"+this.#g+"--"+n;this.#e=0;for(let i of ZC(s).split(`
3512
3512
  `))this.#e+=Math.max(1,Math.ceil(tv(i,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#c&&!this.#u}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#c=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let e=Date.now();(this.#s===-1||e-this.#p>=this.interval)&&(this.#s=++this.#s%this.#i.frames.length,this.#p=e);let{frames:r}=this.#i,n=r[this.#s];this.color&&(n=p[this.color](n));let s=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",i=typeof this.text=="string"?" "+this.text:"",o=typeof this.#l=="string"&&this.#l!==""?" "+this.#l:"";return s+n+i+o}clear(){if(!this.#c||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let e=0;e<this.#o;e++)e>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#d||this.lastIndent!==this.#d)&&this.#n.cursorTo(this.#d),this.lastIndent=this.#d,this.#o=0,this}render(){return this.#u?this:(this.clear(),this.#n.write(this.frame()),this.#o=this.#e,this)}start(e){return e&&(this.text=e),this.#u?this:this.#c?this.isSpinning?this:(this.#t.hideCursor&&QC.hide(this.#n),this.#t.discardStdin&&OE.stdin.isTTY&&(this.#r=!0,iv.start()),this.render(),this.#m=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
@@ -3517,7 +3517,7 @@ ${e}`,Ope=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xpe=Obj
3517
3517
  `+this.color(s,p.dim)}formatError(e){let r=[];return r.push(this.color(`${this.emoji("\u274C ")}${e.message}`,p.red)),e.suggestions&&e.suggestions.length>0&&(r.push(""),r.push(this.color(`${this.emoji("\u{1F4A1} ")}Solutions:`,p.yellow)),e.suggestions.forEach((n,s)=>{r.push(this.color(` ${s+1}. ${n}`,p.gray))})),r.join(`
3518
3518
  `)}formatConfig(e){let r=[];r.push(this.color(`${this.emoji("\u{1F4CB} ")}Current AII Configuration:`,F.model)),r.push(`- Config file: ${e.configFile}`),r.push(`- Storage path: ${e.storagePath}`),e.apiUrl&&r.push(`- Aii Server: ${e.apiUrl}`);let n=e.hasApiKey?this.color("\u2713",p.green):this.color("\u2717",p.red),s=e.model.startsWith(e.provider+"/")?e.model.slice(e.provider.length+1):e.model;if(r.push(`- LLM provider: ${e.provider} (${s}) - ${n}`),e.webSearch){let i=e.webSearch.enabled?this.color("\u2713",p.green):this.color("\u2717",p.red);r.push(`- Web search: ${e.webSearch.provider??"none"} - ${i}`)}return e.issues&&e.issues.length>0&&r.push(`- Configuration issues: ${e.issues.length}`),r.join(`
3519
3519
  `)}formatHealthCheck(e,r){let n=[],s=r?`Aii Doctor v${r}`:"Aii Doctor";n.push(this.color(s,F.model)),n.push("");let i=22;for(let l of e){let c=i-l.name.length-1,u=".".repeat(Math.max(2,c)),d,m;switch(l.status){case"ok":d="OK",m=p.green;break;case"warn":d="WARN",m=p.yellow;break;case"error":d="FAIL",m=p.red;break}let f=this.color(d,m),h=l.message?` (${l.message})`:"";n.push(` ${l.name} ${this.color(u,p.gray)} ${f}${h}`)}let o=e.filter(l=>l.status==="error").length,a=e.filter(l=>l.status==="warn").length;return n.push(""),o>0?n.push(` ${this.color(`${o} check${o>1?"s":""} failed.`,p.red)}`):a>0?n.push(` ${this.color("All checks passed with warnings.",p.yellow)}`):n.push(` ${this.color("All checks passed.",p.green)}`),n.join(`
3520
- `)}};function Fn(t={}){return new Yx(t)}ws();var Sc={openrouter:"openrouter",ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",google:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},S5e=[{provider:"openrouter",patterns:[/^openrouter\//]},{provider:"ollama",patterns:[/^ollama\//]},{provider:"anthropic",patterns:[/^anthropic\//,/^claude-/,/^claude$/i]},{provider:"openai",patterns:[/^openai\//,/^gpt-/,/^o1-/,/^o3-/,/^chatgpt-/,/^text-davinci/]},{provider:"gemini",patterns:[/^gemini\//,/^google\//,/^gemini-/,/^gemini$/i]},{provider:"deepseek",patterns:[/^deepseek\//,/^deepseek-/,/^deepseek$/i]},{provider:"moonshot",patterns:[/^moonshot\//,/^kimi-/,/^moonshot-/,/^moonshot$/i]},{provider:"zai",patterns:[/^zai\//,/^glm-/,/^glm$/i,/^chatglm/i]}];function fr(t){if(!t)return t;let e=t.indexOf(":");if(e>0){let r=t.substring(0,e).toLowerCase();if(r in Sc)return r+"/"+t.substring(e+1)}return t}function jx(t){if(!t)return;let e=t.toLowerCase();for(let{provider:r,patterns:n}of S5e)for(let s of n)if(s.test(e))return r}function hr(t,e){if(!t)return t;let r=t.indexOf("/");if(r===-1)return t;let n=t.substring(0,r).toLowerCase();return n!=="ollama"&&n in Sc?e&&Sc[n]!==e?t:t.substring(r+1):t}function _T(t){if(!t)return;let e=t.indexOf("/");if(e>0){let n=t.substring(0,e).toLowerCase();if(n in Sc){let s=Sc[n],i=t.substring(e+1),o=s==="ollama"?`ollama/${i}`:i;return{provider:s,model:o}}}let r=t.indexOf(":");if(r>0){let n=t.substring(0,r).toLowerCase();if(n in Sc){let s=Sc[n],i=t.substring(r+1),o=s==="ollama"?`ollama/${i}`:i;return{provider:s,model:o}}}}function bc(t){let e=t.lastIndexOf("@");return e===-1||e===t.length-1?{model:t,openrouterProvider:void 0}:{model:t.slice(0,e),openrouterProvider:t.slice(e+1)}}function Dr(t,e){if(t){let r=jx(t);if(r)return r}return e}ve();import*as bne from"readline";ws();import*as qn from"fs";import*as yT from"path";import*as gne from"os";var ET=yT.join(gne.homedir(),".aii","conversations"),Wx=yT.join(ET,"current.json");function ST(){qn.existsSync(ET)||qn.mkdirSync(ET,{recursive:!0})}function b5e(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function T5e(t){let r=t.trim().replace(/\s+/g," ");return r.length>50&&(r=r.substring(0,50).trim()+"..."),r}function _ne(t){return yT.join(ET,`${t}.json`)}function Ene(){ST();try{if(qn.existsSync(Wx)){let t=qn.readFileSync(Wx,"utf-8"),e=JSON.parse(t),r=_ne(e.id);if(qn.existsSync(r)){let n=qn.readFileSync(r,"utf-8");return JSON.parse(n)}}}catch{}return yne()}function yne(){ST();let t={id:b5e(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return Dg(t),w5e(t.id),t}function Dg(t){if(ST(),t.title==="New Conversation"&&t.messages.length>0){let r=t.messages.find(n=>n.role==="user");r&&(t.title=T5e(r.content))}t.updatedAt=Date.now();let e=_ne(t.id);qn.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}function w5e(t){ST(),qn.writeFileSync(Wx,JSON.stringify({id:t}),"utf-8")}function Sne(){return yne()}tc();var C5e="0.16.33",Vx=class{configManager;parsed;running=!1;conversation;stats;formatter;effectiveProvider="";constructor(e,r){this.parsed=e,this.configManager=r,this.conversation=Ene(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=Fn({colors:!e.flags.noColors,emojis:!e.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let e=await this.getUserInput();if(!e.trim()||await this.handleSpecialCommands(e))continue;this.conversation.messages.push({role:"user",content:e,timestamp:Date.now()}),Dg(this.conversation),await this.processWithContext(e)}catch(e){if(e instanceof Error&&e.message==="EXIT")break;if(e instanceof Error&&e.message==="INTERRUPTED"){console.log(`
3520
+ `)}};function Fn(t={}){return new Yx(t)}ws();var Sc={openrouter:"openrouter",ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",google:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},S5e=[{provider:"openrouter",patterns:[/^openrouter\//]},{provider:"ollama",patterns:[/^ollama\//]},{provider:"anthropic",patterns:[/^anthropic\//,/^claude-/,/^claude$/i]},{provider:"openai",patterns:[/^openai\//,/^gpt-/,/^o1-/,/^o3-/,/^chatgpt-/,/^text-davinci/]},{provider:"gemini",patterns:[/^gemini\//,/^google\//,/^gemini-/,/^gemini$/i]},{provider:"deepseek",patterns:[/^deepseek\//,/^deepseek-/,/^deepseek$/i]},{provider:"moonshot",patterns:[/^moonshot\//,/^kimi-/,/^moonshot-/,/^moonshot$/i]},{provider:"zai",patterns:[/^zai\//,/^glm-/,/^glm$/i,/^chatglm/i]}];function fr(t){if(!t)return t;let e=t.indexOf(":");if(e>0){let r=t.substring(0,e).toLowerCase();if(r in Sc)return r+"/"+t.substring(e+1)}return t}function jx(t){if(!t)return;let e=t.toLowerCase();for(let{provider:r,patterns:n}of S5e)for(let s of n)if(s.test(e))return r}function hr(t,e){if(!t)return t;let r=t.indexOf("/");if(r===-1)return t;let n=t.substring(0,r).toLowerCase();return n!=="ollama"&&n in Sc?e&&Sc[n]!==e?t:t.substring(r+1):t}function _T(t){if(!t)return;let e=t.indexOf("/");if(e>0){let n=t.substring(0,e).toLowerCase();if(n in Sc){let s=Sc[n],i=t.substring(e+1),o=s==="ollama"?`ollama/${i}`:i;return{provider:s,model:o}}}let r=t.indexOf(":");if(r>0){let n=t.substring(0,r).toLowerCase();if(n in Sc){let s=Sc[n],i=t.substring(r+1),o=s==="ollama"?`ollama/${i}`:i;return{provider:s,model:o}}}}function bc(t){let e=t.lastIndexOf("@");return e===-1||e===t.length-1?{model:t,openrouterProvider:void 0}:{model:t.slice(0,e),openrouterProvider:t.slice(e+1)}}function Dr(t,e){if(t){let r=jx(t);if(r)return r}return e}ve();import*as bne from"readline";ws();import*as qn from"fs";import*as yT from"path";import*as gne from"os";var ET=yT.join(gne.homedir(),".aii","conversations"),Wx=yT.join(ET,"current.json");function ST(){qn.existsSync(ET)||qn.mkdirSync(ET,{recursive:!0})}function b5e(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function T5e(t){let r=t.trim().replace(/\s+/g," ");return r.length>50&&(r=r.substring(0,50).trim()+"..."),r}function _ne(t){return yT.join(ET,`${t}.json`)}function Ene(){ST();try{if(qn.existsSync(Wx)){let t=qn.readFileSync(Wx,"utf-8"),e=JSON.parse(t),r=_ne(e.id);if(qn.existsSync(r)){let n=qn.readFileSync(r,"utf-8");return JSON.parse(n)}}}catch{}return yne()}function yne(){ST();let t={id:b5e(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return Dg(t),w5e(t.id),t}function Dg(t){if(ST(),t.title==="New Conversation"&&t.messages.length>0){let r=t.messages.find(n=>n.role==="user");r&&(t.title=T5e(r.content))}t.updatedAt=Date.now();let e=_ne(t.id);qn.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}function w5e(t){ST(),qn.writeFileSync(Wx,JSON.stringify({id:t}),"utf-8")}function Sne(){return yne()}tc();var C5e="0.16.34",Vx=class{configManager;parsed;running=!1;conversation;stats;formatter;effectiveProvider="";constructor(e,r){this.parsed=e,this.configManager=r,this.conversation=Ene(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=Fn({colors:!e.flags.noColors,emojis:!e.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let e=await this.getUserInput();if(!e.trim()||await this.handleSpecialCommands(e))continue;this.conversation.messages.push({role:"user",content:e,timestamp:Date.now()}),Dg(this.conversation),await this.processWithContext(e)}catch(e){if(e instanceof Error&&e.message==="EXIT")break;if(e instanceof Error&&e.message==="INTERRUPTED"){console.log(`
3521
3521
  \u26A0\uFE0F Interrupted. Type /exit to quit or continue chatting.`);continue}console.error(p.red(`
3522
3522
  \u274C Error: ${e instanceof Error?e.message:String(e)}`)),this.conversation.messages.length>0&&this.conversation.messages[this.conversation.messages.length-1].role==="user"&&(this.conversation.messages.pop(),Dg(this.conversation))}}displayWelcome(){console.log("\u{1FABC} Entering interactive mode."),console.log(""),console.log("Controls:"),console.log(" \u2022 Enter - Send message"),console.log(" \u2022 End with \\ - Multi-line mode"),console.log(" \u2022 /exit - Quit chat"),console.log(" \u2022 /help - Show all commands"),console.log("")}getUserInput(){return new Promise((e,r)=>{let n=bne.createInterface({input:process.stdin,output:process.stdout}),s=[],i=!1,o=()=>{i=!0,n.close()},a=l=>{n.question(l,c=>{if(s.length===0&&c.trim().startsWith("/")){o(),e(c.trim());return}c.endsWith("\\")?(s.push(c.slice(0,-1)),a(" ")):(s.push(c),o(),e(s.join(`
3523
3523
  `).trim()))})};n.on("SIGINT",()=>{o(),r(new Error("INTERRUPTED"))}),n.on("close",()=>{i||r(new Error("EXIT"))}),a("> ")})}async handleSpecialCommands(e){let r=e.trim().toLowerCase();if(r.startsWith("/"))r=r.slice(1);else return!1;switch(r){case"exit":case"quit":return await this.handleExit(),!0;case"help":return this.displayHelp(),!0;case"clear":case"new":return this.clearConversation(),!0;case"history":return this.displayConversationHistory(),!0;case"stats":return this.displayStats(),!0;case"version":return this.displayVersion(),!0;default:return console.log(p.yellow(`Unknown command: /${r}. Type /help for available commands.`)),console.log(""),!0}}async processWithContext(e){let r=await this.configManager.load(),n=this.configManager.validate();if(!n.valid)throw new Yr(n.issues.join(", "));let i=this.configManager.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",o=fr(this.parsed.flags.model??""),a=Dr(o||void 0,r.llm.provider),l=hr(o||r.llm.model,a);this.effectiveProvider=a;let c=this.configManager.getApiKey(a);if(!c)throw new Yt(`Missing API key for provider: ${a}`);this.stats.totalRequests++;let u=Js(!this.parsed.flags.noAnimations);u.start("");let d=Di({spinner:u,enabled:!this.parsed.flags.noStreaming}),m=this.conversation.messages.slice(-21,-1).map(S=>({role:S.role,content:S.content})),f={api_key:i,system_prompt:null,user_prompt:e,user_message:e,output_mode:"CLEAN",streaming:!this.parsed.flags.noStreaming,model:l,llm_provider:a,llm_api_key:c,provider_api_key:c,client_type:"cli",offline:this.parsed.flags.offline,conversation_history:m.length>0?m:void 0,soul:sn.getInstance().getSoulName()},h=this.parsed.flags.host?`http://${this.parsed.flags.host}`:r.api.url,g=new Xn({url:h}),_="",E=!1;try{let S=await g.executeRequest(f,{onToken:C=>{_+=C,E=!0,d.onToken(C)}});d.flush();let T=S.result||_;!E&&T&&console.log(T),console.log(""),S.metadata&&this.displayExecutionSummary(S.metadata),T&&(this.conversation.messages.push({role:"assistant",content:T,timestamp:Date.now()}),Dg(this.conversation))}catch(S){throw u.stop(!0),S}finally{g.disconnect()}}displayExecutionSummary(e){let r=e.cost||0,n=e.tokens_in||0,s=e.tokens_out||0,i=n+s;this.stats.cumulativeTokens+=i,this.stats.cumulativeCost+=r;let o=e.provider,a=!o;console.log(this.formatter.formatExecutionSummary({provider:o||this.effectiveProvider,providerInferred:a,model:e.model,tokens_in:n,tokens_out:s,cost:r,execution_time:e.execution_time})),console.log("")}clearConversation(){this.conversation=Sne(),console.clear(),this.displayWelcome()}displayConversationHistory(){if(this.conversation.messages.length===0){console.log(`
@@ -4158,10 +4158,10 @@ Container logs:
4158
4158
  ${s}`:`
4159
4159
  Run: docker logs aii-server`}`}return r.includes("unknown option")||r.includes("unrecognized")?"server.sh rejected a flag (likely an older version). Try: curl -fsSL https://aiiware.com/server.sh | bash":`Server setup failed (exit code ${e}).`}function U$e(t){let e=jT()?"sudo ":"";try{let r=zr(`${e}docker port aii-server 26169 2>/dev/null | head -1 | cut -d: -f2`,{timeout:5e3,stdio:"pipe"}).toString().trim(),n=parseInt(r,10);return isNaN(n)?t:n}catch{return t}}async function xse(t,e){let r=e||G$e(t.showProgress);r("Checking Docker...","docker"),HT()||await L$e({interactive:t.interactive}),YT()||(r("Starting Docker daemon...","docker"),await P$e()),r("Docker ready","docker"),r("Setting up Aii Server...","server");let n=await F$e(t.port,r);if(r("Verifying server health...","health"),!await B$e(n.port,3e4,r)){let i=jT()?"sudo ":"",o="";try{o=zr(`${i}docker logs aii-server --tail 15 2>&1`,{timeout:5e3,encoding:"utf-8",stdio:"pipe"})}catch{}throw new yr("Server started but health check failed after 30 seconds.",`curl http://localhost:${n.port}/health`,"docker logs aii-server",o?`
4160
4160
  Recent logs:
4161
- ${o}`:"")}return r("Server ready!","done"),{success:!0,port:n.port,upgraded:!1,freshInstall:!0}}async function B$e(t,e,r){let n=Date.now(),s=0;for(;Date.now()-n<e;){s++;try{let i=new AbortController,o=setTimeout(()=>i.abort(),3e3),a=await fetch(`http://localhost:${t}/health`,{signal:i.signal});if(clearTimeout(o),a.ok)return!0}catch{}if(s%5===0){let i=Math.round((Date.now()-n)/1e3);r(`Waiting for server health... (${i}s)`,"health")}await new Promise(i=>setTimeout(i,2e3))}return!1}function G$e(t){return t?(e,r)=>{process.stderr.write(`\r\x1B[K \u25CF ${e}`)}:()=>{}}function Nse(t){return new Promise(e=>{let r=Ose.createInterface({input:process.stdin,output:process.stderr});r.question(t,n=>{r.close();let s=n.trim().toLowerCase();e(s===""||s==="y"||s==="yes")})})}async function Mse(t,e){let r=Fn({colors:!t.flags.noColors,emojis:!t.flags.noEmojis}),n=[],s=`${e.getConfigDir()}/config.yaml`;e.configExists()?n.push({name:"Config",status:"ok",message:s.replace(process.env.HOME||"","~")}):n.push({name:"Config",status:"warn",message:"Not found (using defaults)"});let i=await e.load();e.getApiKey()?n.push({name:"API Key",status:"ok",message:`${i.llm.provider}:${i.llm.model.replace(`${i.llm.provider}/`,"")}`}):n.push({name:"API Key",status:"error",message:`Not configured for ${i.llm.provider}`});let a=await z$e(i.api.url);n.push({name:"Aii Server",status:a.ok?"ok":"error",message:a.message});let l=`${e.getConfigDir()}/mcp_servers.json`;if(Ri.existsSync(l))try{let f=Ri.readFileSync(l,"utf-8"),h=JSON.parse(f),g=Object.keys(h.mcpServers??{}).length;g>0?n.push({name:"MCP Servers",status:"ok",message:`${g} configured`}):n.push({name:"MCP Servers",status:"warn",message:"Not configured"})}catch{n.push({name:"MCP Servers",status:"warn",message:"Invalid config"})}else n.push({name:"MCP Servers",status:"warn",message:"Not configured"});if(HT())try{let{execSync:f}=await import("child_process"),g=f("docker --version",{timeout:5e3,encoding:"utf-8"}).trim().match(/Docker version ([\d.]+)/);n.push({name:"Docker",status:"ok",message:g?`v${g[1]}`:"Installed"})}catch{n.push({name:"Docker",status:"ok",message:"Installed"})}else n.push({name:"Docker",status:"error",message:"Not installed (brew install --cask docker)"});HT()?YT()?n.push({name:"Docker Daemon",status:"ok",message:"Running"}):n.push({name:"Docker Daemon",status:"error",message:"Not running (open -a Docker)"}):n.push({name:"Docker Daemon",status:"warn",message:"N/A (Docker not installed)"});let c=process.version;parseInt(c.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js",status:"ok",message:c}):n.push({name:"Node.js",status:"error",message:`${c} (requires >= 18)`});let d=await q$e();n.push(...d),console.log(r.formatHealthCheck(n,il)),n.some(f=>f.status==="error")&&process.exit(1)}async function z$e(t){try{let e=new AbortController,r=setTimeout(()=>e.abort(),3e3),n=await fetch(`${t}/api/status`,{signal:e.signal});if(clearTimeout(r),n.ok){let s=new URL(t);return{ok:!0,message:`${s.hostname}:${s.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(e){return e instanceof Error&&e.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}async function q$e(){let t=[];try{let{getAiiHome:e}=await Promise.resolve().then(()=>(Zn(),zE)),r=`${e()}/skills`;if(!Ri.existsSync(r))return t;let n=Ri.readdirSync(r,{withFileTypes:!0});for(let s of n){if(!s.isDirectory()||s.name.startsWith("."))continue;let i=`${r}/${s.name}/SKILL.md`;Ri.existsSync(i)||t.push({name:"Skill Shadow",status:"warn",message:`~/.aii/skills/${s.name}/ has no SKILL.md \u2014 may shadow other skills`})}try{let{PersonaManager:s}=await Promise.resolve().then(()=>(Dt(),Pt));if(s.hasInstance()&&s.getInstance().isActive()){let i=s.getInstance().getActive();if(i)for(let o of i.skillPaths){let a=o.split("/").pop()||"",l=`${r}/${a}`;Ri.existsSync(l)&&Ri.existsSync(`${l}/SKILL.md`)&&t.push({name:"Skill Shadow",status:"ok",message:`"${a}" user-authored shadows persona-bundled (intentional?)`})}}}catch{}}catch{}return t}ve();ar();import{execSync as EM}from"node:child_process";var WT="@aiiware/aii";async function Pse(t){let e=t.args||[],r=t.subcommand||e[0]||"";if(t.flags.help||r==="help"||r==="--help"||e.includes("--help")){let n="0.16.33";console.log(""),console.log(F.logo(" Install")),console.log(""),console.log(` Current version: ${F.model(n)}`),console.log(""),console.log(p.yellow(" USAGE:")),console.log(` ${p.green("aii install")} Update to latest version`),console.log(` ${p.green("aii install <version>")} Install specific version`),console.log(` ${p.green("aii install skill <src>")} Install a skill package ${p.dim("(coming soon)")}`),console.log(` ${p.green("aii install mcp <name>")} Install an MCP server ${p.dim("(coming soon)")}`),console.log(""),console.log(p.yellow(" EXAMPLES:")),console.log(` ${p.green("aii install")} ${p.dim("# Self-update to latest")}`),console.log(` ${p.green("aii install 0.13.10")} ${p.dim("# Pin to specific version")}`),console.log("");return}if(r==="skill"){console.log("Skill installation coming soon. For now use: /skills install owner/repo");return}if(r==="mcp"){console.log("MCP installation coming soon. For now use: aii mcp install <server>");return}console.log("\x1B[33m\u26A0 `aii install` for self-update is deprecated. Use `aii upgrade` instead.\x1B[0m"),console.log(`\x1B[33m This alias will be removed in v0.16.x.\x1B[0m
4162
- `),await H$e(r)}async function H$e(t){let e="0.16.33",r=t&&t!=="latest"?t:"";if(console.log(""),r){console.log(`\u{1FABC} Installing Aii CLI v${r}...`),console.log("");try{EM(`npm install -g ${WT}@${r}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
4161
+ ${o}`:"")}return r("Server ready!","done"),{success:!0,port:n.port,upgraded:!1,freshInstall:!0}}async function B$e(t,e,r){let n=Date.now(),s=0;for(;Date.now()-n<e;){s++;try{let i=new AbortController,o=setTimeout(()=>i.abort(),3e3),a=await fetch(`http://localhost:${t}/health`,{signal:i.signal});if(clearTimeout(o),a.ok)return!0}catch{}if(s%5===0){let i=Math.round((Date.now()-n)/1e3);r(`Waiting for server health... (${i}s)`,"health")}await new Promise(i=>setTimeout(i,2e3))}return!1}function G$e(t){return t?(e,r)=>{process.stderr.write(`\r\x1B[K \u25CF ${e}`)}:()=>{}}function Nse(t){return new Promise(e=>{let r=Ose.createInterface({input:process.stdin,output:process.stderr});r.question(t,n=>{r.close();let s=n.trim().toLowerCase();e(s===""||s==="y"||s==="yes")})})}async function Mse(t,e){let r=Fn({colors:!t.flags.noColors,emojis:!t.flags.noEmojis}),n=[],s=`${e.getConfigDir()}/config.yaml`;e.configExists()?n.push({name:"Config",status:"ok",message:s.replace(process.env.HOME||"","~")}):n.push({name:"Config",status:"warn",message:"Not found (using defaults)"});let i=await e.load();e.getApiKey()?n.push({name:"API Key",status:"ok",message:`${i.llm.provider}:${i.llm.model.replace(`${i.llm.provider}/`,"")}`}):n.push({name:"API Key",status:"error",message:`Not configured for ${i.llm.provider}`});let a=await z$e(i.api.url);n.push({name:"Aii Server",status:a.ok?"ok":"error",message:a.message});let l=`${e.getConfigDir()}/mcp_servers.json`;if(Ri.existsSync(l))try{let f=Ri.readFileSync(l,"utf-8"),h=JSON.parse(f),g=Object.keys(h.mcpServers??{}).length;g>0?n.push({name:"MCP Servers",status:"ok",message:`${g} configured`}):n.push({name:"MCP Servers",status:"warn",message:"Not configured"})}catch{n.push({name:"MCP Servers",status:"warn",message:"Invalid config"})}else n.push({name:"MCP Servers",status:"warn",message:"Not configured"});if(HT())try{let{execSync:f}=await import("child_process"),g=f("docker --version",{timeout:5e3,encoding:"utf-8"}).trim().match(/Docker version ([\d.]+)/);n.push({name:"Docker",status:"ok",message:g?`v${g[1]}`:"Installed"})}catch{n.push({name:"Docker",status:"ok",message:"Installed"})}else n.push({name:"Docker",status:"error",message:"Not installed (brew install --cask docker)"});HT()?YT()?n.push({name:"Docker Daemon",status:"ok",message:"Running"}):n.push({name:"Docker Daemon",status:"error",message:"Not running (open -a Docker)"}):n.push({name:"Docker Daemon",status:"warn",message:"N/A (Docker not installed)"});let c=process.version;parseInt(c.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js",status:"ok",message:c}):n.push({name:"Node.js",status:"error",message:`${c} (requires >= 18)`});let d=await q$e();n.push(...d),console.log(r.formatHealthCheck(n,il)),n.some(f=>f.status==="error")&&process.exit(1)}async function z$e(t){try{let e=new AbortController,r=setTimeout(()=>e.abort(),3e3),n=await fetch(`${t}/api/status`,{signal:e.signal});if(clearTimeout(r),n.ok){let s=new URL(t);return{ok:!0,message:`${s.hostname}:${s.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(e){return e instanceof Error&&e.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}async function q$e(){let t=[];try{let{getAiiHome:e}=await Promise.resolve().then(()=>(Zn(),zE)),r=`${e()}/skills`;if(!Ri.existsSync(r))return t;let n=Ri.readdirSync(r,{withFileTypes:!0});for(let s of n){if(!s.isDirectory()||s.name.startsWith("."))continue;let i=`${r}/${s.name}/SKILL.md`;Ri.existsSync(i)||t.push({name:"Skill Shadow",status:"warn",message:`~/.aii/skills/${s.name}/ has no SKILL.md \u2014 may shadow other skills`})}try{let{PersonaManager:s}=await Promise.resolve().then(()=>(Dt(),Pt));if(s.hasInstance()&&s.getInstance().isActive()){let i=s.getInstance().getActive();if(i)for(let o of i.skillPaths){let a=o.split("/").pop()||"",l=`${r}/${a}`;Ri.existsSync(l)&&Ri.existsSync(`${l}/SKILL.md`)&&t.push({name:"Skill Shadow",status:"ok",message:`"${a}" user-authored shadows persona-bundled (intentional?)`})}}}catch{}}catch{}return t}ve();ar();import{execSync as EM}from"node:child_process";var WT="@aiiware/aii";async function Pse(t){let e=t.args||[],r=t.subcommand||e[0]||"";if(t.flags.help||r==="help"||r==="--help"||e.includes("--help")){let n="0.16.34";console.log(""),console.log(F.logo(" Install")),console.log(""),console.log(` Current version: ${F.model(n)}`),console.log(""),console.log(p.yellow(" USAGE:")),console.log(` ${p.green("aii install")} Update to latest version`),console.log(` ${p.green("aii install <version>")} Install specific version`),console.log(` ${p.green("aii install skill <src>")} Install a skill package ${p.dim("(coming soon)")}`),console.log(` ${p.green("aii install mcp <name>")} Install an MCP server ${p.dim("(coming soon)")}`),console.log(""),console.log(p.yellow(" EXAMPLES:")),console.log(` ${p.green("aii install")} ${p.dim("# Self-update to latest")}`),console.log(` ${p.green("aii install 0.13.10")} ${p.dim("# Pin to specific version")}`),console.log("");return}if(r==="skill"){console.log("Skill installation coming soon. For now use: /skills install owner/repo");return}if(r==="mcp"){console.log("MCP installation coming soon. For now use: aii mcp install <server>");return}console.log("\x1B[33m\u26A0 `aii install` for self-update is deprecated. Use `aii upgrade` instead.\x1B[0m"),console.log(`\x1B[33m This alias will be removed in v0.16.x.\x1B[0m
4162
+ `),await H$e(r)}async function H$e(t){let e="0.16.34",r=t&&t!=="latest"?t:"";if(console.log(""),r){console.log(`\u{1FABC} Installing Aii CLI v${r}...`),console.log("");try{EM(`npm install -g ${WT}@${r}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
4163
4163
  \u274C Failed to install v${r}`),console.error(` Try manually: npm install -g ${WT}@${r}`),process.exit(1)}}else{console.log("\u{1FABC} Updating Aii CLI to latest..."),console.log(` Current version: ${e}`),console.log("");try{EM(`npm install -g ${WT}@latest`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
4164
- \u274C Failed to update Aii CLI`),console.error(` Try manually: npm install -g ${WT}@latest`),process.exit(1)}}try{let n=EM("aii --version 2>/dev/null",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).trim();console.log(""),console.log(n===e?`\u2713 Aii CLI is already up to date (${e})`:`\u2713 Aii CLI updated: ${e} \u2192 ${n}`)}catch{console.log(""),console.log("\u2713 Aii CLI installed. Restart your terminal to use the new version.")}}ve();var Lse="0.16.33";function yM(t){let r=!t.flags.noColors?p:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
4164
+ \u274C Failed to update Aii CLI`),console.error(` Try manually: npm install -g ${WT}@latest`),process.exit(1)}}try{let n=EM("aii --version 2>/dev/null",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).trim();console.log(""),console.log(n===e?`\u2713 Aii CLI is already up to date (${e})`:`\u2713 Aii CLI updated: ${e} \u2192 ${n}`)}catch{console.log(""),console.log("\u2713 Aii CLI installed. Restart your terminal to use the new version.")}}ve();var Lse="0.16.34";function yM(t){let r=!t.flags.noColors?p:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
4165
4165
  ${r.cyan("AII")} - AI-powered CLI assistant v${Lse}
4166
4166
 
4167
4167
  ${r.yellow("USAGE:")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiiware/aii",
3
- "version": "0.16.33",
3
+ "version": "0.16.34",
4
4
  "type": "module",
5
5
  "description": "🪼 AI-powered CLI assistant for terminal productivity",
6
6
  "author": "AiiWare <support@aiiware.com>",