@aiiware/aii 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +48 -8
  2. package/bin/aii +20 -20
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @aiiware/aii
1
+ # 🪼 @aiiware/aii
2
2
 
3
- **AI-powered CLI agent** with autonomous tool execution, multi-agent delegation, and multi-channel access. An intelligent assistant that can read, write, search, and execute commands in your terminal — or through Telegram.
3
+ **AI-powered CLI agent** with autonomous tool execution, multi-agent delegation, persistent server sessions, and multi-channel access. An intelligent assistant that can read, write, search, and execute commands in your terminal — or through Telegram — with conversations that persist across channels and restarts.
4
4
 
5
5
  ## Installation
6
6
 
@@ -70,6 +70,7 @@ aii "your task" # Run single task and exit
70
70
  /commit Generate commit message and commit
71
71
  /loop Start autonomous agent loop
72
72
  /mcp Manage MCP servers
73
+ /sessions Manage server-managed sessions
73
74
  /agents List available subagents
74
75
  /tasks Inspect subagent task executions
75
76
  /diff Show recent file changes
@@ -142,6 +143,48 @@ aii telegram unpair mybot
142
143
 
143
144
  **Bot commands in Telegram**: `/start`, `/help`, `/reset`, `/status`, `/compact`, `/model`
144
145
 
146
+ ## Server Sessions (v0.11)
147
+
148
+ Conversations are managed by Aii Server with persistent storage. Sessions survive restarts and can be resumed from any channel:
149
+
150
+ ```bash
151
+ # List recent sessions
152
+ aii sessions list
153
+
154
+ # Resume a previous session
155
+ aii sessions resume <id>
156
+
157
+ # View session details (stats, messages, context)
158
+ aii sessions info <id>
159
+
160
+ # Rename or delete
161
+ aii sessions rename <id> "my feature work"
162
+ aii sessions delete <id>
163
+ ```
164
+
165
+ ### Cross-Channel Resume
166
+
167
+ Start a conversation in Telegram and continue from the CLI — full conversation history and context preserved:
168
+
169
+ ```bash
170
+ # In Telegram: work on a task via bot
171
+ # Later, from CLI:
172
+ aii sessions list --channel telegram
173
+ aii sessions resume abc123
174
+ ```
175
+
176
+ ### Interactive Session Management
177
+
178
+ ```text
179
+ /sessions list # Browse recent sessions
180
+ /sessions info <id> # View session details
181
+ /sessions resume <id> # Switch to a server session mid-conversation
182
+ /sessions rename <id> name # Rename a session
183
+ /sessions delete <id> # Archive a session
184
+ ```
185
+
186
+ Session stats track turns, tokens (in/out), cost, tool calls, and files modified. Subagent stats are aggregated to the parent session automatically.
187
+
145
188
  ## MCP Integration (v0.10)
146
189
 
147
190
  Extend the agent with external tools via Model Context Protocol:
@@ -336,6 +379,7 @@ Or use environment variables: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `DEEPSEEK_A
336
379
  ```bash
337
380
  aii doctor # System health check
338
381
  aii stats # Usage analytics (models, cost)
382
+ aii sessions list # List server-managed sessions
339
383
  aii --help # Show help
340
384
  aii --version # Show version
341
385
  ```
@@ -353,12 +397,8 @@ aii --version # Show version
353
397
  - **Project Instructions** — Teach the agent your conventions with AGENTS.md
354
398
  - **Skills System** — Extend with reusable skills, invokable via commands or natural language
355
399
  - **Hooks** — Custom scripts for validation, logging, and approval gates
356
- - **Session Persistence** — Continue previous conversations with `--continue-chat`
357
-
358
- ## Links
359
-
360
- - **Website**: [aiiware.com](https://aiiware.com)
361
- - **Issues & Feedback**: [GitHub](https://github.com/aiiware/aii-cli-ts/issues)
400
+ - **Server Sessions** — Persistent conversations that survive restarts and resume across channels
401
+ - **Session Persistence** — Continue previous conversations with `--continue-chat` or `aii sessions resume`
362
402
 
363
403
  ## License
364
404
 
package/bin/aii CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @aiiware/aii v0.11.4
3
+ * @aiiware/aii v0.11.6
4
4
  *
5
5
  * AI-powered CLI assistant for terminal productivity
6
6
  *
@@ -186,7 +186,7 @@ ${a.comment}`:a.comment}this.doc.range[2]=a.offset;break}default:this.errors.pus
186
186
  `)+`\r
187
187
  \r
188
188
  `+a)}function zl(e,t,a,n,r,i){if(e.listenerCount("wsClientError")){let s=new Error(r);Error.captureStackTrace(s,zl),e.emit("wsClientError",s,a,t)}else $f(a,n,r,i)}});var Nye,Mye,Pye,w3,Lye,Cs,nw=le(()=>{Nye=fn(g3(),1),Mye=fn(YT(),1),Pye=fn(VT(),1),w3=fn(A1(),1),Lye=fn(T3(),1),Cs=w3.default});function rw(e){Gf={...Gf,...e}}function Hf(e){return Gf.emojis?e+" ":""}function ql(e,t){return Gf.colors?t(e):e}function Oe(e,...t){Gf.debug&&console.debug(ql(`[DEBUG] ${e}`,g.gray),...t)}function Bye(e,...t){console.log(e,...t)}function jye(e,...t){console.warn(ql(`${Hf("\u26A0\uFE0F")}${e}`,g.yellow),...t)}function Uye(e,...t){console.error(ql(`${Hf("\u274C")}${e}`,g.red),...t)}function zye(e,...t){console.log(ql(`${Hf("\u2705")}${e}`,g.green),...t)}function iw(e){let t=[];return t.push(ql(`${Hf("\u274C")}${e.message}`,g.red)),e.suggestions&&e.suggestions.length>0&&(t.push(""),t.push(ql(`${Hf("\u{1F4A1}")}Solutions:`,g.yellow)),e.suggestions.forEach((a,n)=>{t.push(ql(` ${n+1}. ${a}`,g.gray))})),t.join(`
189
- `)}var Fye,Gf,pe,rn=le(()=>{"use strict";la();Fye={debug:!1,colors:!0,emojis:!0},Gf={...Fye};pe={debug:Oe,info:Bye,warn:jye,error:Uye,success:zye,formatError:iw,configure:rw}});var C3={};lr(C3,{MCPConfigManager:()=>Cn,MCP_CATALOG:()=>$l});import*as gi from"fs";import*as O1 from"path";import*as sw from"os";var $l,Cn,Gl=le(()=>{"use strict";$l={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",sw.homedir()],category:"system"},"brave-search":{name:"Brave Search",description:"Web search using Brave Search API",command:"npx",args:["-y","@brave/brave-search-mcp-server"],env:{BRAVE_API_KEY:"${BRAVE_API_KEY}"},category:"search"},sqlite:{name:"SQLite",description:"Query SQLite databases",command:"uvx",args:["mcp-server-sqlite","--db-path","./database.db"],category:"database"},postgres:{name:"PostgreSQL",description:"Query PostgreSQL databases",command:"npx",args:["-y","@anthropic/mcp-server-postgres"],env:{DATABASE_URL:"${DATABASE_URL}"},category:"database"},"chrome-devtools":{name:"Chrome DevTools",description:"Control Chrome browser via DevTools protocol",command:"npx",args:["chrome-devtools-mcp@latest"],category:"browser"},memory:{name:"Memory",description:"Persistent memory storage for conversation context",command:"npx",args:["-y","@modelcontextprotocol/server-memory"],category:"utility"},puppeteer:{name:"Puppeteer",description:"Browser automation with Puppeteer",command:"npx",args:["-y","@anthropic/mcp-server-puppeteer"],category:"browser"}},Cn=class{configPath;constructor(t){this.configPath=t||O1.join(sw.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let t=O1.dirname(this.configPath);gi.existsSync(t)||gi.mkdirSync(t,{recursive:!0})}loadConfig(){if(!gi.existsSync(this.configPath))return{mcpServers:{}};try{let t=gi.readFileSync(this.configPath,"utf-8"),a=JSON.parse(t);return typeof a=="object"&&a!==null?a:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(t){try{return this.ensureConfigDir(),gi.writeFileSync(this.configPath,JSON.stringify(t,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!gi.existsSync(this.configPath))return!0;try{let t=this.configPath+".backup";return gi.copyFileSync(this.configPath,t),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var yp={};lr(yp,{ClientMCPExecutor:()=>ow});import{Client as qye}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as $ye}from"@modelcontextprotocol/sdk/client/stdio.js";var ow,bp=le(()=>{"use strict";Gl();rn();ow=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new Cn}async initialize(){if(this.initialized)return!0;try{let a=this.configManager.loadConfig().mcpServers||{};Oe(`Initializing MCP executor with ${Object.keys(a).length} servers`);for(let[n,r]of Object.entries(a)){if(r.enabled===!1){Oe(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,r)}catch(i){Oe(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,Oe(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(t){return Oe(`Failed to initialize MCP executor: ${t}`),!1}}async connectToServer(t,a){let n=a.command,r=Array.isArray(a.args)?a.args:[a.args||""],i={...process.env};if(a.env)for(let[u,p]of Object.entries(a.env)){let d=String(p).replace(/\$\{(\w+)\}/g,(m,f)=>process.env[f]||"");i[u]=d}Oe(`Connecting to MCP server: ${t}`),Oe(` command: ${n}`),Oe(` args: ${JSON.stringify(r)}`);let s=new $ye({command:n,args:r,env:i,stderr:"pipe"}),o=new qye({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await o.connect(s);let l=(await o.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:t}));this.connections.set(t,{client:o,transport:s,tools:l});for(let u of l)this.toolToServer.set(u.name,t);Oe(`Connected to ${t}: discovered ${l.length} tools`)}async handleQueryTools(t){let a=t.request_id||"unknown";Oe(`Handling mcp_query_tools request: ${a}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let r=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return Oe(`Found ${r.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:a,success:!0,tools:r}}catch(n){return Oe(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:a,success:!1,error:String(n),tools:[]}}}async handleToolExecution(t){let a=t.request_id||"unknown",n=t.tool_name,r=t.arguments||{};if(Oe(`Handling mcp_tool_request: ${a} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:a,success:!1,error:"Missing tool_name in request"};this.initialized||await this.initialize();try{let i=this.toolToServer.get(n);if(!i)return{type:"mcp_tool_response",request_id:a,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let s=this.connections.get(i);if(!s)return{type:"mcp_tool_response",request_id:a,success:!1,error:`Server '${i}' not connected`};let o=await Promise.race([s.client.callTool({name:n,arguments:r}),new Promise((l,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),c=this.makeContentSerializable(o.content);return Oe(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:a,success:!o.isError,content:c,server_name:i,error:o.isError?"Tool returned error":void 0}}catch(i){return Oe(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:a,success:!1,error:String(i)}}}makeContentSerializable(t){if(t==null)return null;if(Array.isArray(t))return t.map(a=>this.makeContentSerializable(a));if(typeof t=="object"){let a=t;if(a.type==="text"&&typeof a.text=="string")return{type:"text",text:a.text};if(a.type==="image")return{type:"image",data:a.data,mimeType:a.mimeType};let n={};for(let[r,i]of Object.entries(a))n[r]=this.makeContentSerializable(i);return n}return t}async shutdown(){Oe("Shutting down MCP executor");for(let[t,a]of this.connections)try{await a.client.close(),Oe(`Closed connection to ${t}`)}catch(n){Oe(`Error closing ${t}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var M3=y((zQe,t1e)=>{t1e.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 gw=y((qQe,L3)=>{"use strict";var L1=Object.assign({},M3()),P3=Object.keys(L1);Object.defineProperty(L1,"random",{get(){let e=Math.floor(Math.random()*P3.length),t=P3[e];return L1[t]}});L3.exports=L1});function Yl({onlyFirst:e=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,e?void 0:"g")}var F1=le(()=>{});var q3=y((nXe,z3)=>{z3.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});import{resolve as m1e}from"path";function f1e(){let e=process.env.TERM??"",t=process.env.TERM_PROGRAM??"",a=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",r=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return t==="iTerm.app"||t==="Hyper"||t==="vscode"||t==="WezTerm"||t==="Alacritty"||n||r||e.includes("xterm-256color")||e.includes("screen-256color")||e.includes("tmux")||e==="xterm-kitty"||a==="truecolor"?!0:!(e==="dumb"||!process.stdout.isTTY)}function Wf(){return Aw===null&&(Aw=f1e()),Aw}function h1e(){return process.platform==="darwin"?"Cmd":"Ctrl"}function Y3(){return H3||!Wf()?"":(H3=!0,` (${h1e()}+Click to open)`)}function g1e(e,t){return Wf()?`\x1B]8;;${t}\x07${e}\x1B]8;;\x07`:e}function K3(e,t){let a=process.env.HOME??process.env.USERPROFILE??"",n=e;a&&e.startsWith(a)&&(n="~"+e.slice(a.length));let r=t?`${n}:${t}`:n;if(!Wf())return g.cyan.underline(r);let i=g.cyan(r),o=`file://${m1e(e)}`;return t!==void 0&&t>0&&(o+=`#L${t}`),g1e(i,o)}var Aw,H3,W3=le(()=>{"use strict";la();Aw=null,H3=!1});function V3(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")||/^[a-zA-Z]:\\/.test(e)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(e)||/^src\//.test(e)||/^lib\//.test(e)||/^test[s]?\//.test(e)}function U1(e,t,a=!0,n,r=console.log){let i=a?La.success("\u25CF"):La.error("\u25CF"),s=60,o=t.length>s?t.slice(0,s-3)+"...":t;if(V3(t)){let l=t.match(/:(\d+)$/),u=l?parseInt(l[1],10):void 0,p=l?t.replace(/:(\d+)$/,""):t;o=_1e(p,u)}r(`${i} ${g.bold(e)}(${o})`);let c=V3(t)?La.dim(Y3()):"";if(n){let l=a?La.dim:La.error;r(l(`\u2514 ${n}`)+c)}else{let l=a?"(No content)":"(Error)",u=a?La.dim:La.error;r(u(`\u2514 ${l}`)+c)}}function _1e(e,t){if(Wf())return K3(e,t);let a=process.env.HOME??process.env.USERPROFILE??"",n=e;return a&&e.startsWith(a)&&(n="~"+e.slice(a.length)),t&&(n+=`:${t}`),La.filePath(n)}function y1e(){return process.stdout.columns||80}function b1e(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),a=e%60;return a>0?`${t}m ${a}s`:`${t}m`}function Q3(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function X3(e){let t=y1e(),a=Math.min(t-2,76),n=a-4,r=(d,m)=>{let f=d.replace(/\x1b\[[0-9;]*m/g,"").length;return d+" ".repeat(Math.max(0,m-f))},i=d=>La.border("\u2502")+" "+r(d,n)+" "+La.border("\u2502"),s=(d,m,f,h)=>{let _=Math.floor(n/2),v=La.dim(d.padEnd(15))+m,S=La.dim(f.padEnd(15))+h;return i(r(v,_)+S)},o=b1e(e.durationSeconds),c=Q3(e.tokensIn),l=Q3(e.tokensOut),u=`$${e.totalCost.toFixed(4)}`,p=`${e.provider}/${e.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(La.border("\u250C"+"\u2500".repeat(a-2)+"\u2510")),console.log(i(g.cyan.bold("Agent powering down. Goodbye!"))),console.log(La.border("\u251C"+"\u2500".repeat(a-2)+"\u2524")),console.log(i(g.cyan.bold("Session Summary"))),console.log(i(La.dim("\u2500".repeat(15)))),console.log(s("Duration",o,"Tool Calls",e.toolCalls.toString())),console.log(s("Turns",e.turns.toString(),"Files Modified",e.filesModified.toString())),console.log(i("")),console.log(i(g.cyan.bold("Token Usage"))),console.log(i(La.dim("\u2500".repeat(11)))),console.log(s("Input",c,"Output",l)),console.log(i(La.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(La.dim("Model: ")+La.model(p))),console.log(La.border("\u2514"+"\u2500".repeat(a-2)+"\u2518")),console.log("")}var j1,La,Vf=le(()=>{"use strict";la();W3();j1="0.11.4",La={logo:g.cyan.bold,prompt:g.cyan.bold,model:g.cyan,success:g.green,warning:g.yellow,error:g.red,thinking:g.dim.cyan,filePath:g.blue,code:g.white,muted:g.gray,dim:g.dim,safe:g.green,risky:g.yellow,destructive:g.red,border:g.cyan,bannerBorder:g.cyan}});var Do,z1,Dw=le(()=>{"use strict";Do={maxConcurrent:5,maxIterations:100,timeout:3e5,compressionLevel:"medium",permissionMode:"default"},z1={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var q1,Ow=le(()=>{"use strict";q1=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
189
+ `)}var Fye,Gf,pe,rn=le(()=>{"use strict";la();Fye={debug:!1,colors:!0,emojis:!0},Gf={...Fye};pe={debug:Oe,info:Bye,warn:jye,error:Uye,success:zye,formatError:iw,configure:rw}});var C3={};lr(C3,{MCPConfigManager:()=>Cn,MCP_CATALOG:()=>$l});import*as gi from"fs";import*as O1 from"path";import*as sw from"os";var $l,Cn,Gl=le(()=>{"use strict";$l={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",sw.homedir()],category:"system"},"brave-search":{name:"Brave Search",description:"Web search using Brave Search API",command:"npx",args:["-y","@brave/brave-search-mcp-server"],env:{BRAVE_API_KEY:"${BRAVE_API_KEY}"},category:"search"},sqlite:{name:"SQLite",description:"Query SQLite databases",command:"uvx",args:["mcp-server-sqlite","--db-path","./database.db"],category:"database"},postgres:{name:"PostgreSQL",description:"Query PostgreSQL databases",command:"npx",args:["-y","@anthropic/mcp-server-postgres"],env:{DATABASE_URL:"${DATABASE_URL}"},category:"database"},"chrome-devtools":{name:"Chrome DevTools",description:"Control Chrome browser via DevTools protocol",command:"npx",args:["chrome-devtools-mcp@latest"],category:"browser"},memory:{name:"Memory",description:"Persistent memory storage for conversation context",command:"npx",args:["-y","@modelcontextprotocol/server-memory"],category:"utility"},puppeteer:{name:"Puppeteer",description:"Browser automation with Puppeteer",command:"npx",args:["-y","@anthropic/mcp-server-puppeteer"],category:"browser"}},Cn=class{configPath;constructor(t){this.configPath=t||O1.join(sw.homedir(),".aii","mcp_servers.json"),this.ensureConfigDir()}ensureConfigDir(){let t=O1.dirname(this.configPath);gi.existsSync(t)||gi.mkdirSync(t,{recursive:!0})}loadConfig(){if(!gi.existsSync(this.configPath))return{mcpServers:{}};try{let t=gi.readFileSync(this.configPath,"utf-8"),a=JSON.parse(t);return typeof a=="object"&&a!==null?a:{mcpServers:{}}}catch{return{mcpServers:{}}}}saveConfig(t){try{return this.ensureConfigDir(),gi.writeFileSync(this.configPath,JSON.stringify(t,null,2),"utf-8"),!0}catch{return!1}}backupConfig(){if(!gi.existsSync(this.configPath))return!0;try{let t=this.configPath+".backup";return gi.copyFileSync(this.configPath,t),!0}catch{return!1}}getConfigPath(){return this.configPath}}});var yp={};lr(yp,{ClientMCPExecutor:()=>ow});import{Client as qye}from"@modelcontextprotocol/sdk/client/index.js";import{StdioClientTransport as $ye}from"@modelcontextprotocol/sdk/client/stdio.js";var ow,bp=le(()=>{"use strict";Gl();rn();ow=class{connections=new Map;toolToServer=new Map;initialized=!1;configManager;constructor(){this.configManager=new Cn}async initialize(){if(this.initialized)return!0;try{let a=this.configManager.loadConfig().mcpServers||{};Oe(`Initializing MCP executor with ${Object.keys(a).length} servers`);for(let[n,r]of Object.entries(a)){if(r.enabled===!1){Oe(`Skipping disabled server: ${n}`);continue}try{await this.connectToServer(n,r)}catch(i){Oe(`Failed to connect to ${n}: ${i}`)}}return this.initialized=!0,Oe(`MCP executor initialized with ${this.connections.size} connections`),!0}catch(t){return Oe(`Failed to initialize MCP executor: ${t}`),!1}}async connectToServer(t,a){let n=a.command,r=Array.isArray(a.args)?a.args:[a.args||""],i={...process.env};if(a.env)for(let[u,p]of Object.entries(a.env)){let d=String(p).replace(/\$\{(\w+)\}/g,(m,f)=>process.env[f]||"");i[u]=d}Oe(`Connecting to MCP server: ${t}`),Oe(` command: ${n}`),Oe(` args: ${JSON.stringify(r)}`);let s=new $ye({command:n,args:r,env:i,stderr:"pipe"}),o=new qye({name:"aii-cli",version:"0.1.0"},{capabilities:{}});await o.connect(s);let l=(await o.listTools()).tools.map(u=>({name:u.name,description:u.description||"",inputSchema:u.inputSchema,serverName:t}));this.connections.set(t,{client:o,transport:s,tools:l});for(let u of l)this.toolToServer.set(u.name,t);Oe(`Connected to ${t}: discovered ${l.length} tools`)}async handleQueryTools(t){let a=t.request_id||"unknown";Oe(`Handling mcp_query_tools request: ${a}`),this.initialized||await this.initialize();try{let n=[];for(let i of this.connections.values())n.push(...i.tools);let r=n.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema,server_name:i.serverName}));return Oe(`Found ${r.length} MCP tools across all servers`),{type:"mcp_query_tools_response",request_id:a,success:!0,tools:r}}catch(n){return Oe(`Error querying MCP tools: ${n}`),{type:"mcp_query_tools_response",request_id:a,success:!1,error:String(n),tools:[]}}}async handleToolExecution(t){let a=t.request_id||"unknown",n=t.tool_name,r=t.arguments||{};if(Oe(`Handling mcp_tool_request: ${a} - Tool: ${n}`),!n)return{type:"mcp_tool_response",request_id:a,success:!1,error:"Missing tool_name in request"};this.initialized||await this.initialize();try{let i=this.toolToServer.get(n);if(!i)return{type:"mcp_tool_response",request_id:a,success:!1,error:`Tool '${n}' not found in any connected MCP server`};let s=this.connections.get(i);if(!s)return{type:"mcp_tool_response",request_id:a,success:!1,error:`Server '${i}' not connected`};let o=await Promise.race([s.client.callTool({name:n,arguments:r}),new Promise((l,u)=>setTimeout(()=>u(new Error(`Tool '${n}' timed out after 30 seconds`)),3e4))]),c=this.makeContentSerializable(o.content);return Oe(`Tool '${n}' executed successfully (server: ${i})`),{type:"mcp_tool_response",request_id:a,success:!o.isError,content:c,server_name:i,error:o.isError?"Tool returned error":void 0}}catch(i){return Oe(`Error executing MCP tool '${n}': ${i}`),{type:"mcp_tool_response",request_id:a,success:!1,error:String(i)}}}makeContentSerializable(t){if(t==null)return null;if(Array.isArray(t))return t.map(a=>this.makeContentSerializable(a));if(typeof t=="object"){let a=t;if(a.type==="text"&&typeof a.text=="string")return{type:"text",text:a.text};if(a.type==="image")return{type:"image",data:a.data,mimeType:a.mimeType};let n={};for(let[r,i]of Object.entries(a))n[r]=this.makeContentSerializable(i);return n}return t}async shutdown(){Oe("Shutting down MCP executor");for(let[t,a]of this.connections)try{await a.client.close(),Oe(`Closed connection to ${t}`)}catch(n){Oe(`Error closing ${t}: ${n}`)}this.connections.clear(),this.toolToServer.clear(),this.initialized=!1}isInitialized(){return this.initialized}getConnectionCount(){return this.connections.size}}});var M3=y((zQe,t1e)=>{t1e.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 gw=y((qQe,L3)=>{"use strict";var L1=Object.assign({},M3()),P3=Object.keys(L1);Object.defineProperty(L1,"random",{get(){let e=Math.floor(Math.random()*P3.length),t=P3[e];return L1[t]}});L3.exports=L1});function Yl({onlyFirst:e=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,e?void 0:"g")}var F1=le(()=>{});var q3=y((nXe,z3)=>{z3.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});import{resolve as m1e}from"path";function f1e(){let e=process.env.TERM??"",t=process.env.TERM_PROGRAM??"",a=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",r=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return t==="iTerm.app"||t==="Hyper"||t==="vscode"||t==="WezTerm"||t==="Alacritty"||n||r||e.includes("xterm-256color")||e.includes("screen-256color")||e.includes("tmux")||e==="xterm-kitty"||a==="truecolor"?!0:!(e==="dumb"||!process.stdout.isTTY)}function Wf(){return Aw===null&&(Aw=f1e()),Aw}function h1e(){return process.platform==="darwin"?"Cmd":"Ctrl"}function Y3(){return H3||!Wf()?"":(H3=!0,` (${h1e()}+Click to open)`)}function g1e(e,t){return Wf()?`\x1B]8;;${t}\x07${e}\x1B]8;;\x07`:e}function K3(e,t){let a=process.env.HOME??process.env.USERPROFILE??"",n=e;a&&e.startsWith(a)&&(n="~"+e.slice(a.length));let r=t?`${n}:${t}`:n;if(!Wf())return g.cyan.underline(r);let i=g.cyan(r),o=`file://${m1e(e)}`;return t!==void 0&&t>0&&(o+=`#L${t}`),g1e(i,o)}var Aw,H3,W3=le(()=>{"use strict";la();Aw=null,H3=!1});function V3(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")||/^[a-zA-Z]:\\/.test(e)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(e)||/^src\//.test(e)||/^lib\//.test(e)||/^test[s]?\//.test(e)}function U1(e,t,a=!0,n,r=console.log){let i=a?La.success("\u25CF"):La.error("\u25CF"),s=60,o=t.length>s?t.slice(0,s-3)+"...":t;if(V3(t)){let l=t.match(/:(\d+)$/),u=l?parseInt(l[1],10):void 0,p=l?t.replace(/:(\d+)$/,""):t;o=_1e(p,u)}r(`${i} ${g.bold(e)}(${o})`);let c=V3(t)?La.dim(Y3()):"";if(n){let l=a?La.dim:La.error;r(l(`\u2514 ${n}`)+c)}else{let l=a?"(No content)":"(Error)",u=a?La.dim:La.error;r(u(`\u2514 ${l}`)+c)}}function _1e(e,t){if(Wf())return K3(e,t);let a=process.env.HOME??process.env.USERPROFILE??"",n=e;return a&&e.startsWith(a)&&(n="~"+e.slice(a.length)),t&&(n+=`:${t}`),La.filePath(n)}function y1e(){return process.stdout.columns||80}function b1e(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),a=e%60;return a>0?`${t}m ${a}s`:`${t}m`}function Q3(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function X3(e){let t=y1e(),a=Math.min(t-2,76),n=a-4,r=(d,m)=>{let f=d.replace(/\x1b\[[0-9;]*m/g,"").length;return d+" ".repeat(Math.max(0,m-f))},i=d=>La.border("\u2502")+" "+r(d,n)+" "+La.border("\u2502"),s=(d,m,f,h)=>{let _=Math.floor(n/2),v=La.dim(d.padEnd(15))+m,S=La.dim(f.padEnd(15))+h;return i(r(v,_)+S)},o=b1e(e.durationSeconds),c=Q3(e.tokensIn),l=Q3(e.tokensOut),u=`$${e.totalCost.toFixed(4)}`,p=`${e.provider}/${e.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(La.border("\u250C"+"\u2500".repeat(a-2)+"\u2510")),console.log(i(g.cyan.bold("Session complete. \u{1FABC}"))),console.log(La.border("\u251C"+"\u2500".repeat(a-2)+"\u2524")),console.log(i(g.cyan.bold("Session Summary"))),console.log(i(La.dim("\u2500".repeat(15)))),console.log(s("Duration",o,"Tool Calls",e.toolCalls.toString())),console.log(s("Turns",e.turns.toString(),"Files Modified",e.filesModified.toString())),console.log(i("")),console.log(i(g.cyan.bold("Token Usage"))),console.log(i(La.dim("\u2500".repeat(11)))),console.log(s("Input",c,"Output",l)),console.log(i(La.dim("Cost".padEnd(15))+u)),console.log(i("")),console.log(i(La.dim("Model: ")+La.model(p))),console.log(La.border("\u2514"+"\u2500".repeat(a-2)+"\u2518")),console.log("")}var j1,La,Vf=le(()=>{"use strict";la();W3();j1="0.11.6",La={logo:g.cyan.bold,prompt:g.cyan.bold,model:g.cyan,success:g.green,warning:g.yellow,error:g.red,thinking:g.dim.cyan,filePath:g.blue,code:g.white,muted:g.gray,dim:g.dim,safe:g.green,risky:g.yellow,destructive:g.red,border:g.cyan,bannerBorder:g.cyan}});var Do,z1,Dw=le(()=>{"use strict";Do={maxConcurrent:5,maxIterations:100,timeout:3e5,compressionLevel:"medium",permissionMode:"default"},z1={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var q1,Ow=le(()=>{"use strict";q1=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
190
190
 
191
191
  ## Core Capabilities
192
192
  You have access to these tools for codebase exploration:
@@ -462,7 +462,7 @@ Generate a commit message following conventional commits format and execute the
462
462
 
463
463
  <body>
464
464
 
465
- \u{1F916} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
465
+ \u{1FABC} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
466
466
  Co-authored-by: Aii CLI <noreply@aiiware.com>
467
467
  \`\`\`
468
468
 
@@ -508,7 +508,7 @@ Review PR #$ARGUMENTS using the review checklist.
508
508
  2. Review against checklist
509
509
  3. Provide structured feedback
510
510
 
511
- \u{1F916} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
511
+ \u{1FABC} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
512
512
  `,m4=[{name:"commit",content:B1e},{name:"review-pr",content:j1e}]});import{readFile as f4}from"fs/promises";import{join as U1e}from"path";var It,Ww=le(()=>{"use strict";Hw();sh();Jf();Kl();X1();Bw();Kw();It=class e{projectRoot;registry;parser;discovered=!1;constructor(t,a,n){this.projectRoot=t,this.registry=a||new oh,this.parser=n||new Is}async discover(){let t=[],a=[];this.registry.clear();let n=await Q1(this.projectRoot);for(let i of n.project)try{let s=await this.loadSkillMetadata(i,"project");this.registry.register(s),t.push(s)}catch(s){a.push({path:i,error:s instanceof Error?s.message:String(s)})}for(let i of n.user)try{let s=await this.loadSkillMetadata(i,"user");this.registry.register(s),t.push(s)}catch(s){a.push({path:i,error:s instanceof Error?s.message:String(s)})}let r=Yw(this.registry,this.parser);return t.push(...r),this.discovered=!0,{skills:t,errors:a}}async loadSkillMetadata(t,a){let n=U1e(t,Os),r=V1(t),i;try{i=await f4(n,"utf-8")}catch(h){throw new gn(`SKILL.md not found: ${n}`,sn.FILE_NOT_FOUND,{path:n,cause:h instanceof Error?h:void 0})}Y1(i)&&console.warn(`Warning: Skill at ${t} contains hidden Unicode characters`);let s=Zf(i),{frontmatter:o,body:c}=this.parser.parse(s),l=o.name||r;this.parser.validateFrontmatter(o,n,r);let u=`${a}:${l}`,p=o.description||this.parser.extractFirstParagraph(c),d=this.parser.parseAllowedTools(o["allowed-tools"]),m=o["user-invocable"]!==!1,f=o["disable-model-invocation"]!==!0;return{id:u,name:l,description:p,source:a,path:n,directory:t,userInvocable:m,modelInvocable:f,argumentHint:o["argument-hint"],allowedTools:d,license:o.license,compatibility:o.compatibility,metadata:o.metadata,loaded:!1}}async loadSkillContent(t){if(t.loaded&&t.content!==void 0)return t;let a;try{a=await f4(t.path,"utf-8")}catch(s){throw new gn(`Failed to load skill content: ${t.path}`,sn.LOAD_FAILED,{path:t.path,skillName:t.name,cause:s instanceof Error?s:void 0})}let n=Zf(a),{body:r}=this.parser.parse(n),i={...t,content:r,loaded:!0};return this.registry.register(i),i}getByName(t){return this.registry.getByName(t)}getById(t){return this.registry.getById(t)}getAll(){return this.registry.getAll()}getUserInvocableSkills(){return this.registry.getUserInvocable()}getModelInvocableSkills(){return this.registry.getModelInvocable()}getBySource(){return this.registry.getBySource()}has(t){return this.registry.has(t)}getNames(){return this.registry.getNames()}get size(){return this.registry.size}async reload(){return this.discover()}get isDiscovered(){return this.discovered}get root(){return this.projectRoot}updateProjectRoot(t){this.projectRoot=t}getRegistry(){return this.registry}registerSkill(t){this.registry.register(t)}static instance=null;static getInstance(t){if(!e.instance){if(!t)throw new Error("SkillManager not initialized - projectRoot required on first call");e.instance=new e(t)}return e.instance}static hasInstance(){return e.instance!==null}static resetInstance(){e.instance=null}}});var h4,Pc,g4=le(()=>{"use strict";Jf();Uw();h4=100,Pc=class{manager;invocationHistory=[];constructor(t){this.manager=t}async invoke(t,a,n){try{let r=this.manager.getByName(t);if(!r)throw gn.notFound(t);this.checkPermissions(r,n);let i=await this.manager.loadSkillContent(r);if(!i.content)return{success:!1,error:`Skill '${t}' has no content`};let s=th(a),o=ah(i.content,a,s);return this.recordInvocation(i,a,s,n),{success:!0,content:o}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}checkPermissions(t,a){if(a==="user"&&!t.userInvocable)throw gn.notUserInvocable(t.name);if(a==="model"&&!t.modelInvocable)throw gn.notModelInvocable(t.name)}recordInvocation(t,a,n,r){let i={skill:t,arguments:a,parsedArguments:n,invokedBy:r,timestamp:Date.now()};this.invocationHistory.push(i),this.invocationHistory.length>h4&&(this.invocationHistory=this.invocationHistory.slice(-h4))}getRecentInvocations(t=10){return this.invocationHistory.slice(-t).reverse()}get invocationCount(){return this.invocationHistory.length}clearHistory(){this.invocationHistory=[]}getInvocationsForSkill(t,a=10){return this.invocationHistory.filter(n=>n.skill.name===t).slice(-a).reverse()}canUserInvoke(t){let a=this.manager.getByName(t);return a!==void 0&&a.userInvocable}canModelInvoke(t){let a=this.manager.getByName(t);return a!==void 0&&a.modelInvocable}async preview(t,a=""){let n=this.manager.getByName(t);if(!n)return;let r=await this.manager.loadSkillContent(n);if(!r.content)return;let i=th(a);return ah(r.content,a,i)}}});function eb(e,t){return new ch(e,t)}var z1e,ch,Vw=le(()=>{"use strict";z1e={type:"object",properties:{skill:{type:"string",description:'The name of the skill to invoke (e.g., "commit", "review-pr")'},args:{type:"string",description:"Optional arguments to pass to the skill"}},required:["skill"]},ch=class{manager;invoker;_definition=null;constructor(t,a){this.manager=t,this.invoker=a}get definition(){return this._definition||(this._definition={name:"Skill",description:this.buildDescription(),parameters:z1e}),this._definition}permissionLevel="SAFE";async execute(t,a){let n=t.skill,r=t.args??"";if(!n)return{callId:"",success:!1,output:"",error:"Skill name is required"};if(!this.invoker.canModelInvoke(n))return this.manager.getByName(n)?{callId:"",success:!1,output:"",error:`Skill '${n}' is not available for model invocation`}:{callId:"",success:!1,output:"",error:`Skill '${n}' not found. Available skills: ${this.getAvailableSkillNames().join(", ")}`};let i=await this.invoker.invoke(n,r,"model");return i.success?{callId:"",success:!0,output:i.content??""}:{callId:"",success:!1,output:"",error:i.error??"Unknown error invoking skill"}}formatAction(t){let a=t.skill,n=t.args;return n?`[Skill] /${a} ${n}`:`[Skill] /${a}`}invalidateCache(){this._definition=null}buildDescription(){let t=this.manager.getModelInvocableSkills();return t.length===0?"Invoke a skill to extend your capabilities. No skills are currently available.":`Invoke a skill to follow specialized instructions for a task. Skills contain expert-crafted prompts with structured output formats, domain knowledge, and best practices.
513
513
 
514
514
  IMPORTANT: You MUST use the Skill tool when the user's request matches a skill description. Skills provide superior, structured responses compared to answering directly. Always prefer invoking a matching skill over generating a freeform response.
@@ -869,7 +869,7 @@ When the user asks you to analyze, explore, review, or plan across a codebase \u
869
869
  `).filter(ot=>ot.trim()):[];pt=Te.slice(0,15),Te.length>15&&pt.push(`... +${Te.length-15} more lines`),Te.length>0?$e=Te.length===1?"1 line":`${Te.length} lines`:$e="Done"}if(!Ue&&!$e&&ht){let Te=ht.split(`
870
870
  `).filter(ot=>ot.trim());if(Te.length>0){let ot=Te[0].trim();$e=ot.length>100?ot.slice(0,97)+"...":ot}}Yt(""),U1(ge.name,ya,Ue,$e,Yt),ge=null}let ia=Xt.join(`
871
871
  `);this.config.streamOutput&&n.log(ia),this.config.streamOutput&&n.flushStreamingBuffer(),n.addBlankLine(),m="",f=!0,this.setState("thinking")},onToolResultSent:()=>{this.interrupted||(N=Date.now(),this.toolPending--,this.toolPending===0&&this.lastIterationInfo&&this.emit("toolResultSent",this.lastIterationInfo.iteration,this.lastIterationInfo.inputTokens))},onActivity:()=>{N=Date.now()},onIterationUsage:(Ce,Ue,ht)=>{let Xt=Ue.inputTokens-Ue.outputTokens,Yt=Ue.outputTokens;process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] AgentController onIterationUsage called:"),console.error(` iteration=${Ce}, callback inputTokens=${Ue.inputTokens}, outputTokens=${Ue.outputTokens}, cost=${ht}`),console.error(` calculated rawInput=${Xt}, rawOutput=${Yt}`),console.error(` session.stats BEFORE: tokensIn=${a.stats.tokensIn}, tokensOut=${a.stats.tokensOut}, totalCost=${a.stats.totalCost}`)),a.stats.tokensIn+=Xt,a.stats.tokensOut+=Yt,a.stats.totalCost+=ht,process.env.AII_LOOP_DEBUG&&console.error(` session.stats AFTER: tokensIn=${a.stats.tokensIn}, tokensOut=${a.stats.tokensOut}, totalCost=${a.stats.totalCost}`),this.lastIterationInfo={iteration:Ce,inputTokens:Ue.inputTokens},this.emit("iterationUsage",Ce,Ue.inputTokens,Ue.outputTokens,ht)},onUsage:(Ce,Ue)=>{process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] AgentController onUsage (final) called:"),console.error(` usage.inputTokens=${Ce.inputTokens}, usage.outputTokens=${Ce.outputTokens}, cost=${Ue}`),console.error(` session.stats current: tokensIn=${a.stats.tokensIn}, tokensOut=${a.stats.tokensOut}, totalCost=${a.stats.totalCost}`),console.error(" NOTE: Stats already accumulated via onIterationUsage, this is a no-op to avoid double-counting")),this.emit("usage",Ce.inputTokens,Ce.outputTokens,Ue)},onError:(Ce,Ue)=>{this.interrupted||(Ie(),this.setState("error"),Ye=Ce,R=Ue?.retryable??!1)}},de,a.mode==="auto",this.buildProjectInstructions(),ke),Ye){let Ce=Ye,Ue=R;Ye=null,R=!1;let ht=new Error(Ce);throw ht.retryable=Ue,ht}if(m||we.length>0){We.trim()&&(we.push({type:"text",content:We}),We="");let Ce=this.buildTranscriptContent(we,m),Ue={role:"assistant",content:Ce,timestamp:Date.now()};a.messages.push(Ue),process.env.AII_DEBUG&&this.interrupted&&console.error(`[DEBUG-COMPACT] Committed assistant message to session before interrupt (${Ce.length} chars)`)}if(this.interrupted)throw{name:"AgentInterrupt",message:"Agent interrupted"};X(),K(),m&&!m.endsWith(`
872
- `)&&n.log(""),m&&n.log(""),this.loopMode?n.deactivateForCompaction():n.deactivate(),process.stdout.write("\r"),process.stdin.pause();let Me=bi.getInstance(),st={session_id:a.id,cwd:a.projectPath,transcript_path:"",exit_reason:"completed"},At=await Me.fire("Stop",st);if(At.decision==="block"){let Ce=At.reason||"Stop hook requested continuation";console.log(La.dim(`[Hook] Stop blocked: ${Ce}`))}this.setState("complete")}catch(J){if(me(),K(),X(),this.stallDetected)throw this.stallDetected=!1,n.deactivateForCompaction(),process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),{name:"StallTimeout",message:`No response for ${Math.round(this.config.stallTimeoutMs/1e3)} seconds`};let se=J.message??"",de=se.includes("WebSocket disconnected unexpectedly")||se.includes("ECONNRESET")||se.includes("EPIPE")||se.includes("ETIMEDOUT")||se.includes("ECONNREFUSED")||se.includes("socket hang up")||se.includes("WebSocket was closed")||se.includes("WebSocket error")&&!this.interrupted,Me=J.retryable===!0||de;throw this.pauseRequested||Me?n.deactivateForCompaction():n.deactivate(),J.name==="AgentInterrupt"||this.interrupted?(process.stdout.write("\r"),this.setState("error"),{name:"AgentInterrupt",message:"Agent interrupted"}):(process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),Me?{name:"AbnormalDisconnect",message:se}:J)}}disconnect(){this.client.disconnect()}}});function mW(e){let t=new Date;return{id:`subagent_${e.agentId}`,projectPath:e.projectPath,createdAt:t,updatedAt:t,messages:[],model:e.model,provider:e.provider,permissionCache:new Map,fileChanges:[],stats:{startTime:Date.now(),totalTurns:0,tokensIn:0,tokensOut:0,totalCost:0,toolCalls:0,filesModified:0},mode:e.mode??"auto"}}var fW=le(()=>{"use strict"});var uu,eE=le(()=>{"use strict";uu=class{tokens=[];toolCalls=[];toolResults=[];onToken(t){this.tokens.push(t)}onToolCall(t,a){this.toolCalls.push({name:t,args:a,timestamp:Date.now()})}onToolResult(t,a){this.toolResults.push({name:t,result:a,timestamp:Date.now()})}getResponse(){return this.tokens.join("")}getToolCalls(){return[...this.toolCalls]}getToolResults(){return[...this.toolResults]}getToolSummary(){return this.toolCalls.length===0?"":`Tools used: ${this.toolCalls.map(a=>{let n=this.toolResults.find(i=>i.name===a.name);return`${n?n.result.success?"\u2713":"\u2717":"\u2026"} ${a.name}`}).join(", ")}`}hasContent(){return this.tokens.length>0||this.toolCalls.length>0}flush(){this.tokens=[],this.toolCalls=[],this.toolResults=[]}}});import{EventEmitter as DIe}from"events";var Da,Rp=le(()=>{"use strict";Dw();rn();Nw();yO();Lc();UC();fW();eE();RC();IC();_b();Ql();PC();lA();Da=class e extends DIe{static instance=null;config=null;builtinAgents=new Map;customAgents=new Map;activeAgents=new Map;initialized=!1;constructor(){super()}static getInstance(){return e.instance||(e.instance=new e),e.instance}static reset(){e.instance&&(e.instance.cancelAll(),e.instance.removeAllListeners()),e.instance=null}initialize(t){this.config={maxConcurrent:t.maxConcurrent??Do.maxConcurrent,maxIterations:t.maxIterations??Do.maxIterations,timeout:t.timeout??Do.timeout,projectPath:t.projectPath,modelRouting:t.modelRouting,serverUrl:t.serverUrl,providerApiKey:t.providerApiKey,provider:t.provider,parentServerSessionId:t.parentServerSessionId},this.registerBuiltinAgents(),this.discoverCustomAgents(),this.initialized=!0,pe.debug(`SubagentManager initialized with ${this.builtinAgents.size} built-in agents`)}isInitialized(){return this.initialized}registerBuiltinAgents(){this.builtinAgents.set("explore",{name:"explore",description:"Fast codebase exploration and file discovery",type:"explore",systemPrompt:Qf("explore")??"",tools:["Glob","Grep","Read","LS"],modelTier:"cheap",maxIterations:30,compressionLevel:"medium",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("plan",{name:"plan",description:"Software architecture and implementation planning",type:"plan",systemPrompt:Qf("plan")??"",tools:["Glob","Grep","Read","LS","WebSearch","WebFetch"],modelTier:"standard",maxIterations:50,compressionLevel:"low",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("review",{name:"review",description:"Code review and quality analysis",type:"review",systemPrompt:Qf("review")??"",tools:["Glob","Grep","Read","LS","Bash"],disallowedTools:["Write","Edit"],modelTier:"cheap",maxIterations:40,compressionLevel:"medium",permissionMode:"dontAsk",isBuiltin:!0}),pe.debug(`Registered ${this.builtinAgents.size} built-in agents`)}discoverCustomAgents(){if(this.config?.projectPath)try{let t=MC(this.config.projectPath);for(let a of t)this.customAgents.set(a.name,a);t.length>0&&pe.debug(`Discovered ${t.length} custom agents`)}catch(t){pe.debug(`Custom agent discovery failed: ${t}`)}}getAgent(t){return this.customAgents.get(t)??this.builtinAgents.get(t)}listAgents(){let t=[];for(let a of this.builtinAgents.values())t.push(a);for(let a of this.customAgents.values()){let n=t.findIndex(r=>r.name===a.name);n>=0?t[n]=a:t.push(a)}return t}getActiveCount(){return this.activeAgents.size}isAtConcurrencyLimit(){let t=this.config?.maxConcurrent??Do.maxConcurrent;return this.activeAgents.size>=t}async spawn(t){if(!this.initialized||!this.config)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:"SubagentManager not initialized",tokens:{input:0,output:0},duration:0};let a=this.getAgent(t.name);if(!a)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Unknown subagent: ${t.name}`,tokens:{input:0,output:0},duration:0};if(this.isAtConcurrencyLimit())return this.emit("concurrencyLimitReached",this.activeAgents.size,this.config.maxConcurrent),{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Concurrency limit reached (${this.config.maxConcurrent} agents)`,tokens:{input:0,output:0},duration:0};let n=this.generateAgentId(),r=Date.now();pe.debug(`Spawning subagent: ${t.name} (${n})`),this.emit("subagentStart",n,t.name,t.prompt);let i=bi.getInstance();i.fire("SubagentStart",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,prompt:t.prompt,model:a.model??a.modelTier??"default"}).catch(s=>pe.debug(`SubagentStart hook error: ${s}`));try{let s=t.options?.runInBackground?z1.permissionMode:a.permissionMode??Do.permissionMode,o=t.options?.timeout??(t.options?.runInBackground?z1.timeout:this.config.timeout),c=new AbortController,l=this.executeSubagent({agent:a,agentId:n,prompt:t.prompt,sessionId:t.sessionId,cwd:t.cwd,permissionMode:s,timeout:o,model:t.options?.model,abortController:c});this.activeAgents.set(n,{agentId:n,agentName:t.name,promise:l,startedAt:new Date,abortController:c});let u=await l;return this.activeAgents.delete(n),u.duration=Date.now()-r,this.emit("subagentComplete",u),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!0,duration_ms:u.duration,tokens_in:u.tokens?.input??0,tokens_out:u.tokens?.output??0}).catch(p=>pe.debug(`SubagentStop hook error: ${p}`)),u}catch(s){this.activeAgents.delete(n);let o={success:!1,agentId:n,agentName:t.name,error:s instanceof Error?s.message:String(s),tokens:{input:0,output:0},duration:Date.now()-r};return this.emit("subagentComplete",o),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!1,duration_ms:o.duration,tokens_in:0,tokens_out:0,error:o.error}).catch(c=>pe.debug(`SubagentStop hook error: ${c}`)),o}}async executeSubagent(t){let{agent:a,agentId:n,prompt:r,cwd:i,permissionMode:s,timeout:o,abortController:c}=t,l=Date.now();pe.debug(`[${n}] Executing subagent: ${a.name} (${a.type})`);let u=process.env.AII_API_URL||this.config?.serverUrl,p=Wn({...u?{baseUrl:u}:{},...this.config?.providerApiKey?{providerApiKey:this.config.providerApiKey}:{}}),d=jC({allowedTools:a.tools,disallowedTools:[...a.disallowedTools??[],"Task"],permissionMode:s}),m=this.resolveModel(a,t.model),f=Wc({autoApprove:!0,streamOutput:!1,showThinking:!1,maxIterations:a.maxIterations??this.config.maxIterations,excludeTaskTool:!0},d,p),h=mW({agentId:n,agentName:a.name,projectPath:i,model:m.model,provider:m.provider});Vn.getInstance().initialize(i);let _;if(this.config?.parentServerSessionId)try{_=(await p.createSession({projectPath:i,model:m.model,provider:m.provider,channel:"cli",mode:"headless",name:`[${a.name}] ${r.slice(0,50)}`,parentSessionId:this.config.parentServerSessionId,subagentType:a.type})).sessionId,pe.debug(`[${n}] Linked server session: ${_} (parent: ${this.config.parentServerSessionId})`)}catch(F){pe.debug(`[${n}] Failed to create linked server session (standalone mode): ${F}`)}let v=setTimeout(()=>{pe.debug(`[${n}] Timeout reached (${o/1e3}s), aborting`),f.interrupt()},o),S=()=>{pe.debug(`[${n}] External abort signal received`),f.interrupt()};c.signal.addEventListener("abort",S,{once:!0});let T=new uu,C=F=>T.onToken(F),O=(F,B)=>{T.onToolCall(F,B),this.emit("subagentToolUse",n)},P=F=>{let B=T.getToolCalls(),K=B[B.length-1]?.name??"unknown";T.onToolResult(K,{callId:F.callId,success:F.success,output:F.output,error:F.error})},N=()=>{this.emit("subagentTokens",n,{input:h.stats.tokensIn,output:h.stats.tokensOut})};f.on("token",C),f.on("toolCall",O),f.on("toolResult",P),f.on("iterationUsage",N);let L=new Eh(n,a.name,t.sessionId,r);try{await f.run(r,h);let F=Date.now()-l,B={input:h.stats.tokensIn,output:h.stats.tokensOut},ee=T.getResponse(),K=new vh,j=a.compressionLevel??Do.compressionLevel,X=K.compress(ee,j);try{await L.save({messages:h.messages,rawOutput:ee,compressedOutput:X,success:!0,duration:F,tokens:B,iterations:h.stats.totalTurns,model:m.model,provider:m.provider})}catch(me){pe.debug(`[${n}] Failed to save transcript: ${me}`)}if(_)try{await p.deleteSession(_),pe.debug(`[${n}] Server session ${_} archived`)}catch(me){pe.debug(`[${n}] Failed to archive server session: ${me}`)}return pe.debug(`[${n}] Subagent completed: ${F}ms, ${B.input}+${B.output} tokens, ${ee.length} \u2192 ${X.length} chars (${j})`),{success:!0,agentId:n,agentName:a.name,output:X,tokens:B,duration:F,iterations:h.stats.totalTurns}}catch(F){let B=Date.now()-l,ee=c.signal.aborted,j=!ee&&B>=o?`Subagent timed out after ${o/1e3}s`:ee?"Subagent was cancelled":F instanceof Error?F.message:String(F);try{await L.save({messages:h.messages,rawOutput:T.getResponse(),compressedOutput:"",success:!1,duration:B,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},model:m.model,provider:m.provider,error:j})}catch(X){pe.debug(`[${n}] Failed to save error transcript: ${X}`)}if(_)try{await p.deleteSession(_),pe.debug(`[${n}] Server session ${_} archived (after error)`)}catch(X){pe.debug(`[${n}] Failed to archive server session: ${X}`)}return pe.debug(`[${n}] Subagent failed: ${j}`),{success:!1,agentId:n,agentName:a.name,error:j,output:T.getResponse()||void 0,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},duration:B}}finally{clearTimeout(v),c.signal.removeEventListener("abort",S),f.removeListener("token",C),f.removeListener("toolCall",O),f.removeListener("toolResult",P),f.removeListener("iterationUsage",N),f.disconnect()}}resolveModel(t,a){if(a)return this.parseModelString(a);if(t.model)return this.parseModelString(t.model);if(t.modelTier){let i=this.config?.provider??"anthropic",s=new bh;s.initialize(i);let o=s.resolveForSubagent(t.type,t.modelTier);return{provider:this.inferProvider(o),model:o}}let n=this.config?.provider??"anthropic";return{provider:n,model:n==="anthropic"?"claude-sonnet-4":n==="deepseek"?"deepseek-chat":n==="openai"?"gpt-4o":n==="google"?"gemini-2.5-flash":"claude-sonnet-4"}}parseModelString(t){if(t.includes("/")){let[a,...n]=t.split("/");return{provider:a,model:n.join("/")}}return{provider:this.inferProvider(t),model:t}}inferProvider(t){return t.startsWith("claude")?"anthropic":t.startsWith("gpt")||t.startsWith("o1")||t.startsWith("o3")?"openai":t.startsWith("gemini")?"google":t.startsWith("deepseek")?"deepseek":"anthropic"}cancel(t){let a=this.activeAgents.get(t);return a?(pe.debug(`Cancelling subagent: ${t}`),a.abortController.abort(),this.activeAgents.delete(t),!0):!1}cancelAll(){pe.debug(`Cancelling all ${this.activeAgents.size} active subagents`);for(let[t,a]of this.activeAgents)a.abortController.abort(),this.activeAgents.delete(t)}getActiveAgents(){return Array.from(this.activeAgents.values()).map(t=>({agentId:t.agentId,agentName:t.agentName,startedAt:t.startedAt}))}async waitFor(t){let a=this.activeAgents.get(t);if(a)return a.promise}generateAgentId(){let t=Date.now().toString(36),a=Math.random().toString(36).slice(2,9);return`agent_${t}_${a}`}reload(){this.initialized&&(this.customAgents.clear(),this.discoverCustomAgents(),pe.debug("Reloaded custom agent definitions"))}setParentServerSessionId(t){this.config&&(this.config.parentServerSessionId=t,pe.debug(`SubagentManager parentServerSessionId set to: ${t??"none"}`))}getConfig(){return this.config}formatSummaryForDisplay(){let t=[];t.push("\u{1F916} Available Subagents:"),t.push("");let a=this.listAgents();if(a.length===0)return t.push(" No subagents configured."),t.join(`
872
+ `)&&n.log(""),m&&n.log(""),this.loopMode?n.deactivateForCompaction():n.deactivate(),process.stdout.write("\r"),process.stdin.pause();let Me=bi.getInstance(),st={session_id:a.id,cwd:a.projectPath,transcript_path:"",exit_reason:"completed"},At=await Me.fire("Stop",st);if(At.decision==="block"){let Ce=At.reason||"Stop hook requested continuation";console.log(La.dim(`[Hook] Stop blocked: ${Ce}`))}this.setState("complete")}catch(J){if(me(),K(),X(),this.stallDetected)throw this.stallDetected=!1,n.deactivateForCompaction(),process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),{name:"StallTimeout",message:`No response for ${Math.round(this.config.stallTimeoutMs/1e3)} seconds`};let se=J.message??"",de=se.includes("WebSocket disconnected unexpectedly")||se.includes("ECONNRESET")||se.includes("EPIPE")||se.includes("ETIMEDOUT")||se.includes("ECONNREFUSED")||se.includes("socket hang up")||se.includes("WebSocket was closed")||se.includes("WebSocket error")&&!this.interrupted,Me=J.retryable===!0||de;throw this.pauseRequested||Me?n.deactivateForCompaction():n.deactivate(),J.name==="AgentInterrupt"||this.interrupted?(process.stdout.write("\r"),this.setState("error"),{name:"AgentInterrupt",message:"Agent interrupted"}):(process.stdout.write("\r"),process.stdin.pause(),this.setState("error"),Me?{name:"AbnormalDisconnect",message:se}:J)}}disconnect(){this.client.disconnect()}}});function mW(e){let t=new Date;return{id:`subagent_${e.agentId}`,projectPath:e.projectPath,createdAt:t,updatedAt:t,messages:[],model:e.model,provider:e.provider,permissionCache:new Map,fileChanges:[],stats:{startTime:Date.now(),totalTurns:0,tokensIn:0,tokensOut:0,totalCost:0,toolCalls:0,filesModified:0},mode:e.mode??"auto"}}var fW=le(()=>{"use strict"});var uu,eE=le(()=>{"use strict";uu=class{tokens=[];toolCalls=[];toolResults=[];onToken(t){this.tokens.push(t)}onToolCall(t,a){this.toolCalls.push({name:t,args:a,timestamp:Date.now()})}onToolResult(t,a){this.toolResults.push({name:t,result:a,timestamp:Date.now()})}getResponse(){return this.tokens.join("")}getToolCalls(){return[...this.toolCalls]}getToolResults(){return[...this.toolResults]}getToolSummary(){return this.toolCalls.length===0?"":`Tools used: ${this.toolCalls.map(a=>{let n=this.toolResults.find(i=>i.name===a.name);return`${n?n.result.success?"\u2713":"\u2717":"\u2026"} ${a.name}`}).join(", ")}`}hasContent(){return this.tokens.length>0||this.toolCalls.length>0}flush(){this.tokens=[],this.toolCalls=[],this.toolResults=[]}}});import{EventEmitter as DIe}from"events";var Da,Rp=le(()=>{"use strict";Dw();rn();Nw();yO();Lc();UC();fW();eE();RC();IC();_b();Ql();PC();lA();Da=class e extends DIe{static instance=null;config=null;builtinAgents=new Map;customAgents=new Map;activeAgents=new Map;initialized=!1;constructor(){super()}static getInstance(){return e.instance||(e.instance=new e),e.instance}static reset(){e.instance&&(e.instance.cancelAll(),e.instance.removeAllListeners()),e.instance=null}initialize(t){this.config={maxConcurrent:t.maxConcurrent??Do.maxConcurrent,maxIterations:t.maxIterations??Do.maxIterations,timeout:t.timeout??Do.timeout,projectPath:t.projectPath,modelRouting:t.modelRouting,serverUrl:t.serverUrl,providerApiKey:t.providerApiKey,provider:t.provider,parentServerSessionId:t.parentServerSessionId},this.registerBuiltinAgents(),this.discoverCustomAgents(),this.initialized=!0,pe.debug(`SubagentManager initialized with ${this.builtinAgents.size} built-in agents`)}isInitialized(){return this.initialized}registerBuiltinAgents(){this.builtinAgents.set("explore",{name:"explore",description:"Fast codebase exploration and file discovery",type:"explore",systemPrompt:Qf("explore")??"",tools:["Glob","Grep","Read","LS"],modelTier:"cheap",maxIterations:30,compressionLevel:"medium",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("plan",{name:"plan",description:"Software architecture and implementation planning",type:"plan",systemPrompt:Qf("plan")??"",tools:["Glob","Grep","Read","LS","WebSearch","WebFetch"],modelTier:"standard",maxIterations:50,compressionLevel:"low",permissionMode:"plan",isBuiltin:!0}),this.builtinAgents.set("review",{name:"review",description:"Code review and quality analysis",type:"review",systemPrompt:Qf("review")??"",tools:["Glob","Grep","Read","LS","Bash"],disallowedTools:["Write","Edit"],modelTier:"cheap",maxIterations:40,compressionLevel:"medium",permissionMode:"dontAsk",isBuiltin:!0}),pe.debug(`Registered ${this.builtinAgents.size} built-in agents`)}discoverCustomAgents(){if(this.config?.projectPath)try{let t=MC(this.config.projectPath);for(let a of t)this.customAgents.set(a.name,a);t.length>0&&pe.debug(`Discovered ${t.length} custom agents`)}catch(t){pe.debug(`Custom agent discovery failed: ${t}`)}}getAgent(t){return this.customAgents.get(t)??this.builtinAgents.get(t)}listAgents(){let t=[];for(let a of this.builtinAgents.values())t.push(a);for(let a of this.customAgents.values()){let n=t.findIndex(r=>r.name===a.name);n>=0?t[n]=a:t.push(a)}return t}getActiveCount(){return this.activeAgents.size}isAtConcurrencyLimit(){let t=this.config?.maxConcurrent??Do.maxConcurrent;return this.activeAgents.size>=t}async spawn(t){if(!this.initialized||!this.config)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:"SubagentManager not initialized",tokens:{input:0,output:0},duration:0};let a=this.getAgent(t.name);if(!a)return{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Unknown subagent: ${t.name}`,tokens:{input:0,output:0},duration:0};if(this.isAtConcurrencyLimit())return this.emit("concurrencyLimitReached",this.activeAgents.size,this.config.maxConcurrent),{success:!1,agentId:this.generateAgentId(),agentName:t.name,error:`Concurrency limit reached (${this.config.maxConcurrent} agents)`,tokens:{input:0,output:0},duration:0};let n=this.generateAgentId(),r=Date.now();pe.debug(`Spawning subagent: ${t.name} (${n})`),this.emit("subagentStart",n,t.name,t.prompt);let i=bi.getInstance();i.fire("SubagentStart",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,prompt:t.prompt,model:a.model??a.modelTier??"default"}).catch(s=>pe.debug(`SubagentStart hook error: ${s}`));try{let s=t.options?.runInBackground?z1.permissionMode:a.permissionMode??Do.permissionMode,o=t.options?.timeout??(t.options?.runInBackground?z1.timeout:this.config.timeout),c=new AbortController,l=this.executeSubagent({agent:a,agentId:n,prompt:t.prompt,sessionId:t.sessionId,cwd:t.cwd,permissionMode:s,timeout:o,model:t.options?.model,abortController:c});this.activeAgents.set(n,{agentId:n,agentName:t.name,promise:l,startedAt:new Date,abortController:c});let u=await l;return this.activeAgents.delete(n),u.duration=Date.now()-r,this.emit("subagentComplete",u),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!0,duration_ms:u.duration,tokens_in:u.tokens?.input??0,tokens_out:u.tokens?.output??0}).catch(p=>pe.debug(`SubagentStop hook error: ${p}`)),u}catch(s){this.activeAgents.delete(n);let o={success:!1,agentId:n,agentName:t.name,error:s instanceof Error?s.message:String(s),tokens:{input:0,output:0},duration:Date.now()-r};return this.emit("subagentComplete",o),i.fire("SubagentStop",{session_id:t.sessionId,cwd:t.cwd,transcript_path:"",agent_id:n,agent_name:t.name,agent_type:a.type,success:!1,duration_ms:o.duration,tokens_in:0,tokens_out:0,error:o.error}).catch(c=>pe.debug(`SubagentStop hook error: ${c}`)),o}}async executeSubagent(t){let{agent:a,agentId:n,prompt:r,cwd:i,permissionMode:s,timeout:o,abortController:c}=t,l=Date.now();pe.debug(`[${n}] Executing subagent: ${a.name} (${a.type})`);let u=process.env.AII_API_URL||this.config?.serverUrl,p=Wn({...u?{baseUrl:u}:{},...this.config?.providerApiKey?{providerApiKey:this.config.providerApiKey}:{}}),d=jC({allowedTools:a.tools,disallowedTools:[...a.disallowedTools??[],"Task"],permissionMode:s}),m=this.resolveModel(a,t.model),f=Wc({autoApprove:!0,streamOutput:!1,showThinking:!1,maxIterations:a.maxIterations??this.config.maxIterations,excludeTaskTool:!0},d,p),h=mW({agentId:n,agentName:a.name,projectPath:i,model:m.model,provider:m.provider});Vn.getInstance().initialize(i);let _;if(this.config?.parentServerSessionId)try{_=(await p.createSession({projectPath:i,model:m.model,provider:m.provider,channel:"cli",mode:"headless",name:`[${a.name}] ${r.slice(0,50)}`,parentSessionId:this.config.parentServerSessionId,subagentType:a.type})).sessionId,pe.debug(`[${n}] Linked server session: ${_} (parent: ${this.config.parentServerSessionId})`)}catch(F){pe.debug(`[${n}] Failed to create linked server session (standalone mode): ${F}`)}let v=setTimeout(()=>{pe.debug(`[${n}] Timeout reached (${o/1e3}s), aborting`),f.interrupt()},o),S=()=>{pe.debug(`[${n}] External abort signal received`),f.interrupt()};c.signal.addEventListener("abort",S,{once:!0});let T=new uu,C=F=>T.onToken(F),O=(F,B)=>{T.onToolCall(F,B),this.emit("subagentToolUse",n)},P=F=>{let B=T.getToolCalls(),K=B[B.length-1]?.name??"unknown";T.onToolResult(K,{callId:F.callId,success:F.success,output:F.output,error:F.error})},N=()=>{this.emit("subagentTokens",n,{input:h.stats.tokensIn,output:h.stats.tokensOut})};f.on("token",C),f.on("toolCall",O),f.on("toolResult",P),f.on("iterationUsage",N);let L=new Eh(n,a.name,t.sessionId,r);try{await f.run(r,h);let F=Date.now()-l,B={input:h.stats.tokensIn,output:h.stats.tokensOut},ee=T.getResponse(),K=new vh,j=a.compressionLevel??Do.compressionLevel,X=K.compress(ee,j);try{await L.save({messages:h.messages,rawOutput:ee,compressedOutput:X,success:!0,duration:F,tokens:B,iterations:h.stats.totalTurns,model:m.model,provider:m.provider})}catch(me){pe.debug(`[${n}] Failed to save transcript: ${me}`)}if(_)try{await p.deleteSession(_),pe.debug(`[${n}] Server session ${_} archived`)}catch(me){pe.debug(`[${n}] Failed to archive server session: ${me}`)}return pe.debug(`[${n}] Subagent completed: ${F}ms, ${B.input}+${B.output} tokens, ${ee.length} \u2192 ${X.length} chars (${j})`),{success:!0,agentId:n,agentName:a.name,output:X,tokens:B,duration:F,iterations:h.stats.totalTurns}}catch(F){let B=Date.now()-l,ee=c.signal.aborted,j=!ee&&B>=o?`Subagent timed out after ${o/1e3}s`:ee?"Subagent was cancelled":F instanceof Error?F.message:String(F);try{await L.save({messages:h.messages,rawOutput:T.getResponse(),compressedOutput:"",success:!1,duration:B,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},model:m.model,provider:m.provider,error:j})}catch(X){pe.debug(`[${n}] Failed to save error transcript: ${X}`)}if(_)try{await p.deleteSession(_),pe.debug(`[${n}] Server session ${_} archived (after error)`)}catch(X){pe.debug(`[${n}] Failed to archive server session: ${X}`)}return pe.debug(`[${n}] Subagent failed: ${j}`),{success:!1,agentId:n,agentName:a.name,error:j,output:T.getResponse()||void 0,tokens:{input:h.stats.tokensIn,output:h.stats.tokensOut},duration:B}}finally{clearTimeout(v),c.signal.removeEventListener("abort",S),f.removeListener("token",C),f.removeListener("toolCall",O),f.removeListener("toolResult",P),f.removeListener("iterationUsage",N),f.disconnect()}}resolveModel(t,a){if(a)return this.parseModelString(a);if(t.model)return this.parseModelString(t.model);if(t.modelTier){let i=this.config?.provider??"anthropic",s=new bh;s.initialize(i);let o=s.resolveForSubagent(t.type,t.modelTier);return{provider:this.inferProvider(o),model:o}}let n=this.config?.provider??"anthropic";return{provider:n,model:n==="anthropic"?"claude-sonnet-4":n==="deepseek"?"deepseek-chat":n==="openai"?"gpt-4o":n==="google"?"gemini-2.5-flash":"claude-sonnet-4"}}parseModelString(t){if(t.includes("/")){let[a,...n]=t.split("/");return{provider:a,model:n.join("/")}}return{provider:this.inferProvider(t),model:t}}inferProvider(t){return t.startsWith("claude")?"anthropic":t.startsWith("gpt")||t.startsWith("o1")||t.startsWith("o3")?"openai":t.startsWith("gemini")?"google":t.startsWith("deepseek")?"deepseek":"anthropic"}cancel(t){let a=this.activeAgents.get(t);return a?(pe.debug(`Cancelling subagent: ${t}`),a.abortController.abort(),this.activeAgents.delete(t),!0):!1}cancelAll(){pe.debug(`Cancelling all ${this.activeAgents.size} active subagents`);for(let[t,a]of this.activeAgents)a.abortController.abort(),this.activeAgents.delete(t)}getActiveAgents(){return Array.from(this.activeAgents.values()).map(t=>({agentId:t.agentId,agentName:t.agentName,startedAt:t.startedAt}))}async waitFor(t){let a=this.activeAgents.get(t);if(a)return a.promise}generateAgentId(){let t=Date.now().toString(36),a=Math.random().toString(36).slice(2,9);return`agent_${t}_${a}`}reload(){this.initialized&&(this.customAgents.clear(),this.discoverCustomAgents(),pe.debug("Reloaded custom agent definitions"))}setParentServerSessionId(t){this.config&&(this.config.parentServerSessionId=t,pe.debug(`SubagentManager parentServerSessionId set to: ${t??"none"}`))}getConfig(){return this.config}formatSummaryForDisplay(){let t=[];t.push("\u{1FABC} Available Subagents:"),t.push("");let a=this.listAgents();if(a.length===0)return t.push(" No subagents configured."),t.join(`
873
873
  `);let n=a.filter(i=>i.isBuiltin),r=a.filter(i=>!i.isBuiltin);if(n.length>0){t.push(" Built-in:");for(let i of n){let s=i.modelTier??"preferred";t.push(` \u2022 ${i.name} (${s}) - ${i.description}`)}t.push("")}if(r.length>0){t.push(" Custom:");for(let i of r){let s=i.modelTier??i.model??"preferred";t.push(` \u2022 ${i.name} (${s}) - ${i.description}`)}t.push("")}if(this.activeAgents.size>0){t.push(` Active: ${this.activeAgents.size}/${this.config?.maxConcurrent??Do.maxConcurrent}`);for(let i of this.activeAgents.values()){let s=Math.round((Date.now()-i.startedAt.getTime())/1e3);t.push(` \u2022 ${i.agentName} (${i.agentId}) - ${s}s`)}}return t.join(`
874
874
  `)}}});function OIe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Jv(){let e=No(),{nodes:t}=e;if(t.length===0)return"";let a=[];a.push(` ${g.red("\u25CF")} ${t.length} agent${t.length!==1?"s":""} finished`);let n=i=>i.charAt(0).toUpperCase()+i.slice(1),r=" \xB7 ";return t.forEach((i,s)=>{let o=s===t.length-1,c=o?"\u2514\u2500":"\u251C\u2500",l=o?" ":"\u2502 ",u=i.tokens.input+i.tokens.output,p=[`${i.toolUses} tool use${i.toolUses!==1?"s":""}`];u>0&&p.push(`${OIe(u)} tokens`);let d=i.prompt.length>35?i.prompt.slice(0,32)+"...":i.prompt;a.push(g.dim(` ${c} `)+g.bold(n(i.agentName))+g.dim(" (")+d+g.dim(")")+g.dim(`${r}${p.join(r)}`));let m=i.status==="done"?"green":i.status==="failed"?"red":"yellow",f=i.status==="done"?"Done":i.status==="failed"?"Failed":"Timeout";a.push(g.dim(` ${l}\u2514 `)+g[m](f))}),e.clear(),a.join(`
875
875
  `)}function tE(){if(vO)return;let e=Da.getInstance(),t=No();e.on("subagentStart",(a,n,r)=>{t.addNode(a,n,r)}),e.on("subagentToolUse",a=>{t.updateNodeToolUses(a)}),e.on("subagentTokens",(a,n)=>{t.updateNodeTokens(a,n)}),e.on("subagentComplete",a=>{t.completeNode(a.agentId,{success:a.success,duration:a.duration,tokens:a.tokens,error:a.error})}),vO=!0}function hW(){vO=!1}var vO,Zv=le(()=>{"use strict";Rp();Up();la();vO=!1});var _W={};lr(_W,{getUIStore:()=>lg,useUIStore:()=>Vo});import{create as IIe}from"zustand";var gW,Vo,lg,EO=le(()=>{"use strict";gW={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},Vo=IIe(e=>({...gW,setMode:t=>e({mode:t}),setAgentMode:t=>e({agentMode:t}),setStatus:t=>e({status:t}),setThinking:t=>e({isThinking:t}),setStreaming:t=>e(a=>{if(t&&!a.agentTurnStartTime)return{isStreaming:t,agentTurnStartTime:Date.now()};if(!t&&a.agentTurnStartTime){let n=Date.now()-a.agentTurnStartTime;return{isStreaming:t,agentExecMs:a.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:t}}),incrementIteration:()=>e(t=>({currentIteration:t.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:t=>e(a=>({iterationTokens:a.iterationTokens+t})),setIterationTokens:t=>e({iterationTokens:t}),updateContext:(t,a)=>{let n=a>0?Math.round(t/a*100):0,r=n>=90?"critical":n>=70?"warning":"normal";e({contextTokens:t,contextLimit:a,contextPercent:n,contextLevel:r})},updateSession:t=>e(t),updateResources:t=>e(t),setLoopMode:t=>e({loopMode:t}),incrementRenderEpoch:()=>e(t=>({renderEpoch:t.renderEpoch+1})),reset:()=>e(gW)})),lg=Vo.getState});var vW={};lr(vW,{getInputStore:()=>bW,useInputStore:()=>ug});import{create as RIe}from"zustand";var yW,NIe,MIe,ug,bW,SO=le(()=>{"use strict";yW={lines:[""],cursorLine:0,cursorCol:0,typeAheadBuffer:"",isTypeAheadActive:!1,history:[],historyIndex:-1,undoStack:[],redoStack:[]},NIe=100,MIe=50,ug=RIe((e,t)=>({...yW,insertChar:a=>{t().saveSnapshot(),e(r=>{let i=[...r.lines],s=i[r.cursorLine];return i[r.cursorLine]=s.slice(0,r.cursorCol)+a+s.slice(r.cursorCol),{lines:i,cursorCol:r.cursorCol+a.length,redoStack:[]}})},deleteChar:()=>{let a=t();a.cursorCol===0&&a.cursorLine===0||(a.saveSnapshot(),e(n=>{let r=[...n.lines];if(n.cursorCol>0){let i=r[n.cursorLine];return r[n.cursorLine]=i.slice(0,n.cursorCol-1)+i.slice(n.cursorCol),{lines:r,cursorCol:n.cursorCol-1,redoStack:[]}}else if(n.cursorLine>0){let i=r[n.cursorLine-1],s=r[n.cursorLine];return r[n.cursorLine-1]=i+s,r.splice(n.cursorLine,1),{lines:r,cursorLine:n.cursorLine-1,cursorCol:i.length,redoStack:[]}}return n}))},newLine:()=>{t().saveSnapshot(),e(n=>{let r=[...n.lines],i=r[n.cursorLine],s=i.slice(0,n.cursorCol),o=i.slice(n.cursorCol);return r[n.cursorLine]=s,r.splice(n.cursorLine+1,0,o),{lines:r,cursorLine:n.cursorLine+1,cursorCol:0,redoStack:[]}})},moveCursor:a=>{e(n=>{switch(a){case"left":if(n.cursorCol>0)return{cursorCol:n.cursorCol-1};if(n.cursorLine>0)return{cursorLine:n.cursorLine-1,cursorCol:n.lines[n.cursorLine-1].length};break;case"right":if(n.cursorCol<n.lines[n.cursorLine].length)return{cursorCol:n.cursorCol+1};if(n.cursorLine<n.lines.length-1)return{cursorLine:n.cursorLine+1,cursorCol:0};break;case"up":if(n.cursorLine>0){let r=n.cursorLine-1,i=Math.min(n.cursorCol,n.lines[r].length);return{cursorLine:r,cursorCol:i}}break;case"down":if(n.cursorLine<n.lines.length-1){let r=n.cursorLine+1,i=Math.min(n.cursorCol,n.lines[r].length);return{cursorLine:r,cursorCol:i}}break}return n})},setText:a=>{let n=a.split(`
@@ -1181,27 +1181,27 @@ caused by: `+ra.fullStack(t):e.stack};ra.errorFromList=function(e){return kn.arr
1181
1181
  ${e}
1182
1182
  </context>
1183
1183
 
1184
- ${t}`:t}var yde="0.11.4";function bde(){let e=new hL;return e.name("aii").description("AI-powered CLI assistant").version(yde,"-V, --version","Show version number").helpOption(!1).enablePositionalOptions().argument("[query...]","Natural language query").option("--clean","Clean output mode (just the result)").option("--standard","Standard output mode (result + metrics)").option("--thinking","Thinking mode (full reasoning)").option("-v, --verbose","Verbose output (alias for --thinking)").option("-d, --debug","Debug output").option("--model <model>","Override LLM model").option("--provider <provider>","Override LLM provider (e.g., ollama, anthropic, openai)").option("--host <host>","API server host:port").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").option("-i, --interactive","Interactive chat mode").option("-c, --continue-chat <id>","Continue chat session").option("-n, --new-chat","Force new chat session").option("--auto","Auto mode - auto-approve all actions").option("-q, --quiet","Quiet mode - minimal output").option("--no-colors","Disable colored output").option("--no-emojis","Disable emoji icons").option("--no-animations","Disable animations").option("--no-streaming","Disable streaming").option("--show-tokens","Show token usage").option("--show-cost","Show cost estimates").option("-h, --help","Show help"),e.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").action(()=>{}),e.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),e.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),e.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),e.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),e.command("doctor").description("System health check").action(()=>{}),e.command("chat").description("Interactive chat mode").action(()=>{}),e.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),e.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),e.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("sessions").description("Manage server sessions (list, info, resume, rename, delete)").argument("[action]","Action: list, info, resume, rename, delete").argument("[args...]","Additional arguments (session ID, name, etc.)").allowUnknownOption().action(()=>{}),e.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),e.command("version").description("Show version number").action(()=>{}),e}async function _L(e){let t=bde();t.exitOverride(),t.configureOutput({writeErr:()=>{}});let a="query",n,r=[];try{t.parse(e),r=t.args;let l=t.args[0];l&&["config","mcp","prompt","stats","history","doctor","chat","run","help","version","agent","loop","telegram","sessions"].includes(l)&&(a=l,n=t.args[1],r=t.args.slice(2))}catch(l){l instanceof fL&&(l.code==="commander.version"||l.code==="commander.helpDisplayed")&&process.exit(0),r=e.slice(2)}let i=t.opts(),s={clean:i.clean??!1,standard:i.standard??!1,thinking:i.thinking??!1,verbose:i.verbose??!1,debug:i.debug??!1,model:i.model,provider:i.provider,host:i.host,yes:i.yes??!1,offline:i.offline??!1,interactive:i.interactive??!1,continueChat:i.continueChat,newChat:i.newChat??!1,auto:i.auto??!1,quiet:i.quiet??!1,noColors:!i.colors,noEmojis:!i.emojis,noAnimations:!i.animations,noStreaming:!i.streaming,showTokens:i.showTokens??!1,showCost:i.showCost??!1,help:i.help??!1,version:i.version??!1},o;Yx()&&(o=await gL()),(a==="chat"||s.interactive)&&(a="agent"),a==="query"&&!r.length&&!o&&(a="agent");let c;if(a==="query"&&r.length>0)c=r.join(" ");else if(a==="agent"){let l=[];n&&l.push(n),r.length>0&&l.push(...r),l.length>0&&(c=l.join(" "))}return{command:a,subcommand:n,args:r,flags:s,stdinContent:o,query:c}}var Wt;(function(e){e[e.LOCAL=1]="LOCAL",e[e.SERVER=2]="SERVER"})(Wt||(Wt={}));var Kx={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function Xu(e,t,a,n){return e.clean?"clean":e.thinking||e.verbose?"thinking":e.standard?"standard":t&&a?.[t]?a[t]:t&&Kx[t]?Kx[t]:n||Kx._default}var yL={config:Wt.LOCAL,help:Wt.LOCAL,version:Wt.LOCAL,doctor:Wt.LOCAL,mcp:Wt.LOCAL,prompt:Wt.LOCAL,stats:Wt.LOCAL,history:Wt.LOCAL,query:Wt.SERVER,chat:Wt.SERVER,run:Wt.SERVER,agent:Wt.SERVER,loop:Wt.SERVER,telegram:Wt.SERVER,sessions:Wt.SERVER};function Wx(e){let t=yL[e.command]??Wt.SERVER;switch(e.command){case"config":return vde(e);case"mcp":return Ede(e);case"prompt":return Sde(e);case"stats":return xde(e);case"history":return kde(e);case"doctor":return{tier:Wt.LOCAL,handler:"doctor",params:{}};case"chat":return{tier:Wt.SERVER,handler:"chat",params:{continueChat:e.flags.continueChat}};case"run":return wde(e);case"agent":return{tier:Wt.SERVER,handler:"agent",params:{interactive:!e.query}};case"loop":return{tier:Wt.SERVER,handler:"loop",params:{}};case"telegram":return{tier:Wt.SERVER,handler:"telegram",params:{action:e.subcommand??e.args[0]??"start"}};case"sessions":return{tier:Wt.SERVER,handler:"sessions",params:{action:e.subcommand??e.args[0]??"list"}};case"help":return{tier:Wt.LOCAL,handler:"help",params:{command:e.subcommand}};case"version":return{tier:Wt.LOCAL,handler:"version",params:{}};case"query":default:return{tier:t,handler:"query",params:{query:e.query,stdinContent:e.stdinContent}}}}function vde(e){let t=e.subcommand??e.args[0]??"show";return{tier:Wt.LOCAL,handler:`config:${t}`,params:{key:e.args[0],value:e.args[1]}}}function Ede(e){let t=e.subcommand??e.args[0]??"list";return{tier:Wt.LOCAL,handler:`mcp:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function Sde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Wt.LOCAL,handler:`prompt:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function xde(e){let t=e.subcommand??e.args[0];return{tier:Wt.LOCAL,handler:t?`stats:${t}`:"stats",params:{}}}function kde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Wt.LOCAL,handler:`history:${t}`,params:{query:e.args[0],id:e.args[0]}}}var Tde=new Set(["--model","--provider","--host","--continue-chat","-c"]);function wde(e){let t=[];e.subcommand&&t.push(e.subcommand);let a=[];for(let r=0;r<e.args.length;r++){let i=e.args[r];if(Tde.has(i)){r++;continue}i.startsWith("-")||a.push(i)}t.push(...a);let n=t.join(" ");return{tier:Wt.SERVER,handler:"run",params:{operation:n}}}Ll();la();import{createInterface as oNe}from"readline";import{spawn as cNe}from"child_process";nw();Gi();rn();var Gye={timeout:12e4,retries:3,retryDelay:1e3},_i=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(t){this.options={...Gye,...t}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:t}=await Promise.resolve().then(()=>(bp(),yp));this.mcpExecutor=new t,await this.mcpExecutor.initialize(),Oe(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(t,a){let n=null;for(let r=0;r<this.options.retries;r++)try{return await this.executeWithRetry(t,a)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),Oe(`Attempt ${r+1} failed: ${n.message}`),n instanceof Nf||n.message.includes("Authentication"))throw n;if(r<this.options.retries-1){let s=this.options.retryDelay*Math.pow(2,r);Oe(`Retrying in ${s}ms...`),await this.sleep(s)}}throw n??new Rf("Max retries exceeded")}async executeWithRetry(t,a){return new Promise((n,r)=>{let i=this.buildWebSocketUrl();Oe(`Connecting to ${i}`);try{this.ws=new Cs(i)}catch{let c=new URL(this.options.url);r(new Of(c.hostname||"localhost",c.port||"26169"));return}let s=!1,o=null;this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new If("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{Oe("WebSocket connected, sending request"),this.ws?.send(JSON.stringify(t))}),this.ws.on("message",c=>{this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new If("WebSocket activity",this.options.timeout)))});try{let l=JSON.parse(c.toString());this.handleMessage(l,a,u=>{s=!0,o=u,this.cleanup(),n(u)},u=>{s=!0,this.cleanup(),r(u)})}catch(l){let u=c?String(c):"<undefined>";Oe(`Failed to parse message: ${u}`),s||(s=!0,this.cleanup(),r(new Error(`Failed to parse server message: ${l.message}`)))}}),this.ws.on("error",c=>{if(Oe(`WebSocket error: ${c.message}`),!s){s=!0,this.cleanup();let l=new URL(this.options.url);r(new Of(l.hostname||"localhost",l.port||"26169"))}}),this.ws.on("close",(c,l)=>{Oe(`WebSocket closed: ${c} ${l.toString()}`),s||(s=!0,this.cleanup(),o?n(o):r(new Rf(`Connection closed unexpectedly: ${c}`)))})})}handleMessage(t,a,n,r){switch(t.type){case"token":{let i=t;a?.onToken?.(i.data);break}case"complete":{let i=t,s=i.metadata||{},o=this.convertServerMetadata(i),c={result:i.result,metadata:o,clientSideExecution:s.client_side_execution===!0,userRequest:s.user_request};a?.onComplete?.(c),n(c);break}case"error":{let i=t,s=new Nf(i.code,i.message);a?.onError?.(s),r(s);break}case"mcp_query_tools":{Oe("Received mcp_query_tools request"),this.handleMCPQueryTools(t);break}case"mcp_tool_request":{Oe("Received mcp_tool_request"),this.handleMCPToolRequest(t);break}default:Oe(`Unknown message type: ${t.type}`)}}convertServerMetadata(t){let a=t.metadata||{},n,r;a.tokens?(n=a.tokens.input,r=a.tokens.output):(n=a.input_tokens,r=a.output_tokens);let i=a.cost??a.cost_usd,s=a.execution_time??a.total_time;return{function_name:t.function_name,tokens_in:n,tokens_out:r,cost:typeof i=="number"?i:void 0,model:typeof a.model=="string"?a.model:void 0,execution_time:typeof s=="number"?s:void 0}}buildWebSocketUrl(){let t=new URL(this.options.url);return`${t.protocol==="https:"?"wss:":"ws:"}//${t.host}/ws/execute`}async handleMCPQueryTools(t){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(bp(),yp));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let a=await this.mcpExecutor.handleQueryTools(t);this.ws?.send(JSON.stringify(a))}catch(a){let n=a instanceof Error?a.message:String(a),r=a instanceof Error?a.stack:void 0;Oe(`Error handling mcp_query_tools: ${n}${r?`
1184
+ ${t}`:t}var yde="0.11.6";function bde(){let e=new hL;return e.name("aii").description("AI-powered CLI assistant").version(yde,"-V, --version","Show version number").helpOption(!1).enablePositionalOptions().argument("[query...]","Natural language query").option("--clean","Clean output mode (just the result)").option("--standard","Standard output mode (result + metrics)").option("--thinking","Thinking mode (full reasoning)").option("-v, --verbose","Verbose output (alias for --thinking)").option("-d, --debug","Debug output").option("--model <model>","Override LLM model").option("--provider <provider>","Override LLM provider (e.g., ollama, anthropic, openai)").option("--host <host>","API server host:port").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").option("-i, --interactive","Interactive chat mode").option("-c, --continue-chat <id>","Continue chat session").option("-n, --new-chat","Force new chat session").option("--auto","Auto mode - auto-approve all actions").option("-q, --quiet","Quiet mode - minimal output").option("--no-colors","Disable colored output").option("--no-emojis","Disable emoji icons").option("--no-animations","Disable animations").option("--no-streaming","Disable streaming").option("--show-tokens","Show token usage").option("--show-cost","Show cost estimates").option("-h, --help","Show help"),e.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").action(()=>{}),e.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),e.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),e.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),e.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),e.command("doctor").description("System health check").action(()=>{}),e.command("chat").description("Interactive chat mode").action(()=>{}),e.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),e.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),e.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("sessions").description("Manage server sessions (list, info, resume, rename, delete)").argument("[action]","Action: list, info, resume, rename, delete").argument("[args...]","Additional arguments (session ID, name, etc.)").allowUnknownOption().action(()=>{}),e.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),e.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),e.command("version").description("Show version number").action(()=>{}),e}async function _L(e){let t=bde();t.exitOverride(),t.configureOutput({writeErr:()=>{}});let a="query",n,r=[];try{t.parse(e),r=t.args;let l=t.args[0];l&&["config","mcp","prompt","stats","history","doctor","chat","run","help","version","agent","loop","telegram","sessions"].includes(l)&&(a=l,n=t.args[1],r=t.args.slice(2))}catch(l){l instanceof fL&&(l.code==="commander.version"||l.code==="commander.helpDisplayed")&&process.exit(0),r=e.slice(2)}let i=t.opts(),s={clean:i.clean??!1,standard:i.standard??!1,thinking:i.thinking??!1,verbose:i.verbose??!1,debug:i.debug??!1,model:i.model,provider:i.provider,host:i.host,yes:i.yes??!1,offline:i.offline??!1,interactive:i.interactive??!1,continueChat:i.continueChat,newChat:i.newChat??!1,auto:i.auto??!1,quiet:i.quiet??!1,noColors:!i.colors,noEmojis:!i.emojis,noAnimations:!i.animations,noStreaming:!i.streaming,showTokens:i.showTokens??!1,showCost:i.showCost??!1,help:i.help??!1,version:i.version??!1},o;Yx()&&(o=await gL()),(a==="chat"||s.interactive)&&(a="agent"),a==="query"&&!r.length&&!o&&(a="agent");let c;if(a==="query"&&r.length>0)c=r.join(" ");else if(a==="agent"){let l=[];n&&l.push(n),r.length>0&&l.push(...r),l.length>0&&(c=l.join(" "))}return{command:a,subcommand:n,args:r,flags:s,stdinContent:o,query:c}}var Wt;(function(e){e[e.LOCAL=1]="LOCAL",e[e.SERVER=2]="SERVER"})(Wt||(Wt={}));var Kx={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function Xu(e,t,a,n){return e.clean?"clean":e.thinking||e.verbose?"thinking":e.standard?"standard":t&&a?.[t]?a[t]:t&&Kx[t]?Kx[t]:n||Kx._default}var yL={config:Wt.LOCAL,help:Wt.LOCAL,version:Wt.LOCAL,doctor:Wt.LOCAL,mcp:Wt.LOCAL,prompt:Wt.LOCAL,stats:Wt.LOCAL,history:Wt.LOCAL,query:Wt.SERVER,chat:Wt.SERVER,run:Wt.SERVER,agent:Wt.SERVER,loop:Wt.SERVER,telegram:Wt.SERVER,sessions:Wt.SERVER};function Wx(e){let t=yL[e.command]??Wt.SERVER;switch(e.command){case"config":return vde(e);case"mcp":return Ede(e);case"prompt":return Sde(e);case"stats":return xde(e);case"history":return kde(e);case"doctor":return{tier:Wt.LOCAL,handler:"doctor",params:{}};case"chat":return{tier:Wt.SERVER,handler:"chat",params:{continueChat:e.flags.continueChat}};case"run":return wde(e);case"agent":return{tier:Wt.SERVER,handler:"agent",params:{interactive:!e.query}};case"loop":return{tier:Wt.SERVER,handler:"loop",params:{}};case"telegram":return{tier:Wt.SERVER,handler:"telegram",params:{action:e.subcommand??e.args[0]??"start"}};case"sessions":return{tier:Wt.SERVER,handler:"sessions",params:{action:e.subcommand??e.args[0]??"list"}};case"help":return{tier:Wt.LOCAL,handler:"help",params:{command:e.subcommand}};case"version":return{tier:Wt.LOCAL,handler:"version",params:{}};case"query":default:return{tier:t,handler:"query",params:{query:e.query,stdinContent:e.stdinContent}}}}function vde(e){let t=e.subcommand??e.args[0]??"show";return{tier:Wt.LOCAL,handler:`config:${t}`,params:{key:e.args[0],value:e.args[1]}}}function Ede(e){let t=e.subcommand??e.args[0]??"list";return{tier:Wt.LOCAL,handler:`mcp:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function Sde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Wt.LOCAL,handler:`prompt:${t}`,params:{name:e.args[0],args:e.args.slice(1)}}}function xde(e){let t=e.subcommand??e.args[0];return{tier:Wt.LOCAL,handler:t?`stats:${t}`:"stats",params:{}}}function kde(e){let t=e.subcommand??e.args[0]??"list";return{tier:Wt.LOCAL,handler:`history:${t}`,params:{query:e.args[0],id:e.args[0]}}}var Tde=new Set(["--model","--provider","--host","--continue-chat","-c"]);function wde(e){let t=[];e.subcommand&&t.push(e.subcommand);let a=[];for(let r=0;r<e.args.length;r++){let i=e.args[r];if(Tde.has(i)){r++;continue}i.startsWith("-")||a.push(i)}t.push(...a);let n=t.join(" ");return{tier:Wt.SERVER,handler:"run",params:{operation:n}}}Ll();la();import{createInterface as oNe}from"readline";import{spawn as cNe}from"child_process";nw();Gi();rn();var Gye={timeout:12e4,retries:3,retryDelay:1e3},_i=class{options;ws=null;activityTimeout=null;mcpExecutor=null;constructor(t){this.options={...Gye,...t}}async initializeMCP(){if(!this.mcpExecutor){let{ClientMCPExecutor:t}=await Promise.resolve().then(()=>(bp(),yp));this.mcpExecutor=new t,await this.mcpExecutor.initialize(),Oe(`MCP executor initialized with ${this.mcpExecutor.getConnectionCount()} connections`)}}async executeRequest(t,a){let n=null;for(let r=0;r<this.options.retries;r++)try{return await this.executeWithRetry(t,a)}catch(i){if(n=i instanceof Error?i:new Error(String(i)),Oe(`Attempt ${r+1} failed: ${n.message}`),n instanceof Nf||n.message.includes("Authentication"))throw n;if(r<this.options.retries-1){let s=this.options.retryDelay*Math.pow(2,r);Oe(`Retrying in ${s}ms...`),await this.sleep(s)}}throw n??new Rf("Max retries exceeded")}async executeWithRetry(t,a){return new Promise((n,r)=>{let i=this.buildWebSocketUrl();Oe(`Connecting to ${i}`);try{this.ws=new Cs(i)}catch{let c=new URL(this.options.url);r(new Of(c.hostname||"localhost",c.port||"26169"));return}let s=!1,o=null;this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new If("WebSocket activity",this.options.timeout)))}),this.ws.on("open",()=>{Oe("WebSocket connected, sending request"),this.ws?.send(JSON.stringify(t))}),this.ws.on("message",c=>{this.resetActivityTimeout(()=>{s||(this.cleanup(),r(new If("WebSocket activity",this.options.timeout)))});try{let l=JSON.parse(c.toString());this.handleMessage(l,a,u=>{s=!0,o=u,this.cleanup(),n(u)},u=>{s=!0,this.cleanup(),r(u)})}catch(l){let u=c?String(c):"<undefined>";Oe(`Failed to parse message: ${u}`),s||(s=!0,this.cleanup(),r(new Error(`Failed to parse server message: ${l.message}`)))}}),this.ws.on("error",c=>{if(Oe(`WebSocket error: ${c.message}`),!s){s=!0,this.cleanup();let l=new URL(this.options.url);r(new Of(l.hostname||"localhost",l.port||"26169"))}}),this.ws.on("close",(c,l)=>{Oe(`WebSocket closed: ${c} ${l.toString()}`),s||(s=!0,this.cleanup(),o?n(o):r(new Rf(`Connection closed unexpectedly: ${c}`)))})})}handleMessage(t,a,n,r){switch(t.type){case"token":{let i=t;a?.onToken?.(i.data);break}case"complete":{let i=t,s=i.metadata||{},o=this.convertServerMetadata(i),c={result:i.result,metadata:o,clientSideExecution:s.client_side_execution===!0,userRequest:s.user_request};a?.onComplete?.(c),n(c);break}case"error":{let i=t,s=new Nf(i.code,i.message);a?.onError?.(s),r(s);break}case"mcp_query_tools":{Oe("Received mcp_query_tools request"),this.handleMCPQueryTools(t);break}case"mcp_tool_request":{Oe("Received mcp_tool_request"),this.handleMCPToolRequest(t);break}default:Oe(`Unknown message type: ${t.type}`)}}convertServerMetadata(t){let a=t.metadata||{},n,r;a.tokens?(n=a.tokens.input,r=a.tokens.output):(n=a.input_tokens,r=a.output_tokens);let i=a.cost??a.cost_usd,s=a.execution_time??a.total_time;return{function_name:t.function_name,tokens_in:n,tokens_out:r,cost:typeof i=="number"?i:void 0,model:typeof a.model=="string"?a.model:void 0,execution_time:typeof s=="number"?s:void 0}}buildWebSocketUrl(){let t=new URL(this.options.url);return`${t.protocol==="https:"?"wss:":"ws:"}//${t.host}/ws/execute`}async handleMCPQueryTools(t){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(bp(),yp));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let a=await this.mcpExecutor.handleQueryTools(t);this.ws?.send(JSON.stringify(a))}catch(a){let n=a instanceof Error?a.message:String(a),r=a instanceof Error?a.stack:void 0;Oe(`Error handling mcp_query_tools: ${n}${r?`
1185
1185
  ${r}`:""}`),this.ws?.send(JSON.stringify({type:"mcp_query_tools_response",request_id:t.request_id||"unknown",success:!1,error:n,tools:[]}))}}async handleMCPToolRequest(t){try{if(!this.mcpExecutor){let{ClientMCPExecutor:n}=await Promise.resolve().then(()=>(bp(),yp));this.mcpExecutor=new n,await this.mcpExecutor.initialize()}let a=await this.mcpExecutor.handleToolExecution(t);this.ws?.send(JSON.stringify(a))}catch(a){Oe(`Error handling mcp_tool_request: ${a}`),this.ws?.send(JSON.stringify({type:"mcp_tool_response",request_id:t.request_id||"unknown",success:!1,error:String(a)}))}}resetActivityTimeout(t){this.activityTimeout&&clearTimeout(this.activityTimeout),this.activityTimeout=setTimeout(t,this.options.timeout)}cleanup(){if(this.activityTimeout&&(clearTimeout(this.activityTimeout),this.activityTimeout=null),this.ws){try{this.ws.close()}catch(t){Oe(`WebSocket close error: ${t instanceof Error?t.message:String(t)}`)}this.ws=null}}async shutdownMCP(){this.mcpExecutor&&(await this.mcpExecutor.shutdown(),this.mcpExecutor=null)}disconnect(){this.cleanup()}sleep(t){return new Promise(a=>setTimeout(a,t))}};la();import B1 from"node:process";import N3 from"node:process";import M1 from"node:process";var Hye=(e,t,a,n)=>{if(a==="length"||a==="prototype"||a==="arguments"||a==="caller")return;let r=Object.getOwnPropertyDescriptor(e,a),i=Object.getOwnPropertyDescriptor(t,a);!Yye(r,i)&&n||Object.defineProperty(e,a,i)},Yye=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Kye=(e,t)=>{let a=Object.getPrototypeOf(t);a!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,a)},Wye=(e,t)=>`/* Wrapped ${e}*/
1186
1186
  ${t}`,Vye=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Qye=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Xye=(e,t,a)=>{let n=a===""?"":`with ${a.trim()}() `,r=Wye.bind(null,n,t.toString());Object.defineProperty(r,"name",Qye);let{writable:i,enumerable:s,configurable:o}=Vye;Object.defineProperty(e,"toString",{value:r,writable:i,enumerable:s,configurable:o})};function cw(e,t,{ignoreNonConfigurable:a=!1}={}){let{name:n}=e;for(let r of Reflect.ownKeys(t))Hye(e,t,r,a);return Kye(e,t),Xye(e,t,n),e}var I1=new WeakMap,A3=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let a,n=0,r=e.displayName||e.name||"<anonymous>",i=function(...s){if(I1.set(i,++n),n===1)a=e.apply(this,s),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return a};return cw(i,e),I1.set(i,n),i};A3.callCount=e=>{if(!I1.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return I1.get(e)};var D3=A3;var Hl=[];Hl.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Hl.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Hl.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var R1=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",lw=Symbol.for("signal-exit emitter"),uw=globalThis,Jye=Object.defineProperty.bind(Object),pw=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(uw[lw])return uw[lw];Jye(uw,lw,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,a){this.listeners[t].push(a)}removeListener(t,a){let n=this.listeners[t],r=n.indexOf(a);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(t,a,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let r=!1;for(let i of this.listeners[t])r=i(a,n)===!0||r;return t==="exit"&&(r=this.emit("afterExit",a,n)||r),r}},N1=class{},Zye=e=>({onExit(t,a){return e.onExit(t,a)},load(){return e.load()},unload(){return e.unload()}}),dw=class extends N1{onExit(){return()=>{}}load(){}unload(){}},mw=class extends N1{#s=fw.platform==="win32"?"SIGINT":"SIGHUP";#a=new pw;#e;#r;#d;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let a of Hl)this.#t[a]=()=>{let n=this.#e.listeners(a),{count:r}=this.#a,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let s=this.#a.emit("exit",null,a),o=a==="SIGHUP"?this.#s:a;s||t.kill(t.pid,o)}};this.#d=t.reallyExit,this.#r=t.emit}onExit(t,a){if(!R1(this.#e))return()=>{};this.#i===!1&&this.load();let n=a?.alwaysLast?"afterExit":"exit";return this.#a.on(n,t),()=>{this.#a.removeListener(n,t),this.#a.listeners.exit.length===0&&this.#a.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#a.count+=1;for(let t of Hl)try{let a=this.#t[t];a&&this.#e.on(t,a)}catch{}this.#e.emit=(t,...a)=>this.#m(t,...a),this.#e.reallyExit=t=>this.#n(t)}}unload(){this.#i&&(this.#i=!1,Hl.forEach(t=>{let a=this.#t[t];if(!a)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,a)}catch{}}),this.#e.emit=this.#r,this.#e.reallyExit=this.#d,this.#a.count-=1)}#n(t){return R1(this.#e)?(this.#e.exitCode=t||0,this.#a.emit("exit",this.#e.exitCode,null),this.#d.call(this.#e,this.#e.exitCode)):0}#m(t,...a){let n=this.#r;if(t==="exit"&&R1(this.#e)){typeof a[0]=="number"&&(this.#e.exitCode=a[0]);let r=n.call(this.#e,t,...a);return this.#a.emit("exit",this.#e.exitCode,null),r}else return n.call(this.#e,t,...a)}},fw=globalThis.process,{onExit:O3,load:IQe,unload:RQe}=Zye(R1(fw)?new mw(fw):new dw);var I3=M1.stderr.isTTY?M1.stderr:M1.stdout.isTTY?M1.stdout:void 0,e1e=I3?D3(()=>{O3(()=>{I3.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},R3=e1e;var P1=!1,vp={};vp.show=(e=N3.stderr)=>{e.isTTY&&(P1=!1,e.write("\x1B[?25h"))};vp.hide=(e=N3.stderr)=>{e.isTTY&&(R3(),P1=!0,e.write("\x1B[?25l"))};vp.toggle=(e,t)=>{e!==void 0&&(P1=e),P1?vp.show(t):vp.hide(t)};var hw=vp;var Kf=fn(gw(),1);la();import Ki from"node:process";function _w(){return Ki.platform!=="win32"?Ki.env.TERM!=="linux":!!Ki.env.CI||!!Ki.env.WT_SESSION||!!Ki.env.TERMINUS_SUBLIME||Ki.env.ConEmuTask==="{cmd::Cmder}"||Ki.env.TERM_PROGRAM==="Terminus-Sublime"||Ki.env.TERM_PROGRAM==="vscode"||Ki.env.TERM==="xterm-256color"||Ki.env.TERM==="alacritty"||Ki.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var a1e={info:g.blue("\u2139"),success:g.green("\u2714"),warning:g.yellow("\u26A0"),error:g.red("\u2716")},n1e={info:g.blue("i"),success:g.green("\u221A"),warning:g.yellow("\u203C"),error:g.red("\xD7")},r1e=_w()?a1e:n1e,Yf=r1e;F1();var i1e=Yl();function yw(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(i1e,"")}F1();var s1e=Yl();function bw(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(s1e,"")}function F3(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function B3(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function j3(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function o1e(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function U3(e,{ambiguousAsWide:t=!1}={}){return o1e(e),B3(e)||j3(e)||t&&F3(e)?2:1}var $3=fn(q3(),1),c1e=new Intl.Segmenter,l1e=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function vw(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:a=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=bw(e)),e.length===0)return 0;let r=0,i={ambiguousAsWide:!a};for(let{segment:s}of c1e.segment(e)){let o=s.codePointAt(0);if(!(o<=31||o>=127&&o<=159)&&!(o>=8203&&o<=8207||o===65279)&&!(o>=768&&o<=879||o>=6832&&o<=6911||o>=7616&&o<=7679||o>=8400&&o<=8447||o>=65056&&o<=65071)&&!(o>=55296&&o<=57343)&&!(o>=65024&&o<=65039)&&!l1e.test(s)){if((0,$3.default)().test(s)){r+=2;continue}r+=U3(o,i)}}return r}function Ew({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import G3 from"node:process";function Sw(){let{env:e}=G3,{TERM:t,TERM_PROGRAM:a}=e;return G3.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||a==="Terminus-Sublime"||a==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import As from"node:process";var u1e=3,xw=class{#s=0;start(){this.#s++,this.#s===1&&this.#a()}stop(){if(this.#s<=0)throw new Error("`stop` called more times than `start`");this.#s--,this.#s===0&&this.#e()}#a(){As.platform==="win32"||!As.stdin.isTTY||(As.stdin.setRawMode(!0),As.stdin.on("data",this.#r),As.stdin.resume())}#e(){As.stdin.isTTY&&(As.stdin.off("data",this.#r),As.stdin.pause(),As.stdin.setRawMode(!1))}#r(t){t[0]===u1e&&As.emit("SIGINT")}},p1e=new xw,kw=p1e;var d1e=fn(gw(),1),Tw=class{#s=0;#a=!1;#e=0;#r=-1;#d=0;#t;#i;#n;#m;#h;#l;#u;#p;#g;#o;#c;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:B1.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#h=this.#t.interval,this.#n=this.#t.stream,this.#l=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Ew({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,B1.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#s},set(a){this.#s=a}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#r}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#p}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#p=t,this.#f()}get interval(){return this.#h??this.#i.interval??100}get spinner(){return this.#i}set spinner(t){if(this.#r=-1,this.#h=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=t}else if(!Sw())this.#i=Kf.default.line;else if(t===void 0)this.#i=Kf.default.dots;else if(t!=="default"&&Kf.default[t])this.#i=Kf.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(t=""){this.#g=t,this.#f()}get prefixText(){return this.#o}set prefixText(t=""){this.#o=t,this.#f()}get suffixText(){return this.#c}set suffixText(t=""){this.#c=t,this.#f()}get isSpinning(){return this.#m!==void 0}#_(t=this.#o,a=" "){return typeof t=="string"&&t!==""?t+a:typeof t=="function"?t()+a:""}#y(t=this.#c,a=" "){return typeof t=="string"&&t!==""?a+t:typeof t=="function"?a+t():""}#f(){let t=this.#n.columns??80,a=this.#_(this.#o,"-"),n=this.#y(this.#c,"-"),r=" ".repeat(this.#p)+a+"--"+this.#g+"--"+n;this.#e=0;for(let i of yw(r).split(`
1187
1187
  `))this.#e+=Math.max(1,Math.ceil(vw(i,{countAnsiEscapeCodes:!0})/t))}get isEnabled(){return this.#l&&!this.#u}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=t}get isSilent(){return this.#u}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=t}frame(){let t=Date.now();(this.#r===-1||t-this.#d>=this.interval)&&(this.#r=++this.#r%this.#i.frames.length,this.#d=t);let{frames:a}=this.#i,n=a[this.#r];this.color&&(n=g[this.color](n));let r=typeof this.#o=="string"&&this.#o!==""?this.#o+" ":"",i=typeof this.text=="string"?" "+this.text:"",s=typeof this.#c=="string"&&this.#c!==""?" "+this.#c:"";return r+n+i+s}clear(){if(!this.#l||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let t=0;t<this.#s;t++)t>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#p||this.lastIndent!==this.#p)&&this.#n.cursorTo(this.#p),this.lastIndent=this.#p,this.#s=0,this}render(){return this.#u?this:(this.clear(),this.#n.write(this.frame()),this.#s=this.#e,this)}start(t){return t&&(this.text=t),this.#u?this:this.#l?this.isSpinning?this:(this.#t.hideCursor&&hw.hide(this.#n),this.#t.discardStdin&&B1.stdin.isTTY&&(this.#a=!0,kw.start()),this.render(),this.#m=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
1188
1188
  `),this)}stop(){return this.#l?(clearInterval(this.#m),this.#m=void 0,this.#r=0,this.clear(),this.#t.hideCursor&&hw.show(this.#n),this.#t.discardStdin&&B1.stdin.isTTY&&this.#a&&(kw.stop(),this.#a=!1),this):this}succeed(t){return this.stopAndPersist({symbol:Yf.success,text:t})}fail(t){return this.stopAndPersist({symbol:Yf.error,text:t})}warn(t){return this.stopAndPersist({symbol:Yf.warning,text:t})}info(t){return this.stopAndPersist({symbol:Yf.info,text:t})}stopAndPersist(t={}){if(this.#u)return this;let a=t.prefixText??this.#o,n=this.#_(a," "),r=t.symbol??" ",i=t.text??this.text,o=typeof i=="string"?(r?" ":"")+i:"",c=t.suffixText??this.#c,l=this.#y(c," "),u=n+r+o+l+`
1189
1189
  `;return this.stop(),this.#n.write(u),this}};function ww(e){return new Tw(e)}var Cw=class{spinner=null;enabled;constructor(t=!0){this.enabled=t}start(t="Processing"){this.enabled&&(this.spinner=ww({text:t,spinner:"dots"}).start())}update(t){this.spinner&&(this.spinner.text=t)}stop(t=!1){this.spinner&&(t?(this.spinner.stop(),process.stdout.write("\r\x1B[K")):this.spinner.stop(),this.spinner=null)}succeed(t){this.spinner&&(this.spinner.succeed(t),this.spinner=null)}fail(t){this.spinner&&(this.spinner.fail(t),this.spinner=null)}warn(t){this.spinner&&(this.spinner.warn(t),this.spinner=null)}isSpinning(){return this.spinner?.isSpinning??!1}};function Ds(e=!0){return new Cw(e)}Rs();var VO=class{spinner;firstToken=!0;enabled;useInk=!0;constructor(t={}){this.spinner=t.spinner??null,this.enabled=t.enabled??!0}onToken(t){if(this.enabled){if(this.firstToken&&this.spinner&&(this.spinner.stop(!0),this.firstToken=!1),this.useInk&&lu()){let a=ta();if("appendToken"in a){a.appendToken(t);return}}process.stdout.write(t)}}flush(){!this.firstToken&&(!this.useInk||!lu())&&process.stdout.write(`
1190
1190
  `)}reset(){this.firstToken=!0}clear(){(!this.useInk||!lu())&&process.stdout.write("\r\x1B[K")}};function $s(e={}){return new VO(e)}la();var eNe={colors:!0,emojis:!0},QO=class{options;constructor(t={}){this.options={...eNe,...t}}emoji(t){return this.options.emojis?t:""}color(t,a){return this.options.colors?a(t):t}formatResult(t,a){switch(a){case"clean":return t.result;case"thinking":case"standard":default:return this.formatStandardResult(t)}}formatStandardResult(t){let a=[];a.push(t.result);let n=this.formatExecutionSummary(t.metadata);return n&&(a.push(""),a.push(n)),a.join(`
1191
- `)}formatExecutionSummary(t){let a=[];if(t.function_name&&a.push(`${this.emoji("\u{1F527} ")}${t.function_name}`),t.model&&a.push(`${this.emoji("\u{1F916} ")}${t.model}`),t.tokens_in!==void 0||t.tokens_out!==void 0){let r=t.tokens_in??0,i=t.tokens_out??0;a.push(`${this.emoji("\u{1F522} ")}${r}\u2197 ${i}\u2198`)}if(t.cost!==void 0&&a.push(`${this.emoji("\u{1F4B0} ")}$${t.cost.toFixed(6)}`),t.execution_time!==void 0&&a.push(`${this.emoji("\u26A1 ")}${t.execution_time.toFixed(1)}s`),a.length===0)return"";let n=a.join(" \u2022 ");return this.color(n,g.dim)}formatError(t){let a=[];return a.push(this.color(`${this.emoji("\u274C ")}${t.message}`,g.red)),t.suggestions&&t.suggestions.length>0&&(a.push(""),a.push(this.color(`${this.emoji("\u{1F4A1} ")}Solutions:`,g.yellow)),t.suggestions.forEach((n,r)=>{a.push(this.color(` ${r+1}. ${n}`,g.gray))})),a.join(`
1191
+ `)}formatExecutionSummary(t){let a=[];if(t.function_name&&a.push(`${this.emoji("\u{1F527} ")}${t.function_name}`),t.model&&a.push(`${this.emoji("\u{1FABC} ")}${t.model}`),t.tokens_in!==void 0||t.tokens_out!==void 0){let r=t.tokens_in??0,i=t.tokens_out??0;a.push(`${this.emoji("\u{1F522} ")}${r}\u2197 ${i}\u2198`)}if(t.cost!==void 0&&a.push(`${this.emoji("\u{1F4B0} ")}$${t.cost.toFixed(6)}`),t.execution_time!==void 0&&a.push(`${this.emoji("\u26A1 ")}${t.execution_time.toFixed(1)}s`),a.length===0)return"";let n=a.join(" \u2022 ");return this.color(n,g.dim)}formatError(t){let a=[];return a.push(this.color(`${this.emoji("\u274C ")}${t.message}`,g.red)),t.suggestions&&t.suggestions.length>0&&(a.push(""),a.push(this.color(`${this.emoji("\u{1F4A1} ")}Solutions:`,g.yellow)),t.suggestions.forEach((n,r)=>{a.push(this.color(` ${r+1}. ${n}`,g.gray))})),a.join(`
1192
1192
  `)}formatConfig(t){let a=[];a.push(this.color(`${this.emoji("\u{1F4CB} ")}Current AII Configuration:`,g.cyan)),a.push(`- Config file: ${t.configFile}`),a.push(`- Storage path: ${t.storagePath}`),t.apiUrl&&a.push(`- Aii Server: ${t.apiUrl}`);let n=t.hasApiKey?this.color("\u2713",g.green):this.color("\u2717",g.red);if(a.push(`- LLM provider: ${t.provider} (${t.model}) - ${n}`),t.webSearch){let r=t.webSearch.enabled?this.color("\u2713",g.green):this.color("\u2717",g.red);a.push(`- Web search: ${t.webSearch.provider??"none"} - ${r}`)}return t.issues&&t.issues.length>0&&a.push(`- Configuration issues: ${t.issues.length}`),a.join(`
1193
1193
  `)}formatHealthCheck(t){let a=[];a.push(this.color(`${this.emoji("\u{1F3E5} ")}AII Health Check`,g.cyan)),a.push("");for(let i of t){let s,o;switch(i.status){case"ok":s="\u2713",o=g.green;break;case"warn":s="\u26A0",o=g.yellow;break;case"error":s="\u2717",o=g.red;break}let c=this.color(s,o),l=this.color(i.message,o);a.push(` ${c} ${i.name.padEnd(20)} ${l}`)}let n=t.some(i=>i.status==="error"),r=t.some(i=>i.status==="warn");return a.push(""),n?a.push(this.color(`${this.emoji("\u274C ")}Some checks failed!`,g.red)):r?a.push(this.color(`${this.emoji("\u26A0\uFE0F ")}All checks passed with warnings`,g.yellow)):a.push(this.color(`${this.emoji("\u2705 ")}All checks passed!`,g.green)),a.join(`
1194
- `)}};function jr(e={}){return new QO(e)}Gi();var tNe={openrouter:"openrouter",ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},aNe=[{provider:"openrouter",patterns:[/^openrouter\//]},{provider:"ollama",patterns:[/^ollama\//]},{provider:"anthropic",patterns:[/^anthropic\//,/^claude-/,/^claude$/i]},{provider:"openai",patterns:[/^openai\//,/^gpt-/,/^o1-/,/^o3-/,/^chatgpt-/,/^text-davinci/]},{provider:"gemini",patterns:[/^gemini\//,/^gemini-/,/^gemini$/i]},{provider:"deepseek",patterns:[/^deepseek\//,/^deepseek-/,/^deepseek$/i]},{provider:"moonshot",patterns:[/^moonshot\//,/^kimi-/,/^moonshot-/,/^moonshot$/i]},{provider:"zai",patterns:[/^zai\//,/^glm-/,/^glm$/i,/^chatglm/i]}];function XO(e){if(!e)return;let t=e.toLowerCase();for(let{provider:a,patterns:n}of aNe)for(let r of n)if(r.test(t))return a}function yn(e){if(!e)return e;let t=e.indexOf("/");if(t===-1)return e;let a=e.substring(0,t).toLowerCase();return a!=="ollama"&&a in tNe?e.substring(t+1):e}function zn(e,t,a){if(a)return a;if(e){let n=XO(e);if(n)return n}return t}la();import*as PV from"readline";Gi();import*as Jr from"fs";import*as SE from"path";import*as OV from"os";var EE=SE.join(OV.homedir(),".aii","conversations"),JO=SE.join(EE,"current.json");function xE(){Jr.existsSync(EE)||Jr.mkdirSync(EE,{recursive:!0})}function nNe(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function rNe(e){let a=e.trim().replace(/\s+/g," ");return a.length>50&&(a=a.substring(0,50).trim()+"..."),a}function IV(e){return SE.join(EE,`${e}.json`)}function RV(){xE();try{if(Jr.existsSync(JO)){let e=Jr.readFileSync(JO,"utf-8"),t=JSON.parse(e),a=IV(t.id);if(Jr.existsSync(a)){let n=Jr.readFileSync(a,"utf-8");return JSON.parse(n)}}}catch{}return NV()}function NV(){xE();let e={id:nNe(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return bg(e),iNe(e.id),e}function bg(e){if(xE(),e.title==="New Conversation"&&e.messages.length>0){let a=e.messages.find(n=>n.role==="user");a&&(e.title=rNe(a.content))}e.updatedAt=Date.now();let t=IV(e.id);Jr.writeFileSync(t,JSON.stringify(e,null,2),"utf-8")}function iNe(e){xE(),Jr.writeFileSync(JO,JSON.stringify({id:e}),"utf-8")}function MV(){return NV()}var sNe="0.11.4",ZO=class{configManager;parsed;running=!1;conversation;stats;formatter;constructor(t,a){this.parsed=t,this.configManager=a,this.conversation=RV(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=jr({colors:!t.flags.noColors,emojis:!t.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let t=await this.getUserInput();if(!t.trim()||await this.handleSpecialCommands(t))continue;this.conversation.messages.push({role:"user",content:t,timestamp:Date.now()}),bg(this.conversation),await this.processWithContext(t)}catch(t){if(t instanceof Error&&t.message==="EXIT")break;if(t instanceof Error&&t.message==="INTERRUPTED"){console.log(`
1194
+ `)}};function jr(e={}){return new QO(e)}Gi();var tNe={openrouter:"openrouter",ollama:"ollama",anthropic:"anthropic",openai:"openai",gemini:"gemini",deepseek:"deepseek",moonshot:"moonshot",zai:"zai"},aNe=[{provider:"openrouter",patterns:[/^openrouter\//]},{provider:"ollama",patterns:[/^ollama\//]},{provider:"anthropic",patterns:[/^anthropic\//,/^claude-/,/^claude$/i]},{provider:"openai",patterns:[/^openai\//,/^gpt-/,/^o1-/,/^o3-/,/^chatgpt-/,/^text-davinci/]},{provider:"gemini",patterns:[/^gemini\//,/^gemini-/,/^gemini$/i]},{provider:"deepseek",patterns:[/^deepseek\//,/^deepseek-/,/^deepseek$/i]},{provider:"moonshot",patterns:[/^moonshot\//,/^kimi-/,/^moonshot-/,/^moonshot$/i]},{provider:"zai",patterns:[/^zai\//,/^glm-/,/^glm$/i,/^chatglm/i]}];function XO(e){if(!e)return;let t=e.toLowerCase();for(let{provider:a,patterns:n}of aNe)for(let r of n)if(r.test(t))return a}function yn(e){if(!e)return e;let t=e.indexOf("/");if(t===-1)return e;let a=e.substring(0,t).toLowerCase();return a!=="ollama"&&a in tNe?e.substring(t+1):e}function zn(e,t,a){if(a)return a;if(e){let n=XO(e);if(n)return n}return t}la();import*as PV from"readline";Gi();import*as Jr from"fs";import*as SE from"path";import*as OV from"os";var EE=SE.join(OV.homedir(),".aii","conversations"),JO=SE.join(EE,"current.json");function xE(){Jr.existsSync(EE)||Jr.mkdirSync(EE,{recursive:!0})}function nNe(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function rNe(e){let a=e.trim().replace(/\s+/g," ");return a.length>50&&(a=a.substring(0,50).trim()+"..."),a}function IV(e){return SE.join(EE,`${e}.json`)}function RV(){xE();try{if(Jr.existsSync(JO)){let e=Jr.readFileSync(JO,"utf-8"),t=JSON.parse(e),a=IV(t.id);if(Jr.existsSync(a)){let n=Jr.readFileSync(a,"utf-8");return JSON.parse(n)}}}catch{}return NV()}function NV(){xE();let e={id:nNe(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return bg(e),iNe(e.id),e}function bg(e){if(xE(),e.title==="New Conversation"&&e.messages.length>0){let a=e.messages.find(n=>n.role==="user");a&&(e.title=rNe(a.content))}e.updatedAt=Date.now();let t=IV(e.id);Jr.writeFileSync(t,JSON.stringify(e,null,2),"utf-8")}function iNe(e){xE(),Jr.writeFileSync(JO,JSON.stringify({id:e}),"utf-8")}function MV(){return NV()}var sNe="0.11.6",ZO=class{configManager;parsed;running=!1;conversation;stats;formatter;constructor(t,a){this.parsed=t,this.configManager=a,this.conversation=RV(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=jr({colors:!t.flags.noColors,emojis:!t.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let t=await this.getUserInput();if(!t.trim()||await this.handleSpecialCommands(t))continue;this.conversation.messages.push({role:"user",content:t,timestamp:Date.now()}),bg(this.conversation),await this.processWithContext(t)}catch(t){if(t instanceof Error&&t.message==="EXIT")break;if(t instanceof Error&&t.message==="INTERRUPTED"){console.log(`
1195
1195
  \u26A0\uFE0F Interrupted. Type /exit to quit or continue chatting.`);continue}console.error(g.red(`
1196
- \u274C Error: ${t instanceof Error?t.message:String(t)}`)),this.conversation.messages.length>0&&this.conversation.messages[this.conversation.messages.length-1].role==="user"&&(this.conversation.messages.pop(),bg(this.conversation))}}displayWelcome(){console.log("\u{1F916} Entering interactive mode."),console.log(""),console.log("Controls:"),console.log(" \u2022 Enter - Send message"),console.log(" \u2022 End with \\ - Multi-line mode"),console.log(" \u2022 /exit - Quit chat"),console.log(" \u2022 /help - Show all commands"),console.log("")}getUserInput(){return new Promise((t,a)=>{let n=PV.createInterface({input:process.stdin,output:process.stdout}),r=[],i=!1,s=()=>{i=!0,n.close()},o=c=>{n.question(c,l=>{if(r.length===0&&l.trim().startsWith("/")){s(),t(l.trim());return}l.endsWith("\\")?(r.push(l.slice(0,-1)),o(" ")):(r.push(l),s(),t(r.join(`
1196
+ \u274C Error: ${t instanceof Error?t.message:String(t)}`)),this.conversation.messages.length>0&&this.conversation.messages[this.conversation.messages.length-1].role==="user"&&(this.conversation.messages.pop(),bg(this.conversation))}}displayWelcome(){console.log("\u{1FABC} Entering interactive mode."),console.log(""),console.log("Controls:"),console.log(" \u2022 Enter - Send message"),console.log(" \u2022 End with \\ - Multi-line mode"),console.log(" \u2022 /exit - Quit chat"),console.log(" \u2022 /help - Show all commands"),console.log("")}getUserInput(){return new Promise((t,a)=>{let n=PV.createInterface({input:process.stdin,output:process.stdout}),r=[],i=!1,s=()=>{i=!0,n.close()},o=c=>{n.question(c,l=>{if(r.length===0&&l.trim().startsWith("/")){s(),t(l.trim());return}l.endsWith("\\")?(r.push(l.slice(0,-1)),o(" ")):(r.push(l),s(),t(r.join(`
1197
1197
  `).trim()))})};n.on("SIGINT",()=>{s(),a(new Error("INTERRUPTED"))}),n.on("close",()=>{i||a(new Error("EXIT"))}),o("> ")})}async handleSpecialCommands(t){let a=t.trim().toLowerCase();if(a.startsWith("/"))a=a.slice(1);else return!1;switch(a){case"exit":case"quit":return await this.handleExit(),!0;case"help":return this.displayHelp(),!0;case"clear":case"new":return this.clearConversation(),!0;case"history":return this.displayConversationHistory(),!0;case"stats":return this.displayStats(),!0;case"version":return this.displayVersion(),!0;default:return console.log(g.yellow(`Unknown command: /${a}. Type /help for available commands.`)),console.log(""),!0}}async processWithContext(t){let a=await this.configManager.load(),n=this.configManager.validate();if(!n.valid)throw new ur(n.issues.join(", "));let i=this.configManager.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",s=yn(this.parsed.flags.model??a.llm.model),o=zn(this.parsed.flags.model,a.llm.provider,this.parsed.flags.provider),c=this.configManager.getApiKey(o);if(!c)throw new Va(`Missing API key for provider: ${o}`);this.stats.totalRequests++;let l=Ds(!this.parsed.flags.noAnimations);l.start("");let u=$s({spinner:l,enabled:!this.parsed.flags.noStreaming}),p=this.conversation.messages.slice(-21,-1).map(v=>({role:v.role,content:v.content})),d={api_key:i,system_prompt:null,user_prompt:t,user_message:t,output_mode:"CLEAN",streaming:!this.parsed.flags.noStreaming,model:s,llm_provider:o,llm_api_key:c,provider_api_key:c,client_type:"cli",offline:this.parsed.flags.offline,conversation_history:p.length>0?p:void 0},m=this.parsed.flags.host?`http://${this.parsed.flags.host}`:a.api.url,f=new _i({url:m}),h="",_=!1;try{let v=await f.executeRequest(d,{onToken:T=>{h+=T,_=!0,u.onToken(T)}});u.flush();let S=v.result||h;!_&&S&&console.log(S),console.log(""),v.metadata&&this.displayExecutionSummary(v.metadata),S&&(this.conversation.messages.push({role:"assistant",content:S,timestamp:Date.now()}),bg(this.conversation))}catch(v){throw l.stop(!0),v}finally{f.disconnect()}}displayExecutionSummary(t){let a=t.cost||0,n=t.tokens_in||0,r=t.tokens_out||0,i=n+r;this.stats.cumulativeTokens+=i,this.stats.cumulativeCost+=a,console.log(this.formatter.formatExecutionSummary({model:t.model,tokens_in:n,tokens_out:r,cost:a,execution_time:t.execution_time})),console.log("")}clearConversation(){this.conversation=MV(),console.clear(),this.displayWelcome()}displayConversationHistory(){if(this.conversation.messages.length===0){console.log(`
1198
1198
  \u{1F4AC} No conversation history yet
1199
1199
  `);return}console.log(`
1200
1200
  \u{1F4AC} Conversation History:`),console.log("\u2500".repeat(60));for(let t=0;t<this.conversation.messages.length;t++){let a=this.conversation.messages[t],n=a.role==="user"?"You":"Aii",r=a.content;r.length>150&&(r=r.slice(0,150)+"..."),console.log(`${t+1}. ${n}: ${r}`)}console.log("\u2500".repeat(60)),console.log("")}displayStats(){let t=(Date.now()-this.stats.startTime)/1e3;console.log(`
1201
1201
  \u{1F4CA} Session Statistics:`),console.log(` \u2022 Messages: ${this.conversation.messages.length}`),console.log(` \u2022 Requests: ${this.stats.totalRequests}`),console.log(` \u2022 Total Tokens: ${this.stats.cumulativeTokens.toLocaleString()}`),this.stats.cumulativeCost>0&&console.log(` \u2022 Total Cost: $${this.stats.cumulativeCost.toFixed(6)}`);let a=Math.floor(t/60),n=Math.floor(t%60);a>0?console.log(` \u2022 Duration: ${a}m ${n}s`):console.log(` \u2022 Duration: ${n}s`),console.log("")}displayHelp(){console.log(`
1202
1202
  \u{1F4D6} Interactive Chat Commands:`),console.log(" /help - Show this help message"),console.log(" /exit, /quit - Exit chat mode"),console.log(" /clear, /new - Clear conversation and start fresh"),console.log(" /history - Show conversation history"),console.log(" /stats - Show session statistics"),console.log(" /version - Show Aii version"),console.log(""),console.log("\u{1F4A1} How it works:"),console.log(" \u2022 Chat naturally - context is preserved across messages"),console.log(" \u2022 Ask follow-up questions without repeating context"),console.log(" \u2022 Just like Claude.ai, ChatGPT, or Gemini"),console.log(""),console.log("\u{1F4A1} Examples:"),console.log(" You: What is Python?"),console.log(" Aii: Python is a programming language..."),console.log(" You: Show me an example"),console.log(" Aii: [Aii knows you mean Python example]"),console.log("")}displayVersion(){console.log(`
1203
- \u{1F916} Aii CLI v${sNe}`),console.log("")}async handleExit(){let t=(Date.now()-this.stats.startTime)/1e3;if(this.stats.totalRequests>0){console.log(`
1204
- \u{1F4CA} Session Summary:`),console.log(` \u2022 Messages: ${this.conversation.messages.length}`),console.log(` \u2022 Requests: ${this.stats.totalRequests}`),console.log(` \u2022 Total Tokens: ${this.stats.cumulativeTokens.toLocaleString()}`),this.stats.cumulativeCost>0&&console.log(` \u2022 Total Cost: $${this.stats.cumulativeCost.toFixed(6)}`);let a=Math.floor(t/60),n=Math.floor(t%60);a>0?console.log(` \u2022 Duration: ${a}m ${n}s`):console.log(` \u2022 Duration: ${n}s`),console.log("")}console.log("\u{1F44B} Goodbye!"),this.running=!1}};async function kE(e,t){await new ZO(e,t).start()}rn();async function lNe(){let{executeLocalMCP:e}=await Promise.resolve().then(()=>(_O(),gO));return e}async function eI(e,t){let a=await t.load(),n=t.validate();if(!n.valid)throw new ur(n.issues.join(", "));let i=t.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",s=yn(e.flags.model??a.llm.model),o=zn(e.flags.model,a.llm.provider,e.flags.provider),c=t.getApiKey(o);if(!c)throw new Va(`Missing API key for provider: ${o}`);let l=hy(e.stdinContent,e.query??"");if(!l.trim()){await kE(e,t);return}let u=a.output_modes?.overrides,p=a.output_modes?.default,d=Xu(e.flags,void 0,u,p),m=jr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis}),f=Ds(!e.flags.noAnimations);f.start("Processing");let h=$s({spinner:f,enabled:!e.flags.noStreaming}),_={api_key:i,system_prompt:null,user_prompt:l,output_mode:d.toUpperCase(),streaming:!e.flags.noStreaming,model:s,llm_provider:o,llm_api_key:c,offline:e.flags.offline},v=e.flags.host?`http://${e.flags.host}`:a.api.url,S=new _i({url:v}),T="";try{let C=await S.executeRequest(_,{onToken:L=>{T+=L,h.onToken(L)}});if(C.clientSideExecution&&C.userRequest){Oe("Server requested client-side MCP execution"),h.flush(),f.stop();let L=Xu(e.flags,"mcp",u,p);f.start("Connecting to MCP servers");let B=await(await lNe())(C.userRequest,v,i,s,ee=>{f.stop(),f.start(ee)});f.stop(),B.success&&B.result?(console.log(B.result),L!=="clean"&&B.metadata&&(console.log(""),console.log(m.formatExecutionSummary({function_name:`mcp:${B.metadata.toolName}`,tokens_in:B.metadata.inputTokens,tokens_out:B.metadata.outputTokens,cost:B.metadata.cost,model:B.metadata.model}))),process.exit(0)):(console.error(`MCP execution failed: ${B.error}`),process.exit(1))}h.flush();let O=C.result||T;e.flags.noStreaming&&O&&console.log(O);let P=C.metadata?.function_name;if(Xu(e.flags,P,u,p)==="clean"||(console.log(""),console.log(m.formatExecutionSummary(C.metadata))),P==="shell_command"){let L=uNe(O);L&&await pNe(`
1203
+ \u{1FABC} Aii CLI v${sNe}`),console.log("")}async handleExit(){let t=(Date.now()-this.stats.startTime)/1e3;if(this.stats.totalRequests>0){console.log(`
1204
+ \u{1F4CA} Session Summary:`),console.log(` \u2022 Messages: ${this.conversation.messages.length}`),console.log(` \u2022 Requests: ${this.stats.totalRequests}`),console.log(` \u2022 Total Tokens: ${this.stats.cumulativeTokens.toLocaleString()}`),this.stats.cumulativeCost>0&&console.log(` \u2022 Total Cost: $${this.stats.cumulativeCost.toFixed(6)}`);let a=Math.floor(t/60),n=Math.floor(t%60);a>0?console.log(` \u2022 Duration: ${a}m ${n}s`):console.log(` \u2022 Duration: ${n}s`),console.log("")}console.log("Session complete. \u{1FABC}"),this.running=!1}};async function kE(e,t){await new ZO(e,t).start()}rn();async function lNe(){let{executeLocalMCP:e}=await Promise.resolve().then(()=>(_O(),gO));return e}async function eI(e,t){let a=await t.load(),n=t.validate();if(!n.valid)throw new ur(n.issues.join(", "));let i=t.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",s=yn(e.flags.model??a.llm.model),o=zn(e.flags.model,a.llm.provider,e.flags.provider),c=t.getApiKey(o);if(!c)throw new Va(`Missing API key for provider: ${o}`);let l=hy(e.stdinContent,e.query??"");if(!l.trim()){await kE(e,t);return}let u=a.output_modes?.overrides,p=a.output_modes?.default,d=Xu(e.flags,void 0,u,p),m=jr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis}),f=Ds(!e.flags.noAnimations);f.start("Processing");let h=$s({spinner:f,enabled:!e.flags.noStreaming}),_={api_key:i,system_prompt:null,user_prompt:l,output_mode:d.toUpperCase(),streaming:!e.flags.noStreaming,model:s,llm_provider:o,llm_api_key:c,offline:e.flags.offline},v=e.flags.host?`http://${e.flags.host}`:a.api.url,S=new _i({url:v}),T="";try{let C=await S.executeRequest(_,{onToken:L=>{T+=L,h.onToken(L)}});if(C.clientSideExecution&&C.userRequest){Oe("Server requested client-side MCP execution"),h.flush(),f.stop();let L=Xu(e.flags,"mcp",u,p);f.start("Connecting to MCP servers");let B=await(await lNe())(C.userRequest,v,i,s,ee=>{f.stop(),f.start(ee)});f.stop(),B.success&&B.result?(console.log(B.result),L!=="clean"&&B.metadata&&(console.log(""),console.log(m.formatExecutionSummary({function_name:`mcp:${B.metadata.toolName}`,tokens_in:B.metadata.inputTokens,tokens_out:B.metadata.outputTokens,cost:B.metadata.cost,model:B.metadata.model}))),process.exit(0)):(console.error(`MCP execution failed: ${B.error}`),process.exit(1))}h.flush();let O=C.result||T;e.flags.noStreaming&&O&&console.log(O);let P=C.metadata?.function_name;if(Xu(e.flags,P,u,p)==="clean"||(console.log(""),console.log(m.formatExecutionSummary(C.metadata))),P==="shell_command"){let L=uNe(O);L&&await pNe(`
1205
1205
  ${g.yellow("Execute this command?")} ${g.dim(L)}`)&&(console.log(""),await dNe(L))}}catch(C){f.stop(!0),C instanceof Error?console.error(m.formatError(C)):console.error("Unknown error:",C),process.exit(1)}finally{S.disconnect()}}function uNe(e){let t=e.match(/Generated command:\s*`([^`]+)`/i);if(t)return t[1].trim();let a=e.match(/Generated command:[\s\S]*?```(?:\w*\n)?([\s\S]*?)```/i);if(a)return a[1].trim();let n=e.match(/```(?:bash|sh|shell|zsh)\n([\s\S]*?)```/);return n?n[1].trim():null}function pNe(e){let t=oNe({input:process.stdin,output:process.stdout});return new Promise(a=>{t.question(`${e} [Y/n]: `,n=>{t.close();let r=n.trim().toLowerCase();a(r===""||r==="y"||r==="yes")})})}function dNe(e){return new Promise(t=>{let a=cNe("bash",["-c",e],{stdio:"inherit",cwd:process.cwd()});a.on("close",n=>{n!==0&&console.log(g.dim(`
1206
1206
  Exit code: ${n}`)),t()}),a.on("error",n=>{console.error(g.red(`Failed to execute: ${n.message}`)),t()})})}la();rn();la();import*as nI from"readline";var mNe={1:{name:"Anthropic Claude",key:"anthropic",emoji:"\u{1F916}",description:"Best for coding, reasoning, and complex workflows",envVar:"ANTHROPIC_API_KEY",apiKeyUrl:"https://console.anthropic.com/settings/keys",defaultModel:"claude-sonnet-4",models:[{model:"claude-sonnet-4-5",description:"Top-tier Claude for long-running agents, coding, and complex workflows",inputPrice:3,outputPrice:15,tier:"premium"},{model:"claude-sonnet-4",description:"General flagship Claude for reasoning, coding, and enterprise use",inputPrice:2.5,outputPrice:12,tier:"premium"},{model:"claude-opus-4-1",description:"Latest Opus for the most demanding reasoning and analysis tasks",inputPrice:4,outputPrice:20,tier:"premium"},{model:"claude-opus-4",description:"Frontier-level Claude model for maximum capability and accuracy",inputPrice:3.5,outputPrice:18,tier:"premium"},{model:"claude-haiku-4-5",description:"Fast, smaller Claude ideal for chatbots, support flows, and quick tools",inputPrice:.4,outputPrice:2,tier:"cheap"}]},2:{name:"OpenAI GPT",key:"openai",emoji:"\u{1F9E0}",description:"Wide range of models from GPT-4o to GPT-5.2",envVar:"OPENAI_API_KEY",apiKeyUrl:"https://platform.openai.com/api-keys",defaultModel:"gpt-4o",models:[{model:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",description:"Most capable reasoning model for tough problems",inputPrice:21,outputPrice:168,tier:"premium"},{model:"gpt-5.2",description:"Flagship model for coding and agentic tasks",inputPrice:1.75,outputPrice:14,tier:"premium"},{model:"gpt-5.1",description:"Best overall quality for complex tasks and analysis",inputPrice:1.25,outputPrice:10,tier:"premium"},{model:"gpt-5-mini",description:"Smart general-purpose model for most everyday work",inputPrice:.25,outputPrice:2,tier:"standard"},{model:"gpt-4o",description:"Balanced flagship model for multimodal reasoning and coding",inputPrice:.5,outputPrice:5,tier:"standard"},{model:"gpt-4o-mini",description:"Fast, budget-friendly model for chat and code",inputPrice:.15,outputPrice:.6,tier:"cheap"},{model:"gpt-4.1",description:"High-reliability model for production apps",inputPrice:.75,outputPrice:8,tier:"premium"},{model:"gpt-4.1-mini",description:"Good quality, long-context model for backend workloads",inputPrice:.2,outputPrice:1,tier:"standard"},{model:"gpt-5-nano",description:"Very fast, low-cost choice for simple tasks",inputPrice:.05,outputPrice:.4,tier:"cheap"}]},3:{name:"Google Gemini",key:"gemini",emoji:"\u2728",description:"Strong multimodal with audio and video support",envVar:"GEMINI_API_KEY",apiKeyUrl:"https://makersuite.google.com/app/apikey",defaultModel:"gemini-2.5-flash",models:[{model:"gemini-3-pro-preview",description:"Newest Gemini for deep multimodal reasoning",inputPrice:2,outputPrice:12,tier:"premium"},{model:"gemini-2.5-pro",description:"Flagship Gemini with strong reasoning and multimodal support",inputPrice:1.25,outputPrice:10,tier:"premium"},{model:"gemini-2.5-flash",description:"High-speed multimodal Gemini for low-latency workloads",inputPrice:.35,outputPrice:2.8,tier:"standard"}]},4:{name:"Moonshot Kimi",key:"moonshot",emoji:"\u{1F319}",description:"Long context models up to 128K, reasoning-focused",envVar:"MOONSHOT_API_KEY",apiKeyUrl:"https://platform.moonshot.cn/console/api-keys",defaultModel:"kimi-k2-thinking",models:[{model:"kimi-k2-thinking",description:"Reasoning-focused Kimi model for long-context, tool-using agents",inputPrice:.6,outputPrice:1.8,tier:"standard"},{model:"kimi-k2-thinking-turbo",description:"Faster K2 Thinking variant tuned for responsive agent loops",inputPrice:.45,outputPrice:1.4,tier:"standard"},{model:"kimi-k2-0905-preview",description:"Preview K2 model with latest language and coding improvements",inputPrice:.4,outputPrice:1.2,tier:"cheap"},{model:"kimi-k2-turbo-preview",description:"Turbo K2 for very fast, low-cost interactive chat and coding",inputPrice:.3,outputPrice:.9,tier:"cheap"},{model:"moonshot-v1-8k-vision-preview",displayName:"Kimi Vision 8K",description:"Vision model with 8K context and image understanding",inputPrice:.15,outputPrice:.15,tier:"cheap"},{model:"moonshot-v1-128k-vision-preview",displayName:"Kimi Vision 128K",description:"Vision model with 128K context and image understanding",inputPrice:.15,outputPrice:.15,tier:"cheap"}]},5:{name:"DeepSeek AI",key:"deepseek",emoji:"\u{1F50D}",description:"Ultra low cost with strong reasoning capabilities",envVar:"DEEPSEEK_API_KEY",apiKeyUrl:"https://platform.deepseek.com/api_keys",defaultModel:"deepseek-chat",models:[{model:"deepseek-chat",description:"V3.2 general chat model with 128K context, tool calling, and JSON output",inputPrice:.28,outputPrice:.42,tier:"cheap"},{model:"deepseek-coder",description:"Specialized coding assistant for reading and writing code",inputPrice:.14,outputPrice:.28,tier:"cheap"},{model:"deepseek-reasoner",description:"V3.2 thinking mode with 128K context for complex reasoning",inputPrice:.28,outputPrice:.42,tier:"standard"},{model:"deepseek-reasoner-speciale",displayName:"DeepSeek Reasoner Speciale",description:"V3.2 extended thinking mode with 128K max output",inputPrice:.28,outputPrice:.42,tier:"standard"}]},6:{name:"Z.ai",key:"zai",emoji:"\u{1F310}",description:"Chinese AI with vision support and free tier available",envVar:"ZAI_API_KEY",apiKeyUrl:"https://z.ai/manage-apikey/apikey-list",defaultModel:"glm-4.5-air",models:[{model:"glm-4.7",displayName:"GLM-4.7",description:"Latest flagship model with strong reasoning and coding capabilities",inputPrice:.6,outputPrice:2.2,tier:"standard"},{model:"glm-4.7-flashx",displayName:"GLM-4.7 FlashX",description:"Ultra-fast text model, excellent cost-efficiency for high-volume use",inputPrice:.07,outputPrice:.4,tier:"cheap"},{model:"glm-4.6",displayName:"GLM-4.6",description:"Previous flagship model, stable and reliable for general tasks",inputPrice:.6,outputPrice:2.2,tier:"standard"},{model:"glm-4.6v",displayName:"GLM-4.6V",description:"Vision flagship model for image understanding and multimodal reasoning",inputPrice:.3,outputPrice:.9,tier:"cheap"},{model:"glm-4.5-air",displayName:"GLM-4.5 Air",description:"Budget-friendly model, great value for everyday tasks (recommended)",inputPrice:.2,outputPrice:1.1,tier:"cheap"},{model:"glm-4.7-flash",displayName:"GLM-4.7 Flash (Free)",description:"Free tier text model based on GLM-4.7 for testing and development",inputPrice:0,outputPrice:0,tier:"cheap"},{model:"glm-4.5-flash",displayName:"GLM-4.5 Flash (Free)",description:"Free tier text model for testing and development",inputPrice:0,outputPrice:0,tier:"cheap"},{model:"glm-4.6v-flash",displayName:"GLM-4.6V Flash (Free)",description:"Free tier vision model for testing and low-volume usage",inputPrice:0,outputPrice:0,tier:"cheap"}]},7:{name:"Ollama (Local)",key:"ollama",emoji:"\u{1F999}",description:"Local LLM inference \u2014 free, private, no API key needed",envVar:"OLLAMA_HOST",apiKeyUrl:"https://ollama.com/download",defaultModel:"ollama/llama3.1:8b",models:[{model:"ollama/llama3.1:8b",displayName:"Llama 3.1 8B",description:"Fast general-purpose model, great for development and prototyping",inputPrice:0,outputPrice:0,tier:"cheap"},{model:"ollama/llama3.1:70b",displayName:"Llama 3.1 70B",description:"High-quality reasoning model, requires 40GB+ RAM",inputPrice:0,outputPrice:0,tier:"standard"},{model:"ollama/mistral:latest",displayName:"Mistral 7B",description:"Efficient European model, strong multilingual capabilities",inputPrice:0,outputPrice:0,tier:"cheap"},{model:"ollama/qwen3:32b",displayName:"Qwen3 32B",description:"Strong bilingual model (English/Chinese) with reasoning",inputPrice:0,outputPrice:0,tier:"standard"},{model:"ollama/codellama:13b",displayName:"Code Llama 13B",description:"Specialized for code generation and understanding",inputPrice:0,outputPrice:0,tier:"cheap"},{model:"ollama/phi-4:latest",displayName:"Phi-4",description:"Compact Microsoft model, excellent quality-to-size ratio",inputPrice:0,outputPrice:0,tier:"cheap"},{model:"ollama/qwen3-coder:latest",displayName:"Qwen3 Coder",description:"Specialized coding model with strong code generation (18GB)",inputPrice:0,outputPrice:0,tier:"standard"},{model:"ollama/deepseek-r1:32b",displayName:"DeepSeek R1 32B",description:"Reasoning model with chain-of-thought for complex problems (19GB)",inputPrice:0,outputPrice:0,tier:"standard"},{model:"ollama/gpt-oss:20b",displayName:"GPT-OSS 20B",description:"Open-source GPT-class model, efficient local inference (13GB)",inputPrice:0,outputPrice:0,tier:"standard"},{model:"ollama/gpt-oss:120b",displayName:"GPT-OSS 120B",description:"Frontier-level open-source GPT model, requires 65GB+ RAM",inputPrice:0,outputPrice:0,tier:"premium"}]},8:{name:"OpenRouter",key:"openrouter",emoji:"\u{1F500}",description:"300+ models via single API key \u2014 Claude, GPT, Gemini, Llama, and more",envVar:"OPENROUTER_API_KEY",apiKeyUrl:"https://openrouter.ai/keys",defaultModel:"openrouter/anthropic/claude-opus-4.5",models:[{model:"openrouter/anthropic/claude-opus-4.6",displayName:"Claude Opus 4.6",description:"Latest Anthropic frontier model via OpenRouter",inputPrice:5,outputPrice:25,tier:"premium"},{model:"openrouter/anthropic/claude-opus-4.5",displayName:"Claude Opus 4.5",description:"Anthropic flagship model via OpenRouter",inputPrice:5,outputPrice:25,tier:"premium"},{model:"openrouter/openai/gpt-5.2-pro",displayName:"GPT-5.2 Pro",description:"OpenAI most capable reasoning model via OpenRouter",inputPrice:21,outputPrice:168,tier:"premium"},{model:"openrouter/openai/gpt-5.1",displayName:"GPT-5.1",description:"OpenAI balanced flagship via OpenRouter",inputPrice:1.25,outputPrice:10,tier:"standard"},{model:"openrouter/google/gemini-3-pro-preview",displayName:"Gemini 3 Pro",description:"Google latest multimodal model via OpenRouter",inputPrice:2,outputPrice:12,tier:"premium"},{model:"openrouter/google/gemini-3-flash-preview",displayName:"Gemini 3 Flash",description:"Google fast multimodal model via OpenRouter",inputPrice:.5,outputPrice:3,tier:"standard"},{model:"openrouter/deepseek/deepseek-v3.2",displayName:"DeepSeek V3.2",description:"Ultra-low cost reasoning model via OpenRouter",inputPrice:.25,outputPrice:.38,tier:"cheap"},{model:"openrouter/x-ai/grok-4.1-fast",displayName:"Grok 4.1 Fast",description:"xAI fast model via OpenRouter",inputPrice:.2,outputPrice:.5,tier:"cheap"},{model:"openrouter/mistralai/mistral-large-2512",displayName:"Mistral Large",description:"Mistral flagship model via OpenRouter",inputPrice:.5,outputPrice:1.5,tier:"standard"},{model:"openrouter/minimax/minimax-m2.1",displayName:"MiniMax M2.1",description:"MiniMax flagship model via OpenRouter",inputPrice:.255,outputPrice:1,tier:"cheap"}]}},fNe={1:{key:"brave",name:"Brave Search",envVar:"BRAVE_API_KEY",apiKeyUrl:"https://brave.com/search/api/"},2:{key:"google",name:"Google Custom Search",envVar:"GOOGLE_API_KEY",apiKeyUrl:"https://developers.google.com/custom-search/v1/introduction"}};function vg(e){return`$${e.toFixed(2)}`}function hNe(){return process.stdin.isTTY===!0&&process.stdout.isTTY===!0}async function tI(e,t,a=0){return hNe()?new Promise(n=>{let r=a,i=t.length;process.stdout.write("\x1B[?25l");let s=()=>{process.stdout.write("\x1B[2J\x1B[H"),console.log(g.bold(`
1207
1207
  ${e}
@@ -1227,7 +1227,7 @@ Enter your ${n.name} API key:
1227
1227
  `));let i=await this.promptSecret("API Key");return i?(this.context.webSearchApiKey=i,console.log(g.green("\u2713 Web search configured!")),!0):(this.context.webSearchEnabled=!1,console.log(g.yellow("\u26A0 No API key provided. Skipping web search setup.")),!1)}async saveConfiguration(){let{provider:t,model:a,apiKey:n,webSearchEnabled:r,webSearchProvider:i,webSearchApiKey:s}=this.context;if(!t||!a||!n)throw new Error("Missing configuration values");await this.configManager.load(),await this.configManager.set("llm.provider",t.key),await this.configManager.set("llm.model",a),await this.configManager.setSecret(`${t.key}_api_key`,n),r&&i?(await this.configManager.set("web_search.enabled",!0),await this.configManager.set("web_search.provider",i.key),s&&await this.configManager.setSecret(`${i.key}_search_api_key`,s)):await this.configManager.set("web_search.enabled",!1),console.log(g.green(" \u2713 Configuration saved!")),console.log(g.dim(` Config: ${this.configManager.getConfigDir()}/config.yaml`)),console.log(g.dim(` Secrets: ${this.configManager.getConfigDir()}/secrets.yaml`))}showSuccess(){let{provider:t,model:a,webSearchEnabled:n,webSearchProvider:r}=this.context,i=t?.models.find(o=>o.model===a),s=i?.displayName||a;console.log(""),console.log(g.green.bold("\u2705 Setup complete!")),console.log(""),console.log(g.bold("Configuration:")),console.log(g.dim(" \u2022 Provider: ")+g.cyan(`${t?.name}`)),console.log(g.dim(" \u2022 Model: ")+g.cyan(`${s}`)),i&&console.log(g.dim(" \u2022 Pricing: ")+g.cyan(`${vg(i.inputPrice)}/M in, ${vg(i.outputPrice)}/M out`)),console.log(n&&r?g.dim(" \u2022 Web Search: ")+g.cyan(`${r.name} \u2713`):g.dim(" \u2022 Web Search: ")+g.gray("disabled")),console.log(g.dim(" \u2022 Config: ")+g.cyan(`${this.configManager.getConfigDir()}`)),console.log(""),console.log(g.bold("\u{1F4DA} Try your first command:")),console.log(g.cyan(' aii "explain what is TypeScript"')),console.log(""),console.log(g.bold("\u{1F4A1} Other commands to try:")),console.log(g.dim(' aii "translate hello to spanish"')),console.log(g.dim(" aii run git commit")),console.log(g.dim(" aii --help")),console.log(""),console.log(g.bold("\u{1F527} Need help?")),console.log(g.dim(" aii doctor \u2014 Health check")),console.log(g.dim(" aii --help \u2014 Show all commands")),console.log("")}handleCancel(){return console.log(""),console.log(g.yellow("\u23F8\uFE0F Setup cancelled.")),console.log(""),console.log(g.dim("You can run this wizard again anytime with:")),console.log(g.cyan(" aii config init")),console.log(""),!1}prompt(t,a){return this.rl&&(this.rl.close(),this.rl=null),process.stdin.resume(),this.rl=nI.createInterface({input:process.stdin,output:process.stdout}),new Promise(n=>{let r=a?`${t} [${a}]: `:`${t}: `;this.rl.question(r,i=>{n(i.trim()||a||"")})})}promptSecret(t){return this.rl&&(this.rl.close(),this.rl=null),process.stdin.resume(),new Promise(a=>{let n=`${t}: `;process.stdout.write(n);let r="";process.stdin.isTTY&&process.stdin.setRawMode(!0);let i=s=>{let o=s.toString();for(let c of o)if(c==="\r"||c===`
1228
1228
  `){process.stdin.setRawMode(!1),process.stdin.removeListener("data",i),process.stdout.write(`
1229
1229
  `),a(r.trim());return}else if(c===""){process.stdin.setRawMode(!1),process.stdin.removeListener("data",i),process.stdout.write(`
1230
- `),a("");return}else c==="\x7F"||c==="\b"?r.length>0&&(r=r.slice(0,-1),process.stdout.write("\b \b")):c.charCodeAt(0)>=32&&(r+=c,process.stdout.write("*"))};process.stdin.on("data",i)})}};async function TE(e){return new aI(e).run()}Op();async function LV(e,t,a){let n=jr({colors:!t.flags.noColors,emojis:!t.flags.noEmojis});switch(e){case"init":await _Ne(a);break;case"show":await yNe(a,n);break;case"validate":await bNe(a);break;case"set":await vNe(t,a);break;case"model":await ENe(t,a);break;case"provider":await TNe(t,a);break;case"host":await wNe(t,a);break;case"websearch":await CNe(t,a);break;case"models":await ANe(t,a);break;case"providers":await DNe(t,a);break;case"help":ONe(t);break;default:pe.error(`Unknown config action: ${e}`),pe.info("Available actions: init, show, validate, set, model, provider, host, websearch, help"),process.exit(1)}}async function _Ne(e){await TE(e)||process.exit(1),process.exit(0)}async function yNe(e,t){let a=await e.load(),n=e.validate(),r=e.getSecret("brave_search_api_key")||e.getSecret("brave_api_key"),i=e.getSecret("google_search_api_key"),s=e.getSecret("google_search_engine_id"),o;r?o={enabled:!0,provider:"brave"}:i&&s?o={enabled:!0,provider:"google"}:o={enabled:!1,provider:"none"};let c=t.formatConfig({configFile:e.getConfigDir()+"/config.yaml",storagePath:e.getConfigDir(),provider:a.llm.provider,model:a.llm.model,hasApiKey:!!e.getApiKey(),apiUrl:a.api?.url||"http://localhost:26169",webSearch:o,issues:n.issues});console.log(c)}async function bNe(e){await e.load();let t=e.validate();t.valid?pe.success("Configuration is valid"):(pe.error("Configuration has issues:"),t.issues.forEach(a=>{pe.info(` - ${a}`)}),process.exit(1))}async function vNe(e,t){let[a,...n]=e.args,r=n.join(" ");if(a||(pe.error("Usage: aii config set <key> <value>"),pe.info("Example: aii config set llm.model gpt-4o"),process.exit(1)),r||(pe.error("Missing value for key: "+a),process.exit(1)),await t.load(),a.endsWith("_api_key")||a.endsWith("_token")||a.endsWith("_secret")||a.startsWith("api_keys.")){await t.setSecret(a,r),pe.success(`Set ${a} in secrets.yaml`);return}let s=r;try{s=JSON.parse(r)}catch{}await t.set(a,s),pe.success(`Set ${a} = ${r}`)}async function ENe(e,t){let a=e.args[0];if(!a){let n=await t.load();pe.info(`Current model: ${n.llm.model}`);return}await t.load(),await t.set("llm.model",a),pe.success(`Model set to: ${a}`)}var SNe={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.)",openrouter:"OpenRouter gateway (300+ models, single API key)"},xNe={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",openrouter:"openrouter/anthropic/claude-opus-4.5"};function kNe(e){let t=Wr.getInstance();if(t.isInitialized()){let a=t.getCheapestModel(e);if(a)return a}return xNe[e]??"claude-sonnet-4"}async function TNe(e,t){let a=e.args[0],n=["anthropic","openai","gemini","deepseek","moonshot","zai","ollama","openrouter"];if(!a){let i=await t.load(),s=i.llm.provider;console.log(`\u{1F916} Current provider: ${s} (${i.llm.model})`),console.log(""),console.log("\u2728 Available providers:"),n.forEach((o,c)=>{let l=SNe[o];console.log(` ${c+1}. ${o.padEnd(10)} - ${l}`)}),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(a)||(pe.error(`Invalid provider: ${a}`),pe.info(`Valid providers: ${n.join(", ")}`),process.exit(1)),await t.load(),await t.set("llm.provider",a);let r=kNe(a);await t.set("llm.model",r),pe.success(`Provider set to: ${a}`),pe.info(`Model set to: ${r}`)}async function wNe(e,t){let a=e.args[0];if(!a){let i=(await t.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 t.load();let n=a;!a.startsWith("http://")&&!a.startsWith("https://")&&(n=`http://${a}`),await t.set("api.url",n),pe.success(`API host set to: ${n}`)}async function CNe(e,t){let a=e.args[0]?.toLowerCase(),n=e.args[1];if(await t.load(),!a){let r=t.getSecret("brave_search_api_key")||t.getSecret("brave_api_key"),i=t.getSecret("google_search_api_key")||t.getSecret("google_api_key"),s=t.getSecret("google_search_engine_id");console.log(`\u{1F50D} Web Search Configuration
1230
+ `),a("");return}else c==="\x7F"||c==="\b"?r.length>0&&(r=r.slice(0,-1),process.stdout.write("\b \b")):c.charCodeAt(0)>=32&&(r+=c,process.stdout.write("*"))};process.stdin.on("data",i)})}};async function TE(e){return new aI(e).run()}Op();async function LV(e,t,a){let n=jr({colors:!t.flags.noColors,emojis:!t.flags.noEmojis});switch(e){case"init":await _Ne(a);break;case"show":await yNe(a,n);break;case"validate":await bNe(a);break;case"set":await vNe(t,a);break;case"model":await ENe(t,a);break;case"provider":await TNe(t,a);break;case"host":await wNe(t,a);break;case"websearch":await CNe(t,a);break;case"models":await ANe(t,a);break;case"providers":await DNe(t,a);break;case"help":ONe(t);break;default:pe.error(`Unknown config action: ${e}`),pe.info("Available actions: init, show, validate, set, model, provider, host, websearch, help"),process.exit(1)}}async function _Ne(e){await TE(e)||process.exit(1),process.exit(0)}async function yNe(e,t){let a=await e.load(),n=e.validate(),r=e.getSecret("brave_search_api_key")||e.getSecret("brave_api_key"),i=e.getSecret("google_search_api_key"),s=e.getSecret("google_search_engine_id"),o;r?o={enabled:!0,provider:"brave"}:i&&s?o={enabled:!0,provider:"google"}:o={enabled:!1,provider:"none"};let c=t.formatConfig({configFile:e.getConfigDir()+"/config.yaml",storagePath:e.getConfigDir(),provider:a.llm.provider,model:a.llm.model,hasApiKey:!!e.getApiKey(),apiUrl:a.api?.url||"http://localhost:26169",webSearch:o,issues:n.issues});console.log(c)}async function bNe(e){await e.load();let t=e.validate();t.valid?pe.success("Configuration is valid"):(pe.error("Configuration has issues:"),t.issues.forEach(a=>{pe.info(` - ${a}`)}),process.exit(1))}async function vNe(e,t){let[a,...n]=e.args,r=n.join(" ");if(a||(pe.error("Usage: aii config set <key> <value>"),pe.info("Example: aii config set llm.model gpt-4o"),process.exit(1)),r||(pe.error("Missing value for key: "+a),process.exit(1)),await t.load(),a.endsWith("_api_key")||a.endsWith("_token")||a.endsWith("_secret")||a.startsWith("api_keys.")){await t.setSecret(a,r),pe.success(`Set ${a} in secrets.yaml`);return}let s=r;try{s=JSON.parse(r)}catch{}await t.set(a,s),pe.success(`Set ${a} = ${r}`)}async function ENe(e,t){let a=e.args[0];if(!a){let n=await t.load();pe.info(`Current model: ${n.llm.model}`);return}await t.load(),await t.set("llm.model",a),pe.success(`Model set to: ${a}`)}var SNe={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.)",openrouter:"OpenRouter gateway (300+ models, single API key)"},xNe={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",openrouter:"openrouter/anthropic/claude-opus-4.5"};function kNe(e){let t=Wr.getInstance();if(t.isInitialized()){let a=t.getCheapestModel(e);if(a)return a}return xNe[e]??"claude-sonnet-4"}async function TNe(e,t){let a=e.args[0],n=["anthropic","openai","gemini","deepseek","moonshot","zai","ollama","openrouter"];if(!a){let i=await t.load(),s=i.llm.provider;console.log(`\u{1FABC} Current provider: ${s} (${i.llm.model})`),console.log(""),console.log("\u2728 Available providers:"),n.forEach((o,c)=>{let l=SNe[o];console.log(` ${c+1}. ${o.padEnd(10)} - ${l}`)}),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(a)||(pe.error(`Invalid provider: ${a}`),pe.info(`Valid providers: ${n.join(", ")}`),process.exit(1)),await t.load(),await t.set("llm.provider",a);let r=kNe(a);await t.set("llm.model",r),pe.success(`Provider set to: ${a}`),pe.info(`Model set to: ${r}`)}async function wNe(e,t){let a=e.args[0];if(!a){let i=(await t.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 t.load();let n=a;!a.startsWith("http://")&&!a.startsWith("https://")&&(n=`http://${a}`),await t.set("api.url",n),pe.success(`API host set to: ${n}`)}async function CNe(e,t){let a=e.args[0]?.toLowerCase(),n=e.args[1];if(await t.load(),!a){let r=t.getSecret("brave_search_api_key")||t.getSecret("brave_api_key"),i=t.getSecret("google_search_api_key")||t.getSecret("google_api_key"),s=t.getSecret("google_search_engine_id");console.log(`\u{1F50D} Web Search Configuration
1231
1231
  `),console.log(r?` Brave Search: ${g.green("\u2713 Configured")} (key: ${r.slice(0,8)}...)`:` Brave Search: ${g.red("\u2717 Not configured")}`),console.log(i&&s?` Google Search: ${g.green("\u2713 Configured")} (key: ${i.slice(0,8)}...)`:i?` Google Search: ${g.yellow("\u26A0 Partial")} (missing engine ID)`:` Google Search: ${g.red("\u2717 Not configured")}`),console.log(`
1232
1232
  `+g.yellow("USAGE:")),console.log(" aii config websearch brave <api_key>"),console.log(" aii config websearch google <api_key> <engine_id>"),console.log(`
1233
1233
  `+g.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(a!=="brave"&&a!=="google"&&(pe.error(`Invalid web search provider: ${a}`),pe.info("Valid providers: brave, google"),process.exit(1)),a==="brave"){n||(pe.error("Missing API key"),pe.info("Usage: aii config websearch brave <api_key>"),process.exit(1)),await t.setSecret("brave_search_api_key",n),pe.success("Brave Search API key configured"),pe.info("WebSearch tool will now be available in agent sessions");return}if(a==="google"){let r=e.args[2];n||(pe.error("Missing API key"),pe.info("Usage: aii config websearch google <api_key> <engine_id>"),process.exit(1)),r||(pe.error("Missing Search Engine ID"),pe.info("Usage: aii config websearch google <api_key> <engine_id>"),pe.info("Get your Search Engine ID from: https://programmablesearchengine.google.com/"),process.exit(1)),await t.setSecret("google_search_api_key",n),await t.setSecret("google_search_engine_id",r),pe.success("Google Custom Search configured"),pe.info("WebSearch tool will now be available in agent sessions");return}}async function ANe(e,t){let a=e.args[0]?.toLowerCase(),r=(await t.load()).api?.url||"http://localhost:26169",i=t.getSecret("aii_api_key")||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4";try{let s=await fetch(`${r}/v0/models`,{headers:{"Aii-API-Key":i}});if(!s.ok){let l=await s.json().catch(()=>({}));pe.error(`Failed to fetch models: ${l.error||s.statusText}`),pe.info("Make sure aii-server is running and accessible"),process.exit(1)}let o=await s.json(),c=[];for(let l of o.providers)for(let u of l.models)c.push({...u,provider:l.name,provider_display:l.display_name,provider_configured:l.configured,api_key_env_var:l.api_key_env_var});if(a){let l=c.find(v=>v.name.toLowerCase()===a);if(!l){pe.error(`Unknown model: ${a}`);let v=c.filter(S=>S.name.toLowerCase().includes(a)||a.includes(S.name.toLowerCase().split("-")[0])).slice(0,5);v.length>0&&pe.info(`Did you mean: ${v.map(S=>S.name).join(", ")}`),process.exit(1)}console.log(g.cyan.bold(`
@@ -1316,7 +1316,7 @@ ${a.yellow("EXAMPLES:")}
1316
1316
  ${a.yellow("CONFIG FILE:")}
1317
1317
  ~/.aii/config.yaml Main configuration
1318
1318
  ~/.aii/secrets.yaml API keys (secure storage)
1319
- `)}import*as Eg from"fs";async function FV(e,t){let a=jr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis}),n=[];t.configExists()?n.push({name:"Configuration file",status:"ok",message:"Found"}):n.push({name:"Configuration file",status:"warn",message:"Not found (using defaults)"});let r=await t.load(),i=t.getApiKey();if(i){let d=RNe(i);n.push({name:"LLM Model",status:"ok",message:`${r.llm.model}@${r.llm.provider} (${d})`})}else n.push({name:"LLM Model",status:"error",message:`Not configured for ${r.llm.provider}`});let s=await INe(r.api.url);n.push({name:"AII Server",status:s.ok?"ok":"error",message:s.message});let o=`${t.getConfigDir()}/mcp_servers.json`;if(Eg.existsSync(o))try{let d=Eg.readFileSync(o,"utf-8"),m=JSON.parse(d),f=Object.keys(m.mcpServers??{}).length;f>0?n.push({name:"MCP Servers",status:"ok",message:`${f} configured`}):n.push({name:"MCP Servers",status:"warn",message:"Not configured"})}catch{n.push({name:"MCP Servers",status:"warn",message:"Invalid config"})}else n.push({name:"MCP Servers",status:"warn",message:"Not configured"});let c=t.getConfigDir();Eg.existsSync(c)?n.push({name:"Storage Directory",status:"ok",message:c}):n.push({name:"Storage Directory",status:"warn",message:"Not created"});let l=process.version;parseInt(l.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js Version",status:"ok",message:l}):n.push({name:"Node.js Version",status:"error",message:`${l} (requires >= 18)`}),console.log(a.formatHealthCheck(n)),n.some(d=>d.status==="error")&&process.exit(1)}async function INe(e){try{let t=new AbortController,a=setTimeout(()=>t.abort(),3e3),n=await fetch(`${e}/api/status`,{signal:t.signal});if(clearTimeout(a),n.ok){let r=new URL(e);return{ok:!0,message:`Running at ${r.hostname}:${r.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(t){return t instanceof Error&&t.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}function RNe(e){return e.length<=10?"***":e.slice(0,6)+"..."+e.slice(-4)}la();var BV="0.11.4";function rI(e){let a=!e.flags.noColors?g:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
1319
+ `)}import*as Eg from"fs";async function FV(e,t){let a=jr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis}),n=[];t.configExists()?n.push({name:"Configuration file",status:"ok",message:"Found"}):n.push({name:"Configuration file",status:"warn",message:"Not found (using defaults)"});let r=await t.load(),i=t.getApiKey();if(i){let d=RNe(i);n.push({name:"LLM Model",status:"ok",message:`${r.llm.model}@${r.llm.provider} (${d})`})}else n.push({name:"LLM Model",status:"error",message:`Not configured for ${r.llm.provider}`});let s=await INe(r.api.url);n.push({name:"AII Server",status:s.ok?"ok":"error",message:s.message});let o=`${t.getConfigDir()}/mcp_servers.json`;if(Eg.existsSync(o))try{let d=Eg.readFileSync(o,"utf-8"),m=JSON.parse(d),f=Object.keys(m.mcpServers??{}).length;f>0?n.push({name:"MCP Servers",status:"ok",message:`${f} configured`}):n.push({name:"MCP Servers",status:"warn",message:"Not configured"})}catch{n.push({name:"MCP Servers",status:"warn",message:"Invalid config"})}else n.push({name:"MCP Servers",status:"warn",message:"Not configured"});let c=t.getConfigDir();Eg.existsSync(c)?n.push({name:"Storage Directory",status:"ok",message:c}):n.push({name:"Storage Directory",status:"warn",message:"Not created"});let l=process.version;parseInt(l.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js Version",status:"ok",message:l}):n.push({name:"Node.js Version",status:"error",message:`${l} (requires >= 18)`}),console.log(a.formatHealthCheck(n)),n.some(d=>d.status==="error")&&process.exit(1)}async function INe(e){try{let t=new AbortController,a=setTimeout(()=>t.abort(),3e3),n=await fetch(`${e}/api/status`,{signal:t.signal});if(clearTimeout(a),n.ok){let r=new URL(e);return{ok:!0,message:`Running at ${r.hostname}:${r.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(t){return t instanceof Error&&t.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}function RNe(e){return e.length<=10?"***":e.slice(0,6)+"..."+e.slice(-4)}la();var BV="0.11.6";function rI(e){let a=!e.flags.noColors?g:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
1320
1320
  ${a.cyan("AII")} - AI-powered CLI assistant v${BV}
1321
1321
 
1322
1322
  ${a.yellow("USAGE:")}
@@ -1763,7 +1763,7 @@ Session ended unexpectedly: ${S.message}`)),process.env.AII_DEBUG&&console.error
1763
1763
  \u2717 Bot '${n}' not found.`)),console.log("Run "+g.cyan("aii telegram list")+` to see configured bots.
1764
1764
  `),process.exit(1));let i=r.entry.botToken;i||(console.error(g.red(`
1765
1765
  \u2717 Bot '${n}' has no token. Re-pair with:`)),console.log(g.cyan(` aii telegram pair ${n} <TOKEN>
1766
- `)),process.exit(1));let s=yn(e.flags.model??a.llm.model??"claude-sonnet-4"),o=zn(e.flags.model,a.llm.provider??"anthropic",e.flags.provider),c=t.getServerApiKey()||TYe,l=t.getApiKey(o);if(!l)throw new Va(`Missing API key for provider: ${o}`);let u=a.api?.url||"http://localhost:26169",p=Wn({baseUrl:u,apiKey:c,providerApiKey:l}),d=r.entry.workingDirectory||a.telegram?.working_directory||process.cwd();It.hasInstance()||(It.getInstance(d),await It.getInstance().discover());let m=new Ym(i,r.entry.telegramUserId),f=new sy(p,o,s,d),h=`telegram-bot-${r.name}`;Or.register(h,()=>{m.stop(),f.disconnect()});let _="unknown";try{let C=await m.getBotInfo();_=C.username||C.firstName}catch(C){throw console.error(g.red("Failed to get bot info. Check your bot token.")),C}console.log(""),console.log(g.cyan("\u2501".repeat(50))),console.log(g.cyan.bold(" \u{1F916} Aii Telegram Bot")),console.log(g.cyan("\u2501".repeat(50))),console.log(` Name: ${g.bold(r.name)}`),console.log(` Bot: @${g.bold(_)}`),console.log(` Paired: ${g.green(r.entry.username?`@${r.entry.username}`:`ID ${r.entry.telegramUserId}`)}`),console.log(` Model: ${g.bold(s)} (${o})`),console.log(` Directory: ${g.dim(d)}`);let v=Vn.getInstance();if(v.hasInstructions()){let C=v.getSummary(),O=C.files.map(P=>P.path.split("/").pop()).join(", ");console.log(` Instructions: ${g.green(O)} (${C.totalTokens} tokens)`)}else console.log(` Instructions: ${g.dim("none (add AGENTS.md to project root)")}`);console.log(g.cyan("\u2501".repeat(50))),console.log(g.dim(" Press Ctrl+C to stop")),console.log("");let S=Date.now(),T={model:s,provider:o,botUsername:_,botName:r.name,startTime:S,verbose:!1};m.on("message",async C=>{if(C.isCommand){await IYe(C,m,f,T);return}console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.cyan(`@${C.username||C.userId}`)+g.white(": ")+C.text.slice(0,200)+(C.text.length>200?"...":""));let O=setInterval(()=>{m.sendTypingAction(C.chatId)},4e3);await m.sendTypingAction(C.chatId);try{let P=await f.handleMessage(C.text,async B=>{switch(B.type){case"tool_call":if(B.text){let ee=B.toolArgs?Object.values(B.toolArgs).find(j=>typeof j=="string"):void 0,K=ee?`: ${ee.slice(0,80)}`:"";console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.yellow(`\u{1F527} ${B.toolName??"tool"}${K}`)),T.verbose&&await m.sendMessage(C.chatId,B.text,"MarkdownV2")}await m.sendTypingAction(C.chatId);break;case"error":console.error(g.red(` Agent error: ${B.text}`));break}}),N=IP(P);await m.sendChunkedMessage(C.chatId,N,4096,"HTML");let L=2e3,F=P.length>L?P.slice(0,L)+`
1766
+ `)),process.exit(1));let s=yn(e.flags.model??a.llm.model??"claude-sonnet-4"),o=zn(e.flags.model,a.llm.provider??"anthropic",e.flags.provider),c=t.getServerApiKey()||TYe,l=t.getApiKey(o);if(!l)throw new Va(`Missing API key for provider: ${o}`);let u=a.api?.url||"http://localhost:26169",p=Wn({baseUrl:u,apiKey:c,providerApiKey:l}),d=r.entry.workingDirectory||a.telegram?.working_directory||process.cwd();It.hasInstance()||(It.getInstance(d),await It.getInstance().discover());let m=new Ym(i,r.entry.telegramUserId),f=new sy(p,o,s,d),h=`telegram-bot-${r.name}`;Or.register(h,()=>{m.stop(),f.disconnect()});let _="unknown";try{let C=await m.getBotInfo();_=C.username||C.firstName}catch(C){throw console.error(g.red("Failed to get bot info. Check your bot token.")),C}console.log(""),console.log(g.cyan("\u2501".repeat(50))),console.log(g.cyan.bold(" \u{1FABC} Aii Telegram Bot")),console.log(g.cyan("\u2501".repeat(50))),console.log(` Name: ${g.bold(r.name)}`),console.log(` Bot: @${g.bold(_)}`),console.log(` Paired: ${g.green(r.entry.username?`@${r.entry.username}`:`ID ${r.entry.telegramUserId}`)}`),console.log(` Model: ${g.bold(s)} (${o})`),console.log(` Directory: ${g.dim(d)}`);let v=Vn.getInstance();if(v.hasInstructions()){let C=v.getSummary(),O=C.files.map(P=>P.path.split("/").pop()).join(", ");console.log(` Instructions: ${g.green(O)} (${C.totalTokens} tokens)`)}else console.log(` Instructions: ${g.dim("none (add AGENTS.md to project root)")}`);console.log(g.cyan("\u2501".repeat(50))),console.log(g.dim(" Press Ctrl+C to stop")),console.log("");let S=Date.now(),T={model:s,provider:o,botUsername:_,botName:r.name,startTime:S,verbose:!1};m.on("message",async C=>{if(C.isCommand){await IYe(C,m,f,T);return}console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.cyan(`@${C.username||C.userId}`)+g.white(": ")+C.text.slice(0,200)+(C.text.length>200?"...":""));let O=setInterval(()=>{m.sendTypingAction(C.chatId)},4e3);await m.sendTypingAction(C.chatId);try{let P=await f.handleMessage(C.text,async B=>{switch(B.type){case"tool_call":if(B.text){let ee=B.toolArgs?Object.values(B.toolArgs).find(j=>typeof j=="string"):void 0,K=ee?`: ${ee.slice(0,80)}`:"";console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.yellow(`\u{1F527} ${B.toolName??"tool"}${K}`)),T.verbose&&await m.sendMessage(C.chatId,B.text,"MarkdownV2")}await m.sendTypingAction(C.chatId);break;case"error":console.error(g.red(` Agent error: ${B.text}`));break}}),N=IP(P);await m.sendChunkedMessage(C.chatId,N,4096,"HTML");let L=2e3,F=P.length>L?P.slice(0,L)+`
1767
1767
  ... [${P.length} chars total]`:P;console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.green("Agent response:"));for(let B of F.split(`
1768
1768
  `))console.log(g.dim(" \u2502 ")+B)}catch(P){let N=P instanceof Error?P.message:String(P);console.error(g.red(` Error processing message: ${N}`)),await m.sendMessage(C.chatId,`\u274C Error: ${N}`)}finally{clearInterval(O)}}),m.on("error",C=>{console.error(g.red(` Telegram error: ${C.message}`))});try{await m.start(),console.log(g.green(` \u2713 Bot is running and listening for messages
1769
1769
  `))}catch(C){console.error(g.red(" \u2717 Failed to start bot:"),C.message),process.exit(1)}await new Promise(C=>{let O=()=>{console.log(g.dim(`
@@ -1786,7 +1786,7 @@ Example: `+g.dim("aii telegram pair mybot 7123456789:AAF...xyz")),console.log(""
1786
1786
  `);return}FP(t),console.log(g.green(`
1787
1787
  \u2713 Removed bot '${t}' (paired with ${a.entry.username?`@${a.entry.username}`:`ID ${a.entry.telegramUserId}`})`)),console.log(g.dim(" Updated ~/.aii/telegram-bots.json")),console.log(`
1788
1788
  Run ${g.cyan("aii telegram pair <name> <token>")} to add a new bot.
1789
- `)}async function IYe(e,t,a,n){switch(e.command){case"start":{let r=[`\u{1F916} *Aii Agent* \\(${zi(n.botName)}\\) \u2014 ready to assist\\!`,"","I can help with coding tasks, file editing, searches, and more\\.","","*Commands:*","/help \u2014 Show available commands","/reset \u2014 Clear conversation history","/status \u2014 Session statistics","/compact \u2014 Compress conversation context","/model \\[name\\] \u2014 Show or switch model","/mcp \\[action\\] \u2014 MCP server management","/verbose \u2014 Toggle tool call notifications","","Send me any message to get started\\!"].join(`
1789
+ `)}async function IYe(e,t,a,n){switch(e.command){case"start":{let r=[`\u{1FABC} *Aii Agent* \\(${zi(n.botName)}\\) \u2014 ready to assist\\!`,"","I can help with coding tasks, file editing, searches, and more\\.","","*Commands:*","/help \u2014 Show available commands","/reset \u2014 Clear conversation history","/status \u2014 Session statistics","/compact \u2014 Compress conversation context","/model \\[name\\] \u2014 Show or switch model","/mcp \\[action\\] \u2014 MCP server management","/verbose \u2014 Toggle tool call notifications","","Send me any message to get started\\!"].join(`
1790
1790
  `);await t.sendMessage(e.chatId,r,"MarkdownV2");break}case"help":{let r=["*Available Commands:*","","/start \u2014 Welcome message","/help \u2014 This help message","/reset \u2014 Clear conversation \\(fresh start\\)","/status \u2014 Session stats \\(tokens, cost, model\\)","/compact \u2014 Compress conversation context","/model \\[name\\] \u2014 Show or switch model","/mcp \\[action\\] \u2014 MCP server management","/verbose \u2014 Toggle tool call notifications","","*Agent Capabilities:*","\u2022 Read, write, and edit files","\u2022 Run shell commands","\u2022 Search code \\(glob \\+ grep\\)","\u2022 Web search and fetch","\u2022 Skill invocation","","Just send any message to interact with the agent\\."].join(`
1791
1791
  `);await t.sendMessage(e.chatId,r,"MarkdownV2");break}case"reset":{await a.reset(),await t.sendMessage(e.chatId,"\u{1F504} Conversation reset. Starting fresh!"),console.log(""),console.log(g.dim(` ${"\u2500".repeat(40)}`)),console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.yellow("Session reset \u2014 new conversation")),console.log(g.dim(` ${"\u2500".repeat(40)}`)),console.log("");break}case"status":{let r=await a.getStats(),i=Date.now()-n.startTime,s=Math.floor(i/6e4),o=Math.floor(s/60),c=o>0?`${o}h ${s%60}m`:`${s}m`,l=[`\u{1F4CA} *Session Status* \\(${zi(n.botName)}\\)`,"",`Model: \`${zi(r.model)}\``,`Provider: \`${zi(r.provider)}\``,`Messages: ${r.messageCount}`,`Turns: ${r.totalTurns}`,`Tokens: ${r.totalTokensIn.toLocaleString()} in / ${r.totalTokensOut.toLocaleString()} out`,`Cost: $${r.totalCost.toFixed(4)}`,`History: ${a.getHistoryLength()} messages`,`Uptime: ${c}`].join(`
1792
1792
  `);await t.sendMessage(e.chatId,l,"MarkdownV2");break}case"compact":{await t.sendTypingAction(e.chatId),await a.reset(),await t.sendMessage(e.chatId,"\u{1F5DC} Conversation compacted. Context cleared."),console.log(""),console.log(g.dim(` ${"\u2500".repeat(40)}`)),console.log(g.dim(` [${new Date().toLocaleTimeString()}] `)+g.yellow("Context compacted \u2014 new conversation")),console.log(g.dim(` ${"\u2500".repeat(40)}`)),console.log("");break}case"model":{let r=e.commandArgs?.trim();if(r){let i=yn(r),s=zn(r,n.provider);await a.switchModel(i,s),n.model=i,n.provider=s;let o=`\u2705 Model switched to \`${zi(i)}\` \\(${zi(s)}\\)`;await t.sendMessage(e.chatId,o,"MarkdownV2"),console.log(g.dim(` [${new Date().toLocaleTimeString()}] Model switched to ${i} (${s})`))}else{let i=`Current model: \`${zi(n.model)}\` \\(${zi(n.provider)}\\)`;await t.sendMessage(e.chatId,i,"MarkdownV2")}break}case"verbose":{n.verbose=!n.verbose;let r=n.verbose?"ON":"OFF",i=n.verbose?"Tool call notifications will be shown.":"Tool call notifications are hidden. Only final responses will be shown.";await t.sendMessage(e.chatId,`\u{1F514} Verbose mode: ${r}
@@ -1819,7 +1819,7 @@ Requirements:
1819
1819
  - HOW it impacts the codebase (behavior changes, new capabilities)
1820
1820
  5. Focus on clarity and context for future developers
1821
1821
  6. Footer (must include exactly as shown):
1822
- \u{1F916} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
1822
+ \u{1FABC} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
1823
1823
  Co-authored-by: Aii CLI <noreply@aiiware.com>
1824
1824
 
1825
1825
  Output ONLY the commit message in plain text (no markdown code blocks, no explanatory text).
@@ -1832,7 +1832,7 @@ over user-specified periods including executions, token counts, and costs.
1832
1832
  This provides developers with visibility into AI function usage patterns
1833
1833
  and helps track token consumption for cost optimization.
1834
1834
 
1835
- \u{1F916} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
1835
+ \u{1FABC} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
1836
1836
  Co-authored-by: Aii CLI <noreply@aiiware.com>`;function VYe(){try{return UP("git rev-parse --git-dir",{stdio:"pipe"}),!0}catch{return!1}}function QYe(){try{return UP("git diff --cached",{encoding:"utf-8"}).trim()||null}catch{return null}}function XYe(e,t){return t?e.startsWith("diff --git")?g.bold.white(e):e.startsWith("index ")?g.dim(e):e.startsWith("---")?g.bold.red(e):e.startsWith("+++")?g.bold.green(e):e.startsWith("@@")?g.cyan(e):e.startsWith("+")?g.green(e):e.startsWith("-")?g.red(e):e:e}function JYe(e,t){return t?e.split(`
1837
1837
  `).map(a=>XYe(a,t)).join(`
1838
1838
  `):e}function ZYe(e,t=!0){console.log("\u{1F4CB} Git Diff:");let n=e.length>2e3?e.substring(0,2e3):e;console.log(JYe(n,t)),e.length>2e3&&(console.log(g.dim(`
@@ -1894,13 +1894,13 @@ DESCRIPTION:
1894
1894
  - Works with any base branch (main, master, develop, etc.)
1895
1895
  - Supports dry-run mode for preview without creation
1896
1896
 
1897
- \u{1F916} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
1897
+ \u{1FABC} Generated with [aii](https://www.npmjs.com/package/@aiiware/aii)
1898
1898
  ---`;function Es(e){try{return kx(`git ${e}`,{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()}catch{return null}}function oKe(){return Es("rev-parse --git-dir")!==null}function cKe(){try{return kx("gh --version",{stdio:"pipe"}),!0}catch{return!1}}function lKe(){try{return kx("gh auth status",{stdio:"pipe"}),!0}catch{return!1}}function uKe(){return Es("rev-parse --abbrev-ref HEAD")}function pKe(){let e=Es("symbolic-ref refs/remotes/origin/HEAD");if(e){let t=e.split("/");return t[t.length-1]}return Es("rev-parse --verify main")!==null?"main":Es("rev-parse --verify master")!==null?"master":"main"}function dKe(e,t){return Es(`log ${e}..${t} --oneline`)}function mKe(e,t){return Es(`diff ${e}...${t} --stat`)}function fKe(e,t){return Es(`diff ${e}...${t}`)}function hKe(e){let t=Es(`ls-remote --heads origin ${e}`);return t!==null&&t.includes(`refs/heads/${e}`)}function gKe(e){let t=Es(`rev-list origin/${e}..${e} --count`);return t?parseInt(t,10):0}function _Ke(){let e=Es("diff --cached --name-only");return e!==null&&e.length>0}function $pe(e){try{return kx(`git push -u origin ${e}`,{stdio:"inherit"}),!0}catch{return!1}}function yKe(e,t,a,n){let r=["pr","create","--title",e,"--body",t,"--base",a];n&&r.push("--draft");let i=rKe("gh",r,{encoding:"utf-8",stdio:["inherit","pipe","pipe"]});if(i.status===0){let s=i.stdout.trim();return s&&console.log(`
1899
1899
  \u{1F517} ${s}`),!0}else{let s=i.stderr?.trim();return s&&!s.includes("'pr' is not a git command")&&console.error(`
1900
1900
  Error: ${s}`),!1}}function bKe(e){if(!e)return{title:null,description:null};if(e.includes("---")){let r=e.split("---");if(r.length>=3){let i=r[1].trim(),s=r[2].trim(),o=i.replace("TITLE:","").trim(),c=s.replace("DESCRIPTION:","").trim();if(o&&c)return{title:o,description:c}}}if(e.includes("Title:")){let r=e.split(`
1901
1901
  `),i=null,s=[],o=!1;for(let c of r)c.trim().startsWith("Title:")?(i=c.replace("Title:","").trim(),o=!0):o&&s.push(c);if(i&&s.length>0){let c=s.join(`
1902
- `).trim();return c.includes("\u{1F916} Generated with")&&(c=c.split("\u{1F916} Generated with")[0].trim()),{title:i,description:c}}}let t=e.split(`
1903
- `,2),a=t[0].trim();a=a.replace("**Title**:","").replace("Title:","").trim();let n=t[1]?t[1].trim():"";return n.includes("\u{1F916} Generated with")&&(n=n.split("\u{1F916} Generated with")[0].trim()),{title:a||null,description:n||null}}async function qP(e){let t=iKe({input:process.stdin,output:process.stdout});return new Promise(a=>{t.question(e,n=>{t.close(),a(n.toLowerCase()==="y")})})}function vKe(e){let t=null,a=!1,n=!1,r=!1;for(let i=0;i<e.length;i++)e[i]==="--base"&&i+1<e.length?(t=e[i+1],i++):e[i]==="--draft"?a=!0:e[i]==="--dry-run"?n=!0:(e[i]==="--yes"||e[i]==="-y")&&(r=!0);return{baseBranch:t,isDraft:a,dryRun:n,yes:r}}async function $P(e,t){let a=vKe(e.args),n=e.flags.yes||a.yes,r=jr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis});oKe()||(console.error("\u274C Not in a git repository."),console.error("\u{1F4A1} Initialize with: git init"),process.exit(1)),cKe()||(console.error("\u274C GitHub CLI (gh) is not installed."),console.error("\u{1F4A1} Install from: https://cli.github.com/"),process.exit(1)),lKe()||(console.error("\u274C GitHub CLI (gh) is not authenticated."),console.error("\u{1F4A1} Authenticate with: gh auth login"),process.exit(1));let i=uKe();i||(console.error("\u274C Could not determine current branch."),process.exit(1));let s=a.baseBranch||pKe();if(i===s&&(console.error(`\u274C Current branch '${i}' is the same as base branch '${s}'.`),console.error("\u{1F4A1} Create a feature branch first: git checkout -b feature/my-feature"),process.exit(1)),console.log(`\u{1F4CB} Creating PR: ${i} \u2192 ${s}`),_Ke()&&(console.log(`
1902
+ `).trim();return c.includes("\u{1FABC} Generated with")&&(c=c.split("\u{1FABC} Generated with")[0].trim()),{title:i,description:c}}}let t=e.split(`
1903
+ `,2),a=t[0].trim();a=a.replace("**Title**:","").replace("Title:","").trim();let n=t[1]?t[1].trim():"";return n.includes("\u{1FABC} Generated with")&&(n=n.split("\u{1FABC} Generated with")[0].trim()),{title:a||null,description:n||null}}async function qP(e){let t=iKe({input:process.stdin,output:process.stdout});return new Promise(a=>{t.question(e,n=>{t.close(),a(n.toLowerCase()==="y")})})}function vKe(e){let t=null,a=!1,n=!1,r=!1;for(let i=0;i<e.length;i++)e[i]==="--base"&&i+1<e.length?(t=e[i+1],i++):e[i]==="--draft"?a=!0:e[i]==="--dry-run"?n=!0:(e[i]==="--yes"||e[i]==="-y")&&(r=!0);return{baseBranch:t,isDraft:a,dryRun:n,yes:r}}async function $P(e,t){let a=vKe(e.args),n=e.flags.yes||a.yes,r=jr({colors:!e.flags.noColors,emojis:!e.flags.noEmojis});oKe()||(console.error("\u274C Not in a git repository."),console.error("\u{1F4A1} Initialize with: git init"),process.exit(1)),cKe()||(console.error("\u274C GitHub CLI (gh) is not installed."),console.error("\u{1F4A1} Install from: https://cli.github.com/"),process.exit(1)),lKe()||(console.error("\u274C GitHub CLI (gh) is not authenticated."),console.error("\u{1F4A1} Authenticate with: gh auth login"),process.exit(1));let i=uKe();i||(console.error("\u274C Could not determine current branch."),process.exit(1));let s=a.baseBranch||pKe();if(i===s&&(console.error(`\u274C Current branch '${i}' is the same as base branch '${s}'.`),console.error("\u{1F4A1} Create a feature branch first: git checkout -b feature/my-feature"),process.exit(1)),console.log(`\u{1F4CB} Creating PR: ${i} \u2192 ${s}`),_Ke()&&(console.log(`
1904
1904
  \u26A0\uFE0F You have staged changes that aren't committed yet`),console.log("\u{1F4A1} Commit your staged changes first:"),console.log(" git commit -m 'your message'"),console.log(`
1905
1905
  \u{1F4A1} Or unstage them if you don't want them in the PR:`),console.log(" git restore --staged <file>"),process.exit(1)),!hKe(i)){console.log(`
1906
1906
  \u26A0\uFE0F Branch '${i}' is not pushed to remote`);let X=!1;n?(console.log("\u2713 Auto-pushing branch with --yes flag"),X=!0):X=await qP("Push branch to remote? (y/n): "),X?($pe(i)||(console.error("\u274C Failed to push branch"),process.exit(1)),console.log(`\u2705 Branch '${i}' pushed to origin`)):(console.log("\u274C PR creation cancelled (branch not pushed)"),process.exit(1))}let o=gKe(i);if(o>0){console.log(`
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@aiiware/aii",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "type": "module",
5
- "description": "AI-powered CLI assistant for terminal productivity",
5
+ "description": "🪼 AI-powered CLI assistant for terminal productivity",
6
6
  "author": "AiiWare <support@aiiware.com>",
7
7
  "license": "SEE LICENSE IN LICENSE",
8
8
  "homepage": "https://aiiware.com",