@aiiware/aii 0.10.7 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aii +9 -9
- package/package.json +1 -1
package/bin/aii
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @aiiware/aii v0.10.
|
|
3
|
+
* @aiiware/aii v0.10.8
|
|
4
4
|
*
|
|
5
5
|
* AI-powered CLI assistant for terminal productivity
|
|
6
6
|
*
|
|
@@ -186,7 +186,7 @@ ${a.comment}`:a.comment}this.doc.range[2]=a.offset;break}default:this.errors.pus
|
|
|
186
186
|
`)+`\r
|
|
187
187
|
\r
|
|
188
188
|
`+a)}function Bl(e,t,a,n,r,i){if(e.listenerCount("wsClientError")){let s=new Error(r);Error.captureStackTrace(s,Bl),e.emit("wsClientError",s,a,t)}else Bf(a,n,r,i)}});var kye,Tye,wye,x3,Cye,Ts,XT=le(()=>{kye=mn(m3(),1),Tye=mn(UT(),1),wye=mn($T(),1),x3=mn(w1(),1),Cye=mn(S3(),1),Ts=x3.default});function JT(e){jf={...jf,...e}}function Uf(e){return jf.emojis?e+" ":""}function jl(e,t){return jf.colors?t(e):e}function we(e,...t){jf.debug&&console.debug(jl(`[DEBUG] ${e}`,g.gray),...t)}function Dye(e,...t){console.log(e,...t)}function Oye(e,...t){console.warn(jl(`${Uf("\u26A0\uFE0F")}${e}`,g.yellow),...t)}function Iye(e,...t){console.error(jl(`${Uf("\u274C")}${e}`,g.red),...t)}function Rye(e,...t){console.log(jl(`${Uf("\u2705")}${e}`,g.green),...t)}function ZT(e){let t=[];return t.push(jl(`${Uf("\u274C")}${e.message}`,g.red)),e.suggestions&&e.suggestions.length>0&&(t.push(""),t.push(jl(`${Uf("\u{1F4A1}")}Solutions:`,g.yellow)),e.suggestions.forEach((a,n)=>{t.push(jl(` ${n+1}. ${a}`,g.gray))})),t.join(`
|
|
189
|
-
`)}var Aye,jf,me,nn=le(()=>{"use strict";ma();Aye={debug:!1,colors:!0,emojis:!0},jf={...Aye};me={debug:we,info:Dye,warn:Oye,error:Iye,success:Rye,formatError:ZT,configure:JT}});var k3={};Sr(k3,{MCPConfigManager:()=>Cn,MCP_CATALOG:()=>Ul});import*as hi from"fs";import*as A1 from"path";import*as ew from"os";var Ul,Cn,zl=le(()=>{"use strict";Ul={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",ew.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"}},Cn=class{configPath;constructor(t){this.configPath=t||A1.join(ew.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let t=A1.dirname(this.configPath);hi.existsSync(t)||hi.mkdirSync(t,{recursive:!0})}loadConfig(){if(!hi.existsSync(this.configPath))return{mcpServers:{}};try{let t=hi.readFileSync(this.configPath,"utf-8"),a=JSON.parse(t);return typeof a=="object"&&a!==null?a:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(t){try{return this.ensureConfigDir(),hi.writeFileSync(this.configPath,JSON.stringify(t,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!hi.existsSync(this.configPath))return!0;try{let t=this.configPath+".backup";return hi.copyFileSync(this.configPath,t),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var hp={};Sr(hp,{ClientMCPExecutor:()=>tw});import{Client as Nye}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as Mye}from"@modelcontextprotocol/sdk/client/stdio.js";var tw,gp=le(()=>{"use strict";zl();nn();tw=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new Cn}async initialize(){if(this.initialized)return!0;try{let a=this.configManager.loadConfig().mcpServers||{};we(`Initializing MCP executor with ${Object.keys(a).length} servers`);for(let[n,r]of Object.entries(a)){if(r.enabled===!1){we(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,r)}catch(i){we(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,we(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(t){return we(`Failed to initialize MCP executor: ${t}`),!1}}async connectToServer(t,a){let n=a.command,r=Array.isArray(a.args)?a.args:[a.args||""],i={...process.env};if(a.env)for(let[u,p]of Object.entries(a.env)){let d=String(p).replace(/\$\{(\w+)\}/g,(m,f)=>process.env[f]||"");i[u]=d}we(`Connecting to MCP server: ${t}`),we(` command: ${n}`),we(` args: ${JSON.stringify(r)}`);let s=new Mye({command:n,args:r,env:i,stderr:"pipe"}),o=new Nye({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await o.connect(s);let l=(await o.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:t}));this.connections.set(t,{client:o,transport:s,tools:l});for(let u of l)this.toolToServer.set(u.name,t);we(`Connected to ${t}: discovered ${l.length} tools`)}async handleQueryTools(t){let a=t.request_id||"unknown";we(`Handling mcp_query_tools request: ${a}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let r=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return we(`Found ${r.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:a,success:!0,tools:r}}catch(n){return we(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:a,success:!1,error:String(n),tools:[]}}}async handleToolExecution(t){let a=t.request_id||"unknown",n=t.tool_name,r=t.arguments||{};if(we(`Handling mcp_tool_request: ${a} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:a,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:a,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let s=this.connections.get(i);if(!s)return{type:"mcp_tool_response",request_id:a,success:!1,error:`Server '${i}' not connected`};let o=await Promise.race([s.client.callTool({name:n,arguments:r}),new Promise((l,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),c=this.makeContentSerializable(o.content);return we(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:a,success:!o.isError,content:c,server_name:i,error:o.isError?"Tool returned error":void 0}}catch(i){return we(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:a,success:!1,error:String(i)}}}makeContentSerializable(t){if(t==null)return null;if(Array.isArray(t))return t.map(a=>this.makeContentSerializable(a));if(typeof t=="object"){let a=t;if(a.type==="text"&&typeof a.text=="string")return{type:"text",text:a.text};if(a.type==="image")return{type:"image",data:a.data,mimeType:a.mimeType};let n={};for(let[r,i]of Object.entries(a))n[r]=this.makeContentSerializable(i);return n}return t}async shutdown(){we("Shutting down MCP executor");for(let[t,a]of this.connections)try{await a.client.close(),we(`Closed connection to ${t}`)}catch(n){we(`Error closing ${t}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var I3=y((yQe,Yye)=>{Yye.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 uw=y((bQe,N3)=>{"use strict";var M1=Object.assign({},I3()),R3=Object.keys(M1);Object.defineProperty(M1,"random",{get(){let e=Math.floor(Math.random()*R3.length),t=R3[e];return M1[t]}});N3.exports=M1});function $l({onlyFirst:e=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,e?void 0:"g")}var L1=le(()=>{});var j3=y((MQe,B3)=>{B3.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});import{resolve as r1e}from"path";function i1e(){let e=process.env.TERM??"",t=process.env.TERM_PROGRAM??"",a=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",r=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return t==="iTerm.app"||t==="Hyper"||t==="vscode"||t==="WezTerm"||t==="Alacritty"||n||r||e.includes("xterm-256color")||e.includes("screen-256color")||e.includes("tmux")||e==="xterm-kitty"||a==="truecolor"?!0:!(e==="dumb"||!process.stdout.isTTY)}function $f(){return Sw===null&&(Sw=i1e()),Sw}function s1e(){return process.platform==="darwin"?"Cmd":"Ctrl"}function $3(){return q3||!$f()?"":(q3=!0,` (${s1e()}+Click to open)`)}function o1e(e,t){return $f()?`\x1B]8;;${t}\x07${e}\x1B]8;;\x07`:e}function G3(e,t){let a=process.env.HOME??process.env.USERPROFILE??"",n=e;a&&e.startsWith(a)&&(n="~"+e.slice(a.length));let r=t?`${n}:${t}`:n;if(!$f())return g.cyan.underline(r);let i=g.cyan(r),o=`file://${r1e(e)}`;return t!==void 0&&t>0&&(o+=`#L${t}`),o1e(i,o)}var Sw,q3,H3=le(()=>{"use strict";ma();Sw=null,q3=!1});function Y3(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")||/^[a-zA-Z]:\\/.test(e)||/\.(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(e)||/^src\//.test(e)||/^lib\//.test(e)||/^test[s]?\//.test(e)}function K3(e,t,a=!0,n,r=console.log){let i=a?La.success("\u25CF"):La.error("\u25CF"),s=60,o=t.length>s?t.slice(0,s-3)+"...":t;if(Y3(t)){let l=t.match(/:(\d+)$/),u=l?parseInt(l[1],10):void 0,p=l?t.replace(/:(\d+)$/,""):t;o=c1e(p,u)}r(`${i} ${g.bold(e)}(${o})`);let c=Y3(t)?La.dim($3()):"";if(n){let l=a?La.dim:La.error;r(l(`\u2514 ${n}`)+c)}else{let l=a?"(No content)":"(Error)",u=a?La.dim:La.error;r(u(`\u2514 ${l}`)+c)}}function c1e(e,t){if($f())return G3(e,t);let a=process.env.HOME??process.env.USERPROFILE??"",n=e;return a&&e.startsWith(a)&&(n="~"+e.slice(a.length)),t&&(n+=`:${t}`),La.filePath(n)}function l1e(){return process.stdout.columns||80}function u1e(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),a=e%60;return a>0?`${t}m ${a}s`:`${t}m`}function W3(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function V3(e){let t=l1e(),a=Math.min(t-2,76),n=a-4,r=(d,m)=>{let f=d.replace(/\x1b\[[0-9;]*m/g,"").length;return d+" ".repeat(Math.max(0,m-f))},i=d=>La.border("\u2502")+" "+r(d,n)+" "+La.border("\u2502"),s=(d,m,f,h)=>{let _=Math.floor(n/2),v=La.dim(d.padEnd(15))+m,S=La.dim(f.padEnd(15))+h;return i(r(v,_)+S)},o=u1e(e.durationSeconds),c=W3(e.tokensIn),l=W3(e.tokensOut),u=`$${e.totalCost.toFixed(4)}`,p=`${e.provider}/${e.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(La.border("\u250C"+"\u2500".repeat(a-2)+"\u2510")),console.log(i(g.cyan.bold("Agent powering down. Goodbye!"))),console.log(La.border("\u251C"+"\u2500".repeat(a-2)+"\u2524")),console.log(i(g.cyan.bold("Session Summary"))),console.log(i(La.dim("\u2500".repeat(15)))),console.log(s("Duration",o,"Tool Calls",e.toolCalls.toString())),console.log(s("Turns",e.turns.toString(),"Files Modified",e.filesModified.toString())),console.log(i("")),console.log(i(g.cyan.bold("Token Usage"))),console.log(i(La.dim("\u2500".repeat(11)))),console.log(s("Input",c,"Output",l)),console.log(i(La.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(La.dim("Model: ")+La.model(p))),console.log(La.border("\u2514"+"\u2500".repeat(a-2)+"\u2518")),console.log("")}var F1,La,Gf=le(()=>{"use strict";ma();H3();F1="0.10.7",La={logo:g.cyan.bold,prompt:g.cyan.bold,model:g.cyan,success:g.green,warning:g.yellow,error:g.red,thinking:g.dim.cyan,filePath:g.blue,code:g.white,muted:g.gray,dim:g.dim,safe:g.green,risky:g.yellow,destructive:g.red,border:g.cyan,bannerBorder:g.cyan}});var Ao,B1,xw=le(()=>{"use strict";Ao={maxConcurrent:5,maxIterations:100,timeout:3e5,compressionLevel:"medium",permissionMode:"default"},B1={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var j1,kw=le(()=>{"use strict";j1=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
|
|
189
|
+
`)}var Aye,jf,me,nn=le(()=>{"use strict";ma();Aye={debug:!1,colors:!0,emojis:!0},jf={...Aye};me={debug:we,info:Dye,warn:Oye,error:Iye,success:Rye,formatError:ZT,configure:JT}});var k3={};Sr(k3,{MCPConfigManager:()=>Cn,MCP_CATALOG:()=>Ul});import*as hi from"fs";import*as A1 from"path";import*as ew from"os";var Ul,Cn,zl=le(()=>{"use strict";Ul={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",ew.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"}},Cn=class{configPath;constructor(t){this.configPath=t||A1.join(ew.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let t=A1.dirname(this.configPath);hi.existsSync(t)||hi.mkdirSync(t,{recursive:!0})}loadConfig(){if(!hi.existsSync(this.configPath))return{mcpServers:{}};try{let t=hi.readFileSync(this.configPath,"utf-8"),a=JSON.parse(t);return typeof a=="object"&&a!==null?a:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(t){try{return this.ensureConfigDir(),hi.writeFileSync(this.configPath,JSON.stringify(t,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!hi.existsSync(this.configPath))return!0;try{let t=this.configPath+".backup";return hi.copyFileSync(this.configPath,t),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var hp={};Sr(hp,{ClientMCPExecutor:()=>tw});import{Client as Nye}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as Mye}from"@modelcontextprotocol/sdk/client/stdio.js";var tw,gp=le(()=>{"use strict";zl();nn();tw=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new Cn}async initialize(){if(this.initialized)return!0;try{let a=this.configManager.loadConfig().mcpServers||{};we(`Initializing MCP executor with ${Object.keys(a).length} servers`);for(let[n,r]of Object.entries(a)){if(r.enabled===!1){we(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,r)}catch(i){we(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,we(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(t){return we(`Failed to initialize MCP executor: ${t}`),!1}}async connectToServer(t,a){let n=a.command,r=Array.isArray(a.args)?a.args:[a.args||""],i={...process.env};if(a.env)for(let[u,p]of Object.entries(a.env)){let d=String(p).replace(/\$\{(\w+)\}/g,(m,f)=>process.env[f]||"");i[u]=d}we(`Connecting to MCP server: ${t}`),we(` command: ${n}`),we(` args: ${JSON.stringify(r)}`);let s=new Mye({command:n,args:r,env:i,stderr:"pipe"}),o=new Nye({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await o.connect(s);let l=(await o.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:t}));this.connections.set(t,{client:o,transport:s,tools:l});for(let u of l)this.toolToServer.set(u.name,t);we(`Connected to ${t}: discovered ${l.length} tools`)}async handleQueryTools(t){let a=t.request_id||"unknown";we(`Handling mcp_query_tools request: ${a}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let r=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return we(`Found ${r.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:a,success:!0,tools:r}}catch(n){return we(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:a,success:!1,error:String(n),tools:[]}}}async handleToolExecution(t){let a=t.request_id||"unknown",n=t.tool_name,r=t.arguments||{};if(we(`Handling mcp_tool_request: ${a} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:a,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:a,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let s=this.connections.get(i);if(!s)return{type:"mcp_tool_response",request_id:a,success:!1,error:`Server '${i}' not connected`};let o=await Promise.race([s.client.callTool({name:n,arguments:r}),new Promise((l,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),c=this.makeContentSerializable(o.content);return we(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:a,success:!o.isError,content:c,server_name:i,error:o.isError?"Tool returned error":void 0}}catch(i){return we(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:a,success:!1,error:String(i)}}}makeContentSerializable(t){if(t==null)return null;if(Array.isArray(t))return t.map(a=>this.makeContentSerializable(a));if(typeof t=="object"){let a=t;if(a.type==="text"&&typeof a.text=="string")return{type:"text",text:a.text};if(a.type==="image")return{type:"image",data:a.data,mimeType:a.mimeType};let n={};for(let[r,i]of Object.entries(a))n[r]=this.makeContentSerializable(i);return n}return t}async shutdown(){we("Shutting down MCP executor");for(let[t,a]of this.connections)try{await a.client.close(),we(`Closed connection to ${t}`)}catch(n){we(`Error closing ${t}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var I3=y((yQe,Yye)=>{Yye.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 uw=y((bQe,N3)=>{"use strict";var M1=Object.assign({},I3()),R3=Object.keys(M1);Object.defineProperty(M1,"random",{get(){let e=Math.floor(Math.random()*R3.length),t=R3[e];return M1[t]}});N3.exports=M1});function $l({onlyFirst:e=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,e?void 0:"g")}var L1=le(()=>{});var j3=y((MQe,B3)=>{B3.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});import{resolve as r1e}from"path";function i1e(){let e=process.env.TERM??"",t=process.env.TERM_PROGRAM??"",a=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",r=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return t==="iTerm.app"||t==="Hyper"||t==="vscode"||t==="WezTerm"||t==="Alacritty"||n||r||e.includes("xterm-256color")||e.includes("screen-256color")||e.includes("tmux")||e==="xterm-kitty"||a==="truecolor"?!0:!(e==="dumb"||!process.stdout.isTTY)}function $f(){return Sw===null&&(Sw=i1e()),Sw}function s1e(){return process.platform==="darwin"?"Cmd":"Ctrl"}function $3(){return q3||!$f()?"":(q3=!0,` (${s1e()}+Click to open)`)}function o1e(e,t){return $f()?`\x1B]8;;${t}\x07${e}\x1B]8;;\x07`:e}function G3(e,t){let a=process.env.HOME??process.env.USERPROFILE??"",n=e;a&&e.startsWith(a)&&(n="~"+e.slice(a.length));let r=t?`${n}:${t}`:n;if(!$f())return g.cyan.underline(r);let i=g.cyan(r),o=`file://${r1e(e)}`;return t!==void 0&&t>0&&(o+=`#L${t}`),o1e(i,o)}var Sw,q3,H3=le(()=>{"use strict";ma();Sw=null,q3=!1});function Y3(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")||/^[a-zA-Z]:\\/.test(e)||/\.(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(e)||/^src\//.test(e)||/^lib\//.test(e)||/^test[s]?\//.test(e)}function K3(e,t,a=!0,n,r=console.log){let i=a?La.success("\u25CF"):La.error("\u25CF"),s=60,o=t.length>s?t.slice(0,s-3)+"...":t;if(Y3(t)){let l=t.match(/:(\d+)$/),u=l?parseInt(l[1],10):void 0,p=l?t.replace(/:(\d+)$/,""):t;o=c1e(p,u)}r(`${i} ${g.bold(e)}(${o})`);let c=Y3(t)?La.dim($3()):"";if(n){let l=a?La.dim:La.error;r(l(`\u2514 ${n}`)+c)}else{let l=a?"(No content)":"(Error)",u=a?La.dim:La.error;r(u(`\u2514 ${l}`)+c)}}function c1e(e,t){if($f())return G3(e,t);let a=process.env.HOME??process.env.USERPROFILE??"",n=e;return a&&e.startsWith(a)&&(n="~"+e.slice(a.length)),t&&(n+=`:${t}`),La.filePath(n)}function l1e(){return process.stdout.columns||80}function u1e(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),a=e%60;return a>0?`${t}m ${a}s`:`${t}m`}function W3(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function V3(e){let t=l1e(),a=Math.min(t-2,76),n=a-4,r=(d,m)=>{let f=d.replace(/\x1b\[[0-9;]*m/g,"").length;return d+" ".repeat(Math.max(0,m-f))},i=d=>La.border("\u2502")+" "+r(d,n)+" "+La.border("\u2502"),s=(d,m,f,h)=>{let _=Math.floor(n/2),v=La.dim(d.padEnd(15))+m,S=La.dim(f.padEnd(15))+h;return i(r(v,_)+S)},o=u1e(e.durationSeconds),c=W3(e.tokensIn),l=W3(e.tokensOut),u=`$${e.totalCost.toFixed(4)}`,p=`${e.provider}/${e.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(La.border("\u250C"+"\u2500".repeat(a-2)+"\u2510")),console.log(i(g.cyan.bold("Agent powering down. Goodbye!"))),console.log(La.border("\u251C"+"\u2500".repeat(a-2)+"\u2524")),console.log(i(g.cyan.bold("Session Summary"))),console.log(i(La.dim("\u2500".repeat(15)))),console.log(s("Duration",o,"Tool Calls",e.toolCalls.toString())),console.log(s("Turns",e.turns.toString(),"Files Modified",e.filesModified.toString())),console.log(i("")),console.log(i(g.cyan.bold("Token Usage"))),console.log(i(La.dim("\u2500".repeat(11)))),console.log(s("Input",c,"Output",l)),console.log(i(La.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(La.dim("Model: ")+La.model(p))),console.log(La.border("\u2514"+"\u2500".repeat(a-2)+"\u2518")),console.log("")}var F1,La,Gf=le(()=>{"use strict";ma();H3();F1="0.10.8",La={logo:g.cyan.bold,prompt:g.cyan.bold,model:g.cyan,success:g.green,warning:g.yellow,error:g.red,thinking:g.dim.cyan,filePath:g.blue,code:g.white,muted:g.gray,dim:g.dim,safe:g.green,risky:g.yellow,destructive:g.red,border:g.cyan,bannerBorder:g.cyan}});var Ao,B1,xw=le(()=>{"use strict";Ao={maxConcurrent:5,maxIterations:100,timeout:3e5,compressionLevel:"medium",permissionMode:"default"},B1={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var j1,kw=le(()=>{"use strict";j1=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
|
|
190
190
|
|
|
191
191
|
## Core Capabilities
|
|
192
192
|
You have access to these tools for codebase exploration:
|
|
@@ -528,10 +528,10 @@ ${r.yellow(`\u26A0 ${l} error${l!==1?"s":""} during reload`)}`;for(let p of o.er
|
|
|
528
528
|
`)};let l=c[0],u=o.has("--user")?"user":"project";if(u==="project"&&!r)return{continue:!0,handled:!0,output:i.red("No project root available. Use --user to uninstall from user skills.")};let{SkillInstaller:p}=await Promise.resolve().then(()=>(Z1(),Qw)),m=await new p({projectRoot:r||process.cwd()}).uninstall(l,u);return m.success?(await a.reload(),{continue:!0,handled:!0,output:i.green(`\u2713 Uninstalled '${l}' from ${u} skills`)}):{continue:!0,handled:!0,output:i.red(`Failed to uninstall skill: ${m.error}`)}}async function Jw(e,t){let{manager:a,invoker:n,useColors:r=!0}=t,i=r?g:{cyan:p=>p,green:p=>p,yellow:p=>p,red:p=>p,dim:p=>p};if(!e.startsWith("/"))return{continue:!0,handled:!1};let s=e.slice(1).split(/\s+/),o=s[0]?.toLowerCase()??"",c=s.slice(1).join(" "),l=a.getByName(o);if(!l)return{continue:!0,handled:!1};if(!l.userInvocable)return{continue:!0,handled:!0,output:i.yellow(`Skill '${o}' is not user-invocable (model only)`)};let u=await n.invoke(o,c,"user");return u.success?{continue:!0,handled:!0,injectContent:u.content,output:i.dim(`Skill /${o} activated`)}:{continue:!0,handled:!0,output:i.red(`Error invoking skill: ${u.error}`)}}function B1e(e){let t=[];return t.push(e.bold.cyan("/skills")+" \u2014 Manage and invoke skills"),t.push(""),t.push(e.cyan("Subcommands:")),t.push(` ${e.green("/skills")} List all available skills`),t.push(` ${e.green("/skills help")} Show this help message`),t.push(` ${e.green("/skills reload")} Reload skills from disk (hot reload)`),t.push(` ${e.green("/skills install <src>")} Install a skill from GitHub or URL`),t.push(` ${e.green("/skills uninstall <name>")} Remove an installed skill`),t.push(""),t.push(e.cyan("Skill Invocation:")),t.push(` ${e.green("/<skill-name>")} Invoke a user-invocable skill`),t.push(` ${e.green("/<skill-name> [args]")} Invoke with arguments`),t.push(""),t.push(e.cyan("Skill Locations (priority order):")),t.push(` ${e.dim("1. Project:")} .aii/skills/<name>/SKILL.md`),t.push(` ${e.dim("2. User:")} ~/.aii/skills/<name>/SKILL.md`),t.push(` ${e.dim("3. Built-in:")} Bundled with Aii CLI`),t.push(""),t.push(e.cyan("Examples:")),t.push(` ${e.dim("/skills")} ${e.gray("List all skills")}`),t.push(` ${e.dim("/skills reload")} ${e.gray("Hot reload after adding skills")}`),t.push(` ${e.dim("/skills install owner/repo/skill")} ${e.gray("Install from GitHub")}`),t.push(` ${e.dim("/skills install https://example.com/skill.md")} ${e.gray("Install from URL")}`),t.push(` ${e.dim("/skills install owner/repo/skill --user")} ${e.gray("Install to user skills")}`),t.push(` ${e.dim("/skills uninstall my-skill")} ${e.gray("Remove a skill")}`),t.push(""),t.push(e.dim("Project skills override user skills, which override built-in skills.")),t.join(`
|
|
529
529
|
`)}var _4=le(()=>{"use strict";ma();Gl()});var Hl=le(()=>{"use strict";Gl();Wf();l4();th();qw();jw();f4();zw();$w();_4();Z1()});import{EventEmitter as z1e}from"events";function y4(){return[{name:"task",description:"Delegate a task to a specialized subagent that runs autonomously with its own tools and context window. Available subagents: explore (fast codebase exploration \u2014 read-only, cheap model), plan (architecture and implementation planning \u2014 read-only), review (code quality analysis and bug detection \u2014 read-only). IMPORTANT: When the user asks you to analyze, explore, review, or plan across a codebase, prefer this tool over doing the work yourself. Use explore for multi-directory or multi-package searches. Use plan for architecture decisions requiring deep analysis. Use review for code quality checks. Launch multiple task calls in a single response for parallel execution when the task has independent parts.",input_schema:{type:"object",properties:{subagent:{type:"string",description:'Name of the subagent to spawn (e.g., "explore", "plan", "review")'},prompt:{type:"string",description:"Task description for the subagent. Be specific about what you want to find or accomplish."},run_in_background:{type:"boolean",description:"Run the subagent in the background (non-blocking). Default: false"}},required:["subagent","prompt"]}}]}function _i(e){return new eb(e)}var eb,Yl=le(()=>{"use strict";XT();Z3();Hl();nn();eb=class extends z1e{ws=null;config;state="disconnected";mcpExecutor=null;constructor(t){super(),this.config={...J3,...t}}getState(){return this.state}get baseUrl(){return this.config.baseUrl}isConnected(){return this.state==="connected"}async connect(){if(this.state!=="connected")try{let t=await fetch(`${this.config.baseUrl}/v0/status`,{headers:{"Aii-API-Key":this.config.apiKey}});if(!t.ok)throw new Error(`Server returned ${t.status}`);this.setState("connected"),this.emit("connected")}catch(t){throw this.setState("error"),new Error(`Cannot connect to Aii Server at ${this.config.baseUrl}: ${t.message}`)}}setProviderApiKey(t){this.config.providerApiKey=t}disconnect(){if(this.ws){let t=this.ws;this.ws=null,t.terminate()}this.mcpExecutor&&(this.mcpExecutor.shutdown().catch(()=>{}),this.mcpExecutor=null),this.setState("disconnected")}requestGracefulClose(){return new Promise(t=>{if(!this.ws){t();return}let a=this.ws;this.ws=null;let n=()=>{a.removeListener("close",n),this.setState("disconnected"),t()};a.on("close",n),a.close(1e3,"Context compaction requested"),setTimeout(()=>{a.readyState!==Ts.CLOSED&&a.terminate(),t()},2e3)})}async*chat(t,a,n){let r=t.filter(p=>p.role==="user").map(p=>p.content).pop()??"",i=t.filter(p=>p.role==="system").map(p=>p.content).join(`
|
|
530
530
|
|
|
531
|
-
`),s=["read_file","write_file","list_files","search_code","get_file_info","run_command","web_search","web_fetch","skill"
|
|
531
|
+
`),s=["read_file","write_file","list_files","search_code","get_file_info","run_command","web_search","web_fetch","skill"];n.excludeTaskTool||s.push("task");let o;if(It.hasInstance()){let d=It.getInstance().getModelInvocableSkills();d.length>0&&(o={skills:d.map(m=>({name:m.name,description:m.description,argument_hint:Array.isArray(m.argumentHint)?m.argumentHint.join(" "):m.argumentHint}))})}let c={prompt:r,available_tools:s,model:n.model,llm_provider:n.provider,api_key:this.config.apiKey,provider_api_key:this.config.providerApiKey,client_type:"aii-cli-ts",max_output_tokens:n.maxTokens,system_prompt:i||void 0,client_tools:n.excludeTaskTool?void 0:y4(),context:{workspace_root:process.cwd()},skill_metadata:o},l=`${this.config.baseUrl}/v0/agent/execute`,u;try{let p=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json","Aii-API-Key":this.config.apiKey},body:JSON.stringify(c)});if(!p.ok){let d=await p.text();throw new Error(`Failed to create agent session: ${d}`)}u=await p.json()}catch(p){yield{type:"error",requestId:"",error:p.message};return}yield*this.streamFromWebSocket(u.websocket_url,a)}async*streamFromWebSocket(t,a){let n=[],r=null,i=!1,s;try{s=new Ts(t),this.ws=s}catch(u){yield{type:"error",requestId:"",error:`Failed to connect to WebSocket: ${u.message}`};return}let o=u=>{r?(r({value:u,done:!1}),r=null):n.push(u)},c=()=>{i=!0,r&&(r({value:void 0,done:!0}),r=null)},l=async u=>{let p=u.request_id??"",d=u.tool??"";o({type:"tool_call",requestId:p,toolCall:{id:p,name:d,arguments:u.input??{}}})};s.on("open",()=>{}),s.on("message",async u=>{try{if(!u){o({type:"error",requestId:"",error:"Received empty WebSocket message"});return}let p=JSON.parse(u.toString());switch(p.type){case"session_started":break;case"token":p.content&&o({type:"text",requestId:p.request_id??"",text:p.content});break;case"tool_request":await l(p);break;case"complete":let d=p.metadata??{};o({type:"usage",requestId:p.request_id??"",usage:{inputTokens:d.input_tokens??0,outputTokens:d.output_tokens??0},cost:d.cost_usd??0}),o({type:"done",requestId:p.request_id??""}),s.close(),c();break;case"error":o({type:"error",requestId:p.request_id??"",error:p.message??"Unknown error",errorCode:p.code}),s.close(),c();break}}catch(p){o({type:"error",requestId:"",error:`Failed to parse message: ${p.message}`}),s.close(),c()}}),s.on("error",u=>{o({type:"error",requestId:"",error:`WebSocket error: ${u.message}`}),c()}),s.on("close",()=>{c()});try{for(;!i||n.length>0;)if(n.length>0){let u=n.shift();if(yield u,u.type==="done"||u.type==="error")break}else if(!i){let u=await new Promise(p=>{r=d=>p(d.value)});if(u&&(yield u,u.type==="done"||u.type==="error"))break}}finally{s.readyState===Ts.OPEN&&s.close(),this.ws=null}}sendToolResult(t,a,n=!0){if(!this.ws||this.ws.readyState!==Ts.OPEN)return;let r={type:n?"tool_result":"tool_error",request_id:t,content:a.slice(0,5e4),success:n};this.ws.send(JSON.stringify(r))}async listModels(){try{let t=await fetch(`${this.config.baseUrl}/v0/models`,{headers:{"Aii-API-Key":this.config.apiKey}});if(!t.ok)throw new Error(`Failed to list models: ${t.status}`);return(await t.json()).models??[]}catch(t){throw new Error(`Failed to list models: ${t.message}`)}}async getStats(){return{today:{requests:0,tokensIn:0,tokensOut:0,cost:0},thisWeek:{requests:0,cost:0},thisMonth:{requests:0,cost:0}}}async summarize(t){let a=new AbortController,n=setTimeout(()=>a.abort(),12e4);try{let r=await fetch(`${this.config.baseUrl}/v0/summarize`,{method:"POST",headers:{"Content-Type":"application/json","Aii-API-Key":this.config.apiKey},body:JSON.stringify({content:t.content,max_tokens:t.maxTokens,model:t.model,provider_api_key:this.config.providerApiKey}),signal:a.signal});if(clearTimeout(n),!r.ok){let s=await r.text();throw new Error(`Summarization failed: ${r.status} - ${s}`)}let i=await r.json();return{summary:i.summary,tokensUsed:i.tokens_used}}catch(r){throw clearTimeout(n),r.name==="AbortError"?new Error("Summarization request timed out after 120 seconds"):r.message.includes("Summarization failed")?r:new Error(`Summarization request failed: ${r.message}`)}}async generate(t){let a=new AbortController,n=setTimeout(()=>a.abort(),9e4);try{let r=await fetch(`${this.config.baseUrl}/v0/reason`,{method:"POST",headers:{"Content-Type":"application/json","Aii-API-Key":this.config.apiKey},body:JSON.stringify({content:t.content,purpose:t.purpose,model:t.model,max_tokens:t.maxTokens,provider_api_key:this.config.providerApiKey,llm_provider:t.provider}),signal:a.signal});if(clearTimeout(n),!r.ok){let s=await r.text();throw new Error(`Generation failed: ${r.status} - ${s}`)}let i=await r.json();return{output:i.output,inputTokens:i.input_tokens,outputTokens:i.output_tokens,durationMs:i.duration_ms||0,model:i.model||""}}catch(r){throw clearTimeout(n),r.name==="AbortError"?new Error("Generation request timed out after 90 seconds"):r.message.includes("Generation failed")?r:new Error(`Generation request failed: ${r.message}`)}}async runAgent(t,a,n,r,i,s,o,c){let l=["read_file","write_file","list_files","search_code","get_file_info","run_command","web_search","web_fetch","skill"];if(a.excludeTaskTool||l.push("task"),c&&c.tools.length>0){for(let _ of c.tools)l.push(`mcp__${_.server_name}__${_.name}`);we(`Added ${c.tools.length} MCP tools to available_tools`)}let u;if(It.hasInstance()){let v=It.getInstance().getModelInvocableSkills();v.length>0&&(u={skills:v.map(S=>({name:S.name,description:S.description,argument_hint:Array.isArray(S.argumentHint)?S.argumentHint.join(" "):S.argumentHint}))})}let p="";i&&i.length>0&&(p=i.map(_=>_.role==="system"?`[System Context]
|
|
532
532
|
${_.content}`:`${_.role==="user"?"User":"Assistant"}: ${_.content}`).join(`
|
|
533
533
|
|
|
534
|
-
`));let d=parseInt(process.env.AII_TOOL_TIMEOUT_MS??"",10)||6e5,m={prompt:t,available_tools:l,model:a.model,llm_provider:a.provider,api_key:this.config.apiKey,provider_api_key:this.config.providerApiKey,client_type:"cli",max_output_tokens:a.maxTokens,max_iterations:a.maxIterations??500,tool_timeout_ms:d,agent_mode:"plan-first",skill_metadata:u,mcp_metadata:c,client_tools:y4(),capabilities:{parallel_tools:!0},context:{workspace_root:process.cwd(),conversation_history:p||void 0,auto_mode:s||void 0,project_instructions:o||void 0}};process.env.AII_DEBUG&&console.error("[DEBUG] Agent request:",{model:m.model,provider_api_key:m.provider_api_key?"SET ("+m.provider_api_key.slice(0,6)+"...)":"NOT SET",tools_count:m.available_tools?.length,prompt_length:m.prompt?.length,agent_mode:m.agent_mode,capabilities:m.capabilities,project_instructions_length:m.context?.project_instructions?.length??0,project_instructions_preview:m.context?.project_instructions?.slice(0,200)??"NONE"});let f=`${this.config.baseUrl}/v0/agent/execute`,h;try{let _=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json","Aii-API-Key":this.config.apiKey},body:JSON.stringify(m)});if(!_.ok){let v=await _.text();throw new Error(`Failed to create agent session: ${v}`)}h=await _.json()}catch(_){r.onError?.(_.message);return}return new Promise((_,v)=>{let S,T=!1;try{S=new Ts(h.websocket_url),this.ws=S}catch(C){r.onError?.(`Failed to connect to WebSocket: ${C.message}`),v(C);return}S.on("message",async C=>{try{if(this.ws===null)return;if(!C){r.onError?.("Received empty WebSocket message");return}let A=JSON.parse(C.toString());switch(process.env.AII_DEBUG&&A.type!=="token"&&process.stderr.write(`[DEBUG] WS msg: ${A.type}
|
|
534
|
+
`));let d=parseInt(process.env.AII_TOOL_TIMEOUT_MS??"",10)||6e5,m={prompt:t,available_tools:l,model:a.model,llm_provider:a.provider,api_key:this.config.apiKey,provider_api_key:this.config.providerApiKey,client_type:"cli",max_output_tokens:a.maxTokens,max_iterations:a.maxIterations??500,tool_timeout_ms:d,agent_mode:"plan-first",skill_metadata:u,mcp_metadata:c,client_tools:a.excludeTaskTool?void 0:y4(),capabilities:{parallel_tools:!0},context:{workspace_root:process.cwd(),conversation_history:p||void 0,auto_mode:s||void 0,project_instructions:o||void 0}};process.env.AII_DEBUG&&console.error("[DEBUG] Agent request:",{model:m.model,provider_api_key:m.provider_api_key?"SET ("+m.provider_api_key.slice(0,6)+"...)":"NOT SET",tools_count:m.available_tools?.length,prompt_length:m.prompt?.length,agent_mode:m.agent_mode,capabilities:m.capabilities,project_instructions_length:m.context?.project_instructions?.length??0,project_instructions_preview:m.context?.project_instructions?.slice(0,200)??"NONE"});let f=`${this.config.baseUrl}/v0/agent/execute`,h;try{let _=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json","Aii-API-Key":this.config.apiKey},body:JSON.stringify(m)});if(!_.ok){let v=await _.text();throw new Error(`Failed to create agent session: ${v}`)}h=await _.json()}catch(_){r.onError?.(_.message);return}return new Promise((_,v)=>{let S,T=!1;try{S=new Ts(h.websocket_url),this.ws=S}catch(C){r.onError?.(`Failed to connect to WebSocket: ${C.message}`),v(C);return}S.on("message",async C=>{try{if(this.ws===null)return;if(!C){r.onError?.("Received empty WebSocket message");return}let A=JSON.parse(C.toString());switch(process.env.AII_DEBUG&&A.type!=="token"&&process.stderr.write(`[DEBUG] WS msg: ${A.type}
|
|
535
535
|
`),A.type){case"session_started":break;case"token":A.content&&r.onToken?.(A.content);break;case"iteration_tokens_usage":{let R=A.metadata??{},L=R.iteration??0,P=R.input_tokens??0,U=R.output_tokens??0;r.onIterationUsage?.(L,{inputTokens:P+U,outputTokens:U},R.cost_usd??0);break}case"tool_request":{let R=A.request_id??"",L=A.tool??"",P=A.input??{};r.onToolCall?.(L,P);let U=Date.now(),G=setInterval(()=>{try{if(r.onActivity?.(),S.readyState===Ts.OPEN){let W={type:"tool_status",request_id:R,status:"executing",metadata:{elapsed_ms:Date.now()-U}};S.send(JSON.stringify(W))}}catch{}},15e3);try{let W=await n(L,P);if(clearInterval(G),this.ws===null)break;let K=W.success?W.output:W.error||W.output||"Unknown error";r.onToolResult?.(L,W.success,K);let F=W.output??"",ee={type:W.success?"tool_result":"tool_error",request_id:R,content:W.success?F.slice(0,5e4):void 0,message:W.success?void 0:W.error??"Unknown error",success:W.success};S.send(JSON.stringify(ee)),r.onToolResultSent?.(L,W.success)}catch(W){if(clearInterval(G),this.ws===null)break;let K=W.message;r.onToolResult?.(L,!1,K);let F={type:"tool_error",request_id:R,message:K,success:!1};S.send(JSON.stringify(F)),r.onToolResultSent?.(L,!1)}break}case"tool_batch_request":{let R=A.batch_id??"",L=A.tools??[],P=Date.now();r.onActivity?.();let U=setInterval(()=>{try{r.onActivity?.(),S.readyState===Ts.OPEN&&S.send(JSON.stringify({type:"tool_status",batch_id:R,status:"executing",metadata:{elapsed_ms:Date.now()-P}}))}catch{}},15e3),G=await Promise.allSettled(L.map(async K=>{let F=await n(K.tool,K.input);return{request_id:K.request_id,tool:K.tool,input:K.input,success:F.success,output:F.success?F.output:F.error||F.output||"Unknown error",content:F.success?(F.output??"").slice(0,5e4):void 0,message:F.success?void 0:F.error??"Unknown error"}}));clearInterval(U);let W=G.map((K,F)=>{if(K.status==="fulfilled")return K.value;let ee=K.reason?.message??"Unknown error";return{request_id:L[F].request_id,tool:L[F].tool,input:L[F].input,success:!1,output:ee,content:void 0,message:ee}});if(this.ws===null)break;for(let K of W)r.onToolCall?.(K.tool,K.input,{batch:!0}),r.onToolResult?.(K.tool,K.success,K.output??"");S.send(JSON.stringify({type:"tool_batch_result",batch_id:R,results:W.map(K=>({request_id:K.request_id,success:K.success,content:K.content,message:K.message}))}));for(let K of W)r.onToolResultSent?.(K.tool,K.success);break}case"mcp_query_tools":{we("Received mcp_query_tools request from server (interactive mode)");try{if(!this.mcpExecutor){let{ClientMCPExecutor:L}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new L,await this.mcpExecutor.initialize()}let R=await this.mcpExecutor.handleQueryTools(A);S.send(JSON.stringify(R))}catch(R){we(`Error handling mcp_query_tools: ${R}`),S.send(JSON.stringify({type:"mcp_query_tools_response",request_id:A.request_id||"unknown",success:!1,error:String(R),tools:[]}))}break}case"mcp_tool_request":{we("Received mcp_tool_request from server (interactive mode)");try{if(!this.mcpExecutor){let{ClientMCPExecutor:L}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new L,await this.mcpExecutor.initialize()}let R=await this.mcpExecutor.handleToolExecution(A);S.send(JSON.stringify(R))}catch(R){we(`Error handling mcp_tool_request: ${R}`),S.send(JSON.stringify({type:"mcp_tool_response",request_id:A.request_id||"unknown",success:!1,error:String(R)}))}break}case"complete":{T=!0;let R=A.metadata??{};r.onUsage?.({inputTokens:R.input_tokens??0,outputTokens:R.output_tokens??0},R.cost_usd??0),S.close(),this.ws=null,_();break}case"error":T=!0,r.onError?.(A.message??"Unknown error",{code:A.code,retryable:A.retryable}),S.close(),this.ws=null,_();break}}catch(A){let R=A,L=R.stack??"";R instanceof SyntaxError?(r.onError?.(`Failed to parse message: ${R.message}`),S.close(),this.ws=null,_()):we(`Error processing message: ${R.message}
|
|
536
536
|
${L}`)}}),S.on("error",C=>{r.onError?.(`WebSocket error: ${C.message}`),this.ws=null,T=!0,v(C)}),S.on("close",()=>{let C=!T&&this.ws!==null;this.ws=null,C?v(new Error("WebSocket disconnected unexpectedly")):_()})})}setState(t){this.state=t,this.emit("stateChange",t)}}});var sn,Ki=le(()=>{"use strict";sn=class{get definition(){return{name:this.name,description:this.description,parameters:this.inputSchema}}getPermissionLevel(t){return this.permissionLevel}success(t,a,n){return{callId:t,success:!0,output:a,metadata:n}}error(t,a,n=""){return{callId:t,success:!1,output:n,error:a}}validateRequired(t,a){for(let n of a)if(t[n]===void 0||t[n]===null)return`Missing required parameter: ${n}`;return null}resolvePath(t,a){if(t.startsWith("/"))return t;if(t.startsWith("~")){let n=process.env.HOME??process.env.USERPROFILE??"";return t.replace("~",n)}return`${a}/${t}`}}});import*as b4 from"fs/promises";import*as ab from"path";function ih(){return new tb}var tb,Zw=le(()=>{"use strict";Os();tb=class{tools=new Map;constructor(){}register(t){this.tools.set(t.definition.name,t)}registerAll(t){for(let a of t)this.register(a)}get(t){return this.tools.get(t)}has(t){return this.tools.has(t)}getDefinitions(){return Array.from(this.tools.values()).map(t=>t.definition)}getAll(){return Array.from(this.tools.values())}async execute(t,a,n,r){let i=this.get(t);if(!i)return{callId:r,success:!1,output:"",error:`Unknown tool: ${t}`};let s=i.getPermissionLevel?.(a)??i.permissionLevel;if(!await this.checkPermission(i,a,s,n.session))return{callId:r,success:!1,output:"",error:"Permission denied"};try{return await i.execute(a,n)}catch(c){return{callId:r,success:!1,output:"",error:c instanceof Error?c.message:String(c)}}}async checkPermission(t,a,n,r){if(r.mode==="auto"||n==="SAFE")return!0;let i=`tool:${t.definition.name}`,s=r.permissionCache.get(i);if(s&&s.allowed)return!0;switch(await this.requestPermission(t,a,n)){case"yes":return!0;case"no":return!1;case"always":return r.permissionCache.set(i,{allowed:!0,scope:"always",timestamp:Date.now()}),!0;case"session":return r.permissionCache.set(i,{allowed:!0,scope:"session",timestamp:Date.now()}),!0}}async requestPermission(t,a,n){let r=xa(),i=r.hasStreamingFooter();i?r.clearStreamingFooter():r.clearStatus(),r.stopInputCapture();let s=t.definition.name,o=t.formatAction(a),c=[],l=!1;if(s==="Edit"&&a.old_string&&a.new_string){l=!0;let d=String(a.old_string).split(`
|
|
537
537
|
`),m=String(a.new_string).split(`
|
|
@@ -856,7 +856,7 @@ When the user asks you to analyze, explore, review, or plan across a codebase \u
|
|
|
856
856
|
`+i:i}async run(t,a){this.interrupted=!1,this.stallDetected=!1,this.lastIterationInfo=null,this.toolPending=0,this.setState("thinking");let n=fO();"incrementIteration"in n&&typeof n.incrementIteration=="function"&&n.incrementIteration(),this.config.streamOutput&&n.log("");let r=a.contextState?Math.round(a.contextState.usagePercent*100):void 0,i=a.contextState?.status==="critical"||a.contextState?.status==="overflow"?"critical":a.contextState?.status==="warning"?"warning":"normal",c=kC().getModelInfo(a.model)?.contextLength??a.contextState?.thresholds.usableContext;n.setContext({projectPath:a.projectPath,branch:gIe(a.projectPath),mode:a.mode,provider:a.provider,model:a.model,contextPercent:r,contextLevel:a.contextState?i:void 0,contextTokens:a.contextState?.tokens.total,contextLimit:c,sessionCost:a.stats.totalCost}),n.activate();let l=null,u=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],p=0,d=!1,m="",f=!0,h="",_=/\[Tool Call:[^\]]*\]/g,v=/\[Tool Call:[^\]]*$/,S=/\[Tool Result:[^\]]*\][\s\S]*?\[\/Tool Result\]/g,T=/\[Tool Result:[^\]]*$/,C=J=>{h+=J,h=h.replace(_,""),h=h.replace(S,"");let ce=h.match(v);if(ce){let ft=h.slice(0,ce.index);return h=h.slice(ce.index),ft}let fe=h.match(T);if(fe){let ft=h.slice(0,fe.index);return h=h.slice(fe.index),ft}let De=h.match(/\[Tool Result:[^\]]*\]/),je=h.includes("[/Tool Result]");if(De&&!je){let ft=h.slice(0,De.index);return h=h.slice(De.index),ft}let Fe=h;return h="",Fe},A=" Thinking...",R=0,L=Date.now(),P=[" Thinking..."," Considering..."," Working..."," Processing..."],U=null,G=()=>{if(U)return;let J=0,ce=0,fe=0,De=P[0];U=setInterval(()=>{J=(J+1)%u.length,ce++;let je=Date.now()-R,Fe=d&&je>2e3;if(ce%37===0&&(fe=(fe+1)%P.length,De=P[fe]),d&&!Fe?A=" Generating...":A=De,Date.now()-L>this.config.stallTimeoutMs&&!this.interrupted&&!this.stallDetected){this.stallDetected=!0,this.interrupted=!0,ve(),K(),ee(),n.log(g.yellow(`\u26A0 No response for ${Math.round(this.config.stallTimeoutMs/1e3)}s. Auto-recovering...`)),this.client.disconnect();return}n.updateStatus(u[J]+A)},80)},W=()=>{U&&(clearInterval(U),U=null)},K=()=>{W(),n.clearStreamingFooter()};this.escHandler&&(process.stdin.removeListener("data",this.escHandler),this.escHandler=null);let F=()=>{let J=!this.interrupted;this.interrupted=!0,ve(),$a.getInstance().cancelAll(),Ro().clear(),J&&(process.stdout.write("\r\x1B[2K"),n.log(g.yellow("\u26A0 Request cancelled.")),n.log("")),this.client.disconnect()};n.setInterruptCallback(F);let ee=()=>{n.clearInterruptCallback()},ve=()=>{l&&(clearInterval(l),l=null)},Ae=()=>{ve(),K(),ee(),this.loopMode?n.deactivateForCompaction():n.deactivate()};this.config.streamOutput&&(this.skipNextInitialDraw?(this.skipNextInitialDraw=!1,n.updateStatus(u[0]+" Reconnecting...")):n.drawInitial(u[0]+" Thinking..."),n.setThinking?.(!0,"Thinking..."),n.startInputCapture(),l=setInterval(()=>{p=(p+1)%u.length,n.updateStatus(u[p]+A)},80));let Me=0,Ee=null,Q=!1,Pe=[],nt="",We=null,N=!1,$=async(J,ce)=>{if(this.interrupted)return{success:!1,output:"",error:"Interrupted"};if(J.startsWith("mcp__")){let qe=this._mcpExecutor;if(!qe)return{success:!1,output:"",error:"MCP executor not initialized"};let ke=J.slice(5).split("__");if(ke.length!==2)return{success:!1,output:"",error:`Invalid MCP tool name: ${J}`};let st=ke[1];we(`Executing MCP tool: ${st} (server: ${ke[0]})`),a.stats.toolCalls++;try{let ot=await qe.executeTool(st,ce);if(!ot.success)return{success:!1,output:"",error:ot.error||"MCP tool execution failed"};let an="";if(Array.isArray(ot.content))for(let wt of ot.content)if(typeof wt=="object"&&wt!==null){let X=wt;X.type==="text"&&typeof X.text=="string"?an+=X.text+`
|
|
857
857
|
`:an+=JSON.stringify(wt)+`
|
|
858
858
|
`}else an+=String(wt)+`
|
|
859
|
-
`;else ot.content&&(an=JSON.stringify(ot.content));return{success:!0,output:an.trim()}}catch(ot){return{success:!1,output:"",error:`MCP tool error: ${ot}`}}}let fe=iK[J]??J,De=`tool-${++Me}`,je=sK(J,ce);if(!this.toolRegistry.get(fe))return{success:!1,output:"",error:`Unknown tool: ${J} (mapped to: ${fe})`};let ft=bi.getInstance(),Dt={session_id:a.id,cwd:a.projectPath,transcript_path:"",tool_name:fe,tool_args:je},Ue=await ft.fire("PreToolUse",Dt);if(Ue.decision==="block")return{success:!1,output:"",error:`[Hook Blocked] ${Ue.reason||"Blocked by PreToolUse hook"}`};let Ye=fe==="Task",gt=this.escHandler;this.escHandler&&!Ye&&(process.stdin.removeListener("data",this.escHandler),this.escHandler=null,process.stdin.isTTY&&process.stdin.setRawMode(!1));let Yt=!["Bash","Grep","Glob","WebSearch","WebFetch"].includes(fe),ra=Date.now(),qt=await this.toolRegistry.execute(fe,je,{cwd:a.projectPath,session:a,onOutput:Yt?qe=>{this.config.streamOutput&&(n.hasStreamingFooter()?n.writeAboveFooter(g.dim(qe)):process.stdout.write(g.dim(qe)))}:void 0},De),_a=Date.now()-ra;if(this.interrupted)return{success:!1,output:"",error:"Interrupted"};gt&&!Ye&&!this.interrupted&&(this.escHandler=gt,process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("data",this.escHandler));let ut={session_id:a.id,cwd:a.projectPath,transcript_path:"",tool_name:fe,tool_args:je,tool_result:{success:qt.success,output:qt.output,error:qt.error},duration_ms:_a};return await ft.fire("PostToolUse",ut),a.stats.toolCalls++,{success:qt.success,output:qt.output,error:qt.error}};try{let J=/\[Tool Call:[^\]]*\]\n?/g,ce=/\[Tool Result:[^\]]*\][\s\S]*?\[\/Tool Result\]\n?/g,fe=a.messages.slice(0,-1).map(Ue=>({role:Ue.role,content:Ue.content.replace(J,"").replace(ce,"")})),De,je=this._mcpExecutor;if(je){let Ue=je.getAllTools();Ue.length>0&&(De={tools:Ue.map(Ye=>({name:Ye.name,server_name:Ye.serverName,description:Ye.description||"",input_schema:Ye.inputSchema}))},we(`Reusing MCP executor: ${Ue.length} tools from ${je.getConnectionCount()} servers`))}else try{let{MCPConfigManager:Ue}=await Promise.resolve().then(()=>(zl(),k3)),na=new Ue().loadConfig().mcpServers||{},Yt=Object.entries(na).filter(([,ra])=>ra.enabled!==!1);if(Yt.length>0){let ra=`Connecting to ${Yt.length} MCP server${Yt.length>1?"s":""}...`;A=` ${ra}`,n.setThinking?.(!0,ra);let{LocalMCPExecutor:qt}=await Promise.resolve().then(()=>(dO(),pO)),_a=new qt;if(await _a.initialize()){let qe=_a.getAllTools();qe.length>0?(De={tools:qe.map(ke=>({name:ke.name,server_name:ke.serverName,description:ke.description||"",input_schema:ke.inputSchema}))},we(`Discovered ${qe.length} MCP tools from ${_a.getConnectionCount()} servers`),this._mcpExecutor=_a):await _a.shutdown()}A=" Thinking..."}}catch(Ue){we(`MCP discovery failed (non-fatal): ${Ue}`),A=" Thinking..."}if(await this.client.runAgent(t,{model:a.model,provider:a.provider,maxTokens:8192},$,{onToken:Ue=>{if(!this.interrupted){if(Q){let Ye=Ro();if(Ye.nodes.length>0&&Ch(Ye)){Q=!1;let na=Kv();if(na&&this.config.streamOutput){let Yt=cd();Yt.addLine(na),Yt.addBlankLine()}}}if(d?this.config.streamOutput&&!n.hasStreamingFooter()&&(n.drawStreamingFooter(),G()):(ve(),n.clearStatus(),A=" Generating...",this.config.streamOutput&&!n.hasStreamingFooter()&&(n.updateStatus(u[0]+A),n.drawStreamingFooter(),G()),d=!0,R=Date.now(),L=Date.now(),this.config.streamOutput&&(Ue=Ue.replace(/^\n+/,""))),m+=Ue,nt+=Ue,this.config.streamOutput){let Ye=C(Ue);Ye&&(f&&(n.writeAboveFooter(g.white("\u25CF ")),f=!1),n.writeAboveFooter(Ye)),R=Date.now(),L=Date.now()}this.emit("token",Ue)}},onToolCall:(Ue,Ye,gt)=>{let na=gt?.batch??!1;if(process.env.AII_DEBUG&&console.error(`[DEBUG] onToolCall: server_tool=${Ue}, raw_args=${JSON.stringify(Ye)}, batch=${na}`),this.interrupted||this.pauseRequested){process.env.AII_DEBUG&&this.pauseRequested&&process.stderr.write(`>>> SKIPPING TOOL ${Ue} - pause requested <<<
|
|
859
|
+
`;else ot.content&&(an=JSON.stringify(ot.content));return{success:!0,output:an.trim()}}catch(ot){return{success:!1,output:"",error:`MCP tool error: ${ot}`}}}let fe=iK[J]??J,De=`tool-${++Me}`,je=sK(J,ce);if(!this.toolRegistry.get(fe))return{success:!1,output:"",error:`Unknown tool: ${J} (mapped to: ${fe})`};let ft=bi.getInstance(),Dt={session_id:a.id,cwd:a.projectPath,transcript_path:"",tool_name:fe,tool_args:je},Ue=await ft.fire("PreToolUse",Dt);if(Ue.decision==="block")return{success:!1,output:"",error:`[Hook Blocked] ${Ue.reason||"Blocked by PreToolUse hook"}`};let Ye=fe==="Task",gt=this.escHandler;this.escHandler&&!Ye&&(process.stdin.removeListener("data",this.escHandler),this.escHandler=null,process.stdin.isTTY&&process.stdin.setRawMode(!1));let Yt=!["Bash","Grep","Glob","WebSearch","WebFetch"].includes(fe),ra=Date.now(),qt=await this.toolRegistry.execute(fe,je,{cwd:a.projectPath,session:a,onOutput:Yt?qe=>{this.config.streamOutput&&(n.hasStreamingFooter()?n.writeAboveFooter(g.dim(qe)):process.stdout.write(g.dim(qe)))}:void 0},De),_a=Date.now()-ra;if(this.interrupted)return{success:!1,output:"",error:"Interrupted"};gt&&!Ye&&!this.interrupted&&(this.escHandler=gt,process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("data",this.escHandler));let ut={session_id:a.id,cwd:a.projectPath,transcript_path:"",tool_name:fe,tool_args:je,tool_result:{success:qt.success,output:qt.output,error:qt.error},duration_ms:_a};return await ft.fire("PostToolUse",ut),a.stats.toolCalls++,{success:qt.success,output:qt.output,error:qt.error}};try{let J=/\[Tool Call:[^\]]*\]\n?/g,ce=/\[Tool Result:[^\]]*\][\s\S]*?\[\/Tool Result\]\n?/g,fe=a.messages.slice(0,-1).map(Ue=>({role:Ue.role,content:Ue.content.replace(J,"").replace(ce,"")})),De,je=this._mcpExecutor;if(je){let Ue=je.getAllTools();Ue.length>0&&(De={tools:Ue.map(Ye=>({name:Ye.name,server_name:Ye.serverName,description:Ye.description||"",input_schema:Ye.inputSchema}))},we(`Reusing MCP executor: ${Ue.length} tools from ${je.getConnectionCount()} servers`))}else try{let{MCPConfigManager:Ue}=await Promise.resolve().then(()=>(zl(),k3)),na=new Ue().loadConfig().mcpServers||{},Yt=Object.entries(na).filter(([,ra])=>ra.enabled!==!1);if(Yt.length>0){let ra=`Connecting to ${Yt.length} MCP server${Yt.length>1?"s":""}...`;A=` ${ra}`,n.setThinking?.(!0,ra);let{LocalMCPExecutor:qt}=await Promise.resolve().then(()=>(dO(),pO)),_a=new qt;if(await _a.initialize()){let qe=_a.getAllTools();qe.length>0?(De={tools:qe.map(ke=>({name:ke.name,server_name:ke.serverName,description:ke.description||"",input_schema:ke.inputSchema}))},we(`Discovered ${qe.length} MCP tools from ${_a.getConnectionCount()} servers`),this._mcpExecutor=_a):await _a.shutdown()}A=" Thinking..."}}catch(Ue){we(`MCP discovery failed (non-fatal): ${Ue}`),A=" Thinking..."}if(await this.client.runAgent(t,{model:a.model,provider:a.provider,maxTokens:8192,excludeTaskTool:this.config.excludeTaskTool},$,{onToken:Ue=>{if(!this.interrupted){if(Q){let Ye=Ro();if(Ye.nodes.length>0&&Ch(Ye)){Q=!1;let na=Kv();if(na&&this.config.streamOutput){let Yt=cd();Yt.addLine(na),Yt.addBlankLine()}}}if(d?this.config.streamOutput&&!n.hasStreamingFooter()&&(n.drawStreamingFooter(),G()):(ve(),n.clearStatus(),A=" Generating...",this.config.streamOutput&&!n.hasStreamingFooter()&&(n.updateStatus(u[0]+A),n.drawStreamingFooter(),G()),d=!0,R=Date.now(),L=Date.now(),this.config.streamOutput&&(Ue=Ue.replace(/^\n+/,""))),m+=Ue,nt+=Ue,this.config.streamOutput){let Ye=C(Ue);Ye&&(f&&(n.writeAboveFooter(g.white("\u25CF ")),f=!1),n.writeAboveFooter(Ye)),R=Date.now(),L=Date.now()}this.emit("token",Ue)}},onToolCall:(Ue,Ye,gt)=>{let na=gt?.batch??!1;if(process.env.AII_DEBUG&&console.error(`[DEBUG] onToolCall: server_tool=${Ue}, raw_args=${JSON.stringify(Ye)}, batch=${na}`),this.interrupted||this.pauseRequested){process.env.AII_DEBUG&&this.pauseRequested&&process.stderr.write(`>>> SKIPPING TOOL ${Ue} - pause requested <<<
|
|
860
860
|
`);return}this.toolPending++,nt.trim()&&(Pe.push({type:"text",content:nt}),nt=""),Pe.push({type:"tool_call",content:JSON.stringify(Ye),toolName:Ue,toolArgs:Ye}),this.config.streamOutput&&n.flushStreamingBuffer();let Yt=iK[Ue]??Ue,ra=sK(Ue,Ye);d||(ve(),n.clearStatus(),d=!0),m&&!m.endsWith(`
|
|
861
861
|
`)&&(this.config.streamOutput?n.writeAboveFooter(`
|
|
862
862
|
`):n.log("")),this.setState("acting"),Ee={name:Yt,args:ra,batch:na},this.config.streamOutput&&(n.hasStreamingFooter()||(n.drawStreamingFooter(),G()),R=Date.now(),L=Date.now()),this.emit("toolCall",Ue,Ye)},onToolResult:(Ue,Ye,gt)=>{if(this.interrupted)return;L=Date.now(),Pe.push({type:"tool_result",content:gt,toolName:Ue,success:Ye});let na=[],Yt=qt=>na.push(qt);if(Ee){if(Ee.name==="Task"){Ee=null,Q=!0,this.setState("thinking");return}let qt=this.toolRegistry.get(Ee.name),_a=qt?qt.formatAction(Ee.args):"",ut,qe;if(Ee.name==="Read")qe=`${gt?gt.split(`
|
|
@@ -868,7 +868,7 @@ When the user asks you to analyze, explore, review, or plan across a codebase \u
|
|
|
868
868
|
`).filter(st=>st.trim()):[];ut=ke.slice(0,15),ke.length>15&&ut.push(`... +${ke.length-15} more lines`),ke.length>0?qe=ke.length===1?"1 line":`${ke.length} lines`:qe="Done"}if(!Ye&&!qe&>){let ke=gt.split(`
|
|
869
869
|
`).filter(st=>st.trim());if(ke.length>0){let st=ke[0].trim();qe=st.length>100?st.slice(0,97)+"...":st}}Yt(""),K3(Ee.name,_a,Ye,qe,Yt),Ee=null}let ra=na.join(`
|
|
870
870
|
`);this.config.streamOutput&&n.log(ra),this.config.streamOutput&&n.flushStreamingBuffer(),n.addBlankLine(),m="",f=!0,this.setState("thinking")},onToolResultSent:()=>{this.interrupted||(L=Date.now(),this.toolPending--,this.toolPending===0&&this.lastIterationInfo&&this.emit("toolResultSent",this.lastIterationInfo.iteration,this.lastIterationInfo.inputTokens))},onActivity:()=>{L=Date.now()},onIterationUsage:(Ue,Ye,gt)=>{let na=Ye.inputTokens-Ye.outputTokens,Yt=Ye.outputTokens;process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] AgentController onIterationUsage called:"),console.error(` iteration=${Ue}, callback inputTokens=${Ye.inputTokens}, outputTokens=${Ye.outputTokens}, cost=${gt}`),console.error(` calculated rawInput=${na}, rawOutput=${Yt}`),console.error(` session.stats BEFORE: tokensIn=${a.stats.tokensIn}, tokensOut=${a.stats.tokensOut}, totalCost=${a.stats.totalCost}`)),a.stats.tokensIn+=na,a.stats.tokensOut+=Yt,a.stats.totalCost+=gt,process.env.AII_LOOP_DEBUG&&console.error(` session.stats AFTER: tokensIn=${a.stats.tokensIn}, tokensOut=${a.stats.tokensOut}, totalCost=${a.stats.totalCost}`),this.lastIterationInfo={iteration:Ue,inputTokens:Ye.inputTokens},this.emit("iterationUsage",Ue,Ye.inputTokens,Ye.outputTokens,gt)},onUsage:(Ue,Ye)=>{process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] AgentController onUsage (final) called:"),console.error(` usage.inputTokens=${Ue.inputTokens}, usage.outputTokens=${Ue.outputTokens}, cost=${Ye}`),console.error(` session.stats current: tokensIn=${a.stats.tokensIn}, tokensOut=${a.stats.tokensOut}, totalCost=${a.stats.totalCost}`),console.error(" NOTE: Stats already accumulated via onIterationUsage, this is a no-op to avoid double-counting")),this.emit("usage",Ue.inputTokens,Ue.outputTokens,Ye)},onError:(Ue,Ye)=>{this.interrupted||(Ae(),this.setState("error"),We=Ue,N=Ye?.retryable??!1)}},fe,a.mode==="auto",this.buildProjectInstructions(),De),We){let Ue=We,Ye=N;We=null,N=!1;let gt=new Error(Ue);throw gt.retryable=Ye,gt}if(m||Pe.length>0){nt.trim()&&(Pe.push({type:"text",content:nt}),nt="");let Ue=this.buildTranscriptContent(Pe,m),Ye={role:"assistant",content:Ue,timestamp:Date.now()};a.messages.push(Ye),process.env.AII_DEBUG&&this.interrupted&&console.error(`[DEBUG-COMPACT] Committed assistant message to session before interrupt (${Ue.length} chars)`)}if(this.interrupted)throw{name:"AgentInterrupt",message:"Agent interrupted"};ee(),K(),m&&!m.endsWith(`
|
|
871
|
-
`)&&n.log(""),m&&n.log(""),this.loopMode?n.deactivateForCompaction():n.deactivate(),process.stdout.write("\r"),process.stdin.pause();let Fe=bi.getInstance(),ft={session_id:a.id,cwd:a.projectPath,transcript_path:"",exit_reason:"completed"},Dt=await Fe.fire("Stop",ft);if(Dt.decision==="block"){let Ue=Dt.reason||"Stop hook requested continuation";console.log(La.dim(`[Hook] Stop blocked: ${Ue}`))}this.setState("complete")}catch(J){if(ve(),K(),ee(),this.stallDetected)throw this.stallDetected=!1,n.deactivateForCompaction(),process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),{name:"StallTimeout",message:`No response for ${Math.round(this.config.stallTimeoutMs/1e3)} seconds`};let ce=J.message??"",fe=ce.includes("WebSocket disconnected unexpectedly")||ce.includes("ECONNRESET")||ce.includes("EPIPE")||ce.includes("ETIMEDOUT")||ce.includes("ECONNREFUSED")||ce.includes("socket hang up")||ce.includes("WebSocket was closed")||ce.includes("WebSocket error")&&!this.interrupted,Fe=J.retryable===!0||fe;throw this.pauseRequested||Fe?n.deactivateForCompaction():n.deactivate(),J.name==="AgentInterrupt"||this.interrupted?(process.stdout.write("\r"),this.setState("error"),{name:"AgentInterrupt",message:"Agent interrupted"}):(process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),Fe?{name:"AbnormalDisconnect",message:ce}:J)}}disconnect(){this.client.disconnect()}}});function oK(e){let t=new Date;return{id:`subagent_${e.agentId}`,projectPath:e.projectPath,createdAt:t,updatedAt:t,messages:[],model:e.model,provider:e.provider,permissionCache:new Map,fileChanges:[],stats:{startTime:Date.now(),totalTurns:0,tokensIn:0,tokensOut:0,totalCost:0,toolCalls:0,filesModified:0},mode:e.mode??"auto"}}var cK=le(()=>{"use strict"});var cu,Qv=le(()=>{"use strict";cu=class{tokens=[];toolCalls=[];toolResults=[];onToken(t){this.tokens.push(t)}onToolCall(t,a){this.toolCalls.push({name:t,args:a,timestamp:Date.now()})}onToolResult(t,a){this.toolResults.push({name:t,result:a,timestamp:Date.now()})}getResponse(){return this.tokens.join("")}getToolCalls(){return[...this.toolCalls]}getToolResults(){return[...this.toolResults]}getToolSummary(){return this.toolCalls.length===0?"":`Tools used: ${this.toolCalls.map(a=>{let n=this.toolResults.find(i=>i.name===a.name);return`${n?n.result.success?"\u2713":"\u2717":"\u2026"} ${a.name}`}).join(", ")}`}hasContent(){return this.tokens.length>0||this.toolCalls.length>0}flush(){this.tokens=[],this.toolCalls=[],this.toolResults=[]}}});import{EventEmitter as yIe}from"events";var $a,yh=le(()=>{"use strict";xw();nn();Cw();mO();Yl();MC();cK();Qv();wC();TC();fb();Kl();DC();nA();$a=class e extends yIe{static instance=null;config=null;builtinAgents=new Map;customAgents=new Map;activeAgents=new Map;initialized=!1;constructor(){super()}static getInstance(){return e.instance||(e.instance=new e),e.instance}static reset(){e.instance&&(e.instance.cancelAll(),e.instance.removeAllListeners()),e.instance=null}initialize(t){this.config={maxConcurrent:t.maxConcurrent??Ao.maxConcurrent,maxIterations:t.maxIterations??Ao.maxIterations,timeout:t.timeout??Ao.timeout,projectPath:t.projectPath,modelRouting:t.modelRouting,serverUrl:t.serverUrl,providerApiKey:t.providerApiKey,provider:t.provider},this.registerBuiltinAgents(),this.discoverCustomAgents(),this.initialized=!0,me.debug(`SubagentManager initialized with ${this.builtinAgents.size} built-in agents`)}isInitialized(){return this.initialized}registerBuiltinAgents(){this.builtinAgents.set("explore",{name:"explore",description:"Fast codebase exploration and file discovery",type:"explore",systemPrompt:Hf("explore")??"",tools:["Glob","Grep","Read","LS"],modelTier:"cheap",maxIterations:30,compressionLevel:"medium",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("plan",{name:"plan",description:"Software architecture and implementation planning",type:"plan",systemPrompt:Hf("plan")??"",tools:["Glob","Grep","Read","LS","WebSearch","WebFetch"],modelTier:"standard",maxIterations:50,compressionLevel:"low",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("review",{name:"review",description:"Code review and quality analysis",type:"review",systemPrompt:Hf("review")??"",tools:["Glob","Grep","Read","LS","Bash"],disallowedTools:["Write","Edit"],modelTier:"cheap",maxIterations:40,compressionLevel:"medium",permissionMode:"dontAsk",isBuiltin:!0}),me.debug(`Registered ${this.builtinAgents.size} built-in agents`)}discoverCustomAgents(){if(this.config?.projectPath)try{let t=AC(this.config.projectPath);for(let a of t)this.customAgents.set(a.name,a);t.length>0&&me.debug(`Discovered ${t.length} custom agents`)}catch(t){me.debug(`Custom agent discovery failed: ${t}`)}}getAgent(t){return this.customAgents.get(t)??this.builtinAgents.get(t)}listAgents(){let t=[];for(let a of this.builtinAgents.values())t.push(a);for(let a of this.customAgents.values()){let n=t.findIndex(r=>r.name===a.name);n>=0?t[n]=a:t.push(a)}return t}getActiveCount(){return this.activeAgents.size}isAtConcurrencyLimit(){let t=this.config?.maxConcurrent??Ao.maxConcurrent;return this.activeAgents.size>=t}async spawn(t){if(!this.initialized||!this.config)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:"SubagentManager not initialized",tokens:{input:0,output:0},duration:0};let a=this.getAgent(t.name);if(!a)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Unknown subagent: ${t.name}`,tokens:{input:0,output:0},duration:0};if(this.isAtConcurrencyLimit())return this.emit("concurrencyLimitReached",this.activeAgents.size,this.config.maxConcurrent),{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Concurrency limit reached (${this.config.maxConcurrent} agents)`,tokens:{input:0,output:0},duration:0};let n=this.generateAgentId(),r=Date.now();me.debug(`Spawning subagent: ${t.name} (${n})`),this.emit("subagentStart",n,t.name,t.prompt);let i=bi.getInstance();i.fire("SubagentStart",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,prompt:t.prompt,model:a.model??a.modelTier??"default"}).catch(s=>me.debug(`SubagentStart hook error: ${s}`));try{let s=t.options?.runInBackground?B1.permissionMode:a.permissionMode??Ao.permissionMode,o=t.options?.timeout??(t.options?.runInBackground?B1.timeout:this.config.timeout),c=new AbortController,l=this.executeSubagent({agent:a,agentId:n,prompt:t.prompt,sessionId:t.sessionId,cwd:t.cwd,permissionMode:s,timeout:o,model:t.options?.model,abortController:c});this.activeAgents.set(n,{agentId:n,agentName:t.name,promise:l,startedAt:new Date,abortController:c});let u=await l;return this.activeAgents.delete(n),u.duration=Date.now()-r,this.emit("subagentComplete",u),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!0,duration_ms:u.duration,tokens_in:u.tokens?.input??0,tokens_out:u.tokens?.output??0}).catch(p=>me.debug(`SubagentStop hook error: ${p}`)),u}catch(s){this.activeAgents.delete(n);let o={success:!1,agentId:n,agentName:t.name,error:s instanceof Error?s.message:String(s),tokens:{input:0,output:0},duration:Date.now()-r};return this.emit("subagentComplete",o),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!1,duration_ms:o.duration,tokens_in:0,tokens_out:0,error:o.error}).catch(c=>me.debug(`SubagentStop hook error: ${c}`)),o}}async executeSubagent(t){let{agent:a,agentId:n,prompt:r,cwd:i,permissionMode:s,timeout:o,abortController:c}=t,l=Date.now();me.debug(`[${n}] Executing subagent: ${a.name} (${a.type})`);let u=process.env.AII_API_URL||this.config?.serverUrl,p=_i({...u?{baseUrl:u}:{},...this.config?.providerApiKey?{providerApiKey:this.config.providerApiKey}:{}}),d=NC({allowedTools:a.tools,disallowedTools:[...a.disallowedTools??[],"Task"],permissionMode:s}),m=this.resolveModel(a,t.model),f=Bs({autoApprove:!0,streamOutput:!1,showThinking:!1,maxIterations:a.maxIterations??this.config.maxIterations},d,p),h=oK({agentId:n,agentName:a.name,projectPath:i,model:m.model,provider:m.provider});cr.getInstance().initialize(i);let _=setTimeout(()=>{me.debug(`[${n}] Timeout reached (${o/1e3}s), aborting`),f.interrupt()},o),v=()=>{me.debug(`[${n}] External abort signal received`),f.interrupt()};c.signal.addEventListener("abort",v,{once:!0});let S=new cu,T=P=>S.onToken(P),C=(P,U)=>{S.onToolCall(P,U),this.emit("subagentToolUse",n)},A=P=>{let U=S.getToolCalls(),W=U[U.length-1]?.name??"unknown";S.onToolResult(W,{callId:P.callId,success:P.success,output:P.output,error:P.error})},R=()=>{this.emit("subagentTokens",n,{input:h.stats.tokensIn,output:h.stats.tokensOut})};f.on("token",T),f.on("toolCall",C),f.on("toolResult",A),f.on("iterationUsage",R);let L=new gh(n,a.name,t.sessionId,r);try{await f.run(r,h);let P=Date.now()-l,U={input:h.stats.tokensIn,output:h.stats.tokensOut},G=S.getResponse(),W=new hh,K=a.compressionLevel??Ao.compressionLevel,F=W.compress(G,K);try{await L.save({messages:h.messages,rawOutput:G,compressedOutput:F,success:!0,duration:P,tokens:U,iterations:h.stats.totalTurns,model:m.model,provider:m.provider})}catch(ee){me.debug(`[${n}] Failed to save transcript: ${ee}`)}return me.debug(`[${n}] Subagent completed: ${P}ms, ${U.input}+${U.output} tokens, ${G.length} \u2192 ${F.length} chars (${K})`),{success:!0,agentId:n,agentName:a.name,output:F,tokens:U,duration:P,iterations:h.stats.totalTurns}}catch(P){let U=Date.now()-l,G=c.signal.aborted,K=!G&&U>=o?`Subagent timed out after ${o/1e3}s`:G?"Subagent was cancelled":P instanceof Error?P.message:String(P);try{await L.save({messages:h.messages,rawOutput:S.getResponse(),compressedOutput:"",success:!1,duration:U,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},model:m.model,provider:m.provider,error:K})}catch(F){me.debug(`[${n}] Failed to save error transcript: ${F}`)}return me.debug(`[${n}] Subagent failed: ${K}`),{success:!1,agentId:n,agentName:a.name,error:K,output:S.getResponse()||void 0,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},duration:U}}finally{clearTimeout(_),c.signal.removeEventListener("abort",v),f.removeListener("token",T),f.removeListener("toolCall",C),f.removeListener("toolResult",A),f.removeListener("iterationUsage",R),f.disconnect()}}resolveModel(t,a){if(a)return this.parseModelString(a);if(t.model)return this.parseModelString(t.model);if(t.modelTier){let i=this.config?.provider??"anthropic",s=new fh;s.initialize(i);let o=s.resolveForSubagent(t.type,t.modelTier);return{provider:this.inferProvider(o),model:o}}let n=this.config?.provider??"anthropic";return{provider:n,model:n==="anthropic"?"claude-sonnet-4":n==="deepseek"?"deepseek-chat":n==="openai"?"gpt-4o":n==="google"?"gemini-2.5-flash":"claude-sonnet-4"}}parseModelString(t){if(t.includes("/")){let[a,...n]=t.split("/");return{provider:a,model:n.join("/")}}return{provider:this.inferProvider(t),model:t}}inferProvider(t){return t.startsWith("claude")?"anthropic":t.startsWith("gpt")||t.startsWith("o1")||t.startsWith("o3")?"openai":t.startsWith("gemini")?"google":t.startsWith("deepseek")?"deepseek":"anthropic"}cancel(t){let a=this.activeAgents.get(t);return a?(me.debug(`Cancelling subagent: ${t}`),a.abortController.abort(),this.activeAgents.delete(t),!0):!1}cancelAll(){me.debug(`Cancelling all ${this.activeAgents.size} active subagents`);for(let[t,a]of this.activeAgents)a.abortController.abort(),this.activeAgents.delete(t)}getActiveAgents(){return Array.from(this.activeAgents.values()).map(t=>({agentId:t.agentId,agentName:t.agentName,startedAt:t.startedAt}))}async waitFor(t){let a=this.activeAgents.get(t);if(a)return a.promise}generateAgentId(){let t=Date.now().toString(36),a=Math.random().toString(36).slice(2,9);return`agent_${t}_${a}`}reload(){this.initialized&&(this.customAgents.clear(),this.discoverCustomAgents(),me.debug("Reloaded custom agent definitions"))}getConfig(){return this.config}formatSummaryForDisplay(){let t=[];t.push("\u{1F916} Available Subagents:"),t.push("");let a=this.listAgents();if(a.length===0)return t.push(" No subagents configured."),t.join(`
|
|
871
|
+
`)&&n.log(""),m&&n.log(""),this.loopMode?n.deactivateForCompaction():n.deactivate(),process.stdout.write("\r"),process.stdin.pause();let Fe=bi.getInstance(),ft={session_id:a.id,cwd:a.projectPath,transcript_path:"",exit_reason:"completed"},Dt=await Fe.fire("Stop",ft);if(Dt.decision==="block"){let Ue=Dt.reason||"Stop hook requested continuation";console.log(La.dim(`[Hook] Stop blocked: ${Ue}`))}this.setState("complete")}catch(J){if(ve(),K(),ee(),this.stallDetected)throw this.stallDetected=!1,n.deactivateForCompaction(),process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),{name:"StallTimeout",message:`No response for ${Math.round(this.config.stallTimeoutMs/1e3)} seconds`};let ce=J.message??"",fe=ce.includes("WebSocket disconnected unexpectedly")||ce.includes("ECONNRESET")||ce.includes("EPIPE")||ce.includes("ETIMEDOUT")||ce.includes("ECONNREFUSED")||ce.includes("socket hang up")||ce.includes("WebSocket was closed")||ce.includes("WebSocket error")&&!this.interrupted,Fe=J.retryable===!0||fe;throw this.pauseRequested||Fe?n.deactivateForCompaction():n.deactivate(),J.name==="AgentInterrupt"||this.interrupted?(process.stdout.write("\r"),this.setState("error"),{name:"AgentInterrupt",message:"Agent interrupted"}):(process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),Fe?{name:"AbnormalDisconnect",message:ce}:J)}}disconnect(){this.client.disconnect()}}});function oK(e){let t=new Date;return{id:`subagent_${e.agentId}`,projectPath:e.projectPath,createdAt:t,updatedAt:t,messages:[],model:e.model,provider:e.provider,permissionCache:new Map,fileChanges:[],stats:{startTime:Date.now(),totalTurns:0,tokensIn:0,tokensOut:0,totalCost:0,toolCalls:0,filesModified:0},mode:e.mode??"auto"}}var cK=le(()=>{"use strict"});var cu,Qv=le(()=>{"use strict";cu=class{tokens=[];toolCalls=[];toolResults=[];onToken(t){this.tokens.push(t)}onToolCall(t,a){this.toolCalls.push({name:t,args:a,timestamp:Date.now()})}onToolResult(t,a){this.toolResults.push({name:t,result:a,timestamp:Date.now()})}getResponse(){return this.tokens.join("")}getToolCalls(){return[...this.toolCalls]}getToolResults(){return[...this.toolResults]}getToolSummary(){return this.toolCalls.length===0?"":`Tools used: ${this.toolCalls.map(a=>{let n=this.toolResults.find(i=>i.name===a.name);return`${n?n.result.success?"\u2713":"\u2717":"\u2026"} ${a.name}`}).join(", ")}`}hasContent(){return this.tokens.length>0||this.toolCalls.length>0}flush(){this.tokens=[],this.toolCalls=[],this.toolResults=[]}}});import{EventEmitter as yIe}from"events";var $a,yh=le(()=>{"use strict";xw();nn();Cw();mO();Yl();MC();cK();Qv();wC();TC();fb();Kl();DC();nA();$a=class e extends yIe{static instance=null;config=null;builtinAgents=new Map;customAgents=new Map;activeAgents=new Map;initialized=!1;constructor(){super()}static getInstance(){return e.instance||(e.instance=new e),e.instance}static reset(){e.instance&&(e.instance.cancelAll(),e.instance.removeAllListeners()),e.instance=null}initialize(t){this.config={maxConcurrent:t.maxConcurrent??Ao.maxConcurrent,maxIterations:t.maxIterations??Ao.maxIterations,timeout:t.timeout??Ao.timeout,projectPath:t.projectPath,modelRouting:t.modelRouting,serverUrl:t.serverUrl,providerApiKey:t.providerApiKey,provider:t.provider},this.registerBuiltinAgents(),this.discoverCustomAgents(),this.initialized=!0,me.debug(`SubagentManager initialized with ${this.builtinAgents.size} built-in agents`)}isInitialized(){return this.initialized}registerBuiltinAgents(){this.builtinAgents.set("explore",{name:"explore",description:"Fast codebase exploration and file discovery",type:"explore",systemPrompt:Hf("explore")??"",tools:["Glob","Grep","Read","LS"],modelTier:"cheap",maxIterations:30,compressionLevel:"medium",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("plan",{name:"plan",description:"Software architecture and implementation planning",type:"plan",systemPrompt:Hf("plan")??"",tools:["Glob","Grep","Read","LS","WebSearch","WebFetch"],modelTier:"standard",maxIterations:50,compressionLevel:"low",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("review",{name:"review",description:"Code review and quality analysis",type:"review",systemPrompt:Hf("review")??"",tools:["Glob","Grep","Read","LS","Bash"],disallowedTools:["Write","Edit"],modelTier:"cheap",maxIterations:40,compressionLevel:"medium",permissionMode:"dontAsk",isBuiltin:!0}),me.debug(`Registered ${this.builtinAgents.size} built-in agents`)}discoverCustomAgents(){if(this.config?.projectPath)try{let t=AC(this.config.projectPath);for(let a of t)this.customAgents.set(a.name,a);t.length>0&&me.debug(`Discovered ${t.length} custom agents`)}catch(t){me.debug(`Custom agent discovery failed: ${t}`)}}getAgent(t){return this.customAgents.get(t)??this.builtinAgents.get(t)}listAgents(){let t=[];for(let a of this.builtinAgents.values())t.push(a);for(let a of this.customAgents.values()){let n=t.findIndex(r=>r.name===a.name);n>=0?t[n]=a:t.push(a)}return t}getActiveCount(){return this.activeAgents.size}isAtConcurrencyLimit(){let t=this.config?.maxConcurrent??Ao.maxConcurrent;return this.activeAgents.size>=t}async spawn(t){if(!this.initialized||!this.config)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:"SubagentManager not initialized",tokens:{input:0,output:0},duration:0};let a=this.getAgent(t.name);if(!a)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Unknown subagent: ${t.name}`,tokens:{input:0,output:0},duration:0};if(this.isAtConcurrencyLimit())return this.emit("concurrencyLimitReached",this.activeAgents.size,this.config.maxConcurrent),{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Concurrency limit reached (${this.config.maxConcurrent} agents)`,tokens:{input:0,output:0},duration:0};let n=this.generateAgentId(),r=Date.now();me.debug(`Spawning subagent: ${t.name} (${n})`),this.emit("subagentStart",n,t.name,t.prompt);let i=bi.getInstance();i.fire("SubagentStart",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,prompt:t.prompt,model:a.model??a.modelTier??"default"}).catch(s=>me.debug(`SubagentStart hook error: ${s}`));try{let s=t.options?.runInBackground?B1.permissionMode:a.permissionMode??Ao.permissionMode,o=t.options?.timeout??(t.options?.runInBackground?B1.timeout:this.config.timeout),c=new AbortController,l=this.executeSubagent({agent:a,agentId:n,prompt:t.prompt,sessionId:t.sessionId,cwd:t.cwd,permissionMode:s,timeout:o,model:t.options?.model,abortController:c});this.activeAgents.set(n,{agentId:n,agentName:t.name,promise:l,startedAt:new Date,abortController:c});let u=await l;return this.activeAgents.delete(n),u.duration=Date.now()-r,this.emit("subagentComplete",u),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!0,duration_ms:u.duration,tokens_in:u.tokens?.input??0,tokens_out:u.tokens?.output??0}).catch(p=>me.debug(`SubagentStop hook error: ${p}`)),u}catch(s){this.activeAgents.delete(n);let o={success:!1,agentId:n,agentName:t.name,error:s instanceof Error?s.message:String(s),tokens:{input:0,output:0},duration:Date.now()-r};return this.emit("subagentComplete",o),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!1,duration_ms:o.duration,tokens_in:0,tokens_out:0,error:o.error}).catch(c=>me.debug(`SubagentStop hook error: ${c}`)),o}}async executeSubagent(t){let{agent:a,agentId:n,prompt:r,cwd:i,permissionMode:s,timeout:o,abortController:c}=t,l=Date.now();me.debug(`[${n}] Executing subagent: ${a.name} (${a.type})`);let u=process.env.AII_API_URL||this.config?.serverUrl,p=_i({...u?{baseUrl:u}:{},...this.config?.providerApiKey?{providerApiKey:this.config.providerApiKey}:{}}),d=NC({allowedTools:a.tools,disallowedTools:[...a.disallowedTools??[],"Task"],permissionMode:s}),m=this.resolveModel(a,t.model),f=Bs({autoApprove:!0,streamOutput:!1,showThinking:!1,maxIterations:a.maxIterations??this.config.maxIterations,excludeTaskTool:!0},d,p),h=oK({agentId:n,agentName:a.name,projectPath:i,model:m.model,provider:m.provider});cr.getInstance().initialize(i);let _=setTimeout(()=>{me.debug(`[${n}] Timeout reached (${o/1e3}s), aborting`),f.interrupt()},o),v=()=>{me.debug(`[${n}] External abort signal received`),f.interrupt()};c.signal.addEventListener("abort",v,{once:!0});let S=new cu,T=P=>S.onToken(P),C=(P,U)=>{S.onToolCall(P,U),this.emit("subagentToolUse",n)},A=P=>{let U=S.getToolCalls(),W=U[U.length-1]?.name??"unknown";S.onToolResult(W,{callId:P.callId,success:P.success,output:P.output,error:P.error})},R=()=>{this.emit("subagentTokens",n,{input:h.stats.tokensIn,output:h.stats.tokensOut})};f.on("token",T),f.on("toolCall",C),f.on("toolResult",A),f.on("iterationUsage",R);let L=new gh(n,a.name,t.sessionId,r);try{await f.run(r,h);let P=Date.now()-l,U={input:h.stats.tokensIn,output:h.stats.tokensOut},G=S.getResponse(),W=new hh,K=a.compressionLevel??Ao.compressionLevel,F=W.compress(G,K);try{await L.save({messages:h.messages,rawOutput:G,compressedOutput:F,success:!0,duration:P,tokens:U,iterations:h.stats.totalTurns,model:m.model,provider:m.provider})}catch(ee){me.debug(`[${n}] Failed to save transcript: ${ee}`)}return me.debug(`[${n}] Subagent completed: ${P}ms, ${U.input}+${U.output} tokens, ${G.length} \u2192 ${F.length} chars (${K})`),{success:!0,agentId:n,agentName:a.name,output:F,tokens:U,duration:P,iterations:h.stats.totalTurns}}catch(P){let U=Date.now()-l,G=c.signal.aborted,K=!G&&U>=o?`Subagent timed out after ${o/1e3}s`:G?"Subagent was cancelled":P instanceof Error?P.message:String(P);try{await L.save({messages:h.messages,rawOutput:S.getResponse(),compressedOutput:"",success:!1,duration:U,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},model:m.model,provider:m.provider,error:K})}catch(F){me.debug(`[${n}] Failed to save error transcript: ${F}`)}return me.debug(`[${n}] Subagent failed: ${K}`),{success:!1,agentId:n,agentName:a.name,error:K,output:S.getResponse()||void 0,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},duration:U}}finally{clearTimeout(_),c.signal.removeEventListener("abort",v),f.removeListener("token",T),f.removeListener("toolCall",C),f.removeListener("toolResult",A),f.removeListener("iterationUsage",R),f.disconnect()}}resolveModel(t,a){if(a)return this.parseModelString(a);if(t.model)return this.parseModelString(t.model);if(t.modelTier){let i=this.config?.provider??"anthropic",s=new fh;s.initialize(i);let o=s.resolveForSubagent(t.type,t.modelTier);return{provider:this.inferProvider(o),model:o}}let n=this.config?.provider??"anthropic";return{provider:n,model:n==="anthropic"?"claude-sonnet-4":n==="deepseek"?"deepseek-chat":n==="openai"?"gpt-4o":n==="google"?"gemini-2.5-flash":"claude-sonnet-4"}}parseModelString(t){if(t.includes("/")){let[a,...n]=t.split("/");return{provider:a,model:n.join("/")}}return{provider:this.inferProvider(t),model:t}}inferProvider(t){return t.startsWith("claude")?"anthropic":t.startsWith("gpt")||t.startsWith("o1")||t.startsWith("o3")?"openai":t.startsWith("gemini")?"google":t.startsWith("deepseek")?"deepseek":"anthropic"}cancel(t){let a=this.activeAgents.get(t);return a?(me.debug(`Cancelling subagent: ${t}`),a.abortController.abort(),this.activeAgents.delete(t),!0):!1}cancelAll(){me.debug(`Cancelling all ${this.activeAgents.size} active subagents`);for(let[t,a]of this.activeAgents)a.abortController.abort(),this.activeAgents.delete(t)}getActiveAgents(){return Array.from(this.activeAgents.values()).map(t=>({agentId:t.agentId,agentName:t.agentName,startedAt:t.startedAt}))}async waitFor(t){let a=this.activeAgents.get(t);if(a)return a.promise}generateAgentId(){let t=Date.now().toString(36),a=Math.random().toString(36).slice(2,9);return`agent_${t}_${a}`}reload(){this.initialized&&(this.customAgents.clear(),this.discoverCustomAgents(),me.debug("Reloaded custom agent definitions"))}getConfig(){return this.config}formatSummaryForDisplay(){let t=[];t.push("\u{1F916} Available Subagents:"),t.push("");let a=this.listAgents();if(a.length===0)return t.push(" No subagents configured."),t.join(`
|
|
872
872
|
`);let n=a.filter(i=>i.isBuiltin),r=a.filter(i=>!i.isBuiltin);if(n.length>0){t.push(" Built-in:");for(let i of n){let s=i.modelTier??"preferred";t.push(` \u2022 ${i.name} (${s}) - ${i.description}`)}t.push("")}if(r.length>0){t.push(" Custom:");for(let i of r){let s=i.modelTier??i.model??"preferred";t.push(` \u2022 ${i.name} (${s}) - ${i.description}`)}t.push("")}if(this.activeAgents.size>0){t.push(` Active: ${this.activeAgents.size}/${this.config?.maxConcurrent??Ao.maxConcurrent}`);for(let i of this.activeAgents.values()){let s=Math.round((Date.now()-i.startedAt.getTime())/1e3);t.push(` \u2022 ${i.agentName} (${i.agentId}) - ${s}s`)}}return t.join(`
|
|
873
873
|
`)}}});function bIe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Kv(){let e=Ro(),{nodes:t}=e;if(t.length===0)return"";let a=[];a.push(` ${g.red("\u25CF")} ${t.length} agent${t.length!==1?"s":""} finished`);let n=i=>i.charAt(0).toUpperCase()+i.slice(1),r=" \xB7 ";return t.forEach((i,s)=>{let o=s===t.length-1,c=o?"\u2514\u2500":"\u251C\u2500",l=o?" ":"\u2502 ",u=i.tokens.input+i.tokens.output,p=[`${i.toolUses} tool use${i.toolUses!==1?"s":""}`];u>0&&p.push(`${bIe(u)} tokens`);let d=i.prompt.length>35?i.prompt.slice(0,32)+"...":i.prompt;a.push(g.dim(` ${c} `)+g.bold(n(i.agentName))+g.dim(" (")+d+g.dim(")")+g.dim(`${r}${p.join(r)}`));let m=i.status==="done"?"green":i.status==="failed"?"red":"yellow",f=i.status==="done"?"Done":i.status==="failed"?"Failed":"Timeout";a.push(g.dim(` ${l}\u2514 `)+g[m](f))}),e.clear(),a.join(`
|
|
874
874
|
`)}function Xv(){if(hO)return;let e=$a.getInstance(),t=Ro();e.on("subagentStart",(a,n,r)=>{t.addNode(a,n,r)}),e.on("subagentToolUse",a=>{t.updateNodeToolUses(a)}),e.on("subagentTokens",(a,n)=>{t.updateNodeTokens(a,n)}),e.on("subagentComplete",a=>{t.completeNode(a.agentId,{success:a.success,duration:a.duration,tokens:a.tokens,error:a.error})}),hO=!0}function lK(){hO=!1}var hO,Vv=le(()=>{"use strict";yh();Pp();ma();hO=!1});var pK={};Sr(pK,{getUIStore:()=>og,useUIStore:()=>Wo});import{create as vIe}from"zustand";var uK,Wo,og,gO=le(()=>{"use strict";uK={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:"",projectPath:process.cwd(),branch:void 0,toolsCount:0,mcpServersCount:0,contextFilesCount:0,skillsCount:0,sessionStartTime:Date.now(),agentExecMs:0,agentTurnStartTime:null,renderEpoch:0,loopMode:!1},Wo=vIe(e=>({...uK,setMode:t=>e({mode:t}),setAgentMode:t=>e({agentMode:t}),setStatus:t=>e({status:t}),setThinking:t=>e({isThinking:t}),setStreaming:t=>e(a=>{if(t&&!a.agentTurnStartTime)return{isStreaming:t,agentTurnStartTime:Date.now()};if(!t&&a.agentTurnStartTime){let n=Date.now()-a.agentTurnStartTime;return{isStreaming:t,agentExecMs:a.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:t}}),incrementIteration:()=>e(t=>({currentIteration:t.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:t=>e(a=>({iterationTokens:a.iterationTokens+t})),setIterationTokens:t=>e({iterationTokens:t}),updateContext:(t,a)=>{let n=a>0?Math.round(t/a*100):0,r=n>=90?"critical":n>=70?"warning":"normal";e({contextTokens:t,contextLimit:a,contextPercent:n,contextLevel:r})},updateSession:t=>e(t),updateResources:t=>e(t),setLoopMode:t=>e({loopMode:t}),incrementRenderEpoch:()=>e(t=>({renderEpoch:t.renderEpoch+1})),reset:()=>e(uK)})),og=Wo.getState});var fK={};Sr(fK,{getInputStore:()=>mK,useInputStore:()=>cg});import{create as EIe}from"zustand";var dK,SIe,xIe,cg,mK,_O=le(()=>{"use strict";dK={lines:[""],cursorLine:0,cursorCol:0,typeAheadBuffer:"",isTypeAheadActive:!1,history:[],historyIndex:-1,undoStack:[],redoStack:[]},SIe=100,xIe=50,cg=EIe((e,t)=>({...dK,insertChar:a=>{t().saveSnapshot(),e(r=>{let i=[...r.lines],s=i[r.cursorLine];return i[r.cursorLine]=s.slice(0,r.cursorCol)+a+s.slice(r.cursorCol),{lines:i,cursorCol:r.cursorCol+a.length,redoStack:[]}})},deleteChar:()=>{let a=t();a.cursorCol===0&&a.cursorLine===0||(a.saveSnapshot(),e(n=>{let r=[...n.lines];if(n.cursorCol>0){let i=r[n.cursorLine];return r[n.cursorLine]=i.slice(0,n.cursorCol-1)+i.slice(n.cursorCol),{lines:r,cursorCol:n.cursorCol-1,redoStack:[]}}else if(n.cursorLine>0){let i=r[n.cursorLine-1],s=r[n.cursorLine];return r[n.cursorLine-1]=i+s,r.splice(n.cursorLine,1),{lines:r,cursorLine:n.cursorLine-1,cursorCol:i.length,redoStack:[]}}return n}))},newLine:()=>{t().saveSnapshot(),e(n=>{let r=[...n.lines],i=r[n.cursorLine],s=i.slice(0,n.cursorCol),o=i.slice(n.cursorCol);return r[n.cursorLine]=s,r.splice(n.cursorLine+1,0,o),{lines:r,cursorLine:n.cursorLine+1,cursorCol:0,redoStack:[]}})},moveCursor:a=>{e(n=>{switch(a){case"left":if(n.cursorCol>0)return{cursorCol:n.cursorCol-1};if(n.cursorLine>0)return{cursorLine:n.cursorLine-1,cursorCol:n.lines[n.cursorLine-1].length};break;case"right":if(n.cursorCol<n.lines[n.cursorLine].length)return{cursorCol:n.cursorCol+1};if(n.cursorLine<n.lines.length-1)return{cursorLine:n.cursorLine+1,cursorCol:0};break;case"up":if(n.cursorLine>0){let r=n.cursorLine-1,i=Math.min(n.cursorCol,n.lines[r].length);return{cursorLine:r,cursorCol:i}}break;case"down":if(n.cursorLine<n.lines.length-1){let r=n.cursorLine+1,i=Math.min(n.cursorCol,n.lines[r].length);return{cursorLine:r,cursorCol:i}}break}return n})},setText:a=>{let n=a.split(`
|
|
@@ -1180,7 +1180,7 @@ caused by: `+aa.fullStack(t):e.stack};aa.errorFromList=function(e){return kn.arr
|
|
|
1180
1180
|
${e}
|
|
1181
1181
|
</context>
|
|
1182
1182
|
|
|
1183
|
-
${t}`:t}var lde="0.10.7";function ude(){let e=new dP;return e.name("aii").description("AI-powered CLI assistant").version(lde,"-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").option("--provider <provider>","Override LLM provider (e.g., ollama, anthropic, openai)").option("--host <host>","API server host:port").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").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("-q, --quiet","Quiet mode - minimal output").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("-h, --help","Show help"),e.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").action(()=>{}),e.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),e.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),e.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),e.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),e.command("doctor").description("System health check").action(()=>{}),e.command("chat").description("Interactive chat mode").action(()=>{}),e.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),e.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),e.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),e.command("version").description("Show version number").action(()=>{}),e}async function fP(e){let t=ude();t.exitOverride(),t.configureOutput({writeErr:()=>{}});let a="query",n,r=[];try{t.parse(e),r=t.args;let l=t.args[0];l&&["config","mcp","prompt","stats","history","doctor","chat","run","help","version","agent","loop","telegram"].includes(l)&&(a=l,n=t.args[1],r=t.args.slice(2))}catch(l){l instanceof pP&&(l.code==="commander.version"||l.code==="commander.helpDisplayed")&&process.exit(0),r=e.slice(2)}let i=t.opts(),s={clean:i.clean??!1,standard:i.standard??!1,thinking:i.thinking??!1,verbose:i.verbose??!1,debug:i.debug??!1,model:i.model,provider:i.provider,host:i.host,yes:i.yes??!1,offline:i.offline??!1,interactive:i.interactive??!1,continueChat:i.continueChat,newChat:i.newChat??!1,auto:i.auto??!1,quiet:i.quiet??!1,noColors:!i.colors,noEmojis:!i.emojis,noAnimations:!i.animations,noStreaming:!i.streaming,showTokens:i.showTokens??!1,showCost:i.showCost??!1,help:i.help??!1,version:i.version??!1},o;Ux()&&(o=await mP()),(a==="chat"||s.interactive)&&(a="agent"),a==="query"&&!r.length&&!o&&(a="agent");let c;if(a==="query"&&r.length>0)c=r.join(" ");else if(a==="agent"){let l=[];n&&l.push(n),r.length>0&&l.push(...r),l.length>0&&(c=l.join(" "))}return{command:a,subcommand:n,args:r,flags:s,stdinContent:o,query:c}}var Zt;(function(e){e[e.LOCAL=1]="LOCAL",e[e.SERVER=2]="SERVER"})(Zt||(Zt={}));var zx={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function Ku(e,t,a,n){return e.clean?"clean":e.thinking||e.verbose?"thinking":e.standard?"standard":t&&a?.[t]?a[t]:t&&zx[t]?zx[t]:n||zx._default}var hP={config:Zt.LOCAL,help:Zt.LOCAL,version:Zt.LOCAL,doctor:Zt.LOCAL,mcp:Zt.LOCAL,prompt:Zt.LOCAL,stats:Zt.LOCAL,history:Zt.LOCAL,query:Zt.SERVER,chat:Zt.SERVER,run:Zt.SERVER,agent:Zt.SERVER,loop:Zt.SERVER,telegram:Zt.SERVER};function qx(e){let t=hP[e.command]??Zt.SERVER;switch(e.command){case"config":return pde(e);case"mcp":return dde(e);case"prompt":return mde(e);case"stats":return fde(e);case"history":return hde(e);case"doctor":return{tier:Zt.LOCAL,handler:"doctor",params:{}};case"chat":return{tier:Zt.SERVER,handler:"chat",params:{continueChat:e.flags.continueChat}};case"run":return _de(e);case"agent":return{tier:Zt.SERVER,handler:"agent",params:{interactive:!e.query}};case"loop":return{tier:Zt.SERVER,handler:"loop",params:{}};case"telegram":return{tier:Zt.SERVER,handler:"telegram",params:{action:e.subcommand??e.args[0]??"start"}};case"help":return{tier:Zt.LOCAL,handler:"help",params:{command:e.subcommand}};case"version":return{tier:Zt.LOCAL,handler:"version",params:{}};case"query":default:return{tier:t,handler:"query",params:{query:e.query,stdinContent:e.stdinContent}}}}function pde(e){let t=e.subcommand??e.args[0]??"show";return{tier:Zt.LOCAL,handler:`config:${t}`,params:{key:e.args[0],value:e.args[1]}}}function dde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Zt.LOCAL,handler:`mcp:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function mde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Zt.LOCAL,handler:`prompt:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function fde(e){let t=e.subcommand??e.args[0];return{tier:Zt.LOCAL,handler:t?`stats:${t}`:"stats",params:{}}}function hde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Zt.LOCAL,handler:`history:${t}`,params:{query:e.args[0],id:e.args[0]}}}var gde=new Set(["--model","--provider","--host","--continue-chat","-c"]);function _de(e){let t=[];e.subcommand&&t.push(e.subcommand);let a=[];for(let r=0;r<e.args.length;r++){let i=e.args[r];if(gde.has(i)){r++;continue}i.startsWith("-")||a.push(i)}t.push(...a);let n=t.join(" ");return{tier:Zt.SERVER,handler:"run",params:{operation:n}}}Nl();ma();import{createInterface as QRe}from"readline";import{spawn as XRe}from"child_process";XT();Gi();nn();var Lye={timeout:12e4,retries:3,retryDelay:1e3},gi=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(t){this.options={...Lye,...t}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:t}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new t,await this.mcpExecutor.initialize(),we(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(t,a){let n=null;for(let r=0;r<this.options.retries;r++)try{return await this.executeWithRetry(t,a)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),we(`Attempt ${r+1} failed: ${n.message}`),n instanceof Af||n.message.includes("Authentication"))throw n;if(r<this.options.retries-1){let s=this.options.retryDelay*Math.pow(2,r);we(`Retrying in ${s}ms...`),await this.sleep(s)}}throw n??new Cf("Max retries exceeded")}async executeWithRetry(t,a){return new Promise((n,r)=>{let i=this.buildWebSocketUrl();we(`Connecting to ${i}`);try{this.ws=new Ts(i)}catch{let c=new URL(this.options.url);r(new Tf(c.hostname||"localhost",c.port||"26169"));return}let s=!1,o=null;this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new wf("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{we("WebSocket connected, sending request"),this.ws?.send(JSON.stringify(t))}),this.ws.on("message",c=>{this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new wf("WebSocket activity",this.options.timeout)))});try{let l=JSON.parse(c.toString());this.handleMessage(l,a,u=>{s=!0,o=u,this.cleanup(),n(u)},u=>{s=!0,this.cleanup(),r(u)})}catch(l){let u=c?String(c):"<undefined>";we(`Failed to parse message: ${u}`),s||(s=!0,this.cleanup(),r(new Error(`Failed to parse server message: ${l.message}`)))}}),this.ws.on("error",c=>{if(we(`WebSocket error: ${c.message}`),!s){s=!0,this.cleanup();let l=new URL(this.options.url);r(new Tf(l.hostname||"localhost",l.port||"26169"))}}),this.ws.on("close",(c,l)=>{we(`WebSocket closed: ${c} ${l.toString()}`),s||(s=!0,this.cleanup(),o?n(o):r(new Cf(`Connection closed unexpectedly: ${c}`)))})})}handleMessage(t,a,n,r){switch(t.type){case"token":{let i=t;a?.onToken?.(i.data);break}case"complete":{let i=t,s=i.metadata||{},o=this.convertServerMetadata(i),c={result:i.result,metadata:o,clientSideExecution:s.client_side_execution===!0,userRequest:s.user_request};a?.onComplete?.(c),n(c);break}case"error":{let i=t,s=new Af(i.code,i.message);a?.onError?.(s),r(s);break}case"mcp_query_tools":{we("Received mcp_query_tools request"),this.handleMCPQueryTools(t);break}case"mcp_tool_request":{we("Received mcp_tool_request"),this.handleMCPToolRequest(t);break}default:we(`Unknown message type: ${t.type}`)}}convertServerMetadata(t){let a=t.metadata||{},n,r;a.tokens?(n=a.tokens.input,r=a.tokens.output):(n=a.input_tokens,r=a.output_tokens);let i=a.cost??a.cost_usd,s=a.execution_time??a.total_time;return{function_name:t.function_name,tokens_in:n,tokens_out:r,cost:typeof i=="number"?i:void 0,model:typeof a.model=="string"?a.model:void 0,execution_time:typeof s=="number"?s:void 0}}buildWebSocketUrl(){let t=new URL(this.options.url);return`${t.protocol==="https:"?"wss:":"ws:"}//${t.host}/ws/execute`}async handleMCPQueryTools(t){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let a=await this.mcpExecutor.handleQueryTools(t);this.ws?.send(JSON.stringify(a))}catch(a){let n=a instanceof Error?a.message:String(a),r=a instanceof Error?a.stack:void 0;we(`Error handling mcp_query_tools: ${n}${r?`
|
|
1183
|
+
${t}`:t}var lde="0.10.8";function ude(){let e=new dP;return e.name("aii").description("AI-powered CLI assistant").version(lde,"-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").option("--provider <provider>","Override LLM provider (e.g., ollama, anthropic, openai)").option("--host <host>","API server host:port").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").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("-q, --quiet","Quiet mode - minimal output").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("-h, --help","Show help"),e.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").action(()=>{}),e.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),e.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),e.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),e.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),e.command("doctor").description("System health check").action(()=>{}),e.command("chat").description("Interactive chat mode").action(()=>{}),e.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),e.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),e.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),e.command("version").description("Show version number").action(()=>{}),e}async function fP(e){let t=ude();t.exitOverride(),t.configureOutput({writeErr:()=>{}});let a="query",n,r=[];try{t.parse(e),r=t.args;let l=t.args[0];l&&["config","mcp","prompt","stats","history","doctor","chat","run","help","version","agent","loop","telegram"].includes(l)&&(a=l,n=t.args[1],r=t.args.slice(2))}catch(l){l instanceof pP&&(l.code==="commander.version"||l.code==="commander.helpDisplayed")&&process.exit(0),r=e.slice(2)}let i=t.opts(),s={clean:i.clean??!1,standard:i.standard??!1,thinking:i.thinking??!1,verbose:i.verbose??!1,debug:i.debug??!1,model:i.model,provider:i.provider,host:i.host,yes:i.yes??!1,offline:i.offline??!1,interactive:i.interactive??!1,continueChat:i.continueChat,newChat:i.newChat??!1,auto:i.auto??!1,quiet:i.quiet??!1,noColors:!i.colors,noEmojis:!i.emojis,noAnimations:!i.animations,noStreaming:!i.streaming,showTokens:i.showTokens??!1,showCost:i.showCost??!1,help:i.help??!1,version:i.version??!1},o;Ux()&&(o=await mP()),(a==="chat"||s.interactive)&&(a="agent"),a==="query"&&!r.length&&!o&&(a="agent");let c;if(a==="query"&&r.length>0)c=r.join(" ");else if(a==="agent"){let l=[];n&&l.push(n),r.length>0&&l.push(...r),l.length>0&&(c=l.join(" "))}return{command:a,subcommand:n,args:r,flags:s,stdinContent:o,query:c}}var Zt;(function(e){e[e.LOCAL=1]="LOCAL",e[e.SERVER=2]="SERVER"})(Zt||(Zt={}));var zx={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function Ku(e,t,a,n){return e.clean?"clean":e.thinking||e.verbose?"thinking":e.standard?"standard":t&&a?.[t]?a[t]:t&&zx[t]?zx[t]:n||zx._default}var hP={config:Zt.LOCAL,help:Zt.LOCAL,version:Zt.LOCAL,doctor:Zt.LOCAL,mcp:Zt.LOCAL,prompt:Zt.LOCAL,stats:Zt.LOCAL,history:Zt.LOCAL,query:Zt.SERVER,chat:Zt.SERVER,run:Zt.SERVER,agent:Zt.SERVER,loop:Zt.SERVER,telegram:Zt.SERVER};function qx(e){let t=hP[e.command]??Zt.SERVER;switch(e.command){case"config":return pde(e);case"mcp":return dde(e);case"prompt":return mde(e);case"stats":return fde(e);case"history":return hde(e);case"doctor":return{tier:Zt.LOCAL,handler:"doctor",params:{}};case"chat":return{tier:Zt.SERVER,handler:"chat",params:{continueChat:e.flags.continueChat}};case"run":return _de(e);case"agent":return{tier:Zt.SERVER,handler:"agent",params:{interactive:!e.query}};case"loop":return{tier:Zt.SERVER,handler:"loop",params:{}};case"telegram":return{tier:Zt.SERVER,handler:"telegram",params:{action:e.subcommand??e.args[0]??"start"}};case"help":return{tier:Zt.LOCAL,handler:"help",params:{command:e.subcommand}};case"version":return{tier:Zt.LOCAL,handler:"version",params:{}};case"query":default:return{tier:t,handler:"query",params:{query:e.query,stdinContent:e.stdinContent}}}}function pde(e){let t=e.subcommand??e.args[0]??"show";return{tier:Zt.LOCAL,handler:`config:${t}`,params:{key:e.args[0],value:e.args[1]}}}function dde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Zt.LOCAL,handler:`mcp:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function mde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Zt.LOCAL,handler:`prompt:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function fde(e){let t=e.subcommand??e.args[0];return{tier:Zt.LOCAL,handler:t?`stats:${t}`:"stats",params:{}}}function hde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Zt.LOCAL,handler:`history:${t}`,params:{query:e.args[0],id:e.args[0]}}}var gde=new Set(["--model","--provider","--host","--continue-chat","-c"]);function _de(e){let t=[];e.subcommand&&t.push(e.subcommand);let a=[];for(let r=0;r<e.args.length;r++){let i=e.args[r];if(gde.has(i)){r++;continue}i.startsWith("-")||a.push(i)}t.push(...a);let n=t.join(" ");return{tier:Zt.SERVER,handler:"run",params:{operation:n}}}Nl();ma();import{createInterface as QRe}from"readline";import{spawn as XRe}from"child_process";XT();Gi();nn();var Lye={timeout:12e4,retries:3,retryDelay:1e3},gi=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(t){this.options={...Lye,...t}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:t}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new t,await this.mcpExecutor.initialize(),we(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(t,a){let n=null;for(let r=0;r<this.options.retries;r++)try{return await this.executeWithRetry(t,a)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),we(`Attempt ${r+1} failed: ${n.message}`),n instanceof Af||n.message.includes("Authentication"))throw n;if(r<this.options.retries-1){let s=this.options.retryDelay*Math.pow(2,r);we(`Retrying in ${s}ms...`),await this.sleep(s)}}throw n??new Cf("Max retries exceeded")}async executeWithRetry(t,a){return new Promise((n,r)=>{let i=this.buildWebSocketUrl();we(`Connecting to ${i}`);try{this.ws=new Ts(i)}catch{let c=new URL(this.options.url);r(new Tf(c.hostname||"localhost",c.port||"26169"));return}let s=!1,o=null;this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new wf("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{we("WebSocket connected, sending request"),this.ws?.send(JSON.stringify(t))}),this.ws.on("message",c=>{this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new wf("WebSocket activity",this.options.timeout)))});try{let l=JSON.parse(c.toString());this.handleMessage(l,a,u=>{s=!0,o=u,this.cleanup(),n(u)},u=>{s=!0,this.cleanup(),r(u)})}catch(l){let u=c?String(c):"<undefined>";we(`Failed to parse message: ${u}`),s||(s=!0,this.cleanup(),r(new Error(`Failed to parse server message: ${l.message}`)))}}),this.ws.on("error",c=>{if(we(`WebSocket error: ${c.message}`),!s){s=!0,this.cleanup();let l=new URL(this.options.url);r(new Tf(l.hostname||"localhost",l.port||"26169"))}}),this.ws.on("close",(c,l)=>{we(`WebSocket closed: ${c} ${l.toString()}`),s||(s=!0,this.cleanup(),o?n(o):r(new Cf(`Connection closed unexpectedly: ${c}`)))})})}handleMessage(t,a,n,r){switch(t.type){case"token":{let i=t;a?.onToken?.(i.data);break}case"complete":{let i=t,s=i.metadata||{},o=this.convertServerMetadata(i),c={result:i.result,metadata:o,clientSideExecution:s.client_side_execution===!0,userRequest:s.user_request};a?.onComplete?.(c),n(c);break}case"error":{let i=t,s=new Af(i.code,i.message);a?.onError?.(s),r(s);break}case"mcp_query_tools":{we("Received mcp_query_tools request"),this.handleMCPQueryTools(t);break}case"mcp_tool_request":{we("Received mcp_tool_request"),this.handleMCPToolRequest(t);break}default:we(`Unknown message type: ${t.type}`)}}convertServerMetadata(t){let a=t.metadata||{},n,r;a.tokens?(n=a.tokens.input,r=a.tokens.output):(n=a.input_tokens,r=a.output_tokens);let i=a.cost??a.cost_usd,s=a.execution_time??a.total_time;return{function_name:t.function_name,tokens_in:n,tokens_out:r,cost:typeof i=="number"?i:void 0,model:typeof a.model=="string"?a.model:void 0,execution_time:typeof s=="number"?s:void 0}}buildWebSocketUrl(){let t=new URL(this.options.url);return`${t.protocol==="https:"?"wss:":"ws:"}//${t.host}/ws/execute`}async handleMCPQueryTools(t){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let a=await this.mcpExecutor.handleQueryTools(t);this.ws?.send(JSON.stringify(a))}catch(a){let n=a instanceof Error?a.message:String(a),r=a instanceof Error?a.stack:void 0;we(`Error handling mcp_query_tools: ${n}${r?`
|
|
1184
1184
|
${r}`:""}`),this.ws?.send(JSON.stringify({type:"mcp_query_tools_response",request_id:t.request_id||"unknown",success:!1,error:n,tools:[]}))}}async handleMCPToolRequest(t){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(gp(),hp));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let a=await this.mcpExecutor.handleToolExecution(t);this.ws?.send(JSON.stringify(a))}catch(a){we(`Error handling mcp_tool_request: ${a}`),this.ws?.send(JSON.stringify({type:"mcp_tool_response",request_id:t.request_id||"unknown",success:!1,error:String(a)}))}}resetActivityTimeout(t){this.activityTimeout&&clearTimeout(this.activityTimeout),this.activityTimeout=setTimeout(t,this.options.timeout)}cleanup(){if(this.activityTimeout&&(clearTimeout(this.activityTimeout),this.activityTimeout=null),this.ws){try{this.ws.close()}catch(t){we(`WebSocket close error: ${t instanceof Error?t.message:String(t)}`)}this.ws=null}}async shutdownMCP(){this.mcpExecutor&&(await this.mcpExecutor.shutdown(),this.mcpExecutor=null)}disconnect(){this.cleanup()}sleep(t){return new Promise(a=>setTimeout(a,t))}};ma();import P1 from"node:process";import O3 from"node:process";import R1 from"node:process";var Pye=(e,t,a,n)=>{if(a==="length"||a==="prototype"||a==="arguments"||a==="caller")return;let r=Object.getOwnPropertyDescriptor(e,a),i=Object.getOwnPropertyDescriptor(t,a);!Fye(r,i)&&n||Object.defineProperty(e,a,i)},Fye=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Bye=(e,t)=>{let a=Object.getPrototypeOf(t);a!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,a)},jye=(e,t)=>`/* Wrapped ${e}*/
|
|
1185
1185
|
${t}`,Uye=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),zye=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),qye=(e,t,a)=>{let n=a===""?"":`with ${a.trim()}() `,r=jye.bind(null,n,t.toString());Object.defineProperty(r,"name",zye);let{writable:i,enumerable:s,configurable:o}=Uye;Object.defineProperty(e,"toString",{value:r,writable:i,enumerable:s,configurable:o})};function aw(e,t,{ignoreNonConfigurable:a=!1}={}){let{name:n}=e;for(let r of Reflect.ownKeys(t))Pye(e,t,r,a);return Bye(e,t),qye(e,t,n),e}var D1=new WeakMap,T3=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let a,n=0,r=e.displayName||e.name||"<anonymous>",i=function(...s){if(D1.set(i,++n),n===1)a=e.apply(this,s),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return a};return aw(i,e),D1.set(i,n),i};T3.callCount=e=>{if(!D1.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return D1.get(e)};var w3=T3;var ql=[];ql.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ql.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ql.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var O1=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",nw=Symbol.for("signal-exit emitter"),rw=globalThis,$ye=Object.defineProperty.bind(Object),iw=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(rw[nw])return rw[nw];$ye(rw,nw,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,a){this.listeners[t].push(a)}removeListener(t,a){let n=this.listeners[t],r=n.indexOf(a);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(t,a,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let r=!1;for(let i of this.listeners[t])r=i(a,n)===!0||r;return t==="exit"&&(r=this.emit("afterExit",a,n)||r),r}},I1=class{},Gye=e=>({onExit(t,a){return e.onExit(t,a)},load(){return e.load()},unload(){return e.unload()}}),sw=class extends I1{onExit(){return()=>{}}load(){}unload(){}},ow=class extends I1{#s=cw.platform==="win32"?"SIGINT":"SIGHUP";#a=new iw;#e;#r;#d;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let a of ql)this.#t[a]=()=>{let n=this.#e.listeners(a),{count:r}=this.#a,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let s=this.#a.emit("exit",null,a),o=a==="SIGHUP"?this.#s:a;s||t.kill(t.pid,o)}};this.#d=t.reallyExit,this.#r=t.emit}onExit(t,a){if(!O1(this.#e))return()=>{};this.#i===!1&&this.load();let n=a?.alwaysLast?"afterExit":"exit";return this.#a.on(n,t),()=>{this.#a.removeListener(n,t),this.#a.listeners.exit.length===0&&this.#a.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#a.count+=1;for(let t of ql)try{let a=this.#t[t];a&&this.#e.on(t,a)}catch{}this.#e.emit=(t,...a)=>this.#m(t,...a),this.#e.reallyExit=t=>this.#n(t)}}unload(){this.#i&&(this.#i=!1,ql.forEach(t=>{let a=this.#t[t];if(!a)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,a)}catch{}}),this.#e.emit=this.#r,this.#e.reallyExit=this.#d,this.#a.count-=1)}#n(t){return O1(this.#e)?(this.#e.exitCode=t||0,this.#a.emit("exit",this.#e.exitCode,null),this.#d.call(this.#e,this.#e.exitCode)):0}#m(t,...a){let n=this.#r;if(t==="exit"&&O1(this.#e)){typeof a[0]=="number"&&(this.#e.exitCode=a[0]);let r=n.call(this.#e,t,...a);return this.#a.emit("exit",this.#e.exitCode,null),r}else return n.call(this.#e,t,...a)}},cw=globalThis.process,{onExit:C3,load:cQe,unload:lQe}=Gye(O1(cw)?new ow(cw):new sw);var A3=R1.stderr.isTTY?R1.stderr:R1.stdout.isTTY?R1.stdout:void 0,Hye=A3?w3(()=>{C3(()=>{A3.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},D3=Hye;var N1=!1,_p={};_p.show=(e=O3.stderr)=>{e.isTTY&&(N1=!1,e.write("\x1B[?25h"))};_p.hide=(e=O3.stderr)=>{e.isTTY&&(D3(),N1=!0,e.write("\x1B[?25l"))};_p.toggle=(e,t)=>{e!==void 0&&(N1=e),N1?_p.show(t):_p.hide(t)};var lw=_p;var qf=mn(uw(),1);ma();import Wi from"node:process";function pw(){return Wi.platform!=="win32"?Wi.env.TERM!=="linux":!!Wi.env.CI||!!Wi.env.WT_SESSION||!!Wi.env.TERMINUS_SUBLIME||Wi.env.ConEmuTask==="{cmd::Cmder}"||Wi.env.TERM_PROGRAM==="Terminus-Sublime"||Wi.env.TERM_PROGRAM==="vscode"||Wi.env.TERM==="xterm-256color"||Wi.env.TERM==="alacritty"||Wi.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Wye={info:g.blue("\u2139"),success:g.green("\u2714"),warning:g.yellow("\u26A0"),error:g.red("\u2716")},Kye={info:g.blue("i"),success:g.green("\u221A"),warning:g.yellow("\u203C"),error:g.red("\xD7")},Vye=pw()?Wye:Kye,zf=Vye;L1();var Qye=$l();function dw(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Qye,"")}L1();var Xye=$l();function mw(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Xye,"")}function M3(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function L3(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function P3(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Jye(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function F3(e,{ambiguousAsWide:t=!1}={}){return Jye(e),L3(e)||P3(e)||t&&M3(e)?2:1}var U3=mn(j3(),1),Zye=new Intl.Segmenter,e1e=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function fw(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:a=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=mw(e)),e.length===0)return 0;let r=0,i={ambiguousAsWide:!a};for(let{segment:s}of Zye.segment(e)){let o=s.codePointAt(0);if(!(o<=31||o>=127&&o<=159)&&!(o>=8203&&o<=8207||o===65279)&&!(o>=768&&o<=879||o>=6832&&o<=6911||o>=7616&&o<=7679||o>=8400&&o<=8447||o>=65056&&o<=65071)&&!(o>=55296&&o<=57343)&&!(o>=65024&&o<=65039)&&!e1e.test(s)){if((0,U3.default)().test(s)){r+=2;continue}r+=F3(o,i)}}return r}function hw({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import z3 from"node:process";function gw(){let{env:e}=z3,{TERM:t,TERM_PROGRAM:a}=e;return z3.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||a==="Terminus-Sublime"||a==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import ws from"node:process";var t1e=3,_w=class{#s=0;start(){this.#s++,this.#s===1&&this.#a()}stop(){if(this.#s<=0)throw new Error("`stop` called more times than `start`");this.#s--,this.#s===0&&this.#e()}#a(){ws.platform==="win32"||!ws.stdin.isTTY||(ws.stdin.setRawMode(!0),ws.stdin.on("data",this.#r),ws.stdin.resume())}#e(){ws.stdin.isTTY&&(ws.stdin.off("data",this.#r),ws.stdin.pause(),ws.stdin.setRawMode(!1))}#r(t){t[0]===t1e&&ws.emit("SIGINT")}},a1e=new _w,yw=a1e;var n1e=mn(uw(),1),bw=class{#s=0;#a=!1;#e=0;#r=-1;#d=0;#t;#i;#n;#m;#h;#l;#u;#p;#g;#o;#c;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:P1.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#h=this.#t.interval,this.#n=this.#t.stream,this.#l=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:hw({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,P1.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#s},set(a){this.#s=a}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#r}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#p}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#p=t,this.#f()}get interval(){return this.#h??this.#i.interval??100}get spinner(){return this.#i}set spinner(t){if(this.#r=-1,this.#h=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=t}else if(!gw())this.#i=qf.default.line;else if(t===void 0)this.#i=qf.default.dots;else if(t!=="default"&&qf.default[t])this.#i=qf.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(t=""){this.#g=t,this.#f()}get prefixText(){return this.#o}set prefixText(t=""){this.#o=t,this.#f()}get suffixText(){return this.#c}set suffixText(t=""){this.#c=t,this.#f()}get isSpinning(){return this.#m!==void 0}#_(t=this.#o,a=" "){return typeof t=="string"&&t!==""?t+a:typeof t=="function"?t()+a:""}#y(t=this.#c,a=" "){return typeof t=="string"&&t!==""?a+t:typeof t=="function"?a+t():""}#f(){let t=this.#n.columns??80,a=this.#_(this.#o,"-"),n=this.#y(this.#c,"-"),r=" ".repeat(this.#p)+a+"--"+this.#g+"--"+n;this.#e=0;for(let i of dw(r).split(`
|
|
1186
1186
|
`))this.#e+=Math.max(1,Math.ceil(fw(i,{countAnsiEscapeCodes:!0})/t))}get isEnabled(){return this.#l&&!this.#u}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=t}get isSilent(){return this.#u}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=t}frame(){let t=Date.now();(this.#r===-1||t-this.#d>=this.interval)&&(this.#r=++this.#r%this.#i.frames.length,this.#d=t);let{frames:a}=this.#i,n=a[this.#r];this.color&&(n=g[this.color](n));let r=typeof this.#o=="string"&&this.#o!==""?this.#o+" ":"",i=typeof this.text=="string"?" "+this.text:"",s=typeof this.#c=="string"&&this.#c!==""?" "+this.#c:"";return r+n+i+s}clear(){if(!this.#l||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let t=0;t<this.#s;t++)t>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#p||this.lastIndent!==this.#p)&&this.#n.cursorTo(this.#p),this.lastIndent=this.#p,this.#s=0,this}render(){return this.#u?this:(this.clear(),this.#n.write(this.frame()),this.#s=this.#e,this)}start(t){return t&&(this.text=t),this.#u?this:this.#l?this.isSpinning?this:(this.#t.hideCursor&&lw.hide(this.#n),this.#t.discardStdin&&P1.stdin.isTTY&&(this.#a=!0,yw.start()),this.render(),this.#m=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
|
|
@@ -1190,7 +1190,7 @@ ${t}`,Uye=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),zye=Obj
|
|
|
1190
1190
|
`)}formatExecutionSummary(t){let a=[];if(t.function_name&&a.push(`${this.emoji("\u{1F527} ")}${t.function_name}`),t.model&&a.push(`${this.emoji("\u{1F916} ")}${t.model}`),t.tokens_in!==void 0||t.tokens_out!==void 0){let r=t.tokens_in??0,i=t.tokens_out??0;a.push(`${this.emoji("\u{1F522} ")}${r}\u2197 ${i}\u2198`)}if(t.cost!==void 0&&a.push(`${this.emoji("\u{1F4B0} ")}$${t.cost.toFixed(6)}`),t.execution_time!==void 0&&a.push(`${this.emoji("\u26A1 ")}${t.execution_time.toFixed(1)}s`),a.length===0)return"";let n=a.join(" \u2022 ");return this.color(n,g.dim)}formatError(t){let a=[];return a.push(this.color(`${this.emoji("\u274C ")}${t.message}`,g.red)),t.suggestions&&t.suggestions.length>0&&(a.push(""),a.push(this.color(`${this.emoji("\u{1F4A1} ")}Solutions:`,g.yellow)),t.suggestions.forEach((n,r)=>{a.push(this.color(` ${r+1}. ${n}`,g.gray))})),a.join(`
|
|
1191
1191
|
`)}formatConfig(t){let a=[];a.push(this.color(`${this.emoji("\u{1F4CB} ")}Current AII Configuration:`,g.cyan)),a.push(`- Config file: ${t.configFile}`),a.push(`- Storage path: ${t.storagePath}`),t.apiUrl&&a.push(`- Aii Server: ${t.apiUrl}`);let n=t.hasApiKey?this.color("\u2713",g.green):this.color("\u2717",g.red);if(a.push(`- LLM provider: ${t.provider} (${t.model}) - ${n}`),t.webSearch){let r=t.webSearch.enabled?this.color("\u2713",g.green):this.color("\u2717",g.red);a.push(`- Web search: ${t.webSearch.provider??"none"} - ${r}`)}return t.issues&&t.issues.length>0&&a.push(`- Configuration issues: ${t.issues.length}`),a.join(`
|
|
1192
1192
|
`)}formatHealthCheck(t){let a=[];a.push(this.color(`${this.emoji("\u{1F3E5} ")}AII Health Check`,g.cyan)),a.push("");for(let i of t){let s,o;switch(i.status){case"ok":s="\u2713",o=g.green;break;case"warn":s="\u26A0",o=g.yellow;break;case"error":s="\u2717",o=g.red;break}let c=this.color(s,o),l=this.color(i.message,o);a.push(` ${c} ${i.name.padEnd(20)} ${l}`)}let n=t.some(i=>i.status==="error"),r=t.some(i=>i.status==="warn");return a.push(""),n?a.push(this.color(`${this.emoji("\u274C ")}Some checks failed!`,g.red)):r?a.push(this.color(`${this.emoji("\u26A0\uFE0F ")}All checks passed with warnings`,g.yellow)):a.push(this.color(`${this.emoji("\u2705 ")}All checks passed!`,g.green)),a.join(`
|
|
1193
|
-
`)}};function Fr(e={}){return new WO(e)}Gi();var GRe={openrouter:"openrouter",ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},HRe=[{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\//,/^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 KO(e){if(!e)return;let t=e.toLowerCase();for(let{provider:a,patterns:n}of HRe)for(let r of n)if(r.test(t))return a}function yn(e){if(!e)return e;let t=e.indexOf("/");if(t===-1)return e;let a=e.substring(0,t).toLowerCase();return a!=="ollama"&&a in GRe?e.substring(t+1):e}function zn(e,t,a){if(a)return a;if(e){let n=KO(e);if(n)return n}return t}ma();import*as AV from"readline";Gi();import*as Qr from"fs";import*as _E from"path";import*as xV from"os";var gE=_E.join(xV.homedir(),".aii","conversations"),VO=_E.join(gE,"current.json");function yE(){Qr.existsSync(gE)||Qr.mkdirSync(gE,{recursive:!0})}function YRe(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function WRe(e){let a=e.trim().replace(/\s+/g," ");return a.length>50&&(a=a.substring(0,50).trim()+"..."),a}function kV(e){return _E.join(gE,`${e}.json`)}function TV(){yE();try{if(Qr.existsSync(VO)){let e=Qr.readFileSync(VO,"utf-8"),t=JSON.parse(e),a=kV(t.id);if(Qr.existsSync(a)){let n=Qr.readFileSync(a,"utf-8");return JSON.parse(n)}}}catch{}return wV()}function wV(){yE();let e={id:YRe(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return yg(e),KRe(e.id),e}function yg(e){if(yE(),e.title==="New Conversation"&&e.messages.length>0){let a=e.messages.find(n=>n.role==="user");a&&(e.title=WRe(a.content))}e.updatedAt=Date.now();let t=kV(e.id);Qr.writeFileSync(t,JSON.stringify(e,null,2),"utf-8")}function KRe(e){yE(),Qr.writeFileSync(VO,JSON.stringify({id:e}),"utf-8")}function CV(){return wV()}var VRe="0.10.
|
|
1193
|
+
`)}};function Fr(e={}){return new WO(e)}Gi();var GRe={openrouter:"openrouter",ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},HRe=[{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\//,/^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 KO(e){if(!e)return;let t=e.toLowerCase();for(let{provider:a,patterns:n}of HRe)for(let r of n)if(r.test(t))return a}function yn(e){if(!e)return e;let t=e.indexOf("/");if(t===-1)return e;let a=e.substring(0,t).toLowerCase();return a!=="ollama"&&a in GRe?e.substring(t+1):e}function zn(e,t,a){if(a)return a;if(e){let n=KO(e);if(n)return n}return t}ma();import*as AV from"readline";Gi();import*as Qr from"fs";import*as _E from"path";import*as xV from"os";var gE=_E.join(xV.homedir(),".aii","conversations"),VO=_E.join(gE,"current.json");function yE(){Qr.existsSync(gE)||Qr.mkdirSync(gE,{recursive:!0})}function YRe(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function WRe(e){let a=e.trim().replace(/\s+/g," ");return a.length>50&&(a=a.substring(0,50).trim()+"..."),a}function kV(e){return _E.join(gE,`${e}.json`)}function TV(){yE();try{if(Qr.existsSync(VO)){let e=Qr.readFileSync(VO,"utf-8"),t=JSON.parse(e),a=kV(t.id);if(Qr.existsSync(a)){let n=Qr.readFileSync(a,"utf-8");return JSON.parse(n)}}}catch{}return wV()}function wV(){yE();let e={id:YRe(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return yg(e),KRe(e.id),e}function yg(e){if(yE(),e.title==="New Conversation"&&e.messages.length>0){let a=e.messages.find(n=>n.role==="user");a&&(e.title=WRe(a.content))}e.updatedAt=Date.now();let t=kV(e.id);Qr.writeFileSync(t,JSON.stringify(e,null,2),"utf-8")}function KRe(e){yE(),Qr.writeFileSync(VO,JSON.stringify({id:e}),"utf-8")}function CV(){return wV()}var VRe="0.10.8",QO=class{configManager;parsed;running=!1;conversation;stats;formatter;constructor(t,a){this.parsed=t,this.configManager=a,this.conversation=TV(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=Fr({colors:!t.flags.noColors,emojis:!t.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let t=await this.getUserInput();if(!t.trim()||await this.handleSpecialCommands(t))continue;this.conversation.messages.push({role:"user",content:t,timestamp:Date.now()}),yg(this.conversation),await this.processWithContext(t)}catch(t){if(t instanceof Error&&t.message==="EXIT")break;if(t instanceof Error&&t.message==="INTERRUPTED"){console.log(`
|
|
1194
1194
|
\u26A0\uFE0F Interrupted. Type /exit to quit or continue chatting.`);continue}console.error(g.red(`
|
|
1195
1195
|
\u274C Error: ${t instanceof Error?t.message:String(t)}`)),this.conversation.messages.length>0&&this.conversation.messages[this.conversation.messages.length-1].role==="user"&&(this.conversation.messages.pop(),yg(this.conversation))}}displayWelcome(){console.log("\u{1F916} 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((t,a)=>{let n=AV.createInterface({input:process.stdin,output:process.stdout}),r=[],i=!1,s=()=>{i=!0,n.close()},o=c=>{n.question(c,l=>{if(r.length===0&&l.trim().startsWith("/")){s(),t(l.trim());return}l.endsWith("\\")?(r.push(l.slice(0,-1)),o(" ")):(r.push(l),s(),t(r.join(`
|
|
1196
1196
|
`).trim()))})};n.on("SIGINT",()=>{s(),a(new Error("INTERRUPTED"))}),n.on("close",()=>{i||a(new Error("EXIT"))}),o("> ")})}async handleSpecialCommands(t){let a=t.trim().toLowerCase();if(a.startsWith("/"))a=a.slice(1);else return!1;switch(a){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(g.yellow(`Unknown command: /${a}. Type /help for available commands.`)),console.log(""),!0}}async processWithContext(t){let a=await this.configManager.load(),n=this.configManager.validate();if(!n.valid)throw new or(n.issues.join(", "));let i=this.configManager.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",s=yn(this.parsed.flags.model??a.llm.model),o=zn(this.parsed.flags.model,a.llm.provider,this.parsed.flags.provider),c=this.configManager.getApiKey(o);if(!c)throw new hn(`Missing API key for provider: ${o}`);this.stats.totalRequests++;let l=Cs(!this.parsed.flags.noAnimations);l.start("");let u=qs({spinner:l,enabled:!this.parsed.flags.noStreaming}),p=this.conversation.messages.slice(-21,-1).map(v=>({role:v.role,content:v.content})),d={api_key:i,system_prompt:null,user_prompt:t,user_message:t,output_mode:"CLEAN",streaming:!this.parsed.flags.noStreaming,model:s,llm_provider:o,llm_api_key:c,provider_api_key:c,client_type:"cli",offline:this.parsed.flags.offline,conversation_history:p.length>0?p:void 0},m=this.parsed.flags.host?`http://${this.parsed.flags.host}`:a.api.url,f=new gi({url:m}),h="",_=!1;try{let v=await f.executeRequest(d,{onToken:T=>{h+=T,_=!0,u.onToken(T)}});u.flush();let S=v.result||h;!_&&S&&console.log(S),console.log(""),v.metadata&&this.displayExecutionSummary(v.metadata),S&&(this.conversation.messages.push({role:"assistant",content:S,timestamp:Date.now()}),yg(this.conversation))}catch(v){throw l.stop(!0),v}finally{f.disconnect()}}displayExecutionSummary(t){let a=t.cost||0,n=t.tokens_in||0,r=t.tokens_out||0,i=n+r;this.stats.cumulativeTokens+=i,this.stats.cumulativeCost+=a,console.log(this.formatter.formatExecutionSummary({model:t.model,tokens_in:n,tokens_out:r,cost:a,execution_time:t.execution_time})),console.log("")}clearConversation(){this.conversation=CV(),console.clear(),this.displayWelcome()}displayConversationHistory(){if(this.conversation.messages.length===0){console.log(`
|
|
@@ -1315,7 +1315,7 @@ ${a.yellow("EXAMPLES:")}
|
|
|
1315
1315
|
${a.yellow("CONFIG FILE:")}
|
|
1316
1316
|
~/.aii/config.yaml Main configuration
|
|
1317
1317
|
~/.aii/secrets.yaml API keys (secure storage)
|
|
1318
|
-
`)}import*as vg from"fs";async function OV(e,t){let a=Fr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis}),n=[];t.configExists()?n.push({name:"Configuration file",status:"ok",message:"Found"}):n.push({name:"Configuration file",status:"warn",message:"Not found (using defaults)"});let r=await t.load(),i=t.getApiKey();if(i){let d=ENe(i);n.push({name:"LLM Model",status:"ok",message:`${r.llm.model}@${r.llm.provider} (${d})`})}else n.push({name:"LLM Model",status:"error",message:`Not configured for ${r.llm.provider}`});let s=await vNe(r.api.url);n.push({name:"AII Server",status:s.ok?"ok":"error",message:s.message});let o=`${t.getConfigDir()}/mcp_servers.json`;if(vg.existsSync(o))try{let d=vg.readFileSync(o,"utf-8"),m=JSON.parse(d),f=Object.keys(m.mcpServers??{}).length;f>0?n.push({name:"MCP Servers",status:"ok",message:`${f} 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"});let c=t.getConfigDir();vg.existsSync(c)?n.push({name:"Storage Directory",status:"ok",message:c}):n.push({name:"Storage Directory",status:"warn",message:"Not created"});let l=process.version;parseInt(l.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js Version",status:"ok",message:l}):n.push({name:"Node.js Version",status:"error",message:`${l} (requires >= 18)`}),console.log(a.formatHealthCheck(n)),n.some(d=>d.status==="error")&&process.exit(1)}async function vNe(e){try{let t=new AbortController,a=setTimeout(()=>t.abort(),3e3),n=await fetch(`${e}/api/status`,{signal:t.signal});if(clearTimeout(a),n.ok){let r=new URL(e);return{ok:!0,message:`Running at ${r.hostname}:${r.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(t){return t instanceof Error&&t.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}function ENe(e){return e.length<=10?"***":e.slice(0,6)+"..."+e.slice(-4)}ma();var IV="0.10.
|
|
1318
|
+
`)}import*as vg from"fs";async function OV(e,t){let a=Fr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis}),n=[];t.configExists()?n.push({name:"Configuration file",status:"ok",message:"Found"}):n.push({name:"Configuration file",status:"warn",message:"Not found (using defaults)"});let r=await t.load(),i=t.getApiKey();if(i){let d=ENe(i);n.push({name:"LLM Model",status:"ok",message:`${r.llm.model}@${r.llm.provider} (${d})`})}else n.push({name:"LLM Model",status:"error",message:`Not configured for ${r.llm.provider}`});let s=await vNe(r.api.url);n.push({name:"AII Server",status:s.ok?"ok":"error",message:s.message});let o=`${t.getConfigDir()}/mcp_servers.json`;if(vg.existsSync(o))try{let d=vg.readFileSync(o,"utf-8"),m=JSON.parse(d),f=Object.keys(m.mcpServers??{}).length;f>0?n.push({name:"MCP Servers",status:"ok",message:`${f} 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"});let c=t.getConfigDir();vg.existsSync(c)?n.push({name:"Storage Directory",status:"ok",message:c}):n.push({name:"Storage Directory",status:"warn",message:"Not created"});let l=process.version;parseInt(l.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js Version",status:"ok",message:l}):n.push({name:"Node.js Version",status:"error",message:`${l} (requires >= 18)`}),console.log(a.formatHealthCheck(n)),n.some(d=>d.status==="error")&&process.exit(1)}async function vNe(e){try{let t=new AbortController,a=setTimeout(()=>t.abort(),3e3),n=await fetch(`${e}/api/status`,{signal:t.signal});if(clearTimeout(a),n.ok){let r=new URL(e);return{ok:!0,message:`Running at ${r.hostname}:${r.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(t){return t instanceof Error&&t.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}function ENe(e){return e.length<=10?"***":e.slice(0,6)+"..."+e.slice(-4)}ma();var IV="0.10.8";function tI(e){let a=!e.flags.noColors?g:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
|
|
1319
1319
|
${a.cyan("AII")} - AI-powered CLI assistant v${IV}
|
|
1320
1320
|
|
|
1321
1321
|
${a.yellow("USAGE:")}
|