@aiiware/aii 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aii +8 -8
- 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.8.
|
|
3
|
+
* @aiiware/aii v0.8.2
|
|
4
4
|
*
|
|
5
5
|
* AI-powered CLI assistant for terminal productivity
|
|
6
6
|
*
|
|
@@ -186,7 +186,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
186
186
|
`)+`\r
|
|
187
187
|
\r
|
|
188
188
|
`+r)}function Ps(t,e,r,n,s,i){if(t.listenerCount("wsClientError")){let a=new Error(s);Error.captureStackTrace(a,Ps),t.emit("wsClientError",a,r,e)}else To(r,n,s,i)}});function Zf(t){bo={...bo,...t}}function Co(t){return bo.emojis?t+" ":""}function Fs(t,e){return bo.colors?e(t):t}function H(t,...e){bo.debug&&console.debug(Fs(`[DEBUG] ${t}`,_.gray),...e)}function w6(t,...e){console.log(t,...e)}function x6(t,...e){console.warn(Fs(`${Co("\u26A0\uFE0F")}${t}`,_.yellow),...e)}function M6(t,...e){console.error(Fs(`${Co("\u274C")}${t}`,_.red),...e)}function L6(t,...e){console.log(Fs(`${Co("\u2705")}${t}`,_.green),...e)}function Jf(t){let e=[];return e.push(Fs(`${Co("\u274C")}${t.message}`,_.red)),t.suggestions&&t.suggestions.length>0&&(e.push(""),e.push(Fs(`${Co("\u{1F4A1}")}Solutions:`,_.yellow)),t.suggestions.forEach((r,n)=>{e.push(Fs(` ${n+1}. ${r}`,_.gray))})),e.join(`
|
|
189
|
-
`)}var v6,bo,U,Mt=le(()=>{"use strict";Pe();v6={debug:!1,colors:!0,emojis:!0},bo={...v6};U={debug:H,info:w6,warn:x6,error:M6,success:L6,formatError:Jf,configure:Zf}});import*as Er from"fs";import*as Du from"path";import*as eg from"os";var vi,St,wi=le(()=>{"use strict";vi={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",eg.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"}},St=class{configPath;constructor(e){this.configPath=e||Du.join(eg.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let e=Du.dirname(this.configPath);Er.existsSync(e)||Er.mkdirSync(e,{recursive:!0})}loadConfig(){if(!Er.existsSync(this.configPath))return{mcpServers:{}};try{let e=Er.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(e){try{return this.ensureConfigDir(),Er.writeFileSync(this.configPath,JSON.stringify(e,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!Er.existsSync(this.configPath))return!0;try{let e=this.configPath+".backup";return Er.copyFileSync(this.configPath,e),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var Au={};tr(Au,{ClientMCPExecutor:()=>tg});import{Client as P6}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as F6}from"@modelcontextprotocol/sdk/client/stdio.js";var tg,Nu=le(()=>{"use strict";wi();Mt();tg=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new St}async initialize(){if(this.initialized)return!0;try{let r=this.configManager.loadConfig().mcpServers||{};H(`Initializing MCP executor with ${Object.keys(r).length} servers`);for(let[n,s]of Object.entries(r)){if(s.enabled===!1){H(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,s)}catch(i){H(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,H(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(e){return H(`Failed to initialize MCP executor: ${e}`),!1}}async connectToServer(e,r){let n=r.command,s=Array.isArray(r.args)?r.args:[r.args||""],i={...process.env};if(r.env)for(let[u,d]of Object.entries(r.env)){let p=String(d).replace(/\$\{(\w+)\}/g,(h,m)=>process.env[m]||"");i[u]=p}H(`Connecting to MCP server: ${e}`),H(` command: ${n}`),H(` args: ${JSON.stringify(s)}`);let a=new F6({command:n,args:s,env:i,stderr:"pipe"}),o=new P6({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await o.connect(a);let c=(await o.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:e}));this.connections.set(e,{client:o,transport:a,tools:c});for(let u of c)this.toolToServer.set(u.name,e);H(`Connected to ${e}: discovered ${c.length} tools`)}async handleQueryTools(e){let r=e.request_id||"unknown";H(`Handling mcp_query_tools request: ${r}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let s=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return H(`Found ${s.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:r,success:!0,tools:s}}catch(n){return H(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:r,success:!1,error:String(n),tools:[]}}}async handleToolExecution(e){let r=e.request_id||"unknown",n=e.tool_name,s=e.arguments||{};if(H(`Handling mcp_tool_request: ${r} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:r,success:!1,error:"Missing tool_name in request"};this.initialized||await this.initialize();try{let i=this.toolToServer.get(n);if(!i)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let a=this.connections.get(i);if(!a)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Server '${i}' not connected`};let o=await Promise.race([a.client.callTool({name:n,arguments:s}),new Promise((c,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),l=this.makeContentSerializable(o.content);return H(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:r,success:!o.isError,content:l,server_name:i,error:o.isError?"Tool returned error":void 0}}catch(i){return H(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:r,success:!1,error:String(i)}}}makeContentSerializable(e){if(e==null)return null;if(Array.isArray(e))return e.map(r=>this.makeContentSerializable(r));if(typeof e=="object"){let r=e;if(r.type==="text"&&typeof r.text=="string")return{type:"text",text:r.text};if(r.type==="image")return{type:"image",data:r.data,mimeType:r.mimeType};let n={};for(let[s,i]of Object.entries(r))n[s]=this.makeContentSerializable(i);return n}return e}async shutdown(){H("Shutting down MCP executor");for(let[e,r]of this.connections)try{await r.client.close(),H(`Closed connection to ${e}`)}catch(n){H(`Error closing ${e}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var C0=S((Aae,j6)=>{j6.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 ug=S((Nae,A0)=>{"use strict";var wu=Object.assign({},C0()),D0=Object.keys(wu);Object.defineProperty(wu,"random",{get(){let t=Math.floor(Math.random()*D0.length),e=D0[t];return wu[e]}});A0.exports=wu});function Bs({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var xu=le(()=>{});var v0=S(($ae,k0)=>{k0.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function se(t,...e){process.env.AII_INK_DEBUG==="1"&&console.error(`[INK-DEBUG] ${t}`,...e)}var Lu=le(()=>{"use strict"});import{resolve as oG}from"path";function lG(){let t=process.env.TERM??"",e=process.env.TERM_PROGRAM??"",r=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",s=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return e==="iTerm.app"||e==="Hyper"||e==="vscode"||e==="WezTerm"||e==="Alacritty"||n||s||t.includes("xterm-256color")||t.includes("screen-256color")||t.includes("tmux")||t==="xterm-kitty"||r==="truecolor"?!0:!(t==="dumb"||!process.stdout.isTTY)}function No(){return bg===null&&(bg=lG()),bg}function cG(){return process.platform==="darwin"?"Cmd":"Ctrl"}function L0(){return M0||!No()?"":(M0=!0,` (${cG()}+Click to open)`)}function uG(t,e){return No()?`\x1B]8;;${e}\x07${t}\x1B]8;;\x07`:t}function P0(t,e){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;r&&t.startsWith(r)&&(n="~"+t.slice(r.length));let s=e?`${n}:${e}`:n;if(!No())return _.cyan.underline(s);let i=_.cyan(s),o=`file://${oG(t)}`;return e!==void 0&&e>0&&(o+=`#L${e}`),uG(i,o)}var bg,M0,F0=le(()=>{"use strict";Pe();bg=null,M0=!1});function U0(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z]:\\/.test(t)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(t)||/^src\//.test(t)||/^lib\//.test(t)||/^test[s]?\//.test(t)}function G0(t,e,r=!0,n,s=console.log){let i=r?He.success("\u25CF"):He.error("\u25CF"),a=60,o=e.length>a?e.slice(0,a-3)+"...":e;if(U0(e)){let c=e.match(/:(\d+)$/),u=c?parseInt(c[1],10):void 0,d=c?e.replace(/:(\d+)$/,""):e;o=dG(d,u)}s(`${i} ${_.bold(t)}(${o})`);let l=U0(e)?He.dim(L0()):"";if(n){let c=r?He.dim:He.error;s(c(`\u2514 ${n}`)+l)}else{let c=r?"(No content)":"(Error)",u=r?He.dim:He.error;s(u(`\u2514 ${c}`)+l)}}function dG(t,e){if(No())return P0(t,e);let r=process.env.HOME??process.env.USERPROFILE??"",n=t;return r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),e&&(n+=`:${e}`),He.filePath(n)}function pG(){return process.stdout.columns||80}function _G(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return r>0?`${e}m ${r}s`:`${e}m`}function B0(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function $0(t){let e=pG(),r=Math.min(e-2,76),n=r-4,s=(p,h)=>{let m=p.replace(/\x1b\[[0-9;]*m/g,"").length;return p+" ".repeat(Math.max(0,h-m))},i=p=>He.border("\u2502")+" "+s(p,n)+" "+He.border("\u2502"),a=(p,h,m,g)=>{let E=Math.floor(n/2),y=He.dim(p.padEnd(15))+h,T=He.dim(m.padEnd(15))+g;return i(s(y,E)+T)},o=_G(t.durationSeconds),l=B0(t.tokensIn),c=B0(t.tokensOut),u=`$${t.totalCost.toFixed(4)}`,d=`${t.provider}/${t.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(He.border("\u250C"+"\u2500".repeat(r-2)+"\u2510")),console.log(i(_.cyan.bold("Agent powering down. Goodbye!"))),console.log(He.border("\u251C"+"\u2500".repeat(r-2)+"\u2524")),console.log(i(_.cyan.bold("Session Summary"))),console.log(i(He.dim("\u2500".repeat(15)))),console.log(a("Duration",o,"Tool Calls",t.toolCalls.toString())),console.log(a("Turns",t.turns.toString(),"Files Modified",t.filesModified.toString())),console.log(i("")),console.log(i(_.cyan.bold("Token Usage"))),console.log(i(He.dim("\u2500".repeat(11)))),console.log(a("Input",l,"Output",c)),console.log(i(He.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(He.dim("Model: ")+He.model(d))),console.log(He.border("\u2514"+"\u2500".repeat(r-2)+"\u2518")),console.log("")}var Pu,He,Io=le(()=>{"use strict";Pe();F0();Pu="0.8.1",He={logo:_.cyan.bold,prompt:_.cyan.bold,model:_.cyan,success:_.green,warning:_.yellow,error:_.red,thinking:_.dim.cyan,filePath:_.blue,code:_.white,muted:_.gray,dim:_.dim,safe:_.green,risky:_.yellow,destructive:_.red,border:_.cyan,bannerBorder:_.cyan}});var H0={};tr(H0,{getUIStore:()=>Ro,useUIStore:()=>yn});import{create as mG}from"zustand";var z0,yn,Ro,Cg=le(()=>{"use strict";z0={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},yn=mG(t=>({...z0,setMode:e=>t({mode:e}),setAgentMode:e=>t({agentMode:e}),setStatus:e=>t({status:e}),setThinking:e=>t({isThinking:e}),setStreaming:e=>t(r=>{if(e&&!r.agentTurnStartTime)return{isStreaming:e,agentTurnStartTime:Date.now()};if(!e&&r.agentTurnStartTime){let n=Date.now()-r.agentTurnStartTime;return{isStreaming:e,agentExecMs:r.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:e}}),incrementIteration:()=>t(e=>({currentIteration:e.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:e=>t(r=>({iterationTokens:r.iterationTokens+e})),setIterationTokens:e=>t({iterationTokens:e}),updateContext:(e,r)=>{let n=r>0?Math.round(e/r*100):0,s=n>=90?"critical":n>=70?"warning":"normal";t({contextTokens:e,contextLimit:r,contextPercent:n,contextLevel:s})},updateSession:e=>t(e),updateResources:e=>t(e),setLoopMode:e=>t({loopMode:e}),incrementRenderEpoch:()=>t(e=>({renderEpoch:e.renderEpoch+1})),reset:()=>t(z0)})),Ro=yn.getState});function Ig(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function j0(t){$s=t}function Oe(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Bt.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,e)};return n}function Kr(t,e){if(e){if(Bt.escapeTest.test(t))return t.replace(Bt.escapeReplace,Y0)}else if(Bt.escapeTestNoEncode.test(t))return t.replace(Bt.escapeReplaceNoEncode,Y0);return t}function K0(t){try{t=encodeURI(t).replace(Bt.percentDecode,"%")}catch{return null}return t}function V0(t,e){let r=t.replace(Bt.findPipe,(i,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Bt.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(Bt.slashPipe,"|");return n}function ko(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n;){let i=t.charAt(n-s-1);if(i===e&&!r)s++;else if(i!==e&&r)s++;else break}return t.slice(0,n-s)}function WG(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function W0(t,e,r,n,s){let i=e.href,a=e.title||null,o=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function jG(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
|
|
189
|
+
`)}var v6,bo,U,Mt=le(()=>{"use strict";Pe();v6={debug:!1,colors:!0,emojis:!0},bo={...v6};U={debug:H,info:w6,warn:x6,error:M6,success:L6,formatError:Jf,configure:Zf}});import*as Er from"fs";import*as Du from"path";import*as eg from"os";var vi,St,wi=le(()=>{"use strict";vi={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",eg.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"}},St=class{configPath;constructor(e){this.configPath=e||Du.join(eg.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let e=Du.dirname(this.configPath);Er.existsSync(e)||Er.mkdirSync(e,{recursive:!0})}loadConfig(){if(!Er.existsSync(this.configPath))return{mcpServers:{}};try{let e=Er.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(e){try{return this.ensureConfigDir(),Er.writeFileSync(this.configPath,JSON.stringify(e,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!Er.existsSync(this.configPath))return!0;try{let e=this.configPath+".backup";return Er.copyFileSync(this.configPath,e),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var Au={};tr(Au,{ClientMCPExecutor:()=>tg});import{Client as P6}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as F6}from"@modelcontextprotocol/sdk/client/stdio.js";var tg,Nu=le(()=>{"use strict";wi();Mt();tg=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new St}async initialize(){if(this.initialized)return!0;try{let r=this.configManager.loadConfig().mcpServers||{};H(`Initializing MCP executor with ${Object.keys(r).length} servers`);for(let[n,s]of Object.entries(r)){if(s.enabled===!1){H(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,s)}catch(i){H(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,H(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(e){return H(`Failed to initialize MCP executor: ${e}`),!1}}async connectToServer(e,r){let n=r.command,s=Array.isArray(r.args)?r.args:[r.args||""],i={...process.env};if(r.env)for(let[u,d]of Object.entries(r.env)){let p=String(d).replace(/\$\{(\w+)\}/g,(h,m)=>process.env[m]||"");i[u]=p}H(`Connecting to MCP server: ${e}`),H(` command: ${n}`),H(` args: ${JSON.stringify(s)}`);let a=new F6({command:n,args:s,env:i,stderr:"pipe"}),o=new P6({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await o.connect(a);let c=(await o.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:e}));this.connections.set(e,{client:o,transport:a,tools:c});for(let u of c)this.toolToServer.set(u.name,e);H(`Connected to ${e}: discovered ${c.length} tools`)}async handleQueryTools(e){let r=e.request_id||"unknown";H(`Handling mcp_query_tools request: ${r}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let s=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return H(`Found ${s.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:r,success:!0,tools:s}}catch(n){return H(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:r,success:!1,error:String(n),tools:[]}}}async handleToolExecution(e){let r=e.request_id||"unknown",n=e.tool_name,s=e.arguments||{};if(H(`Handling mcp_tool_request: ${r} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:r,success:!1,error:"Missing tool_name in request"};this.initialized||await this.initialize();try{let i=this.toolToServer.get(n);if(!i)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let a=this.connections.get(i);if(!a)return{type:"mcp_tool_response",request_id:r,success:!1,error:`Server '${i}' not connected`};let o=await Promise.race([a.client.callTool({name:n,arguments:s}),new Promise((c,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),l=this.makeContentSerializable(o.content);return H(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:r,success:!o.isError,content:l,server_name:i,error:o.isError?"Tool returned error":void 0}}catch(i){return H(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:r,success:!1,error:String(i)}}}makeContentSerializable(e){if(e==null)return null;if(Array.isArray(e))return e.map(r=>this.makeContentSerializable(r));if(typeof e=="object"){let r=e;if(r.type==="text"&&typeof r.text=="string")return{type:"text",text:r.text};if(r.type==="image")return{type:"image",data:r.data,mimeType:r.mimeType};let n={};for(let[s,i]of Object.entries(r))n[s]=this.makeContentSerializable(i);return n}return e}async shutdown(){H("Shutting down MCP executor");for(let[e,r]of this.connections)try{await r.client.close(),H(`Closed connection to ${e}`)}catch(n){H(`Error closing ${e}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var C0=S((Aae,j6)=>{j6.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 ug=S((Nae,A0)=>{"use strict";var wu=Object.assign({},C0()),D0=Object.keys(wu);Object.defineProperty(wu,"random",{get(){let t=Math.floor(Math.random()*D0.length),e=D0[t];return wu[e]}});A0.exports=wu});function Bs({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var xu=le(()=>{});var v0=S(($ae,k0)=>{k0.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function se(t,...e){process.env.AII_INK_DEBUG==="1"&&console.error(`[INK-DEBUG] ${t}`,...e)}var Lu=le(()=>{"use strict"});import{resolve as oG}from"path";function lG(){let t=process.env.TERM??"",e=process.env.TERM_PROGRAM??"",r=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",s=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return e==="iTerm.app"||e==="Hyper"||e==="vscode"||e==="WezTerm"||e==="Alacritty"||n||s||t.includes("xterm-256color")||t.includes("screen-256color")||t.includes("tmux")||t==="xterm-kitty"||r==="truecolor"?!0:!(t==="dumb"||!process.stdout.isTTY)}function No(){return bg===null&&(bg=lG()),bg}function cG(){return process.platform==="darwin"?"Cmd":"Ctrl"}function L0(){return M0||!No()?"":(M0=!0,` (${cG()}+Click to open)`)}function uG(t,e){return No()?`\x1B]8;;${e}\x07${t}\x1B]8;;\x07`:t}function P0(t,e){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;r&&t.startsWith(r)&&(n="~"+t.slice(r.length));let s=e?`${n}:${e}`:n;if(!No())return _.cyan.underline(s);let i=_.cyan(s),o=`file://${oG(t)}`;return e!==void 0&&e>0&&(o+=`#L${e}`),uG(i,o)}var bg,M0,F0=le(()=>{"use strict";Pe();bg=null,M0=!1});function U0(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z]:\\/.test(t)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(t)||/^src\//.test(t)||/^lib\//.test(t)||/^test[s]?\//.test(t)}function G0(t,e,r=!0,n,s=console.log){let i=r?He.success("\u25CF"):He.error("\u25CF"),a=60,o=e.length>a?e.slice(0,a-3)+"...":e;if(U0(e)){let c=e.match(/:(\d+)$/),u=c?parseInt(c[1],10):void 0,d=c?e.replace(/:(\d+)$/,""):e;o=dG(d,u)}s(`${i} ${_.bold(t)}(${o})`);let l=U0(e)?He.dim(L0()):"";if(n){let c=r?He.dim:He.error;s(c(`\u2514 ${n}`)+l)}else{let c=r?"(No content)":"(Error)",u=r?He.dim:He.error;s(u(`\u2514 ${c}`)+l)}}function dG(t,e){if(No())return P0(t,e);let r=process.env.HOME??process.env.USERPROFILE??"",n=t;return r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),e&&(n+=`:${e}`),He.filePath(n)}function pG(){return process.stdout.columns||80}function _G(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return r>0?`${e}m ${r}s`:`${e}m`}function B0(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function $0(t){let e=pG(),r=Math.min(e-2,76),n=r-4,s=(p,h)=>{let m=p.replace(/\x1b\[[0-9;]*m/g,"").length;return p+" ".repeat(Math.max(0,h-m))},i=p=>He.border("\u2502")+" "+s(p,n)+" "+He.border("\u2502"),a=(p,h,m,g)=>{let E=Math.floor(n/2),y=He.dim(p.padEnd(15))+h,T=He.dim(m.padEnd(15))+g;return i(s(y,E)+T)},o=_G(t.durationSeconds),l=B0(t.tokensIn),c=B0(t.tokensOut),u=`$${t.totalCost.toFixed(4)}`,d=`${t.provider}/${t.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(He.border("\u250C"+"\u2500".repeat(r-2)+"\u2510")),console.log(i(_.cyan.bold("Agent powering down. Goodbye!"))),console.log(He.border("\u251C"+"\u2500".repeat(r-2)+"\u2524")),console.log(i(_.cyan.bold("Session Summary"))),console.log(i(He.dim("\u2500".repeat(15)))),console.log(a("Duration",o,"Tool Calls",t.toolCalls.toString())),console.log(a("Turns",t.turns.toString(),"Files Modified",t.filesModified.toString())),console.log(i("")),console.log(i(_.cyan.bold("Token Usage"))),console.log(i(He.dim("\u2500".repeat(11)))),console.log(a("Input",l,"Output",c)),console.log(i(He.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(He.dim("Model: ")+He.model(d))),console.log(He.border("\u2514"+"\u2500".repeat(r-2)+"\u2518")),console.log("")}var Pu,He,Io=le(()=>{"use strict";Pe();F0();Pu="0.8.2",He={logo:_.cyan.bold,prompt:_.cyan.bold,model:_.cyan,success:_.green,warning:_.yellow,error:_.red,thinking:_.dim.cyan,filePath:_.blue,code:_.white,muted:_.gray,dim:_.dim,safe:_.green,risky:_.yellow,destructive:_.red,border:_.cyan,bannerBorder:_.cyan}});var H0={};tr(H0,{getUIStore:()=>Ro,useUIStore:()=>yn});import{create as mG}from"zustand";var z0,yn,Ro,Cg=le(()=>{"use strict";z0={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},yn=mG(t=>({...z0,setMode:e=>t({mode:e}),setAgentMode:e=>t({agentMode:e}),setStatus:e=>t({status:e}),setThinking:e=>t({isThinking:e}),setStreaming:e=>t(r=>{if(e&&!r.agentTurnStartTime)return{isStreaming:e,agentTurnStartTime:Date.now()};if(!e&&r.agentTurnStartTime){let n=Date.now()-r.agentTurnStartTime;return{isStreaming:e,agentExecMs:r.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:e}}),incrementIteration:()=>t(e=>({currentIteration:e.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:e=>t(r=>({iterationTokens:r.iterationTokens+e})),setIterationTokens:e=>t({iterationTokens:e}),updateContext:(e,r)=>{let n=r>0?Math.round(e/r*100):0,s=n>=90?"critical":n>=70?"warning":"normal";t({contextTokens:e,contextLimit:r,contextPercent:n,contextLevel:s})},updateSession:e=>t(e),updateResources:e=>t(e),setLoopMode:e=>t({loopMode:e}),incrementRenderEpoch:()=>t(e=>({renderEpoch:e.renderEpoch+1})),reset:()=>t(z0)})),Ro=yn.getState});function Ig(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function j0(t){$s=t}function Oe(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Bt.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,e)};return n}function Kr(t,e){if(e){if(Bt.escapeTest.test(t))return t.replace(Bt.escapeReplace,Y0)}else if(Bt.escapeTestNoEncode.test(t))return t.replace(Bt.escapeReplaceNoEncode,Y0);return t}function K0(t){try{t=encodeURI(t).replace(Bt.percentDecode,"%")}catch{return null}return t}function V0(t,e){let r=t.replace(Bt.findPipe,(i,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Bt.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(Bt.slashPipe,"|");return n}function ko(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n;){let i=t.charAt(n-s-1);if(i===e&&!r)s++;else if(i!==e&&r)s++;else break}return t.slice(0,n-s)}function WG(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function W0(t,e,r,n,s){let i=e.href,a=e.title||null,o=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function jG(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
|
|
190
190
|
`).map(i=>{let a=i.match(r.other.beginningSpace);if(a===null)return i;let[o]=a;return o.length>=s.length?i.slice(s.length):i}).join(`
|
|
191
191
|
`)}function we(t,e){return Gs.parse(t,e)}var $s,vo,Bt,fG,gG,hG,wo,EG,Rg,Q0,X0,SG,Og,yG,kg,TG,bG,zu,vg,CG,Z0,DG,wg,q0,AG,NG,IG,RG,J0,OG,Hu,xg,eD,kG,tD,vG,wG,xG,rD,MG,LG,nD,PG,FG,UG,BG,GG,$G,zG,Bu,HG,sD,iD,qG,Mg,YG,Dg,KG,Fu,Oo,VG,Y0,Gu,Tn,$u,Lg,bn,Uu,Pg,Gs,goe,hoe,Eoe,Soe,yoe,Toe,boe,aD=le(()=>{$s=Ig();vo={exec:()=>null};Bt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},fG=/^(?:[ \t]*(?:\n|$))+/,gG=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hG=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,wo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,EG=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Rg=/(?:[*+-]|\d{1,9}[.)])/,Q0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,X0=Oe(Q0).replace(/bull/g,Rg).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SG=Oe(Q0).replace(/bull/g,Rg).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Og=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yG=/^[^\n]+/,kg=/(?!\s*\])(?:\\.|[^\[\]\\])+/,TG=Oe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bG=Oe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Rg).getRegex(),zu="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,CG=Oe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vg).replace("tag",zu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z0=Oe(Og).replace("hr",wo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zu).getRegex(),DG=Oe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Z0).getRegex(),wg={blockquote:DG,code:gG,def:TG,fences:hG,heading:EG,hr:wo,html:CG,lheading:X0,list:bG,newline:fG,paragraph:Z0,table:vo,text:yG},q0=Oe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",wo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zu).getRegex(),AG={...wg,lheading:SG,table:q0,paragraph:Oe(Og).replace("hr",wo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",q0).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zu).getRegex()},NG={...wg,html:Oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vg).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Oe(Og).replace("hr",wo).replace("heading",` *#{1,6} *[^
|
|
192
192
|
]`).replace("lheading",X0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IG=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,RG=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,J0=/^( {2,}|\\)\n(?!\s*$)/,OG=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hu=/[\p{P}\p{S}]/u,xg=/[\s\p{P}\p{S}]/u,eD=/[^\s\p{P}\p{S}]/u,kG=Oe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xg).getRegex(),tD=/(?!~)[\p{P}\p{S}]/u,vG=/(?!~)[\s\p{P}\p{S}]/u,wG=/(?:[^\s\p{P}\p{S}]|~)/u,xG=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,rD=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,MG=Oe(rD,"u").replace(/punct/g,Hu).getRegex(),LG=Oe(rD,"u").replace(/punct/g,tD).getRegex(),nD="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",PG=Oe(nD,"gu").replace(/notPunctSpace/g,eD).replace(/punctSpace/g,xg).replace(/punct/g,Hu).getRegex(),FG=Oe(nD,"gu").replace(/notPunctSpace/g,wG).replace(/punctSpace/g,vG).replace(/punct/g,tD).getRegex(),UG=Oe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,eD).replace(/punctSpace/g,xg).replace(/punct/g,Hu).getRegex(),BG=Oe(/\\(punct)/,"gu").replace(/punct/g,Hu).getRegex(),GG=Oe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$G=Oe(vg).replace("(?:-->|$)","-->").getRegex(),zG=Oe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$G).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bu=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,HG=Oe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Bu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sD=Oe(/^!?\[(label)\]\[(ref)\]/).replace("label",Bu).replace("ref",kg).getRegex(),iD=Oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",kg).getRegex(),qG=Oe("reflink|nolink(?!\\()","g").replace("reflink",sD).replace("nolink",iD).getRegex(),Mg={_backpedal:vo,anyPunctuation:BG,autolink:GG,blockSkip:xG,br:J0,code:RG,del:vo,emStrongLDelim:MG,emStrongRDelimAst:PG,emStrongRDelimUnd:UG,escape:IG,link:HG,nolink:iD,punctuation:kG,reflink:sD,reflinkSearch:qG,tag:zG,text:OG,url:vo},YG={...Mg,link:Oe(/^!?\[(label)\]\((.*?)\)/).replace("label",Bu).getRegex(),reflink:Oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bu).getRegex()},Dg={...Mg,emStrongRDelimAst:FG,emStrongLDelim:LG,url:Oe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},KG={...Dg,br:Oe(J0).replace("{2,}","*").getRegex(),text:Oe(Dg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Fu={normal:wg,gfm:AG,pedantic:NG},Oo={normal:Mg,gfm:Dg,breaks:KG,pedantic:YG},VG={"&":"&","<":"<",">":">",'"':""","'":"'"},Y0=t=>VG[t];Gu=class{options;rules;lexer;constructor(t){this.options=t||$s}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ko(r,`
|
|
@@ -415,7 +415,7 @@ Review PR #$ARGUMENTS using the review checklist.
|
|
|
415
415
|
${t}
|
|
416
416
|
</context>
|
|
417
417
|
|
|
418
|
-
${e}`:e}var p5="0.8.1";function _5(){let t=new ay;return t.name("aii").description("AI-powered CLI assistant").version(p5,"-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"),t.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").action(()=>{}),t.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),t.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),t.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),t.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),t.command("doctor").description("System health check").action(()=>{}),t.command("chat").description("Interactive chat mode").action(()=>{}),t.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),t.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),t.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),t.command("version").description("Show version number").action(()=>{}),t}async function ly(t){let e=_5();e.exitOverride(),e.configureOutput({writeErr:()=>{}});let r="query",n,s=[];try{e.parse(t),s=e.args;let c=e.args[0];c&&["config","mcp","prompt","stats","history","doctor","chat","run","help","version","agent","loop"].includes(c)&&(r=c,n=e.args[1],s=e.args.slice(2))}catch(c){c instanceof iy&&(c.code==="commander.version"||c.code==="commander.helpDisplayed")&&process.exit(0),s=t.slice(2)}let i=e.opts(),a={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;G_()&&(o=await oy()),(r==="chat"||a.interactive)&&(r="agent"),r==="query"&&!s.length&&!o&&(r="agent");let l;if(r==="query"&&s.length>0)l=s.join(" ");else if(r==="agent"){let c=[];n&&c.push(n),s.length>0&&c.push(...s),c.length>0&&(l=c.join(" "))}return{command:r,subcommand:n,args:s,flags:a,stdinContent:o,query:l}}var Ne;(function(t){t[t.LOCAL=1]="LOCAL",t[t.SERVER=2]="SERVER"})(Ne||(Ne={}));var $_={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function ui(t,e,r,n){return t.clean?"clean":t.thinking||t.verbose?"thinking":t.standard?"standard":e&&r?.[e]?r[e]:e&&$_[e]?$_[e]:n||$_._default}var cy={config:Ne.LOCAL,help:Ne.LOCAL,version:Ne.LOCAL,doctor:Ne.LOCAL,mcp:Ne.LOCAL,prompt:Ne.LOCAL,stats:Ne.LOCAL,history:Ne.LOCAL,query:Ne.SERVER,chat:Ne.SERVER,run:Ne.SERVER,agent:Ne.SERVER,loop:Ne.SERVER};function z_(t){let e=cy[t.command]??Ne.SERVER;switch(t.command){case"config":return m5(t);case"mcp":return f5(t);case"prompt":return g5(t);case"stats":return h5(t);case"history":return E5(t);case"doctor":return{tier:Ne.LOCAL,handler:"doctor",params:{}};case"chat":return{tier:Ne.SERVER,handler:"chat",params:{continueChat:t.flags.continueChat}};case"run":return y5(t);case"agent":return{tier:Ne.SERVER,handler:"agent",params:{interactive:!t.query}};case"loop":return{tier:Ne.SERVER,handler:"loop",params:{}};case"help":return{tier:Ne.LOCAL,handler:"help",params:{command:t.subcommand}};case"version":return{tier:Ne.LOCAL,handler:"version",params:{}};case"query":default:return{tier:e,handler:"query",params:{query:t.query,stdinContent:t.stdinContent}}}}function m5(t){let e=t.subcommand??t.args[0]??"show";return{tier:Ne.LOCAL,handler:`config:${e}`,params:{key:t.args[0],value:t.args[1]}}}function f5(t){let e=t.subcommand??t.args[0]??"list";return{tier:Ne.LOCAL,handler:`mcp:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function g5(t){let e=t.subcommand??t.args[0]??"list";return{tier:Ne.LOCAL,handler:`prompt:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function h5(t){let e=t.subcommand??t.args[0];return{tier:Ne.LOCAL,handler:e?`stats:${e}`:"stats",params:{}}}function E5(t){let e=t.subcommand??t.args[0]??"list";return{tier:Ne.LOCAL,handler:`history:${e}`,params:{query:t.args[0],id:t.args[0]}}}var S5=new Set(["--model","--provider","--host","--continue-chat","-c"]);function y5(t){let e=[];t.subcommand&&e.push(t.subcommand);let r=[];for(let s=0;s<t.args.length;s++){let i=t.args[s];if(S5.has(i)){s++;continue}i.startsWith("-")||r.push(i)}e.push(...r);let n=e.join(" ");return{tier:Ne.SERVER,handler:"run",params:{operation:n}}}var vs=pt(au(),1);import*as It from"fs";import*as lu from"path";import*as Xb from"os";var Df={llm:{provider:"anthropic",model:"claude-sonnet-4-20250514",temperature:.7,max_tokens:4e3},api:{url:"http://localhost:26169"},streaming:{enabled:!0,buffer_size:10},output_modes:{default:"standard"}},ou={configDir:".aii",configFile:"config.yaml",secretsFile:"secrets.yaml",mcpFile:"mcp.json"};var Jn=class t extends Error{code;suggestions;constructor(e,r,n=[]){super(e),this.name="AiiError",this.code=r,this.suggestions=n,Object.setPrototypeOf(this,t.prototype)}},oo=class t extends Jn{constructor(e,r){super(`Cannot connect to Aii Server at ${e}:${r}`,"CONNECTION_ERROR",[`Check if Aii Server is running: curl ${e}:${r}/api/status`,"Start the Aii Server (separate process)","Verify host in config: aii config show",`Try a different host: aii "hello" --host ${e}:${r}`]),this.name="ConnectionError",Object.setPrototypeOf(this,t.prototype)}},xt=class t extends Jn{constructor(e,r){super(`Configuration error: ${e}`,"CONFIG_ERROR",r??["Run 'aii config init' to complete setup"]),this.name="ConfigError",Object.setPrototypeOf(this,t.prototype)}},lo=class t extends Jn{constructor(e,r){super(`Operation timed out: ${e} (${r}ms)`,"TIMEOUT_ERROR",["Try again","Check network connectivity","The server might be overloaded"]),this.name="TimeoutError",Object.setPrototypeOf(this,t.prototype)}},co=class t extends Jn{constructor(e){super(e,"WEBSOCKET_ERROR",["Check if Aii Server is running","Verify the server URL in config","Check network connectivity"]),this.name="WebSocketError",Object.setPrototypeOf(this,t.prototype)}},uo=class t extends Jn{constructor(e,r){super(r,e,["Check server logs for more details","Try again with a different query"]),this.name="ServerError",Object.setPrototypeOf(this,t.prototype)}},ht=class t extends Jn{constructor(e="Missing or invalid API key"){super(`Authentication error: ${e}`,"AUTH_ERROR",["Run 'aii config init' to set up your API key","Check that your API key is valid","Verify the API key in ~/.aii/secrets.yaml"]),this.name="AuthError",Object.setPrototypeOf(this,t.prototype)}};var Nf=class{configDir;configPath;secretsPath;config=null;secrets=null;constructor(e){this.configDir=e??lu.join(Xb.homedir(),ou.configDir),this.configPath=lu.join(this.configDir,ou.configFile),this.secretsPath=lu.join(this.configDir,ou.secretsFile)}getConfigDir(){return this.configDir}configExists(){return It.existsSync(this.configPath)}async load(){if(this.config)return this.config;let e={...Df};if(It.existsSync(this.configPath))try{let r=It.readFileSync(this.configPath,"utf-8"),n=vs.parse(r);e=this.mergeConfig(Df,n)}catch{throw new xt(`Failed to parse config file: ${this.configPath}`,["Check if the YAML syntax is valid","Try running: aii config init"])}return await this.loadSecrets(),e=this.applyEnvOverrides(e),this.config=e,e}async loadSecrets(){if(this.secrets)return this.secrets;let e={};if(It.existsSync(this.secretsPath))try{let r=It.readFileSync(this.secretsPath,"utf-8");e=vs.parse(r)}catch{}return this.secrets=e,e}mergeConfig(e,r){let n={...e};return r.llm&&(n.llm={...e.llm,...r.llm}),r.api&&(n.api={...e.api,...r.api},n.api.url&&!n.api.url.startsWith("http://")&&!n.api.url.startsWith("https://")&&(n.api.url=`http://${n.api.url}`)),r.streaming&&(n.streaming={...e.streaming,...r.streaming}),r.output_modes&&(n.output_modes={...e.output_modes,...r.output_modes}),r.mcp&&(n.mcp=r.mcp),r.web_search&&(n.web_search=r.web_search),n}applyEnvOverrides(e){let r={...e};return process.env.AII_LLM_PROVIDER&&(r.llm.provider=process.env.AII_LLM_PROVIDER),process.env.AII_MODEL&&(r.llm.model=process.env.AII_MODEL),process.env.AII_API_URL&&(r.api.url=process.env.AII_API_URL),r}getServerApiKey(){let e=this.config?.api.keys;return e&&e.length>0?e[0]:this.config?.api.key?this.config.api.key:process.env.AII_API_KEY}getApiKey(e){let r=e??this.config?.llm.provider??"anthropic";if(r==="ollama")return"ollama";if(this.secrets){let a=this.secrets[`${r}_api_key`];if(a)return a;let o=this.secrets.api_keys?.[r];if(o)return o}let n={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY",gemini:"GEMINI_API_KEY",deepseek:"DEEPSEEK_API_KEY",moonshot:"MOONSHOT_API_KEY",zai:"ZAI_API_KEY",ollama:"OLLAMA_HOST"},s=process.env[n[r]];if(s)return s;let i=process.env[`AII_${n[r]}`];if(i)return i}get(e){if(!this.config)return;let r=e.split("."),n=this.config;for(let s of r){if(n==null)return;n=n[s]}return n}async set(e,r){this.config||await this.load();let n=r;e==="api.url"&&typeof r=="string"&&!r.startsWith("http://")&&!r.startsWith("https://")&&(n=`http://${r}`);let s=e.split("."),i=this.config;for(let a=0;a<s.length-1;a++){let o=s[a];i[o]===void 0&&(i[o]={}),i=i[o]}i[s[s.length-1]]=n,await this.save()}async save(){if(!this.config)throw new xt("No config loaded to save");It.existsSync(this.configDir)||It.mkdirSync(this.configDir,{recursive:!0,mode:448});let e=vs.stringify(this.config);It.writeFileSync(this.configPath,e,{encoding:"utf-8",mode:384})}loadSecretsSync(){if(this.secrets)return;let e={};if(It.existsSync(this.secretsPath))try{let r=It.readFileSync(this.secretsPath,"utf-8");e=vs.parse(r)}catch{}this.secrets=e}getSecret(e){this.secrets||this.loadSecretsSync();let r=this.secrets?.[e];return typeof r=="string"?r:void 0}async setSecret(e,r){It.existsSync(this.configDir)||It.mkdirSync(this.configDir,{recursive:!0,mode:448}),this.secrets||await this.loadSecrets(),this.secrets=this.secrets||{},this.secrets[e]=r;let n=vs.stringify(this.secrets);It.writeFileSync(this.secretsPath,n,{encoding:"utf-8",mode:384})}getConfig(){if(!this.config)throw new xt("Config not loaded. Call load() first.");return this.config}validate(){let e=[];return this.config?(this.config.llm.provider||e.push("Missing LLM provider"),this.config.llm.model||e.push("Missing LLM model"),this.getApiKey()||e.push(`Missing API key for provider: ${this.config.llm.provider}`),this.config.api.url||e.push("Missing API URL"),{valid:e.length===0,issues:e}):(e.push("Configuration not loaded"),{valid:!1,issues:e})}},Af=null;function rr(){return Af||(Af=new Nf),Af}Pe();import{createInterface as lJ}from"readline";import{spawn as cJ}from"child_process";var I6=pt(a0(),1),R6=pt($f(),1),O6=pt(qf(),1),g0=pt(bu(),1),k6=pt(f0(),1);var Sn=g0.default;Mt();var U6={timeout:12e4,retries:3,retryDelay:1e3},Sr=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(e){this.options={...U6,...e}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:e}=await Promise.resolve().then(()=>(Nu(),Au));this.mcpExecutor=new e,await this.mcpExecutor.initialize(),H(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(e,r){let n=null;for(let s=0;s<this.options.retries;s++)try{return await this.executeWithRetry(e,r)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),H(`Attempt ${s+1} failed: ${n.message}`),n instanceof uo||n.message.includes("Authentication"))throw n;if(s<this.options.retries-1){let a=this.options.retryDelay*Math.pow(2,s);H(`Retrying in ${a}ms...`),await this.sleep(a)}}throw n??new co("Max retries exceeded")}async executeWithRetry(e,r){return new Promise((n,s)=>{let i=this.buildWebSocketUrl();H(`Connecting to ${i}`);try{this.ws=new Sn(i)}catch{let l=new URL(this.options.url);s(new oo(l.hostname||"localhost",l.port||"26169"));return}let a=!1,o=null;this.resetActivityTimeout(()=>{a||(this.cleanup(),s(new lo("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{H("WebSocket connected, sending request"),this.ws?.send(JSON.stringify(e))}),this.ws.on("message",l=>{this.resetActivityTimeout(()=>{a||(this.cleanup(),s(new lo("WebSocket activity",this.options.timeout)))});try{let c=JSON.parse(l.toString());this.handleMessage(c,r,u=>{a=!0,o=u,this.cleanup(),n(u)},u=>{a=!0,this.cleanup(),s(u)})}catch(c){let u=l?String(l):"<undefined>";H(`Failed to parse message: ${u}`),a||(a=!0,this.cleanup(),s(new Error(`Failed to parse server message: ${c.message}`)))}}),this.ws.on("error",l=>{if(H(`WebSocket error: ${l.message}`),!a){a=!0,this.cleanup();let c=new URL(this.options.url);s(new oo(c.hostname||"localhost",c.port||"26169"))}}),this.ws.on("close",(l,c)=>{H(`WebSocket closed: ${l} ${c.toString()}`),a||(a=!0,this.cleanup(),o?n(o):s(new co(`Connection closed unexpectedly: ${l}`)))})})}handleMessage(e,r,n,s){switch(e.type){case"token":{let i=e;r?.onToken?.(i.data);break}case"complete":{let i=e,a=i.metadata||{},o=this.convertServerMetadata(i),l={result:i.result,metadata:o,clientSideExecution:a.client_side_execution===!0,userRequest:a.user_request};r?.onComplete?.(l),n(l);break}case"error":{let i=e,a=new uo(i.code,i.message);r?.onError?.(a),s(a);break}case"mcp_query_tools":{H("Received mcp_query_tools request"),this.handleMCPQueryTools(e);break}case"mcp_tool_request":{H("Received mcp_tool_request"),this.handleMCPToolRequest(e);break}default:H(`Unknown message type: ${e.type}`)}}convertServerMetadata(e){let r=e.metadata||{},n,s;r.tokens?(n=r.tokens.input,s=r.tokens.output):(n=r.input_tokens,s=r.output_tokens);let i=r.cost??r.cost_usd,a=r.execution_time??r.total_time;return{function_name:e.function_name,tokens_in:n,tokens_out:s,cost:typeof i=="number"?i:void 0,model:typeof r.model=="string"?r.model:void 0,execution_time:typeof a=="number"?a:void 0}}buildWebSocketUrl(){let e=new URL(this.options.url);return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/ws/execute`}async handleMCPQueryTools(e){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(Nu(),Au));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let r=await this.mcpExecutor.handleQueryTools(e);this.ws?.send(JSON.stringify(r))}catch(r){let n=r instanceof Error?r.message:String(r),s=r instanceof Error?r.stack:void 0;H(`Error handling mcp_query_tools: ${n}${s?`
|
|
418
|
+
${e}`:e}var p5="0.8.2";function _5(){let t=new ay;return t.name("aii").description("AI-powered CLI assistant").version(p5,"-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"),t.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").action(()=>{}),t.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),t.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),t.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),t.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),t.command("doctor").description("System health check").action(()=>{}),t.command("chat").description("Interactive chat mode").action(()=>{}),t.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),t.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),t.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),t.command("version").description("Show version number").action(()=>{}),t}async function ly(t){let e=_5();e.exitOverride(),e.configureOutput({writeErr:()=>{}});let r="query",n,s=[];try{e.parse(t),s=e.args;let c=e.args[0];c&&["config","mcp","prompt","stats","history","doctor","chat","run","help","version","agent","loop"].includes(c)&&(r=c,n=e.args[1],s=e.args.slice(2))}catch(c){c instanceof iy&&(c.code==="commander.version"||c.code==="commander.helpDisplayed")&&process.exit(0),s=t.slice(2)}let i=e.opts(),a={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;G_()&&(o=await oy()),(r==="chat"||a.interactive)&&(r="agent"),r==="query"&&!s.length&&!o&&(r="agent");let l;if(r==="query"&&s.length>0)l=s.join(" ");else if(r==="agent"){let c=[];n&&c.push(n),s.length>0&&c.push(...s),c.length>0&&(l=c.join(" "))}return{command:r,subcommand:n,args:s,flags:a,stdinContent:o,query:l}}var Ne;(function(t){t[t.LOCAL=1]="LOCAL",t[t.SERVER=2]="SERVER"})(Ne||(Ne={}));var $_={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function ui(t,e,r,n){return t.clean?"clean":t.thinking||t.verbose?"thinking":t.standard?"standard":e&&r?.[e]?r[e]:e&&$_[e]?$_[e]:n||$_._default}var cy={config:Ne.LOCAL,help:Ne.LOCAL,version:Ne.LOCAL,doctor:Ne.LOCAL,mcp:Ne.LOCAL,prompt:Ne.LOCAL,stats:Ne.LOCAL,history:Ne.LOCAL,query:Ne.SERVER,chat:Ne.SERVER,run:Ne.SERVER,agent:Ne.SERVER,loop:Ne.SERVER};function z_(t){let e=cy[t.command]??Ne.SERVER;switch(t.command){case"config":return m5(t);case"mcp":return f5(t);case"prompt":return g5(t);case"stats":return h5(t);case"history":return E5(t);case"doctor":return{tier:Ne.LOCAL,handler:"doctor",params:{}};case"chat":return{tier:Ne.SERVER,handler:"chat",params:{continueChat:t.flags.continueChat}};case"run":return y5(t);case"agent":return{tier:Ne.SERVER,handler:"agent",params:{interactive:!t.query}};case"loop":return{tier:Ne.SERVER,handler:"loop",params:{}};case"help":return{tier:Ne.LOCAL,handler:"help",params:{command:t.subcommand}};case"version":return{tier:Ne.LOCAL,handler:"version",params:{}};case"query":default:return{tier:e,handler:"query",params:{query:t.query,stdinContent:t.stdinContent}}}}function m5(t){let e=t.subcommand??t.args[0]??"show";return{tier:Ne.LOCAL,handler:`config:${e}`,params:{key:t.args[0],value:t.args[1]}}}function f5(t){let e=t.subcommand??t.args[0]??"list";return{tier:Ne.LOCAL,handler:`mcp:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function g5(t){let e=t.subcommand??t.args[0]??"list";return{tier:Ne.LOCAL,handler:`prompt:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function h5(t){let e=t.subcommand??t.args[0];return{tier:Ne.LOCAL,handler:e?`stats:${e}`:"stats",params:{}}}function E5(t){let e=t.subcommand??t.args[0]??"list";return{tier:Ne.LOCAL,handler:`history:${e}`,params:{query:t.args[0],id:t.args[0]}}}var S5=new Set(["--model","--provider","--host","--continue-chat","-c"]);function y5(t){let e=[];t.subcommand&&e.push(t.subcommand);let r=[];for(let s=0;s<t.args.length;s++){let i=t.args[s];if(S5.has(i)){s++;continue}i.startsWith("-")||r.push(i)}e.push(...r);let n=e.join(" ");return{tier:Ne.SERVER,handler:"run",params:{operation:n}}}var vs=pt(au(),1);import*as It from"fs";import*as lu from"path";import*as Xb from"os";var Df={llm:{provider:"anthropic",model:"claude-sonnet-4-20250514",temperature:.7,max_tokens:4e3},api:{url:"http://localhost:26169"},streaming:{enabled:!0,buffer_size:10},output_modes:{default:"standard"}},ou={configDir:".aii",configFile:"config.yaml",secretsFile:"secrets.yaml",mcpFile:"mcp.json"};var Jn=class t extends Error{code;suggestions;constructor(e,r,n=[]){super(e),this.name="AiiError",this.code=r,this.suggestions=n,Object.setPrototypeOf(this,t.prototype)}},oo=class t extends Jn{constructor(e,r){super(`Cannot connect to Aii Server at ${e}:${r}`,"CONNECTION_ERROR",[`Check if Aii Server is running: curl ${e}:${r}/api/status`,"Start the Aii Server (separate process)","Verify host in config: aii config show",`Try a different host: aii "hello" --host ${e}:${r}`]),this.name="ConnectionError",Object.setPrototypeOf(this,t.prototype)}},xt=class t extends Jn{constructor(e,r){super(`Configuration error: ${e}`,"CONFIG_ERROR",r??["Run 'aii config init' to complete setup"]),this.name="ConfigError",Object.setPrototypeOf(this,t.prototype)}},lo=class t extends Jn{constructor(e,r){super(`Operation timed out: ${e} (${r}ms)`,"TIMEOUT_ERROR",["Try again","Check network connectivity","The server might be overloaded"]),this.name="TimeoutError",Object.setPrototypeOf(this,t.prototype)}},co=class t extends Jn{constructor(e){super(e,"WEBSOCKET_ERROR",["Check if Aii Server is running","Verify the server URL in config","Check network connectivity"]),this.name="WebSocketError",Object.setPrototypeOf(this,t.prototype)}},uo=class t extends Jn{constructor(e,r){super(r,e,["Check server logs for more details","Try again with a different query"]),this.name="ServerError",Object.setPrototypeOf(this,t.prototype)}},ht=class t extends Jn{constructor(e="Missing or invalid API key"){super(`Authentication error: ${e}`,"AUTH_ERROR",["Run 'aii config init' to set up your API key","Check that your API key is valid","Verify the API key in ~/.aii/secrets.yaml"]),this.name="AuthError",Object.setPrototypeOf(this,t.prototype)}};var Nf=class{configDir;configPath;secretsPath;config=null;secrets=null;constructor(e){this.configDir=e??lu.join(Xb.homedir(),ou.configDir),this.configPath=lu.join(this.configDir,ou.configFile),this.secretsPath=lu.join(this.configDir,ou.secretsFile)}getConfigDir(){return this.configDir}configExists(){return It.existsSync(this.configPath)}async load(){if(this.config)return this.config;let e={...Df};if(It.existsSync(this.configPath))try{let r=It.readFileSync(this.configPath,"utf-8"),n=vs.parse(r);e=this.mergeConfig(Df,n)}catch{throw new xt(`Failed to parse config file: ${this.configPath}`,["Check if the YAML syntax is valid","Try running: aii config init"])}return await this.loadSecrets(),e=this.applyEnvOverrides(e),this.config=e,e}async loadSecrets(){if(this.secrets)return this.secrets;let e={};if(It.existsSync(this.secretsPath))try{let r=It.readFileSync(this.secretsPath,"utf-8");e=vs.parse(r)}catch{}return this.secrets=e,e}mergeConfig(e,r){let n={...e};return r.llm&&(n.llm={...e.llm,...r.llm}),r.api&&(n.api={...e.api,...r.api},n.api.url&&!n.api.url.startsWith("http://")&&!n.api.url.startsWith("https://")&&(n.api.url=`http://${n.api.url}`)),r.streaming&&(n.streaming={...e.streaming,...r.streaming}),r.output_modes&&(n.output_modes={...e.output_modes,...r.output_modes}),r.mcp&&(n.mcp=r.mcp),r.web_search&&(n.web_search=r.web_search),n}applyEnvOverrides(e){let r={...e};return process.env.AII_LLM_PROVIDER&&(r.llm.provider=process.env.AII_LLM_PROVIDER),process.env.AII_MODEL&&(r.llm.model=process.env.AII_MODEL),process.env.AII_API_URL&&(r.api.url=process.env.AII_API_URL),r}getServerApiKey(){let e=this.config?.api.keys;return e&&e.length>0?e[0]:this.config?.api.key?this.config.api.key:process.env.AII_API_KEY}getApiKey(e){let r=e??this.config?.llm.provider??"anthropic";if(r==="ollama")return"ollama";if(this.secrets){let a=this.secrets[`${r}_api_key`];if(a)return a;let o=this.secrets.api_keys?.[r];if(o)return o}let n={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY",gemini:"GEMINI_API_KEY",deepseek:"DEEPSEEK_API_KEY",moonshot:"MOONSHOT_API_KEY",zai:"ZAI_API_KEY",ollama:"OLLAMA_HOST"},s=process.env[n[r]];if(s)return s;let i=process.env[`AII_${n[r]}`];if(i)return i}get(e){if(!this.config)return;let r=e.split("."),n=this.config;for(let s of r){if(n==null)return;n=n[s]}return n}async set(e,r){this.config||await this.load();let n=r;e==="api.url"&&typeof r=="string"&&!r.startsWith("http://")&&!r.startsWith("https://")&&(n=`http://${r}`);let s=e.split("."),i=this.config;for(let a=0;a<s.length-1;a++){let o=s[a];i[o]===void 0&&(i[o]={}),i=i[o]}i[s[s.length-1]]=n,await this.save()}async save(){if(!this.config)throw new xt("No config loaded to save");It.existsSync(this.configDir)||It.mkdirSync(this.configDir,{recursive:!0,mode:448});let e=vs.stringify(this.config);It.writeFileSync(this.configPath,e,{encoding:"utf-8",mode:384})}loadSecretsSync(){if(this.secrets)return;let e={};if(It.existsSync(this.secretsPath))try{let r=It.readFileSync(this.secretsPath,"utf-8");e=vs.parse(r)}catch{}this.secrets=e}getSecret(e){this.secrets||this.loadSecretsSync();let r=this.secrets?.[e];return typeof r=="string"?r:void 0}async setSecret(e,r){It.existsSync(this.configDir)||It.mkdirSync(this.configDir,{recursive:!0,mode:448}),this.secrets||await this.loadSecrets(),this.secrets=this.secrets||{},this.secrets[e]=r;let n=vs.stringify(this.secrets);It.writeFileSync(this.secretsPath,n,{encoding:"utf-8",mode:384})}getConfig(){if(!this.config)throw new xt("Config not loaded. Call load() first.");return this.config}validate(){let e=[];return this.config?(this.config.llm.provider||e.push("Missing LLM provider"),this.config.llm.model||e.push("Missing LLM model"),this.getApiKey()||e.push(`Missing API key for provider: ${this.config.llm.provider}`),this.config.api.url||e.push("Missing API URL"),{valid:e.length===0,issues:e}):(e.push("Configuration not loaded"),{valid:!1,issues:e})}},Af=null;function rr(){return Af||(Af=new Nf),Af}Pe();import{createInterface as lJ}from"readline";import{spawn as cJ}from"child_process";var I6=pt(a0(),1),R6=pt($f(),1),O6=pt(qf(),1),g0=pt(bu(),1),k6=pt(f0(),1);var Sn=g0.default;Mt();var U6={timeout:12e4,retries:3,retryDelay:1e3},Sr=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(e){this.options={...U6,...e}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:e}=await Promise.resolve().then(()=>(Nu(),Au));this.mcpExecutor=new e,await this.mcpExecutor.initialize(),H(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(e,r){let n=null;for(let s=0;s<this.options.retries;s++)try{return await this.executeWithRetry(e,r)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),H(`Attempt ${s+1} failed: ${n.message}`),n instanceof uo||n.message.includes("Authentication"))throw n;if(s<this.options.retries-1){let a=this.options.retryDelay*Math.pow(2,s);H(`Retrying in ${a}ms...`),await this.sleep(a)}}throw n??new co("Max retries exceeded")}async executeWithRetry(e,r){return new Promise((n,s)=>{let i=this.buildWebSocketUrl();H(`Connecting to ${i}`);try{this.ws=new Sn(i)}catch{let l=new URL(this.options.url);s(new oo(l.hostname||"localhost",l.port||"26169"));return}let a=!1,o=null;this.resetActivityTimeout(()=>{a||(this.cleanup(),s(new lo("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{H("WebSocket connected, sending request"),this.ws?.send(JSON.stringify(e))}),this.ws.on("message",l=>{this.resetActivityTimeout(()=>{a||(this.cleanup(),s(new lo("WebSocket activity",this.options.timeout)))});try{let c=JSON.parse(l.toString());this.handleMessage(c,r,u=>{a=!0,o=u,this.cleanup(),n(u)},u=>{a=!0,this.cleanup(),s(u)})}catch(c){let u=l?String(l):"<undefined>";H(`Failed to parse message: ${u}`),a||(a=!0,this.cleanup(),s(new Error(`Failed to parse server message: ${c.message}`)))}}),this.ws.on("error",l=>{if(H(`WebSocket error: ${l.message}`),!a){a=!0,this.cleanup();let c=new URL(this.options.url);s(new oo(c.hostname||"localhost",c.port||"26169"))}}),this.ws.on("close",(l,c)=>{H(`WebSocket closed: ${l} ${c.toString()}`),a||(a=!0,this.cleanup(),o?n(o):s(new co(`Connection closed unexpectedly: ${l}`)))})})}handleMessage(e,r,n,s){switch(e.type){case"token":{let i=e;r?.onToken?.(i.data);break}case"complete":{let i=e,a=i.metadata||{},o=this.convertServerMetadata(i),l={result:i.result,metadata:o,clientSideExecution:a.client_side_execution===!0,userRequest:a.user_request};r?.onComplete?.(l),n(l);break}case"error":{let i=e,a=new uo(i.code,i.message);r?.onError?.(a),s(a);break}case"mcp_query_tools":{H("Received mcp_query_tools request"),this.handleMCPQueryTools(e);break}case"mcp_tool_request":{H("Received mcp_tool_request"),this.handleMCPToolRequest(e);break}default:H(`Unknown message type: ${e.type}`)}}convertServerMetadata(e){let r=e.metadata||{},n,s;r.tokens?(n=r.tokens.input,s=r.tokens.output):(n=r.input_tokens,s=r.output_tokens);let i=r.cost??r.cost_usd,a=r.execution_time??r.total_time;return{function_name:e.function_name,tokens_in:n,tokens_out:s,cost:typeof i=="number"?i:void 0,model:typeof r.model=="string"?r.model:void 0,execution_time:typeof a=="number"?a:void 0}}buildWebSocketUrl(){let e=new URL(this.options.url);return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/ws/execute`}async handleMCPQueryTools(e){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(Nu(),Au));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let r=await this.mcpExecutor.handleQueryTools(e);this.ws?.send(JSON.stringify(r))}catch(r){let n=r instanceof Error?r.message:String(r),s=r instanceof Error?r.stack:void 0;H(`Error handling mcp_query_tools: ${n}${s?`
|
|
419
419
|
${s}`:""}`),this.ws?.send(JSON.stringify({type:"mcp_query_tools_response",request_id:e.request_id||"unknown",success:!1,error:n,tools:[]}))}}async handleMCPToolRequest(e){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(Nu(),Au));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let r=await this.mcpExecutor.handleToolExecution(e);this.ws?.send(JSON.stringify(r))}catch(r){H(`Error handling mcp_tool_request: ${r}`),this.ws?.send(JSON.stringify({type:"mcp_tool_response",request_id:e.request_id||"unknown",success:!1,error:String(r)}))}}resetActivityTimeout(e){this.activityTimeout&&clearTimeout(this.activityTimeout),this.activityTimeout=setTimeout(e,this.options.timeout)}cleanup(){if(this.activityTimeout&&(clearTimeout(this.activityTimeout),this.activityTimeout=null),this.ws){try{this.ws.close()}catch(e){H(`WebSocket close error: ${e instanceof Error?e.message:String(e)}`)}this.ws=null}}async shutdownMCP(){this.mcpExecutor&&(await this.mcpExecutor.shutdown(),this.mcpExecutor=null)}disconnect(){this.cleanup()}sleep(e){return new Promise(r=>setTimeout(r,e))}};Pe();import Mu from"node:process";import b0 from"node:process";import ku from"node:process";var B6=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(e,r);!G6(s,i)&&n||Object.defineProperty(t,r,i)},G6=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},$6=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},z6=(t,e)=>`/* Wrapped ${t}*/
|
|
420
420
|
${e}`,H6=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),q6=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Y6=(t,e,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=z6.bind(null,n,e.toString());Object.defineProperty(s,"name",q6);let{writable:i,enumerable:a,configurable:o}=H6;Object.defineProperty(t,"toString",{value:s,writable:i,enumerable:a,configurable:o})};function rg(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:n}=t;for(let s of Reflect.ownKeys(e))B6(t,e,s,r);return $6(t,e),Y6(t,e,n),t}var Iu=new WeakMap,h0=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,s=t.displayName||t.name||"<anonymous>",i=function(...a){if(Iu.set(i,++n),n===1)r=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return rg(i,t),Iu.set(i,n),i};h0.callCount=t=>{if(!Iu.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Iu.get(t)};var E0=h0;var Us=[];Us.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Us.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Us.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ru=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ng=Symbol.for("signal-exit emitter"),sg=globalThis,K6=Object.defineProperty.bind(Object),ig=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(sg[ng])return sg[ng];K6(sg,ng,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let i of this.listeners[e])s=i(r,n)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},Ou=class{},V6=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),ag=class extends Ou{onExit(){return()=>{}}load(){}unload(){}},og=class extends Ou{#a=lg.platform==="win32"?"SIGINT":"SIGHUP";#r=new ig;#e;#s;#p;#t={};#i=!1;constructor(e){super(),this.#e=e,this.#t={};for(let r of Us)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,i=e;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(s+=i.__signal_exit_emitter__.count),n.length===s){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#a:r;a||e.kill(e.pid,o)}};this.#p=e.reallyExit,this.#s=e.emit}onExit(e,r){if(!Ru(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let e of Us)try{let r=this.#t[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#_(e,...r),this.#e.reallyExit=e=>this.#n(e)}}unload(){this.#i&&(this.#i=!1,Us.forEach(e=>{let r=this.#t[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#s,this.#e.reallyExit=this.#p,this.#r.count-=1)}#n(e){return Ru(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#p.call(this.#e,this.#e.exitCode)):0}#_(e,...r){let n=this.#s;if(e==="exit"&&Ru(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,e,...r)}},lg=globalThis.process,{onExit:S0,load:fae,unload:gae}=V6(Ru(lg)?new og(lg):new ag);var y0=ku.stderr.isTTY?ku.stderr:ku.stdout.isTTY?ku.stdout:void 0,W6=y0?E0(()=>{S0(()=>{y0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},T0=W6;var vu=!1,xi={};xi.show=(t=b0.stderr)=>{t.isTTY&&(vu=!1,t.write("\x1B[?25h"))};xi.hide=(t=b0.stderr)=>{t.isTTY&&(T0(),vu=!0,t.write("\x1B[?25l"))};xi.toggle=(t,e)=>{t!==void 0&&(vu=t),vu?xi.show(e):xi.hide(e)};var cg=xi;var Ao=pt(ug(),1);Pe();import xr from"node:process";function dg(){return xr.platform!=="win32"?xr.env.TERM!=="linux":!!xr.env.CI||!!xr.env.WT_SESSION||!!xr.env.TERMINUS_SUBLIME||xr.env.ConEmuTask==="{cmd::Cmder}"||xr.env.TERM_PROGRAM==="Terminus-Sublime"||xr.env.TERM_PROGRAM==="vscode"||xr.env.TERM==="xterm-256color"||xr.env.TERM==="alacritty"||xr.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Q6={info:_.blue("\u2139"),success:_.green("\u2714"),warning:_.yellow("\u26A0"),error:_.red("\u2716")},X6={info:_.blue("i"),success:_.green("\u221A"),warning:_.yellow("\u203C"),error:_.red("\xD7")},Z6=dg()?Q6:X6,Do=Z6;xu();var J6=Bs();function pg(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(J6,"")}xu();var eG=Bs();function _g(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(eG,"")}function N0(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function I0(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function R0(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function tG(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function O0(t,{ambiguousAsWide:e=!1}={}){return tG(t),I0(t)||R0(t)||e&&N0(t)?2:1}var w0=pt(v0(),1),rG=new Intl.Segmenter,nG=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function mg(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=_g(t)),t.length===0)return 0;let s=0,i={ambiguousAsWide:!r};for(let{segment:a}of rG.segment(t)){let o=a.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)&&!nG.test(a)){if((0,w0.default)().test(a)){s+=2;continue}s+=O0(o,i)}}return s}function fg({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import x0 from"node:process";function gg(){let{env:t}=x0,{TERM:e,TERM_PROGRAM:r}=t;return x0.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import qr from"node:process";var sG=3,hg=class{#a=0;start(){this.#a++,this.#a===1&&this.#r()}stop(){if(this.#a<=0)throw new Error("`stop` called more times than `start`");this.#a--,this.#a===0&&this.#e()}#r(){qr.platform==="win32"||!qr.stdin.isTTY||(qr.stdin.setRawMode(!0),qr.stdin.on("data",this.#s),qr.stdin.resume())}#e(){qr.stdin.isTTY&&(qr.stdin.off("data",this.#s),qr.stdin.pause(),qr.stdin.setRawMode(!1))}#s(e){e[0]===sG&&qr.emit("SIGINT")}},iG=new hg,Eg=iG;var aG=pt(ug(),1),Sg=class{#a=0;#r=!1;#e=0;#s=-1;#p=0;#t;#i;#n;#_;#f;#c;#u;#d;#g;#o;#l;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:Mu.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#f=this.#t.interval,this.#n=this.#t.stream,this.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:fg({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,Mu.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#c,Object.defineProperty(this,"_linesToClear",{get(){return this.#a},set(r){this.#a=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#s}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#m()}get interval(){return this.#f??this.#i.interval??100}get spinner(){return this.#i}set spinner(e){if(this.#s=-1,this.#f=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=e}else if(!gg())this.#i=Ao.default.line;else if(e===void 0)this.#i=Ao.default.dots;else if(e!=="default"&&Ao.default[e])this.#i=Ao.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#m()}get prefixText(){return this.#o}set prefixText(e=""){this.#o=e,this.#m()}get suffixText(){return this.#l}set suffixText(e=""){this.#l=e,this.#m()}get isSpinning(){return this.#_!==void 0}#h(e=this.#o,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#E(e=this.#l,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#m(){let e=this.#n.columns??80,r=this.#h(this.#o,"-"),n=this.#E(this.#l,"-"),s=" ".repeat(this.#d)+r+"--"+this.#g+"--"+n;this.#e=0;for(let i of pg(s).split(`
|
|
421
421
|
`))this.#e+=Math.max(1,Math.ceil(mg(i,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#c&&!this.#u}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#c=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let e=Date.now();(this.#s===-1||e-this.#p>=this.interval)&&(this.#s=++this.#s%this.#i.frames.length,this.#p=e);let{frames:r}=this.#i,n=r[this.#s];this.color&&(n=_[this.color](n));let s=typeof this.#o=="string"&&this.#o!==""?this.#o+" ":"",i=typeof this.text=="string"?" "+this.text:"",a=typeof this.#l=="string"&&this.#l!==""?" "+this.#l:"";return s+n+i+a}clear(){if(!this.#c||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let e=0;e<this.#a;e++)e>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#d||this.lastIndent!==this.#d)&&this.#n.cursorTo(this.#d),this.lastIndent=this.#d,this.#a=0,this}render(){return this.#u?this:(this.clear(),this.#n.write(this.frame()),this.#a=this.#e,this)}start(e){return e&&(this.text=e),this.#u?this:this.#c?this.isSpinning?this:(this.#t.hideCursor&&cg.hide(this.#n),this.#t.discardStdin&&Mu.stdin.isTTY&&(this.#r=!0,Eg.start()),this.render(),this.#_=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
|
|
@@ -425,7 +425,7 @@ ${e}`,H6=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),q6=Objec
|
|
|
425
425
|
`)}formatExecutionSummary(e){let r=[];if(e.function_name&&r.push(`${this.emoji("\u{1F527} ")}${e.function_name}`),e.model&&r.push(`${this.emoji("\u{1F916} ")}${e.model}`),e.tokens_in!==void 0||e.tokens_out!==void 0){let s=e.tokens_in??0,i=e.tokens_out??0;r.push(`${this.emoji("\u{1F522} ")}${s}\u2197 ${i}\u2198`)}if(e.cost!==void 0&&r.push(`${this.emoji("\u{1F4B0} ")}$${e.cost.toFixed(6)}`),e.execution_time!==void 0&&r.push(`${this.emoji("\u26A1 ")}${e.execution_time.toFixed(1)}s`),r.length===0)return"";let n=r.join(" \u2022 ");return this.color(n,_.dim)}formatError(e){let r=[];return r.push(this.color(`${this.emoji("\u274C ")}${e.message}`,_.red)),e.suggestions&&e.suggestions.length>0&&(r.push(""),r.push(this.color(`${this.emoji("\u{1F4A1} ")}Solutions:`,_.yellow)),e.suggestions.forEach((n,s)=>{r.push(this.color(` ${s+1}. ${n}`,_.gray))})),r.join(`
|
|
426
426
|
`)}formatConfig(e){let r=[];r.push(this.color(`${this.emoji("\u{1F4CB} ")}Current AII Configuration:`,_.cyan)),r.push(`- Config file: ${e.configFile}`),r.push(`- Storage path: ${e.storagePath}`),e.apiUrl&&r.push(`- Aii Server: ${e.apiUrl}`);let n=e.hasApiKey?this.color("\u2713",_.green):this.color("\u2717",_.red);if(r.push(`- LLM provider: ${e.provider} (${e.model}) - ${n}`),e.webSearch){let s=e.webSearch.enabled?this.color("\u2713",_.green):this.color("\u2717",_.red);r.push(`- Web search: ${e.webSearch.provider??"none"} - ${s}`)}return e.issues&&e.issues.length>0&&r.push(`- Configuration issues: ${e.issues.length}`),r.join(`
|
|
427
427
|
`)}formatHealthCheck(e){let r=[];r.push(this.color(`${this.emoji("\u{1F3E5} ")}AII Health Check`,_.cyan)),r.push("");for(let i of e){let a,o;switch(i.status){case"ok":a="\u2713",o=_.green;break;case"warn":a="\u26A0",o=_.yellow;break;case"error":a="\u2717",o=_.red;break}let l=this.color(a,o),c=this.color(i.message,o);r.push(` ${l} ${i.name.padEnd(20)} ${c}`)}let n=e.some(i=>i.status==="error"),s=e.some(i=>i.status==="warn");return r.push(""),n?r.push(this.color(`${this.emoji("\u274C ")}Some checks failed!`,_.red)):s?r.push(this.color(`${this.emoji("\u26A0\uFE0F ")}All checks passed with warnings`,_.yellow)):r.push(this.color(`${this.emoji("\u2705 ")}All checks passed!`,_.green)),r.join(`
|
|
428
|
-
`)}};function Jt(t={}){return new l1(t)}var WZ={ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},jZ=[{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 c1(t){if(!t)return;let e=t.toLowerCase();for(let{provider:r,patterns:n}of jZ)for(let s of n)if(s.test(e))return r}function vt(t){if(!t)return t;let e=t.indexOf("/");if(e===-1)return t;let r=t.substring(0,e).toLowerCase();return r!=="ollama"&&r in WZ?t.substring(e+1):t}function qt(t,e,r){if(r)return r;if(t){let n=c1(t);if(n)return n}return e}Pe();import*as h9 from"readline";import*as ar from"fs";import*as Cp from"path";import*as p9 from"os";var bp=Cp.join(p9.homedir(),".aii","conversations"),u1=Cp.join(bp,"current.json");function Dp(){ar.existsSync(bp)||ar.mkdirSync(bp,{recursive:!0})}function QZ(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function XZ(t){let r=t.trim().replace(/\s+/g," ");return r.length>50&&(r=r.substring(0,50).trim()+"..."),r}function _9(t){return Cp.join(bp,`${t}.json`)}function m9(){Dp();try{if(ar.existsSync(u1)){let t=ar.readFileSync(u1,"utf-8"),e=JSON.parse(t),r=_9(e.id);if(ar.existsSync(r)){let n=ar.readFileSync(r,"utf-8");return JSON.parse(n)}}}catch{}return f9()}function f9(){Dp();let t={id:QZ(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return Sl(t),ZZ(t.id),t}function Sl(t){if(Dp(),t.title==="New Conversation"&&t.messages.length>0){let r=t.messages.find(n=>n.role==="user");r&&(t.title=XZ(r.content))}t.updatedAt=Date.now();let e=_9(t.id);ar.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}function ZZ(t){Dp(),ar.writeFileSync(u1,JSON.stringify({id:t}),"utf-8")}function g9(){return f9()}var JZ="0.8.
|
|
428
|
+
`)}};function Jt(t={}){return new l1(t)}var WZ={ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},jZ=[{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 c1(t){if(!t)return;let e=t.toLowerCase();for(let{provider:r,patterns:n}of jZ)for(let s of n)if(s.test(e))return r}function vt(t){if(!t)return t;let e=t.indexOf("/");if(e===-1)return t;let r=t.substring(0,e).toLowerCase();return r!=="ollama"&&r in WZ?t.substring(e+1):t}function qt(t,e,r){if(r)return r;if(t){let n=c1(t);if(n)return n}return e}Pe();import*as h9 from"readline";import*as ar from"fs";import*as Cp from"path";import*as p9 from"os";var bp=Cp.join(p9.homedir(),".aii","conversations"),u1=Cp.join(bp,"current.json");function Dp(){ar.existsSync(bp)||ar.mkdirSync(bp,{recursive:!0})}function QZ(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function XZ(t){let r=t.trim().replace(/\s+/g," ");return r.length>50&&(r=r.substring(0,50).trim()+"..."),r}function _9(t){return Cp.join(bp,`${t}.json`)}function m9(){Dp();try{if(ar.existsSync(u1)){let t=ar.readFileSync(u1,"utf-8"),e=JSON.parse(t),r=_9(e.id);if(ar.existsSync(r)){let n=ar.readFileSync(r,"utf-8");return JSON.parse(n)}}}catch{}return f9()}function f9(){Dp();let t={id:QZ(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return Sl(t),ZZ(t.id),t}function Sl(t){if(Dp(),t.title==="New Conversation"&&t.messages.length>0){let r=t.messages.find(n=>n.role==="user");r&&(t.title=XZ(r.content))}t.updatedAt=Date.now();let e=_9(t.id);ar.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}function ZZ(t){Dp(),ar.writeFileSync(u1,JSON.stringify({id:t}),"utf-8")}function g9(){return f9()}var JZ="0.8.2",d1=class{configManager;parsed;running=!1;conversation;stats;formatter;constructor(e,r){this.parsed=e,this.configManager=r,this.conversation=m9(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=Jt({colors:!e.flags.noColors,emojis:!e.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let e=await this.getUserInput();if(!e.trim()||await this.handleSpecialCommands(e))continue;this.conversation.messages.push({role:"user",content:e,timestamp:Date.now()}),Sl(this.conversation),await this.processWithContext(e)}catch(e){if(e instanceof Error&&e.message==="EXIT")break;if(e instanceof Error&&e.message==="INTERRUPTED"){console.log(`
|
|
429
429
|
\u26A0\uFE0F Interrupted. Type /exit to quit or continue chatting.`);continue}console.error(_.red(`
|
|
430
430
|
\u274C Error: ${e instanceof Error?e.message:String(e)}`)),this.conversation.messages.length>0&&this.conversation.messages[this.conversation.messages.length-1].role==="user"&&(this.conversation.messages.pop(),Sl(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((e,r)=>{let n=h9.createInterface({input:process.stdin,output:process.stdout}),s=[],i=!1,a=()=>{i=!0,n.close()},o=l=>{n.question(l,c=>{if(s.length===0&&c.trim().startsWith("/")){a(),e(c.trim());return}c.endsWith("\\")?(s.push(c.slice(0,-1)),o(" ")):(s.push(c),a(),e(s.join(`
|
|
431
431
|
`).trim()))})};n.on("SIGINT",()=>{a(),r(new Error("INTERRUPTED"))}),n.on("close",()=>{i||r(new Error("EXIT"))}),o("> ")})}async handleSpecialCommands(e){let r=e.trim().toLowerCase();if(r.startsWith("/"))r=r.slice(1);else return!1;switch(r){case"exit":case"quit":return await this.handleExit(),!0;case"help":return this.displayHelp(),!0;case"clear":case"new":return this.clearConversation(),!0;case"history":return this.displayConversationHistory(),!0;case"stats":return this.displayStats(),!0;case"version":return this.displayVersion(),!0;default:return console.log(_.yellow(`Unknown command: /${r}. Type /help for available commands.`)),console.log(""),!0}}async processWithContext(e){let r=await this.configManager.load(),n=this.configManager.validate();if(!n.valid)throw new xt(n.issues.join(", "));let i=this.configManager.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",a=vt(this.parsed.flags.model??r.llm.model),o=qt(this.parsed.flags.model,r.llm.provider,this.parsed.flags.provider),l=this.configManager.getApiKey(o);if(!l)throw new ht(`Missing API key for provider: ${o}`);this.stats.totalRequests++;let c=Yr(!this.parsed.flags.noAnimations);c.start("");let u=rn({spinner:c,enabled:!this.parsed.flags.noStreaming}),d=this.conversation.messages.slice(-21,-1).map(y=>({role:y.role,content:y.content})),p={api_key:i,system_prompt:null,user_prompt:e,user_message:e,output_mode:"CLEAN",streaming:!this.parsed.flags.noStreaming,model:a,llm_provider:o,llm_api_key:l,provider_api_key:l,client_type:"cli",offline:this.parsed.flags.offline,conversation_history:d.length>0?d:void 0},h=this.parsed.flags.host?`http://${this.parsed.flags.host}`:r.api.url,m=new Sr({url:h}),g="",E=!1;try{let y=await m.executeRequest(p,{onToken:N=>{g+=N,E=!0,u.onToken(N)}});u.flush();let T=y.result||g;!E&&T&&console.log(T),console.log(""),y.metadata&&this.displayExecutionSummary(y.metadata),T&&(this.conversation.messages.push({role:"assistant",content:T,timestamp:Date.now()}),Sl(this.conversation))}catch(y){throw c.stop(!0),y}finally{m.disconnect()}}displayExecutionSummary(e){let r=e.cost||0,n=e.tokens_in||0,s=e.tokens_out||0,i=n+s;this.stats.cumulativeTokens+=i,this.stats.cumulativeCost+=r,console.log(this.formatter.formatExecutionSummary({model:e.model,tokens_in:n,tokens_out:s,cost:r,execution_time:e.execution_time})),console.log("")}clearConversation(){this.conversation=g9(),console.clear(),this.displayWelcome()}displayConversationHistory(){if(this.conversation.messages.length===0){console.log(`
|
|
@@ -461,7 +461,7 @@ Enter your ${n.name} API key:
|
|
|
461
461
|
`));let i=await this.promptSecret("API Key");return i?(this.context.webSearchApiKey=i,console.log(_.green("\u2713 Web search configured!")),!0):(this.context.webSearchEnabled=!1,console.log(_.yellow("\u26A0 No API key provided. Skipping web search setup.")),!1)}async saveConfiguration(){let{provider:e,model:r,apiKey:n,webSearchEnabled:s,webSearchProvider:i,webSearchApiKey:a}=this.context;if(!e||!r||!n)throw new Error("Missing configuration values");await this.configManager.load(),await this.configManager.set("llm.provider",e.key),await this.configManager.set("llm.model",r),await this.configManager.setSecret(`${e.key}_api_key`,n),s&&i?(await this.configManager.set("web_search.enabled",!0),await this.configManager.set("web_search.provider",i.key),a&&await this.configManager.setSecret(`${i.key}_search_api_key`,a)):await this.configManager.set("web_search.enabled",!1),console.log(_.green(" \u2713 Configuration saved!")),console.log(_.dim(` Config: ${this.configManager.getConfigDir()}/config.yaml`)),console.log(_.dim(` Secrets: ${this.configManager.getConfigDir()}/secrets.yaml`))}showSuccess(){let{provider:e,model:r,webSearchEnabled:n,webSearchProvider:s}=this.context,i=e?.models.find(o=>o.model===r),a=i?.displayName||r;console.log(""),console.log(_.green.bold("\u2705 Setup complete!")),console.log(""),console.log(_.bold("Configuration:")),console.log(_.dim(" \u2022 Provider: ")+_.cyan(`${e?.name}`)),console.log(_.dim(" \u2022 Model: ")+_.cyan(`${a}`)),i&&console.log(_.dim(" \u2022 Pricing: ")+_.cyan(`${yl(i.inputPrice)}/M in, ${yl(i.outputPrice)}/M out`)),console.log(n&&s?_.dim(" \u2022 Web Search: ")+_.cyan(`${s.name} \u2713`):_.dim(" \u2022 Web Search: ")+_.gray("disabled")),console.log(_.dim(" \u2022 Config: ")+_.cyan(`${this.configManager.getConfigDir()}`)),console.log(""),console.log(_.bold("\u{1F4DA} Try your first command:")),console.log(_.cyan(' aii "explain what is TypeScript"')),console.log(""),console.log(_.bold("\u{1F4A1} Other commands to try:")),console.log(_.dim(' aii "translate hello to spanish"')),console.log(_.dim(" aii run git commit")),console.log(_.dim(" aii --help")),console.log(""),console.log(_.bold("\u{1F527} Need help?")),console.log(_.dim(" aii doctor \u2014 Health check")),console.log(_.dim(" aii --help \u2014 Show all commands")),console.log("")}handleCancel(){return console.log(""),console.log(_.yellow("\u23F8\uFE0F Setup cancelled.")),console.log(""),console.log(_.dim("You can run this wizard again anytime with:")),console.log(_.cyan(" aii config init")),console.log(""),!1}prompt(e,r){return this.rl&&(this.rl.close(),this.rl=null),process.stdin.resume(),this.rl=g1.createInterface({input:process.stdin,output:process.stdout}),new Promise(n=>{let s=r?`${e} [${r}]: `:`${e}: `;this.rl.question(s,i=>{n(i.trim()||r||"")})})}promptSecret(e){return this.rl&&(this.rl.close(),this.rl=null),process.stdin.resume(),new Promise(r=>{let n=`${e}: `;process.stdout.write(n);let s="";process.stdin.isTTY&&process.stdin.setRawMode(!0);let i=a=>{let o=a.toString();for(let l of o)if(l==="\r"||l===`
|
|
462
462
|
`){process.stdin.setRawMode(!1),process.stdin.removeListener("data",i),process.stdout.write(`
|
|
463
463
|
`),r(s.trim());return}else if(l===""){process.stdin.setRawMode(!1),process.stdin.removeListener("data",i),process.stdout.write(`
|
|
464
|
-
`),r("");return}else l==="\x7F"||l==="\b"?s.length>0&&(s=s.slice(0,-1),process.stdout.write("\b \b")):l.charCodeAt(0)>=32&&(s+=l,process.stdout.write("*"))};process.stdin.on("data",i)})}};async function Ip(t){return new f1(t).run()}var Tl={safetyBuffer:.05,minThreshold:.1,recentTokensTarget:3e4,summaryTokensTarget:1e4,overlapTokens:2e3,enabled:!0},bl={warning:.55,critical:.7,overflow:.85,usableContext:1e5};var EJ=5e3,SJ=60*60*1e3,Ar=class t{static instance=null;models=new Map;thresholds=new Map;lastFetchTime=0;fetchPromise=null;config;serverBaseUrl;apiKey;constructor(e,r,n){this.serverBaseUrl=e,this.apiKey=r??"",this.config={...Tl,...n}}static getInstance(e,r,n){return t.instance?r&&!t.instance.apiKey&&(t.instance.apiKey=r):(e||(e="http://localhost:26169"),t.instance=new t(e,r,n)),t.instance}setApiKey(e){this.apiKey=e}static resetInstance(){t.instance=null}async initialize(){if(this.fetchPromise)return this.fetchPromise;if(!this.isCacheFresh()){this.fetchPromise=this.fetchWithTimeout();try{await this.fetchPromise}finally{this.fetchPromise=null}}}isCacheFresh(){return this.lastFetchTime>0&&Date.now()-this.lastFetchTime<SJ&&this.models.size>0}async refresh(){this.lastFetchTime=0,this.models.clear(),this.thresholds.clear(),await this.initialize()}async fetchWithTimeout(){let e=new AbortController,r=setTimeout(()=>e.abort(),EJ);try{let n={Accept:"application/json"};this.apiKey&&(n["Aii-API-Key"]=this.apiKey);let s=await fetch(`${this.serverBaseUrl}/v0/models`,{signal:e.signal,headers:n});if(clearTimeout(r),!s.ok)throw new Error(`Server returned ${s.status}`);let i=await s.json();this.processServerResponse(i),this.lastFetchTime=Date.now(),process.env.AII_DEBUG&&console.log(`[DEBUG] ModelInfoCache: Cached ${this.models.size} models`)}catch(n){clearTimeout(r);let s=n.message;s.includes("aborted")||s.includes("abort")?console.warn("[ModelInfoCache] Fetch timed out, using fallback thresholds"):console.warn(`[ModelInfoCache] Fetch failed: ${s}, using fallback thresholds`),this.scheduleBackgroundRefresh()}}processServerResponse(e){for(let r of e.providers)for(let n of r.models){if(!n.context_length||!n.max_output_tokens)continue;let s={id:n.name,name:n.display_name??n.name,provider:r.name,contextLength:n.context_length,maxOutputTokens:n.max_output_tokens,inputPrice:n.input_price_per_million??0,outputPrice:n.output_price_per_million??0,costTier:n.cost_tier,description:n.description};this.models.set(n.name,s);let i=this.calculateDynamicThresholds(s);this.thresholds.set(n.name,i)}}calculateDynamicThresholds(e){let n=1-e.maxOutputTokens/e.contextLength-this.config.safetyBuffer,s=Math.min(.7,Math.max(this.config.minThreshold,n)),i=Math.min(.6,Math.max(0,s-.15)),a=Math.min(.85,s+.15),o=Math.floor(e.contextLength*s);return{warning:i,critical:s,overflow:a,usableContext:o}}scheduleBackgroundRefresh(){setTimeout(()=>{this.fetchWithTimeout().catch(()=>{})},3e4)}getModelInfo(e){return this.models.get(e)}getThresholds(e){let r=this.thresholds.get(e);if(r)return r;let n=this.models.get(e);if(n){let s=this.calculateDynamicThresholds(n);return this.thresholds.set(e,s),s}return bl}getUsableContext(e){return this.getThresholds(e).usableContext}hasModel(e){return this.models.has(e)}getModelIds(){return Array.from(this.models.keys())}isInitialized(){return this.models.size>0}getStats(){return{modelCount:this.models.size,lastFetch:this.lastFetchTime,isFresh:this.isCacheFresh()}}getModelsByProvider(e){let r=[];for(let n of this.models.values())n.provider===e&&r.push(n);return r}getCheapestModel(e){let r=this.getModelsByProvider(e),n=r.filter(s=>s.costTier==="cheap");if(n.length>0)return n.sort((s,i)=>s.inputPrice-i.inputPrice),n[0].id;if(r.length>0)return[...r].sort((i,a)=>i.inputPrice-a.inputPrice)[0].id}getModelPricing(e){let r=this.models.get(e);if(r&&(r.inputPrice>0||r.outputPrice>0))return{input:r.inputPrice,output:r.outputPrice};for(let[n,s]of this.models)if(e.startsWith(n)&&(s.inputPrice>0||s.outputPrice>0))return{input:s.inputPrice,output:s.outputPrice}}getModelsByTier(e,r){return this.getModelsByProvider(e).filter(n=>n.costTier===r)}getProviders(){let e=new Set;for(let r of this.models.values())e.add(r.provider);return Array.from(e)}};function h1(t,e){return Ar.getInstance(t,e)}async function y9(t,e,r){let n=Jt({colors:!e.flags.noColors,emojis:!e.flags.noEmojis});switch(t){case"init":await yJ(r);break;case"show":await TJ(r,n);break;case"validate":await bJ(r);break;case"set":await CJ(e,r);break;case"model":await DJ(e,r);break;case"provider":await RJ(e,r);break;case"host":await OJ(e,r);break;case"websearch":await kJ(e,r);break;case"models":await vJ(e,r);break;case"providers":await wJ(e,r);break;case"help":xJ(e);break;default:U.error(`Unknown config action: ${t}`),U.info("Available actions: init, show, validate, set, model, provider, host, websearch, help"),process.exit(1)}}async function yJ(t){await Ip(t)||process.exit(1),process.exit(0)}async function TJ(t,e){let r=await t.load(),n=t.validate(),s=t.getSecret("brave_search_api_key")||t.getSecret("brave_api_key"),i=t.getSecret("google_search_api_key"),a=t.getSecret("google_search_engine_id"),o;s?o={enabled:!0,provider:"brave"}:i&&a?o={enabled:!0,provider:"google"}:o={enabled:!1,provider:"none"};let l=e.formatConfig({configFile:t.getConfigDir()+"/config.yaml",storagePath:t.getConfigDir(),provider:r.llm.provider,model:r.llm.model,hasApiKey:!!t.getApiKey(),apiUrl:r.api?.url||"http://localhost:26169",webSearch:o,issues:n.issues});console.log(l)}async function bJ(t){await t.load();let e=t.validate();e.valid?U.success("Configuration is valid"):(U.error("Configuration has issues:"),e.issues.forEach(r=>{U.info(` - ${r}`)}),process.exit(1))}async function CJ(t,e){let[r,...n]=t.args,s=n.join(" ");r||(U.error("Usage: aii config set <key> <value>"),U.info("Example: aii config set llm.model gpt-4o"),process.exit(1)),s||(U.error("Missing value for key: "+r),process.exit(1)),await e.load();let i=s;try{i=JSON.parse(s)}catch{}await e.set(r,i),U.success(`Set ${r} = ${s}`)}async function DJ(t,e){let r=t.args[0];if(!r){let n=await e.load();U.info(`Current model: ${n.llm.model}`);return}await e.load(),await e.set("llm.model",r),U.success(`Model set to: ${r}`)}var AJ={anthropic:"Claude models (Sonnet 4, Opus 4, Haiku 4.5)",openai:"GPT models (GPT-5.2, GPT-4o, GPT-4.1)",gemini:"Gemini models (3-pro, 2.5-pro, 2.5-flash)",moonshot:"Kimi models (K2 Thinking, Vision)",deepseek:"DeepSeek models (chat, coder, reasoner)",zai:"Z.ai GLM models (GLM-4.7, 4.6V, 4.5)",ollama:"Ollama local models (Llama, Mistral, Qwen, etc.)"},NJ={anthropic:"claude-haiku-4-5",openai:"gpt-4.1-mini",gemini:"gemini-2.5-flash",moonshot:"kimi-k2-thinking",deepseek:"deepseek-chat",zai:"glm-4.5-air",ollama:"ollama/llama3.1:8b"};function IJ(t){let e=Ar.getInstance();if(e.isInitialized()){let r=e.getCheapestModel(t);if(r)return r}return NJ[t]??"claude-sonnet-4"}async function RJ(t,e){let r=t.args[0],n=["anthropic","openai","gemini","deepseek","moonshot","zai","ollama"];if(!r){let i=await e.load(),a=i.llm.provider;console.log(`\u{1F916} Current provider: ${a} (${i.llm.model})`),console.log(""),console.log("\u2728 Available providers:"),n.forEach((o,l)=>{let c=AJ[o];console.log(` ${l+1}. ${o.padEnd(10)} - ${c}`)}),console.log(""),console.log("Usage: aii config provider <provider_name>"),console.log(""),console.log("\u26A0\uFE0F Note: Changing provider may require setting a new model");return}n.includes(r)||(U.error(`Invalid provider: ${r}`),U.info(`Valid providers: ${n.join(", ")}`),process.exit(1)),await e.load(),await e.set("llm.provider",r);let s=IJ(r);await e.set("llm.model",s),U.success(`Provider set to: ${r}`),U.info(`Model set to: ${s}`)}async function OJ(t,e){let r=t.args[0];if(!r){let i=(await e.load()).api?.url||"http://localhost:26169";console.log(`\u{1F310} Current API host: ${i}`),console.log(""),console.log("Usage: aii config host <host:port>"),console.log(""),console.log("Examples:"),console.log(" aii config host localhost:26169"),console.log(" aii config host 192.168.1.100:26169"),console.log(" aii config host http://api.example.com:26169");return}await e.load();let n=r;!r.startsWith("http://")&&!r.startsWith("https://")&&(n=`http://${r}`),await e.set("api.url",n),U.success(`API host set to: ${n}`)}async function kJ(t,e){let r=t.args[0]?.toLowerCase(),n=t.args[1];if(await e.load(),!r){let s=e.getSecret("brave_search_api_key")||e.getSecret("brave_api_key"),i=e.getSecret("google_search_api_key")||e.getSecret("google_api_key"),a=e.getSecret("google_search_engine_id");console.log(`\u{1F50D} Web Search Configuration
|
|
464
|
+
`),r("");return}else l==="\x7F"||l==="\b"?s.length>0&&(s=s.slice(0,-1),process.stdout.write("\b \b")):l.charCodeAt(0)>=32&&(s+=l,process.stdout.write("*"))};process.stdin.on("data",i)})}};async function Ip(t){return new f1(t).run()}var Tl={safetyBuffer:.05,minThreshold:.1,recentTokensTarget:3e4,summaryTokensTarget:1e4,overlapTokens:2e3,enabled:!0},bl={warning:.55,critical:.7,overflow:.85,usableContext:1e5};var EJ=5e3,SJ=60*60*1e3,Ar=class t{static instance=null;models=new Map;thresholds=new Map;lastFetchTime=0;fetchPromise=null;config;serverBaseUrl;apiKey;constructor(e,r,n){this.serverBaseUrl=e,this.apiKey=r??"",this.config={...Tl,...n}}static getInstance(e,r,n){return t.instance?r&&!t.instance.apiKey&&(t.instance.apiKey=r):(e||(e="http://localhost:26169"),t.instance=new t(e,r,n)),t.instance}setApiKey(e){this.apiKey=e}static resetInstance(){t.instance=null}async initialize(){if(this.fetchPromise)return this.fetchPromise;if(!this.isCacheFresh()){this.fetchPromise=this.fetchWithTimeout();try{await this.fetchPromise}finally{this.fetchPromise=null}}}isCacheFresh(){return this.lastFetchTime>0&&Date.now()-this.lastFetchTime<SJ&&this.models.size>0}async refresh(){this.lastFetchTime=0,this.models.clear(),this.thresholds.clear(),await this.initialize()}async fetchWithTimeout(){let e=new AbortController,r=setTimeout(()=>e.abort(),EJ);try{let n={Accept:"application/json"};this.apiKey&&(n["Aii-API-Key"]=this.apiKey);let s=await fetch(`${this.serverBaseUrl}/v0/models`,{signal:e.signal,headers:n});if(clearTimeout(r),!s.ok)throw new Error(`Server returned ${s.status}`);let i=await s.json();this.processServerResponse(i),this.lastFetchTime=Date.now(),process.env.AII_DEBUG&&console.log(`[DEBUG] ModelInfoCache: Cached ${this.models.size} models`)}catch(n){clearTimeout(r);let s=n.message;s.includes("aborted")||s.includes("abort")?console.warn("[ModelInfoCache] Fetch timed out, using fallback thresholds"):console.warn(`[ModelInfoCache] Fetch failed: ${s}, using fallback thresholds`),this.scheduleBackgroundRefresh()}}processServerResponse(e){for(let r of e.providers)for(let n of r.models){if(!n.context_length||!n.max_output_tokens)continue;let s={id:n.name,name:n.display_name??n.name,provider:r.name,contextLength:n.context_length,maxOutputTokens:n.max_output_tokens,inputPrice:n.input_price_per_million??0,outputPrice:n.output_price_per_million??0,costTier:n.cost_tier,description:n.description};this.models.set(n.name,s);let i=this.calculateDynamicThresholds(s);if(this.thresholds.set(n.name,i),n.name.startsWith("ollama/")){let a=n.name.slice(7);this.models.set(a,s),this.thresholds.set(a,i)}}}calculateDynamicThresholds(e){let n=1-e.maxOutputTokens/e.contextLength-this.config.safetyBuffer,s=Math.min(.7,Math.max(this.config.minThreshold,n)),i=Math.min(.6,Math.max(0,s-.15)),a=Math.min(.85,s+.15),o=Math.floor(e.contextLength*s);return{warning:i,critical:s,overflow:a,usableContext:o}}scheduleBackgroundRefresh(){setTimeout(()=>{this.fetchWithTimeout().catch(()=>{})},3e4)}getModelInfo(e){return this.models.get(e)}getThresholds(e){let r=this.thresholds.get(e);if(r)return r;let n=this.models.get(e);if(n){let s=this.calculateDynamicThresholds(n);return this.thresholds.set(e,s),s}return bl}getUsableContext(e){return this.getThresholds(e).usableContext}hasModel(e){return this.models.has(e)}getModelIds(){return Array.from(this.models.keys())}isInitialized(){return this.models.size>0}getStats(){return{modelCount:this.models.size,lastFetch:this.lastFetchTime,isFresh:this.isCacheFresh()}}getModelsByProvider(e){let r=[];for(let n of this.models.values())n.provider===e&&r.push(n);return r}getCheapestModel(e){let r=this.getModelsByProvider(e),n=r.filter(s=>s.costTier==="cheap");if(n.length>0)return n.sort((s,i)=>s.inputPrice-i.inputPrice),n[0].id;if(r.length>0)return[...r].sort((i,a)=>i.inputPrice-a.inputPrice)[0].id}getModelPricing(e){let r=this.models.get(e);if(r&&(r.inputPrice>0||r.outputPrice>0))return{input:r.inputPrice,output:r.outputPrice};for(let[n,s]of this.models)if(e.startsWith(n)&&(s.inputPrice>0||s.outputPrice>0))return{input:s.inputPrice,output:s.outputPrice}}getModelsByTier(e,r){return this.getModelsByProvider(e).filter(n=>n.costTier===r)}getProviders(){let e=new Set;for(let r of this.models.values())e.add(r.provider);return Array.from(e)}};function h1(t,e){return Ar.getInstance(t,e)}async function y9(t,e,r){let n=Jt({colors:!e.flags.noColors,emojis:!e.flags.noEmojis});switch(t){case"init":await yJ(r);break;case"show":await TJ(r,n);break;case"validate":await bJ(r);break;case"set":await CJ(e,r);break;case"model":await DJ(e,r);break;case"provider":await RJ(e,r);break;case"host":await OJ(e,r);break;case"websearch":await kJ(e,r);break;case"models":await vJ(e,r);break;case"providers":await wJ(e,r);break;case"help":xJ(e);break;default:U.error(`Unknown config action: ${t}`),U.info("Available actions: init, show, validate, set, model, provider, host, websearch, help"),process.exit(1)}}async function yJ(t){await Ip(t)||process.exit(1),process.exit(0)}async function TJ(t,e){let r=await t.load(),n=t.validate(),s=t.getSecret("brave_search_api_key")||t.getSecret("brave_api_key"),i=t.getSecret("google_search_api_key"),a=t.getSecret("google_search_engine_id"),o;s?o={enabled:!0,provider:"brave"}:i&&a?o={enabled:!0,provider:"google"}:o={enabled:!1,provider:"none"};let l=e.formatConfig({configFile:t.getConfigDir()+"/config.yaml",storagePath:t.getConfigDir(),provider:r.llm.provider,model:r.llm.model,hasApiKey:!!t.getApiKey(),apiUrl:r.api?.url||"http://localhost:26169",webSearch:o,issues:n.issues});console.log(l)}async function bJ(t){await t.load();let e=t.validate();e.valid?U.success("Configuration is valid"):(U.error("Configuration has issues:"),e.issues.forEach(r=>{U.info(` - ${r}`)}),process.exit(1))}async function CJ(t,e){let[r,...n]=t.args,s=n.join(" ");r||(U.error("Usage: aii config set <key> <value>"),U.info("Example: aii config set llm.model gpt-4o"),process.exit(1)),s||(U.error("Missing value for key: "+r),process.exit(1)),await e.load();let i=s;try{i=JSON.parse(s)}catch{}await e.set(r,i),U.success(`Set ${r} = ${s}`)}async function DJ(t,e){let r=t.args[0];if(!r){let n=await e.load();U.info(`Current model: ${n.llm.model}`);return}await e.load(),await e.set("llm.model",r),U.success(`Model set to: ${r}`)}var AJ={anthropic:"Claude models (Sonnet 4, Opus 4, Haiku 4.5)",openai:"GPT models (GPT-5.2, GPT-4o, GPT-4.1)",gemini:"Gemini models (3-pro, 2.5-pro, 2.5-flash)",moonshot:"Kimi models (K2 Thinking, Vision)",deepseek:"DeepSeek models (chat, coder, reasoner)",zai:"Z.ai GLM models (GLM-4.7, 4.6V, 4.5)",ollama:"Ollama local models (Llama, Mistral, Qwen, etc.)"},NJ={anthropic:"claude-haiku-4-5",openai:"gpt-4.1-mini",gemini:"gemini-2.5-flash",moonshot:"kimi-k2-thinking",deepseek:"deepseek-chat",zai:"glm-4.5-air",ollama:"ollama/llama3.1:8b"};function IJ(t){let e=Ar.getInstance();if(e.isInitialized()){let r=e.getCheapestModel(t);if(r)return r}return NJ[t]??"claude-sonnet-4"}async function RJ(t,e){let r=t.args[0],n=["anthropic","openai","gemini","deepseek","moonshot","zai","ollama"];if(!r){let i=await e.load(),a=i.llm.provider;console.log(`\u{1F916} Current provider: ${a} (${i.llm.model})`),console.log(""),console.log("\u2728 Available providers:"),n.forEach((o,l)=>{let c=AJ[o];console.log(` ${l+1}. ${o.padEnd(10)} - ${c}`)}),console.log(""),console.log("Usage: aii config provider <provider_name>"),console.log(""),console.log("\u26A0\uFE0F Note: Changing provider may require setting a new model");return}n.includes(r)||(U.error(`Invalid provider: ${r}`),U.info(`Valid providers: ${n.join(", ")}`),process.exit(1)),await e.load(),await e.set("llm.provider",r);let s=IJ(r);await e.set("llm.model",s),U.success(`Provider set to: ${r}`),U.info(`Model set to: ${s}`)}async function OJ(t,e){let r=t.args[0];if(!r){let i=(await e.load()).api?.url||"http://localhost:26169";console.log(`\u{1F310} Current API host: ${i}`),console.log(""),console.log("Usage: aii config host <host:port>"),console.log(""),console.log("Examples:"),console.log(" aii config host localhost:26169"),console.log(" aii config host 192.168.1.100:26169"),console.log(" aii config host http://api.example.com:26169");return}await e.load();let n=r;!r.startsWith("http://")&&!r.startsWith("https://")&&(n=`http://${r}`),await e.set("api.url",n),U.success(`API host set to: ${n}`)}async function kJ(t,e){let r=t.args[0]?.toLowerCase(),n=t.args[1];if(await e.load(),!r){let s=e.getSecret("brave_search_api_key")||e.getSecret("brave_api_key"),i=e.getSecret("google_search_api_key")||e.getSecret("google_api_key"),a=e.getSecret("google_search_engine_id");console.log(`\u{1F50D} Web Search Configuration
|
|
465
465
|
`),console.log(s?` Brave Search: ${_.green("\u2713 Configured")} (key: ${s.slice(0,8)}...)`:` Brave Search: ${_.red("\u2717 Not configured")}`),console.log(i&&a?` Google Search: ${_.green("\u2713 Configured")} (key: ${i.slice(0,8)}...)`:i?` Google Search: ${_.yellow("\u26A0 Partial")} (missing engine ID)`:` Google Search: ${_.red("\u2717 Not configured")}`),console.log(`
|
|
466
466
|
`+_.yellow("USAGE:")),console.log(" aii config websearch brave <api_key>"),console.log(" aii config websearch google <api_key> <engine_id>"),console.log(`
|
|
467
467
|
`+_.yellow("GET API KEYS:")),console.log(" Brave: https://brave.com/search/api/ (2,000 free/month)"),console.log(" Google: https://developers.google.com/custom-search/v1/overview");return}if(r!=="brave"&&r!=="google"&&(U.error(`Invalid web search provider: ${r}`),U.info("Valid providers: brave, google"),process.exit(1)),r==="brave"){n||(U.error("Missing API key"),U.info("Usage: aii config websearch brave <api_key>"),process.exit(1)),await e.setSecret("brave_search_api_key",n),U.success("Brave Search API key configured"),U.info("WebSearch tool will now be available in agent sessions");return}if(r==="google"){let s=t.args[2];n||(U.error("Missing API key"),U.info("Usage: aii config websearch google <api_key> <engine_id>"),process.exit(1)),s||(U.error("Missing Search Engine ID"),U.info("Usage: aii config websearch google <api_key> <engine_id>"),U.info("Get your Search Engine ID from: https://programmablesearchengine.google.com/"),process.exit(1)),await e.setSecret("google_search_api_key",n),await e.setSecret("google_search_engine_id",s),U.success("Google Custom Search configured"),U.info("WebSearch tool will now be available in agent sessions");return}}async function vJ(t,e){let r=t.args[0]?.toLowerCase(),s=(await e.load()).api?.url||"http://localhost:26169",i=e.getSecret("aii_api_key")||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4";try{let a=await fetch(`${s}/v0/models`,{headers:{"Aii-API-Key":i}});if(!a.ok){let c=await a.json().catch(()=>({}));U.error(`Failed to fetch models: ${c.error||a.statusText}`),U.info("Make sure aii-server is running and accessible"),process.exit(1)}let o=await a.json(),l=[];for(let c of o.providers)for(let u of c.models)l.push({...u,provider:c.name,provider_display:c.display_name,provider_configured:c.configured,api_key_env_var:c.api_key_env_var});if(r){let c=l.find(y=>y.name.toLowerCase()===r);if(!c){U.error(`Unknown model: ${r}`);let y=l.filter(T=>T.name.toLowerCase().includes(r)||r.includes(T.name.toLowerCase().split("-")[0])).slice(0,5);y.length>0&&U.info(`Did you mean: ${y.map(T=>T.name).join(", ")}`),process.exit(1)}console.log(_.cyan.bold(`
|
|
@@ -550,7 +550,7 @@ ${r.yellow("EXAMPLES:")}
|
|
|
550
550
|
${r.yellow("CONFIG FILE:")}
|
|
551
551
|
~/.aii/config.yaml Main configuration
|
|
552
552
|
~/.aii/secrets.yaml API keys (secure storage)
|
|
553
|
-
`)}import*as Cl from"fs";async function T9(t,e){let r=Jt({colors:!t.flags.noColors,emojis:!t.flags.noEmojis}),n=[];e.configExists()?n.push({name:"Configuration file",status:"ok",message:"Found"}):n.push({name:"Configuration file",status:"warn",message:"Not found (using defaults)"});let s=await e.load(),i=e.getApiKey();if(i){let p=LJ(i);n.push({name:"LLM Model",status:"ok",message:`${s.llm.model}@${s.llm.provider} (${p})`})}else n.push({name:"LLM Model",status:"error",message:`Not configured for ${s.llm.provider}`});let a=await MJ(s.api.url);n.push({name:"AII Server",status:a.ok?"ok":"error",message:a.message});let o=`${e.getConfigDir()}/mcp_servers.json`;if(Cl.existsSync(o))try{let p=Cl.readFileSync(o,"utf-8"),h=JSON.parse(p),m=Object.keys(h.mcpServers??{}).length;m>0?n.push({name:"MCP Servers",status:"ok",message:`${m} 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 l=e.getConfigDir();Cl.existsSync(l)?n.push({name:"Storage Directory",status:"ok",message:l}):n.push({name:"Storage Directory",status:"warn",message:"Not created"});let c=process.version;parseInt(c.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js Version",status:"ok",message:c}):n.push({name:"Node.js Version",status:"error",message:`${c} (requires >= 18)`}),console.log(r.formatHealthCheck(n)),n.some(p=>p.status==="error")&&process.exit(1)}async function MJ(t){try{let e=new AbortController,r=setTimeout(()=>e.abort(),3e3),n=await fetch(`${t}/api/status`,{signal:e.signal});if(clearTimeout(r),n.ok){let s=new URL(t);return{ok:!0,message:`Running at ${s.hostname}:${s.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(e){return e instanceof Error&&e.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}function LJ(t){return t.length<=10?"***":t.slice(0,6)+"..."+t.slice(-4)}Pe();var b9="0.8.
|
|
553
|
+
`)}import*as Cl from"fs";async function T9(t,e){let r=Jt({colors:!t.flags.noColors,emojis:!t.flags.noEmojis}),n=[];e.configExists()?n.push({name:"Configuration file",status:"ok",message:"Found"}):n.push({name:"Configuration file",status:"warn",message:"Not found (using defaults)"});let s=await e.load(),i=e.getApiKey();if(i){let p=LJ(i);n.push({name:"LLM Model",status:"ok",message:`${s.llm.model}@${s.llm.provider} (${p})`})}else n.push({name:"LLM Model",status:"error",message:`Not configured for ${s.llm.provider}`});let a=await MJ(s.api.url);n.push({name:"AII Server",status:a.ok?"ok":"error",message:a.message});let o=`${e.getConfigDir()}/mcp_servers.json`;if(Cl.existsSync(o))try{let p=Cl.readFileSync(o,"utf-8"),h=JSON.parse(p),m=Object.keys(h.mcpServers??{}).length;m>0?n.push({name:"MCP Servers",status:"ok",message:`${m} 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 l=e.getConfigDir();Cl.existsSync(l)?n.push({name:"Storage Directory",status:"ok",message:l}):n.push({name:"Storage Directory",status:"warn",message:"Not created"});let c=process.version;parseInt(c.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js Version",status:"ok",message:c}):n.push({name:"Node.js Version",status:"error",message:`${c} (requires >= 18)`}),console.log(r.formatHealthCheck(n)),n.some(p=>p.status==="error")&&process.exit(1)}async function MJ(t){try{let e=new AbortController,r=setTimeout(()=>e.abort(),3e3),n=await fetch(`${t}/api/status`,{signal:e.signal});if(clearTimeout(r),n.ok){let s=new URL(t);return{ok:!0,message:`Running at ${s.hostname}:${s.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(e){return e instanceof Error&&e.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}function LJ(t){return t.length<=10?"***":t.slice(0,6)+"..."+t.slice(-4)}Pe();var b9="0.8.2";function E1(t){let r=!t.flags.noColors?_:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
|
|
554
554
|
${r.cyan("AII")} - AI-powered CLI assistant v${b9}
|
|
555
555
|
|
|
556
556
|
${r.yellow("USAGE:")}
|
|
@@ -1209,7 +1209,7 @@ The subagent will execute autonomously and return a summary of its findings.`;pe
|
|
|
1209
1209
|
\u{1F534} Context at critical level - summarization unavailable (no server client)`)),!1;let e=this.contextManager.getState(),r=Math.round(e.usagePercent*100);console.log(_.yellow(`
|
|
1210
1210
|
\u{1F504} Context at ${r}% - auto-summarizing older messages before next turn...`));let n=9e4;return await Promise.race([this.contextManager.performSummarization(),new Promise(i=>setTimeout(()=>{console.warn(_.yellow(` \u26A0 Summarization timed out after ${n/1e3}s`)),this.contextManager.abortSummarization(),i(null)},n))])?(this.updateInputStatusContext(),!0):(console.log(_.red(" Summarization failed - proceeding with full context (may cause overflow)")),!1)}updateSessionMessagesWithSummary(e){let r=this.contextManager.getRecentMessages(),n={role:"system",content:`=== CONVERSATION SUMMARY (older turns) ===
|
|
1211
1211
|
${e}
|
|
1212
|
-
=== END SUMMARY ===`,timestamp:Date.now()};this.session.messages=[n,...r.map(s=>({role:s.role,content:s.content,timestamp:s.timestamp??Date.now()}))]}clearAndRedraw(e=""){process.stdout.write("\x1B[2J"),process.stdout.write("\x1B[H"),this.displayWelcome(),this.inputHandler.drawInputBox(e)}getSession(){return this.session}getContextManager(){return this.contextManager}syncContextWithSession(){let e=this.session.messages.length,r=this.contextManager.getMessageCount();if(e>0&&this.session.messages[0]?.role==="system"&&this.session.messages[0]?.content.includes("=== CONVERSATION SUMMARY")){let s=e-1;if(r<s)for(let i=r+1;i<e;i++){let a=this.session.messages[i];a&&a.role!=="system"&&this.contextManager.addMessage(a.role,a.content)}}else for(let s=r;s<e;s++){let i=this.session.messages[s];i&&this.contextManager.addMessage(i.role,i.content)}this.updateInputStatusContext()}getContextState(){return this.contextManager.getState()}hasServerReportedTokens(){return this.contextManager.hasServerReportedTokens()}getLastUserMessage(){for(let e=this.session.messages.length-1;e>=0;e--){let r=this.session.messages[e];if(r.role==="user")return r.content}return null}updateContextFromServerUsage(e){this.contextManager.updateFromServerUsage(e),this.updateInputStatusContext()}async start(){if(!this.isRunning){if(this.isRunning=!0,await this.contextManager.initialize(),this.setupContextManagerEvents(),nn.getInstance().initialize(this.session.projectPath),sn.getInstance().initialize(this.session.projectPath),this.options.config?.resumeSessionId){let e=await this.persistence.load(this.options.config.resumeSessionId);e&&(this.session=e,this.contextManager.setModel(this.session.model))}this.options.quiet||this.displayWelcome(),this.emit("start",this.session),await this.runInputLoop(),await this.persistence.save(this.session),this.inputHandler.close(),this.isRunning=!1,this.emit("end",this.session)}}async stop(){process.env.AII_INK_DEBUG&&(console.error("[INK-DEBUG] stop() called, isRunning="+this.isRunning),console.error("[INK-DEBUG] stop() stack:",new Error().stack)),this.isRunning&&(this.isRunning=!1,await this.persistence.save(this.session),this.inputHandler.close(),El())}displayWelcome(){let e=Le();this.updateInputStatusContext(),"setResourceCounts"in e&&e.setResourceCounts({tools:this.getToolCount(),mcpServers:this.getMcpServerCount(),contextFiles:0,skills:this.getSkillsCount()}),"drawInitial"in e&&e.drawInitial("")}getMcpServerCount(){try{let n=new St().loadConfig().mcpServers||{};return Object.values(n).filter(s=>s.enabled!==!1).length}catch{return 0}}getToolCount(){try{return SS().length}catch{return 6}}getSkillsCount(){try{return ge.hasInstance()?ge.getInstance().size:0}catch{return 0}}updateInputStatusContext(){let e=this.contextManager.getState(),r=Math.round(e.usagePercent*100),n="normal";e.status==="critical"||e.status==="overflow"?n="critical":e.status==="warning"&&(n="warning");let i=this.contextManager.getModelInfo()?.contextLength??e.thresholds.usableContext,a={projectPath:this.session.projectPath,branch:this.getGitBranch(),mode:this.session.mode,provider:this.session.provider,model:this.session.model,memoryMB:this.getMemoryUsage(),contextPercent:r,contextLevel:n,contextTokens:e.tokens.total,contextLimit:i,sessionCost:this.session.stats.totalCost};this.inputHandler.setStatusContext(a);let o=this.commandRegistry.getCommands();this.inputHandler.setSlashCommands(o.map(l=>({name:l.name,description:l.description,aliases:l.aliases}))),Le().setSlashCommands(o.map(l=>({name:l.name,description:l.description,aliases:l.aliases}))),Le().setContext({projectPath:this.session.projectPath,branch:this.getGitBranch(),mode:this.session.mode,provider:this.session.provider,model:this.session.model,contextPercent:r,contextLevel:n,contextTokens:e.tokens.total,contextLimit:i,sessionCost:this.session.stats.totalCost})}getGitBranch(){try{return ote("git rev-parse --abbrev-ref HEAD 2>/dev/null",{encoding:"utf-8",cwd:this.session.projectPath}).trim()||void 0}catch{return}}getMemoryUsage(){return process.memoryUsage().heapUsed/1024/1024}setupContextManagerEvents(){this.contextManager.on("warning",e=>{let r=Math.round(e.usagePercent*100),n=Math.round(e.thresholds.critical*100),s=Le();s.log(""),s.log(_.yellow(`\u26A0 Context usage: ${r}% (approaching ${n}% limit for ${e.model})`)),s.log(_.dim(" Consider using /context clear or context will be auto-summarized soon.")),s.log("")}),this.contextManager.on("critical",e=>{this.emit("contextCritical",e)}),this.contextManager.on("summarizationComplete",e=>{this.updateSessionMessagesWithSummary(e.summary)}),this.contextManager.on("stateChange",e=>{this.session.contextState=e})}async runInputLoop(){for(process.env.AII_INK_DEBUG&&console.error("[INK-DEBUG] runInputLoop started, isRunning="+this.isRunning);this.isRunning;)try{process.env.AII_INK_DEBUG&&console.error("[INK-DEBUG] Calling getInput()...");let e=await this.inputHandler.getInput();if(process.env.AII_INK_DEBUG&&console.error('[INK-DEBUG] getInput() returned: "'+e+'"'),!e.trim())continue;let r=e;if(!e.startsWith("/")&&this.serverClient&&ge.hasInstance()){let i=ge.getInstance().getUserInvocableSkills();if(i.length>0)try{let a=this.session.model,o=this.session.provider,l=async(d,p,h)=>(await this.serverClient.generate({content:d,purpose:p,maxTokens:h,model:a,provider:o})).output,u=await new fa(l).classify(e,i.map(d=>({name:d.name,description:d.description})));if(process.env.AII_DEBUG&&console.error(`[skill-intent] input="${e}" \u2192 shouldInvoke=${u.shouldInvoke}, skill=${u.skillName}, confidence=${u.confidence}`),u.shouldInvoke&&u.skillName&&u.confidence>=.75){let d=u.skillArgs||"";r=`/${u.skillName}${d?" "+d:""}`}}catch(a){process.env.AII_DEBUG&&console.error("[skill-intent] classification error:",a instanceof Error?a.message:a)}}let n=r;if(this.commandRegistry.isCommand(r)){let i=await this.commandRegistry.execute(r,this.session);if(i.output){let a=Le();a.log(i.output),"commitToStatic"in a&&typeof a.commitToStatic=="function"&&a.commitToStatic()}if(!i.continue)break;if(this.updateInputStatusContext(),i.injectContent)n=i.injectContent;else continue}let s={role:"user",content:n,timestamp:Date.now()};if(this.session.messages.push(s),this.session.stats.totalTurns++,this.syncContextWithSession(),this.emit("input",n),await this.checkAndSummarizeBeforeTurn(),this.onAgentTurn)try{await this.onAgentTurn(n,this.session),this.syncContextWithSession()}catch(i){i.name==="AgentInterrupt"?this.syncContextWithSession():(console.error(_.red(`
|
|
1212
|
+
=== END SUMMARY ===`,timestamp:Date.now()};this.session.messages=[n,...r.map(s=>({role:s.role,content:s.content,timestamp:s.timestamp??Date.now()}))]}clearAndRedraw(e=""){process.stdout.write("\x1B[2J"),process.stdout.write("\x1B[H"),this.displayWelcome(),this.inputHandler.drawInputBox(e)}getSession(){return this.session}getContextManager(){return this.contextManager}syncContextWithSession(){let e=this.session.messages.length,r=this.contextManager.getMessageCount();if(e>0&&this.session.messages[0]?.role==="system"&&this.session.messages[0]?.content.includes("=== CONVERSATION SUMMARY")){let s=e-1;if(r<s)for(let i=r+1;i<e;i++){let a=this.session.messages[i];a&&a.role!=="system"&&this.contextManager.addMessage(a.role,a.content)}}else for(let s=r;s<e;s++){let i=this.session.messages[s];i&&this.contextManager.addMessage(i.role,i.content)}this.updateInputStatusContext()}getContextState(){return this.contextManager.getState()}hasServerReportedTokens(){return this.contextManager.hasServerReportedTokens()}getLastUserMessage(){for(let e=this.session.messages.length-1;e>=0;e--){let r=this.session.messages[e];if(r.role==="user")return r.content}return null}updateContextFromServerUsage(e){this.contextManager.updateFromServerUsage(e),this.updateInputStatusContext()}async start(){if(!this.isRunning){if(this.isRunning=!0,await this.contextManager.initialize(),this.setupContextManagerEvents(),nn.getInstance().initialize(this.session.projectPath),sn.getInstance().initialize(this.session.projectPath),this.options.config?.resumeSessionId){let e=await this.persistence.load(this.options.config.resumeSessionId);e&&(this.session=e,this.contextManager.setModel(this.session.model))}this.options.quiet||this.displayWelcome(),this.emit("start",this.session),await this.runInputLoop(),await this.persistence.save(this.session),this.inputHandler.close(),this.isRunning=!1,this.emit("end",this.session)}}async stop(){process.env.AII_INK_DEBUG&&(console.error("[INK-DEBUG] stop() called, isRunning="+this.isRunning),console.error("[INK-DEBUG] stop() stack:",new Error().stack)),this.isRunning&&(this.isRunning=!1,await this.persistence.save(this.session),this.inputHandler.close(),El())}displayWelcome(){let e=Le();this.updateInputStatusContext(),"setResourceCounts"in e&&e.setResourceCounts({tools:this.getToolCount(),mcpServers:this.getMcpServerCount(),contextFiles:0,skills:this.getSkillsCount()}),"drawInitial"in e&&e.drawInitial("")}getMcpServerCount(){try{let n=new St().loadConfig().mcpServers||{};return Object.values(n).filter(s=>s.enabled!==!1).length}catch{return 0}}getToolCount(){try{return SS().length}catch{return 6}}getSkillsCount(){try{return ge.hasInstance()?ge.getInstance().size:0}catch{return 0}}updateInputStatusContext(){let e=this.contextManager.getState(),r=Math.round(e.usagePercent*100),n="normal";e.status==="critical"||e.status==="overflow"?n="critical":e.status==="warning"&&(n="warning");let i=this.contextManager.getModelInfo()?.contextLength??e.thresholds.usableContext,a={projectPath:this.session.projectPath,branch:this.getGitBranch(),mode:this.session.mode,provider:this.session.provider,model:this.session.model,memoryMB:this.getMemoryUsage(),contextPercent:r,contextLevel:n,contextTokens:e.tokens.total,contextLimit:i,sessionCost:this.session.stats.totalCost};this.inputHandler.setStatusContext(a);let o=this.commandRegistry.getCommands();this.inputHandler.setSlashCommands(o.map(l=>({name:l.name,description:l.description,aliases:l.aliases}))),Le().setSlashCommands(o.map(l=>({name:l.name,description:l.description,aliases:l.aliases}))),Le().setContext({projectPath:this.session.projectPath,branch:this.getGitBranch(),mode:this.session.mode,provider:this.session.provider,model:this.session.model,contextPercent:r,contextLevel:n,contextTokens:e.tokens.total,contextLimit:i,sessionCost:this.session.stats.totalCost})}getGitBranch(){try{return ote("git rev-parse --abbrev-ref HEAD 2>/dev/null",{encoding:"utf-8",cwd:this.session.projectPath}).trim()||void 0}catch{return}}getMemoryUsage(){return process.memoryUsage().heapUsed/1024/1024}setupContextManagerEvents(){this.contextManager.on("warning",e=>{let r=Math.round(e.usagePercent*100),n=Math.round(e.thresholds.critical*100),s=Le();s.log(""),s.log(_.yellow(`\u26A0 Context usage: ${r}% (approaching ${n}% limit for ${e.model})`)),s.log(_.dim(" Consider using /context clear or context will be auto-summarized soon.")),s.log("")}),this.contextManager.on("critical",e=>{this.emit("contextCritical",e)}),this.contextManager.on("summarizationComplete",e=>{this.updateSessionMessagesWithSummary(e.summary)}),this.contextManager.on("stateChange",e=>{this.session.contextState=e})}async runInputLoop(){for(process.env.AII_INK_DEBUG&&console.error("[INK-DEBUG] runInputLoop started, isRunning="+this.isRunning);this.isRunning;)try{process.env.AII_INK_DEBUG&&console.error("[INK-DEBUG] Calling getInput()...");let e=await this.inputHandler.getInput();if(process.env.AII_INK_DEBUG&&console.error('[INK-DEBUG] getInput() returned: "'+e+'"'),!e.trim())continue;let r=e;if(!e.startsWith("/")&&this.serverClient&&ge.hasInstance()){let i=ge.getInstance().getUserInvocableSkills();if(i.length>0)try{let a=this.session.model,o=this.session.provider,l=async(d,p,h)=>(await this.serverClient.generate({content:d,purpose:p,maxTokens:h,model:a,provider:o})).output,u=await new fa(l).classify(e,i.map(d=>({name:d.name,description:d.description})));if(process.env.AII_DEBUG&&console.error(`[skill-intent] input="${e}" \u2192 shouldInvoke=${u.shouldInvoke}, skill=${u.skillName}, confidence=${u.confidence}`),u.shouldInvoke&&u.skillName&&u.confidence>=.75){let d=u.skillArgs||"";r=`/${u.skillName}${d?" "+d:""}`}}catch(a){process.env.AII_DEBUG&&console.error("[skill-intent] classification error:",a instanceof Error?a.message:a)}}let n=r;if(this.commandRegistry.isCommand(r)){let i=await this.commandRegistry.execute(r,this.session);if(i.output){let a=Le();a.log(i.output),"commitToStatic"in a&&typeof a.commitToStatic=="function"&&a.commitToStatic()}if(!i.continue)break;if(this.session.model!==this.contextManager.getState().model&&this.contextManager.setModel(this.session.model),this.updateInputStatusContext(),i.injectContent)n=i.injectContent;else continue}let s={role:"user",content:n,timestamp:Date.now()};if(this.session.messages.push(s),this.session.stats.totalTurns++,this.syncContextWithSession(),this.emit("input",n),await this.checkAndSummarizeBeforeTurn(),this.onAgentTurn)try{await this.onAgentTurn(n,this.session),this.syncContextWithSession()}catch(i){i.name==="AgentInterrupt"?this.syncContextWithSession():(console.error(_.red(`
|
|
1213
1213
|
\u2717 Error: ${i.message}`)),this.emit("error",i))}else console.log(_.dim("(Agent loop not connected)"));this.session.updatedAt=new Date,this.session.stats.totalTurns%5===0&&await this.persistence.save(this.session)}catch(e){process.env.AII_INK_DEBUG&&console.error("[INK-DEBUG] runInputLoop caught error:",e.message),e.message?.includes("interrupt")?console.log(_.yellow(`
|
|
1214
1214
|
\u26A0 Interrupted`)):(console.error(_.red(`Error: ${e.message}`)),this.emit("error",e))}process.env.AII_INK_DEBUG&&console.error("[INK-DEBUG] runInputLoop exited, isRunning="+this.isRunning)}};function TS(t){return new __(t)}Pe();import{EventEmitter as cte}from"events";var aF={maxIterations:500,maxTokensPerTurn:1e5,streamOutput:!0,autoApprove:!1,showThinking:!1,stallTimeoutMs:3e5};import{execSync as ute}from"child_process";import{EventEmitter as lte}from"events";var oF={baseUrl:"http://localhost:26169",apiKey:"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",reconnectAttempts:5,reconnectDelayMs:1e3,timeout:3e4};var m_=class extends lte{ws=null;config;state="disconnected";constructor(e){super(),this.config={...oF,...e}}getState(){return this.state}get baseUrl(){return this.config.baseUrl}isConnected(){return this.state==="connected"}async connect(){if(this.state!=="connected")try{let e=await fetch(`${this.config.baseUrl}/v0/status`,{headers:{"Aii-API-Key":this.config.apiKey}});if(!e.ok)throw new Error(`Server returned ${e.status}`);this.setState("connected"),this.emit("connected")}catch(e){throw this.setState("error"),new Error(`Cannot connect to Aii Server at ${this.config.baseUrl}: ${e.message}`)}}setProviderApiKey(e){this.config.providerApiKey=e}disconnect(){if(this.ws){let e=this.ws;this.ws=null,e.terminate()}this.setState("disconnected")}requestGracefulClose(){return new Promise(e=>{if(!this.ws){e();return}let r=this.ws;this.ws=null;let n=()=>{r.removeListener("close",n),this.setState("disconnected"),e()};r.on("close",n),r.close(1e3,"Context compaction requested"),setTimeout(()=>{r.readyState!==Sn.CLOSED&&r.terminate(),e()},2e3)})}async*chat(e,r,n){let s=e.filter(d=>d.role==="user").map(d=>d.content).pop()??"",i=e.filter(d=>d.role==="system").map(d=>d.content).join(`
|
|
1215
1215
|
|
|
@@ -1588,7 +1588,7 @@ Prompt validation coming soon.
|
|
|
1588
1588
|
\u274C Missing prompt name`),console.error(` Usage: aii prompt use <name> [--vars]
|
|
1589
1589
|
`),process.exit(1)),await pre(t,r,n,c);break;case"validate":r||(console.error(`
|
|
1590
1590
|
\u274C Missing file path`),console.error(` Usage: aii prompt validate <file>
|
|
1591
|
-
`),process.exit(1)),await _re(t,r);break;case"help":case"--help":case"-h":default:cre(!t.flags.noColors);break}}import{execSync as bs,spawn as mre}from"child_process";import{existsSync as fre,mkdirSync as gre}from"fs";import{homedir as hre}from"os";import{join as Ere}from"path";var Sre="aiiware/aii-server:latest",yre="aii-server",ur=26169,Cs="v0.4.
|
|
1591
|
+
`),process.exit(1)),await _re(t,r);break;case"help":case"--help":case"-h":default:cre(!t.flags.noColors);break}}import{execSync as bs,spawn as mre}from"child_process";import{existsSync as fre,mkdirSync as gre}from"fs";import{homedir as hre}from"os";import{join as Ere}from"path";var Sre="aiiware/aii-server:latest",yre="aii-server",ur=26169,Cs="v0.4.9",oi="https://aiiware.short.gy/server.sh",b_=class t{port;host;containerName;image;configDir;constructor(e=ur){this.port=e,this.host="127.0.0.1",this.containerName=yre,this.image=Sre,this.configDir=Ere(hre(),".aii")}isDockerAvailable(){try{return bs("docker info",{stdio:"pipe",timeout:5e3}),!0}catch{return!1}}isContainerExists(){try{return bs(`docker container inspect ${this.containerName}`,{stdio:"pipe",timeout:5e3}),!0}catch{return!1}}isContainerRunning(){try{return bs(`docker container inspect -f "{{.State.Running}}" ${this.containerName}`,{stdio:"pipe",timeout:5e3,encoding:"utf-8"}).trim()==="true"}catch{return!1}}async isServerHealthy(){try{let e=new AbortController,r=setTimeout(()=>e.abort(),2e3),n=await fetch(`http://${this.host}:${this.port}/health`,{signal:e.signal});return clearTimeout(r),n.ok}catch{return!1}}async getServerVersion(){try{let e=new AbortController,r=setTimeout(()=>e.abort(),2e3),n=await fetch(`http://${this.host}:${this.port}/v0/status`,{signal:e.signal});return clearTimeout(r),n.ok&&(await n.json()).version||null}catch{return null}}static isVersionBelow(e,r){try{let n=e?.replace(/^v/,"")||"0.0.0",s=r?.replace(/^v/,"")||"0.0.0",i=n.split(".").map(Number),a=s.split(".").map(Number),o=Math.max(i.length,a.length);for(;i.length<o;)i.push(0);for(;a.length<o;)a.push(0);for(let l=0;l<o;l++){if(i[l]<a[l])return!0;if(i[l]>a[l])return!1}return!1}catch{return!1}}async checkServerAtPort(e){try{let r=new AbortController,n=setTimeout(()=>r.abort(),2e3),s=await fetch(`http://${this.host}:${e}/health`,{signal:r.signal});if(clearTimeout(n),!s.ok)return{isCompatible:!1,version:null};let i=new AbortController,a=setTimeout(()=>i.abort(),2e3),o=await fetch(`http://${this.host}:${e}/v0/status`,{signal:i.signal});if(clearTimeout(a),o.ok){let c=(await o.json()).version||null;return c?{isCompatible:!t.isVersionBelow(c,Cs),version:c}:{isCompatible:!0,version:null}}return{isCompatible:!0,version:null}}catch{return{isCompatible:!1,version:null}}}getContainerHostPort(){try{let e=bs(`docker inspect --format='{{(index (index .NetworkSettings.Ports "26169/tcp") 0).HostPort}}' ${this.containerName}`,{stdio:"pipe",timeout:5e3,encoding:"utf-8"}),r=parseInt(e.trim(),10);return isNaN(r)?null:r}catch{return null}}async scanForServer(e=ur,r=10){for(let n=0;n<r;n++){let s=e+n,{isCompatible:i}=await this.checkServerAtPort(s);if(i)return s}return null}startContainer(){try{return bs(`docker start ${this.containerName}`,{stdio:"pipe",timeout:3e4}),!0}catch{return!1}}stopContainer(){try{return bs(`docker stop ${this.containerName}`,{stdio:"pipe",timeout:3e4}),!0}catch{return!1}}getContainerLogs(e=50){try{return bs(`docker logs --tail ${e} ${this.containerName}`,{stdio:"pipe",timeout:1e4,encoding:"utf-8"})}catch{return""}}async waitForHealthy(e=3e4){let r=Date.now(),n=!1,s=()=>{n=!0,process.exit(130)};process.on("SIGINT",s);try{for(;Date.now()-r<e&&!n;){if(await this.isServerHealthy())return!0;await new Promise(i=>setTimeout(i,500))}return!1}finally{process.removeListener("SIGINT",s)}}async runInstallScript(e=!0){return new Promise(r=>{e&&console.log(` Running: curl -fsSL ${oi} | bash
|
|
1592
1592
|
`);let n=mre("bash",["-c",`curl -fsSL ${oi} | bash`],{stdio:e?["pipe","inherit","inherit"]:"pipe",detached:!1}),s=()=>{try{n.kill("SIGINT")}catch{}console.log(`
|
|
1593
1593
|
|
|
1594
1594
|
Cancelled.`),process.exit(130)},i=process.listeners("SIGINT");process.removeAllListeners("SIGINT"),process.on("SIGINT",s),n.on("close",a=>{process.removeListener("SIGINT",s),i.forEach(o=>process.on("SIGINT",o)),r(a===0)}),n.on("error",()=>{process.removeListener("SIGINT",s),i.forEach(a=>process.on("SIGINT",a)),r(!1)})})}async upgradeServer(e=!0){e&&console.log(`
|