fluxflow-cli 3.22.0 → 3.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/ai-7LT7T34E.js +1 -0
- package/dist/chunks/ai-IOVX3WCN.js +1 -0
- package/dist/chunks/ai-NDNZ4XGW.js +1 -0
- package/dist/chunks/ai-O2AHKT2Q.js +1 -0
- package/dist/chunks/ai-OLHI3UWZ.js +1 -0
- package/dist/chunks/ai-T2SZGY7Y.js +1 -0
- package/dist/chunks/ai-VMV4EAEQ.js +1 -0
- package/dist/chunks/app-2BDYKT26.js +226 -0
- package/dist/chunks/app-4VRQVBXL.js +226 -0
- package/dist/chunks/app-AASWJUCP.js +226 -0
- package/dist/chunks/app-DLGENJXK.js +226 -0
- package/dist/chunks/app-HW6KINDL.js +226 -0
- package/dist/chunks/app-OIIPCXZF.js +226 -0
- package/dist/chunks/app-ZUY2BADH.js +226 -0
- package/dist/chunks/chunk-3VSDH7DF.js +3 -0
- package/dist/chunks/chunk-77P7CACS.js +3 -0
- package/dist/chunks/chunk-BVYPWENJ.js +803 -0
- package/dist/chunks/chunk-IW2KLAXM.js +803 -0
- package/dist/chunks/chunk-O4A5T73D.js +801 -0
- package/dist/chunks/chunk-UKBUOJ3P.js +803 -0
- package/dist/chunks/chunk-VBKX2PU3.js +803 -0
- package/dist/chunks/chunk-Y2EZRWRZ.js +803 -0
- package/dist/chunks/chunk-ZQZIEF5I.js +803 -0
- package/dist/chunks/settings-57QAZRCP.js +1 -0
- package/dist/chunks/settings-DTH5C6BO.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/model_config.json +605 -0
- package/dist/package.json +4 -4
- package/model_config.json +605 -571
- package/package.json +4 -4
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import{e as Zs}from"./chunk-RTGBM2SA.js";import{A as gi,B as Jn,C as fi,D as hi,E as Zn,F as Rn,G as pt,H as Fo,I as jr,J as xi,K as pi,L as Ti,M as wi,N as yi,O as Vr,P as Uo,Q as er,S as Si,V as Ci,W as Cn,X as vi,Y as Mi,Z as Ei,a as lt,b as gt,c as at,d as ii,e as Xr,f as Wr,g as yn,h as li,i as io,j as ai,k as Ye,l as Ve,m as Qn,n as bn,o as Gr,p as di,q as Zo,r as $t,s as ci,t as Sn,u as yo,v as Ro,w as zn,x as Yr,y as ui,z as mi}from"./chunk-VBKX2PU3.js";import{b as Jo,c as $r,k as si}from"./chunk-7WH5DREO.js";import{a as oi,b as ni,d as No,e as so,f as ri,g as Hr,h as It}from"./chunk-77P7CACS.js";import{c as Rs,d as ei,e as ti}from"./chunk-SIINYZWE.js";import{a as Nr,b as wn,c as wo,d as qn,e as Fr,j as Ur}from"./chunk-SGZ2OI72.js";import{a as bi}from"./chunk-56EJGQU3.js";import{a as Js,b as Hl}from"./chunk-6DHFEWGX.js";var Bi=Js((Vd,Xl)=>{Xl.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 Ii=Js((Kd,ki)=>{"use strict";var tr=Object.assign({},Bi()),Di=Object.keys(tr);Object.defineProperty(tr,"random",{get(){let t=Math.floor(Math.random()*Di.length),u=Di[t];return tr[u]}});ki.exports=tr});import gs from"os";import e,{useState as V,useEffect as Ke,useRef as Xe,useMemo as sn}from"react";import{Box as m,Text as s,useInput as wd,useStdout as yd,Static as bd}from"ink";var Ai=Hl(Ii(),1);import Wl,{useState as Gl,useEffect as Yl}from"react";import{Text as jl}from"ink";function Vl({type:t="dots"}){let[u,x]=Gl(0),b=Ai.default[t];return Yl(()=>{let p=setInterval(()=>{x(f=>f===b.frames.length-1?0:f+1)},b.interval);return()=>{clearInterval(p)}},[b]),Wl.createElement(jl,null,b.frames[u])}var Li=Vl;import ot from"fs-extra";import Bt from"path";import{exec as gr}from"child_process";import{fileURLToPath as Sd}from"url";import _t,{useState as or,useEffect as Kr,useMemo as vn,useCallback as Kl,useRef as lo}from"react";import{Box as ql,Text as Kt,useInput as Ql}from"ink";function zl(t,u){return t.replace(/\t/g," ".repeat(u))}function nr(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
|
+
`).replace(/\r/g,`
|
|
3
|
+
`)}function $o(t,u,x){let b=t,p=[...u].sort((i,B)=>i.start-B.start),f=0;for(let i of p){let B=i.start-f,c=nr(i.text).split(`
|
|
4
|
+
`).length,v=i.text.length,M=(c>3?`[Pasted ${c} lines]`:`[Pasted ${v} chars]`).length,$=B+M;if(t<=B)break;if(t<$){b=i.end;break}else{let E=i.text.length-M;b+=E,f+=E}}return Math.min(b,x.length)}function qr(t,u,x,b,p=[]){let f=(t||"").slice(0,u),i=b(f).length,B=b(t||""),c=[...p].sort((A,N)=>N.start-A.start);for(let A of c){let N=b(t.slice(0,A.start)).length,Z=b(A.text),R=N+Z.length,ce=nr(A.text).split(`
|
|
5
|
+
`).length,ge=A.text.length,Y=ce>3?`[Pasted ${ce} lines]`:`[Pasted ${ge} chars]`;B=B.slice(0,N)+Y+B.slice(R),i>N&&i<R?i=N+Y.length:i>=R&&(i=i-(R-N)+Y.length)}let v=B.split(`
|
|
6
|
+
`),M=[],$=0,E=0,O=0,D=!1;for(let A=0;A<v.length;A++){let N=v[A];if(N.length===0){!D&&i===$&&(E=M.length,O=0,D=!0),M.push({text:"",globalStart:$o($,p,t),formattedStart:$}),$+=1;continue}let R=gt(N,x).split(`
|
|
7
|
+
`),ce=0,ge=[];for(let Y=0;Y<R.length;Y++){let W=R[Y],ie=W.trim();if(ie.length===0){let Ee=W.length||1;ge.push({text:W,start:ce,length:Ee}),ce+=Ee}else{let Ee=N.indexOf(ie,ce);if(Ee!==-1){let xe=ce,Ae=Y<R.length-1?R[Y+1].trim():"",le=N.length;if(Ae.length>0){let Q=N.indexOf(Ae,Ee+ie.length);Q!==-1&&(le=Q)}ge.push({text:N.slice(xe,le),start:xe,length:le-xe}),ce=le}else ge.push({text:W,start:ce,length:W.length}),ce+=W.length}}for(let Y=0;Y<ge.length;Y++){let W=ge[Y],ie=W.text,Ee=$+W.start,xe=Ee+W.length;!D&&i>=Ee&&(i<xe||i===xe&&Y===ge.length-1)&&(E=M.length,O=i-Ee,D=!0),M.push({text:ie,globalStart:$o(Ee,p,t),formattedStart:Ee})}$+=N.length+1}return D||(M.length===0?M.push({text:"",globalStart:0,formattedStart:0}):B.endsWith(`
|
|
8
|
+
`)?(M.push({text:"",globalStart:$o($,p,t),formattedStart:$}),E=M.length-1,O=0):(E=M.length-1,O=M[E].text.length)),{visualLines:M,cursorLine:E,cursorCol:O}}var Jl=({value:t,rows:u,maxRows:x,highlightStyle:b,textStyle:p,placeholder:f="",mask:i,showCursor:B=!0,focus:c=!0,tabSize:v=4,cursorIndex:M=0,highlight:$,columns:E=80,pasteBlocks:O=[],cursorColor:D})=>{let A=lo(0),N=vn(()=>Math.max(20,E-10),[E]),Z=Kl((ue,K=!1)=>{let _=nr(ue);if(!K&&i)return _.replace(/[^\n]/g,i);let q=zl(_,v);return K?q:q.replace(/@\[(.*?)\]/g,(oe,ve)=>{let Oe=ve.indexOf("#"),Me=ve.indexOf(":L"),z=ve,Je="";Oe!==-1?(z=ve.slice(0,Oe),Je=ve.slice(Oe)):Me!==-1&&(z=ve.slice(0,Me),Je=ve.slice(Me));let We=z.replace(/\\/g,"/"),st=(process.cwd()||"").replace(/\\/g,"/");st&&We.toLowerCase().startsWith(st.toLowerCase()+"/")?We=We.slice(st.length+1):We.startsWith("./")&&(We=We.slice(2));let L=We.split("/");return`[${L[L.length-1]}${Je}]`})},[v,i]),{visualLines:R,cursorLine:ce,cursorCol:ge}=vn(()=>qr(t,M,N,Z,O),[t,M,N,Z,O]),Y=R.length,W=vn(()=>Math.max(u??x??1,Math.min(x??u??1,Y)),[u,x,Y]),ie=ce+1,Ee=A.current+W,xe=A.current;ie<=A.current?xe=Math.max(0,ie-1):ie>Ee?xe=ie-W:Y&&(Y<W?xe=0:Y<Ee&&(xe=Y-W)),A.current=xe;let Ae=vn(()=>R.slice(xe,xe+W),[R,xe,W]),[le,Q]=or(!0);Kr(()=>{if(Q(!0),!c||!B)return;let ue=setInterval(()=>{Q(K=>!K)},530);return()=>clearInterval(ue)},[c,B,t,M]);let pe=vn(()=>({...p,color:B&&c&&le?D||"white":void 0,bold:B&&c&&le,inverse:B&&c&&le}),[p,B,c,le,D]),fe=(ue,K,_,q)=>{if(!ue){let z=f&&t.length===0?Z(f,!0):"";if(K){let Je=z[0]||" ",We=z.slice(1);return _t.createElement(Kt,null,_t.createElement(Kt,{...q},Je),_t.createElement(Kt,{color:"gray",dimColor:!0},We))}return _t.createElement(Kt,{color:"gray",dimColor:!0},z||" ")}let oe=/(\[Pasted \d+ (?:lines|chars)\])/g,ve=ue.split(oe),Oe=0,Me=[];for(let z=0;z<ve.length;z++){let Je=ve[z];if(Je==="")continue;let We=Je.match(/^\[Pasted \d+ (?:lines|chars)\]$/),st=Je.length,L=Oe+st;if(K&&_>=Oe&&_<L){let he=_-Oe,qe=Je.slice(0,he),Qe=Je[he]||" ",Tt=Je.slice(he+1);Me.push(_t.createElement(Kt,{key:z},_t.createElement(Kt,{color:We?"magenta":void 0},qe),_t.createElement(Kt,{...q},Qe),_t.createElement(Kt,{color:We?"magenta":void 0},Tt)))}else Me.push(_t.createElement(Kt,{key:z,color:We?"magenta":void 0},Je));Oe=L}return K&&_>=ue.length&&Me.push(_t.createElement(Kt,{key:"cursor-end",...q}," ")),_t.createElement(_t.Fragment,null,Me)};return _t.createElement(ql,{height:W,width:N+1,overflow:"hidden",flexDirection:"column",flexGrow:0,flexShrink:0},Ae.map((ue,K)=>{let _=xe+K,q=_===ce&&c&&B;return _t.createElement(Kt,{key:_,...p,wrap:"truncate"},fe(ue.text,q,ge,pe))}))},_i=({value:t,onChange:u,onSubmit:x,keyBindings:b,showCursor:p=!0,highlightPastedText:f=!1,focus:i=!0,columns:B=80,useCustomInput:c=(E,O)=>Ql(E,{isActive:O}),onPasteStateChange:v,cursorColor:M,...$})=>{let[E,O]=or(t.length),[D,A]=or(0),[N,Z]=or([]),R=lo(t.length),ce=lo(t),ge=lo(0),Y=lo([]),W=lo(""),ie=lo(-1),Ee=lo(null),xe=lo(0);R.current=E,ce.current=t,ge.current=D,Y.current=N,Kr(()=>{R.current>t.length&&(R.current=t.length,O(t.length)),t?Z(Q=>Q.filter(pe=>pe.end<=t.length&&pe.start<=t.length)):(Z([]),A(0))},[t]),Kr(()=>{v?.(N.length>0)},[N,v]);let Ae=()=>{let Q=W.current,pe=ie.current,fe=pe+Q.length,ue=ce.current,K=ue.slice(0,pe)+Q+ue.slice(pe);u(K),R.current=fe,O(fe),A(Q.length>1?Q.length:0);let _=nr(Q).split(`
|
|
9
|
+
`).length,q=Q.length;if(q>50&&(_>3||_<=3&&q>200)){let oe={start:pe,end:fe,text:Q};Z(ve=>{let Oe=Q.length;return[...ve.map(z=>pe<=z.start?{...z,start:z.start+Oe,end:z.end+Oe}:z),oe]})}W.current="",ie.current=-1,Ee.current=null},le=()=>{Ee.current&&(clearTimeout(Ee.current),Ae())};return c((Q,pe)=>{if(Q==="\x1B[I"||Q==="\x1B[O"||Q==="[I"||Q==="[O")return;let fe=Q,ue=!1,K=!1;fe&&typeof fe=="string"&&(fe.includes("\x1B[200~")&&(ue=!0,fe=fe.replace(/\x1b\[200~/g,"")),fe.includes("\x1B[201~")&&(K=!0,fe=fe.replace(/\x1b\[201~/g,"")));let _=R.current,q=ce.current,oe=Y.current,ve=Math.max(20,B-10),Oe=(L,he)=>{if(oe.length===0)return;let qe=oe.map(Qe=>L<=Qe.start?{...Qe,start:Qe.start+he,end:Qe.end+he}:L>Qe.start&&L<Qe.end?null:Qe).filter(Boolean);Z(qe)},Me=L=>{for(let he of oe)if(L>he.start&&L<he.end)return he.start;return L};if(pe.ctrl&&(fe==="o"||fe==="")){Z([]);return}if(pe.ctrl&&(fe.toLowerCase()==="r"||fe===""||fe===""))return;if(pe.upArrow||pe.downArrow||pe.leftArrow||pe.rightArrow){le();let L=Date.now();if(L-xe.current<33)return;xe.current=L}let Je=b?.submit??(L=>L.return&&L.ctrl),We=b?.newline??(L=>L.return);if(Je(pe)){le(),x?.(q);return}else if(We(pe)){le(),Oe(_,1);let L=q.slice(0,_)+`
|
|
10
|
+
`+q.slice(_);u(L),R.current=_+1,O(_+1),A(0);return}if(pe.tab||pe.shift&&pe.tab||pe.ctrl&&fe==="c")return;let st=L=>L;if(pe.upArrow||pe.downArrow){if(le(),p){let{visualLines:L,cursorLine:he,cursorCol:qe}=qr(q,_,ve,st,oe),Qe=pe.upArrow?he-1:he+1;if(Qe>=0&&Qe<L.length){let Tt=L[Qe],ct=Math.min(qe,Tt.text.length),vt=Tt.formattedStart+ct,mo=$o(vt,oe,q);mo=Me(mo),R.current=mo,O(mo),A(0)}else if(pe.upArrow&&he===0)R.current=0,O(0),A(0);else if(pe.downArrow&&he===L.length-1){let Tt=L[L.length-1],ct=Tt.formattedStart+Tt.text.length,vt=$o(ct,oe,q);vt=Me(vt),R.current=vt,O(vt),A(0)}}}else if(pe.leftArrow){if(le(),p){let L=Math.max(0,_-1),he=oe.find(qe=>_===qe.end);he&&(L=he.start),R.current=L,O(L),A(0)}}else if(pe.rightArrow){if(le(),p){let L=Math.min(q.length,_+1),he=oe.find(qe=>_===qe.start);he&&(L=he.end),R.current=L,O(L),A(0)}}else if(pe.backspace){le();let L=oe.findIndex(he=>_===he.end);if(L!==-1){let he=oe[L],qe=-(he.end-he.start),Qe=q.slice(0,he.start)+q.slice(he.end);u(Qe),R.current=he.start,O(he.start),A(0);let Tt=oe.filter((ct,vt)=>vt!==L).map(ct=>ct.start>=he.end?{...ct,start:ct.start+qe,end:ct.end+qe}:ct);Z(Tt)}else if(_>0){Oe(_-1,-1);let he=q.slice(0,_-1)+q.slice(_);u(he),R.current=_-1,O(_-1),A(0)}}else if(pe.delete){le();let L=oe.findIndex(he=>_===he.start);if(L!==-1){let he=oe[L],qe=-(he.end-he.start),Qe=q.slice(0,he.start)+q.slice(he.end);u(Qe),A(0);let Tt=oe.filter((ct,vt)=>vt!==L).map(ct=>ct.start>=he.end?{...ct,start:ct.start+qe,end:ct.end+qe}:ct);Z(Tt)}else if(Oe(_,-1),_<q.length){let he=q.slice(0,_)+q.slice(_+1);u(he),A(0)}}else if(pe.home||pe.end){if(le(),p){let{visualLines:L,cursorLine:he}=qr(q,_,ve,st,oe),qe=L[he];if(qe){let Qe;pe.home?Qe=$o(qe.formattedStart,oe,q):pe.end&&(Qe=$o(qe.formattedStart+qe.text.length,oe,q)),Qe=Me(Qe),R.current=Qe,O(Qe),A(0)}}}else if(fe!==""||ue||K)if(ue||K||fe.length>1||Ee.current!==null)Ee.current?(clearTimeout(Ee.current),W.current+=fe):(ie.current=_,W.current=fe),K?(Ee.current=null,Ae()):Ee.current=setTimeout(()=>{Ae()},80);else{Oe(_,fe.length);let he=q.slice(0,_)+fe+q.slice(_);u(he);let qe=_+fe.length;R.current=qe,O(qe),A(0)}},i),_t.createElement(Jl,{...$,value:t,cursorIndex:E,showCursor:p,focus:i,columns:B,pasteBlocks:N,cursorColor:M})};import cs from"ink-text-input";import"ink-select-input";import r from"react";import{Box as k,Text as te}from"ink";import yt,{useState as Zl}from"react";import{Box as ao,Text as co,useInput as Rl}from"ink";var rr=yt.memo(({command:t,output:u,completed:x=!1,isFocused:b=!1,columns:p=80,isPty:f=!1,terminalHeight:i=24,theme:B="Dark"})=>{let c=Ye(B),M=(ge=>{if(!ge)return"";let Y=[[]],W=0,ie=0,Ee="",xe=/\x1b\[([0-9;]*?)([a-zA-Z])/g,Ae=0,le,Q=fe=>{for(let ue=0;ue<fe.length;ue++){let K=fe[ue];if(K===`
|
|
11
|
+
`)for(W++,ie=0;W>=Y.length;)Y.push([]);else if(K==="\r")ie=0;else{for(;W>=Y.length;)Y.push([]);let _=Y[W];for(;ie>_.length;)_.push({char:" ",style:""});_[ie]={char:K,style:Ee},ie++}}};for(;(le=xe.exec(ge))!==null;){Q(ge.substring(Ae,le.index));let fe=le[1],ue=le[2],K=fe?fe.split(";").map(Number):[];if(ue==="A"){let _=K[0]||1;W=Math.max(0,W-_)}else if(ue==="B"){let _=K[0]||1;for(W=W+_;W>=Y.length;)Y.push([])}else if(ue==="C"){let _=K[0]||1;ie=ie+_}else if(ue==="D"){let _=K[0]||1;ie=Math.max(0,ie-_)}else if(ue==="G"){let _=(K[0]||1)-1;ie=Math.max(0,_)}else if(ue==="H"||ue==="f"){let _=(K[0]||1)-1,q=(K[1]||1)-1;for(W=Math.max(0,_),ie=Math.max(0,q);W>=Y.length;)Y.push([])}else if(ue==="K"){let _=K[0]||0;if(W<Y.length){let q=Y[W];if(_===0)q.length=ie;else if(_===1)for(let oe=0;oe<ie&&oe<q.length;oe++)q[oe]={char:" ",style:""};else _===2&&(q.length=0)}}else if(ue==="J"){let _=K[0]||0;(_===2||_===3)&&(Y.length=0,Y.push([]),W=0,ie=0)}else if(ue==="m"){let _=le[0];_==="\x1B[0m"?Ee="":Ee=_}Ae=xe.lastIndex}Q(ge.substring(Ae));let pe=Y.map(fe=>{let ue="",K="";for(let _=0;_<fe.length;_++){let q=fe[_]||{char:" ",style:""};q.style!==K&&(K&&(ue+="\x1B[0m"),ue+=q.style,K=q.style),ue+=q.char}return K&&(ue+="\x1B[0m"),ue});for(;pe.length>0&&pe[pe.length-1]==="";)pe.pop();return pe.join(`
|
|
12
|
+
`)})(u).replace(/\n{3,}/g,`
|
|
13
|
+
|
|
14
|
+
`),$=f?M?M.split(`
|
|
15
|
+
`):[]:M?gt(M,p-6).split(`
|
|
16
|
+
`):[],[E,O]=Zl(!1);Rl((ge,Y)=>{b&&Y.ctrl&&(ge==="o"||ge==="")&&O(W=>!W)},{isActive:b});let D=Math.max(5,x?i-10:i-25),A=$.length>D,N=$.length-D,R=(A&&!E?$.slice($.length-D):$).join(`
|
|
17
|
+
`),ce=$.length>0;return yt.createElement(ao,{flexDirection:"column",borderStyle:b?"double":"single",borderLeft:!1,borderRight:!1,borderTop:!0,borderBottom:!0,borderColor:c.codeBorder,paddingLeft:2,paddingRight:0,paddingY:1,marginY:1,width:p-2},yt.createElement(ao,{marginBottom:1,justifyContent:"space-between",width:"100%"},yt.createElement(ao,{flexShrink:1,paddingRight:2},yt.createElement(co,null,yt.createElement(co,{color:c.text,bold:!0},x?"\u{1F3C1} FINISHED:":"\u26A1 EXECUTING:"," "),yt.createElement(co,{color:c.text},t))),f&&yt.createElement(ao,{flexShrink:0,paddingX:1},yt.createElement(co,{color:"green",bold:!0},"ADVANCE"))),ce?yt.createElement(ao,{flexDirection:"column",marginTop:0,backgroundColor:f?void 0:c.codeBg,paddingX:1,width:"100%"},A&&!E&&yt.createElement(ao,{marginBottom:1},yt.createElement(co,{color:"magenta"},"...",N," lines collapsed...")),yt.createElement(co,{color:c.text},R)):!x&&yt.createElement(ao,{marginTop:1,backgroundColor:f?void 0:c.codeBg,paddingX:1,width:"100%"},yt.createElement(co,{color:c.textMuted,italic:!0},"Waiting for output...")),yt.createElement(ao,{justifyContent:"space-between",marginTop:1},x?yt.createElement(ao,null):yt.createElement(co,{color:c.textMuted,italic:!0},b?"Press TAB to unfocus, then double-press ESC to terminate.":"Double-press ESC to terminate if hanging."),yt.createElement(co,{color:c.textMuted,bold:!0},x?"\u25CF ARCHIVED":b?"\u25B6 TERMINAL FOCUSED":"\u25CF LIVE (Press TAB to focus)")))});import{diffWordsWithSpace as ea}from"diff";var Oi=(t,u,x)=>t,ta=(t,u=80)=>{if(!t)return null;let x=u-10,b=t.trim();if(!b.includes("```"))return r.createElement(k,{width:"100%",flexDirection:"column"},r.createElement(tn,{text:b,color:"#969696",columns:x,italic:!0}));let p=b.split(/(```\w*\n?[\s\S]*?(?:```|$))/g);return r.createElement(k,{width:"100%",flexDirection:"column"},p.map((f,i)=>{if(f.startsWith("```")){let c=f.match(/```(\w*)\n?([\s\S]*?)(?:```|$)/),v=c?c[2]:f.replace(/^```\w*\n?/,"").replace(/```$/,""),M=gt(v.trimEnd(),x);return r.createElement(k,{key:i,flexDirection:"column",width:"100%"},M.split(`
|
|
18
|
+
`).map(($,E)=>r.createElement(te,{key:E,color:"cyan"},$)))}let B=f;return i>0&&(B=B.replace(/^[\r\n]+/,"")),i<p.length-1&&(B=B.replace(/[\r\n]+$/,"")),B?r.createElement(tn,{key:i,text:B,color:"gray",columns:x,italic:!0}):null}))},oa=/(```[\s\S]*?```|`[^`\r\n]+`|@\[.*?\]|\*\*.*?\*\*|\*.*?\*|\\\(.*?\\\)|\\\[.*?\\\]|\$.*?\$|\[.*?\]\s*\(.*?\)|\[.*?\]\s*\[.*?\]|https?:\/\/[^\s]+)/g;var na=/\\frac\s*\{([^{}]*)\}\s*\{([^{}]*)\}/g,ra=/(\\(?:mathbf|textbf|textit|underline|texttt)\{[^{}]*\})/g;var sa=/\\multiply|\\mul|\\times/g,ia=/\\div/g,la=/\\cdot/g,aa=/\\infty/g,da=/\\pm/g,ca=/\\leq/g,ua=/\\geq/g,ma=/\\neq/g,ga=/\\sqrt\s*\{([^}]+)\}/g,fa=/\\sqrt\s*(\w+|\d+)/g,ha=/\\alpha/g,xa=/\\beta/g,pa=/\\theta/g,Ta=/\\pi/g,wa=/\\approx/g,ya=/\\Delta/g,ba=/\\sigma/g,Sa=/\\sum/g,Ca=/\\prod/g,va=/\\rightarrow|\\to/g,Ma=/\\left\b|\\right\b/g,Ea=/\\left\(|\\right\)/g,Ba=/\\left\[|\\right\]/g,Da=/\\\{|\\\}/g,ka=/\\text\s*\{([^}]+)\}/g,Ia=/\\text\s+(\w+)/g,Aa=/\\%/g,La=/\\\(|\\\)/g,_a=/\\\[|\\\]/g,Oa=/@\[(.*?)\]/g,Pi=/:L/gi,Pa=/\[(.*?)\]\s*\((.*?)\)/,Na=/\[(.*?)\]\s*\[(.*?)\]/,Fa=/\\(\w+)\{([^{}]*)\}/,Ua=t=>t.replace(La,u=>u.includes("(")?"(":")").replace(_a,u=>u.includes("[")?"[":"]").replace(sa,"\xD7").replace(ia,"\xF7").replace(la,"\u22C5").replace(aa,"\u221E").replace(da,"\xB1").replace(ca,"\u2264").replace(ua,"\u2265").replace(ma,"\u2260").replace(ga,"\u221A($1)").replace(fa,"\u221A($1)").replace(ha,"\u03B1").replace(xa,"\u03B2").replace(pa,"\u03B8").replace(Ta,"\u03C0").replace(wa,"\u2248").replace(ya,"\u0394").replace(ba,"\u03C3").replace(Sa,"\u03A3").replace(Ca,"\u03A0").replace(va,"\u2192").replace(Ma,"").replace(Ea,u=>u.includes("left")?"(":")").replace(Ba,u=>u.includes("left")?"[":"]").replace(Da,u=>u.includes("{")?"{":"}").replace(ka,"$1").replace(Ia,"$1").replace(Aa,"%"),$a=/\b(const|let|var|function|return|if|else|for|while|do|switch|case|break|continue|import|export|from|default|class|extends|new|this|typeof|instanceof|try|catch|finally|throw|async|await|yield|public|private|protected|static|void|int|float|double|char|bool|boolean|def|elif|fn|pub|mut|struct|impl|enum|type|interface|package|namespace|using|include|define|nil|None|self|lambda)\b/,Ha=[/((?<=\binclude\s+)(?:<[^>]+>|"[^"]+"))/.source,/((?<=\b(?:from|import|require\s*\(\s*)\s*)(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"))/.source,/(\/\/.*|#.*)/.source,/("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^\`\\])*`)/.source,$a.source,/\b([a-zA-Z_][a-zA-Z0-9_]*)(?=\s*\()/.source,/\b(true|false|null|undefined|nil|None)\b/.source,/\b(\d+(?:\.\d+)?|0x[0-9a-fA-F]+)\b/.source],Qr=new RegExp(Ha.join("|"),"g"),en=new Map,Xa=1e3,Wa=(t,u)=>{if(!t)return[];let x=`${u}:${t}`;if(en.has(x))return en.get(x);let b=0,p=[],f;for(Qr.lastIndex=0;(f=Qr.exec(t))!==null;){let i=f[0],B=f.index;B>b&&p.push({text:lt(t.substring(b,B))});let c,v=!1;f[1]||f[2]?c="#ce9178":f[3]?c="#9ece6a":f[4]?c="#fcfca4":f[5]?(c="#ff7b72",v=!0):f[6]?c="#b392f0":(f[7]||f[8])&&(c="#ff9e64"),p.push({text:lt(i),color:c,bold:v}),b=Qr.lastIndex}if(b<t.length&&p.push({text:lt(t.substring(b))}),en.size>=Xa){let i=en.keys().next().value;en.delete(i)}return en.set(x,p),p},At=(t,u,x=void 0,b=void 0)=>{if(!t)return r.createElement(te,{backgroundColor:b}," ");let p=Wa(t,u);return r.createElement(te,{color:x,backgroundColor:b},p.map((f,i)=>r.createElement(te,{key:i,color:f.color||x,backgroundColor:b,bold:f.bold},f.text)))},zr=(t,u)=>{if(!t)return null;let x=t.replace(na,"($1/$2)");x=Ua(x);let b=x.split(ra);return r.createElement(r.Fragment,{key:u},b.map((p,f)=>{if(p.startsWith("\\")){let i=p.match(Fa);if(i){let B=i[1],c=i[2];return r.createElement(te,{key:f,bold:B==="mathbf"||B==="textbf",italic:B==="textit",underline:B==="underline",color:B==="texttt"?"cyan":void 0},c)}}return p}))},bo=r.memo(({text:t,color:u,italic:x,theme:b="Dark"})=>{if(!t)return null;let p=Ye(b),f=u||p.text,i=p.codeText||p.logoGradient&&p.logoGradient[0]||p.info||p.secondary||"cyan",B=t.split(oa);return r.createElement(te,{color:f,wrap:"anywhere",italic:x},B.map((c,v)=>{if(!c)return null;if(c.startsWith("```")&&c.endsWith("```")){let M=c.slice(3,-3);return r.createElement(te,{key:v,color:i},M)}if(c.startsWith("**")&&c.endsWith("**"))return r.createElement(te,{key:v,bold:!0,color:f},r.createElement(bo,{text:c.slice(2,-2),color:f,theme:b}));if(c.startsWith("*")&&c.endsWith("*"))return r.createElement(te,{key:v,italic:!0,color:f},r.createElement(bo,{text:c.slice(1,-1),color:f,italic:x,theme:b}));if(c.startsWith("`"))if(c.endsWith("`")&&c.length>1){let M=c.slice(1,-1),$=M.replace(Oa,(O,D)=>D.split("/").pop().split("\\").pop().replace(Pi,"#L")),E=M.includes("@[");return r.createElement(te,{key:v,color:i,bold:E},$)}else return r.createElement(te,{key:v,color:i},c.slice(1));if(c.startsWith("@[")&&c.endsWith("]")){let $=c.slice(2,-1).split("/").pop().split("\\").pop().replace(Pi,"#L");return r.createElement(te,{key:v,color:i,bold:!0},$)}if(c.startsWith("\\(")&&c.endsWith("\\)")||c.startsWith("\\[")&&c.endsWith("\\]")){let M=c.slice(2,-2);return r.createElement(te,{key:v,color:"yellow"},zr(M,v))}if(c.startsWith("$")&&c.endsWith("$")){let M=c.slice(1,-1);return r.createElement(te,{key:v,color:"yellow"},zr(M,v))}if(c.startsWith("[")&&(c.includes("](")||c.includes("] ("))){let M=c.match(Pa);if(M)return r.createElement(te,{key:v},r.createElement(te,{color:i,underline:!0,bold:!0},M[1]),r.createElement(te,{color:"gray",italic:!0}," (",M[2],")"))}if(c.startsWith("[")&&(c.includes("][")||c.includes("] ["))){let M=c.match(Na);if(M)return r.createElement(te,{key:v},r.createElement(te,{color:i,underline:!0,bold:!0},M[1]),r.createElement(te,{color:"gray",italic:!0}," [",M[2],"]"))}return c.startsWith("http")?r.createElement(te,{key:v,color:i,underline:!0,italic:!0},c):zr(c,v)}))}),Ni=r.memo(({buffer:t,terminalWidth:u=80,theme:x="Dark"})=>{if(t.length<2)return null;let b=Ye(x),p=b.codeText||b.secondary||b.info||"cyan",f=t.map($=>{let E=$.split("|");return E[0]!==void 0&&E[0].trim()===""&&E.shift(),E.length>0&&E[E.length-1].trim()===""&&E.pop(),E.map(O=>O.trim())}),i=f[0],B=f.slice(2),c=Math.floor(100/i.length),v=u-8,M=Math.floor(v/i.length)-2;return r.createElement(k,{flexDirection:"column",borderStyle:"round",borderColor:b.borderMuted,paddingX:1,marginY:0,width:u-2},r.createElement(k,{flexDirection:"row",borderStyle:"single",borderBottom:!0,borderTop:!1,borderLeft:!1,borderRight:!1,borderColor:b.borderMuted,marginBottom:1,paddingBottom:0,width:"100%"},i.map(($,E)=>r.createElement(k,{key:E,flexBasis:`${c}%`,flexGrow:1,flexShrink:0,paddingRight:2},r.createElement(bo,{text:gt($,M),color:p,theme:x})))),B.map(($,E)=>r.createElement(k,{key:E,flexDirection:"row",marginBottom:E===B.length-1?0:1,width:"100%"},$.map((O,D)=>r.createElement(k,{key:D,flexBasis:`${c}%`,flexGrow:1,flexShrink:0,paddingRight:2,flexDirection:"column"},r.createElement(bo,{text:gt(O,M),color:b.text,theme:x}))))))}),tn=r.memo(({text:t,color:u,columns:x=80,italic:b=!1,theme:p="Dark"})=>{if(!t)return null;let f=Ye(p),i=u||f.text,B=t.split(`
|
|
19
|
+
`),c=[],v=[],M=[],$=E=>{if(v.length>0&&(c.push(r.createElement(Ni,{key:`table-${E}`,buffer:[...v],terminalWidth:x,theme:p})),v=[]),M.length>0){let O=x-6,D=M.flatMap(A=>gt(A,O).split(`
|
|
20
|
+
`));c.push(r.createElement(k,{key:`quote-${E}`,borderStyle:"bold",borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:f.borderMuted,paddingLeft:1,marginY:1,flexDirection:"column"},D.map((A,N)=>r.createElement(bo,{key:N,text:A,color:f.textMuted,italic:b,theme:p})))),M=[]}};return B.forEach((E,O)=>{let D=E.trim(),A=D.startsWith("|"),N=D.startsWith(">");if(A)M.length>0&&$(O),v.push(E);else if(N)v.length>0&&$(O),M.push(D.replace(/^>\s*/,""));else{if($(O),D===""){c.push(r.createElement(k,{key:O,height:1}));return}if(D==="---"||D==="***"||D==="___"){c.push(r.createElement(k,{key:O,marginY:0,borderStyle:"single",borderTop:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,width:"100%",borderColor:f.borderMuted}));return}let Z=D.match(/^(#{1,6})\s+(.*)/);if(Z){let W=Z[1].length,ie=Z[2];c.push(r.createElement(k,{key:O,marginTop:1,marginBottom:0,width:"100%"},r.createElement(te,{bold:!0,color:W===1?"cyan":W===2?"magenta":W===3?"yellow":W===4?"green":W===5?"blue":f.text,underline:!0},ie)));return}let R=/^[\*\-\+]\s/.test(D),ce=/^\d+\.\s/.test(D),ge=E.includes("\u2588")||E.includes("\u2554")||E.includes("\u255A")||E.includes("\u2550"),Y="";if(ge)Y=E;else if(R||ce){let W=R?" \u2022 ":D.match(/^\d+\.\s/)[0],ie=" ".repeat(W.length),Ee=gt(D.replace(/^[\*\-\d+\.]+\s/,""),x-(W.length+6));Y=W+Ee.split(`
|
|
21
|
+
`).join(`
|
|
22
|
+
`+ie)}else Y=gt(D,x-4);c.push(r.createElement(k,{key:O,flexDirection:"column",width:"100%"},r.createElement(bo,{text:Y,color:i,italic:b,theme:p})))}}),$("final"),r.createElement(k,{flexDirection:"column",width:x-2},c)}),Fi=r.memo(({line:t,pairContent:u,parentText:x,columns:b=80,extension:p,theme:f="Dark"})=>{let i=Ye(f),B=t.includes("[UI_CONTEXT]"),c=t.replace("[UI_CONTEXT]","");if(B&&c.includes("\u2550"))return r.createElement(k,{backgroundColor:i.codeBg,paddingX:1,width:b},r.createElement(te,{color:"gray"},"\u2550".repeat(Math.max(10,b-4))));let v=Xr(t);if(!v)return r.createElement(k,{backgroundColor:i.codeBg,paddingX:1,width:b},r.createElement(k,{width:3,flexShrink:0}),r.createElement(k,{width:1,flexShrink:0,marginLeft:1}),r.createElement(k,{flexGrow:1,marginLeft:1},r.createElement(te,{color:"gray"},gt(c,b-14))));let{isR:M,isA:$,num:E,content:O}=v,D=u,A=[];if(D!=null){let ie=M?O:D,Ee=M?D:O;try{A=ea(ie,Ee)}catch{A=[]}}let N=A.some(ie=>M&&ie.removed||$&&ie.added),Z=!D&&(M||$),R=M?i.diffRemovalBg:$?i.diffAdditionBg:void 0,ce=M||$?M?i.diffRemovalNum:i.diffAdditionNum:i.textMuted,ge=M?i.diffRemovalPrefix:i.diffAdditionPrefix,Y=M?"-":$?"+":" ",W=()=>{if(Z){let K=M?i.diffRemovalHighlightBg:i.diffAdditionHighlightBg;return r.createElement(k,{flexDirection:"column"},At(gt(O,b-15),p,void 0,K))}if(!(M||$)||A.length===0||!N){let K=M?i.diffRemovalText:$?i.diffAdditionText:i.textMuted;return r.createElement(k,{flexDirection:"column"},At(gt(O,b-15),p,K,void 0))}let ie=Math.max(10,b-15),Ee=gt(O,ie).split(`
|
|
23
|
+
`),xe=[];if(A.forEach((K,_)=>{let q=/^\s+$/.test(K.value);if(M){let oe=A[_-1]?.removed||A[_+1]?.removed;K.removed||q&&oe?xe.push({text:K.value,isHighlight:!0}):K.added||xe.push({text:K.value,isHighlight:!1})}else if($){let oe=A[_-1]?.added||A[_+1]?.added;K.added||q&&oe?xe.push({text:K.value,isHighlight:!0}):K.removed||xe.push({text:K.value,isHighlight:!1})}}),Ee.length<=1)return r.createElement(te,{wrap:"wrap"},xe.map((K,_)=>M?K.isHighlight?r.createElement(r.Fragment,{key:_},At(K.text,p,i.diffRemovalHighlightColor,i.diffRemovalHighlightBg)):r.createElement(r.Fragment,{key:_},At(K.text,p,i.diffRemovalText)):$?K.isHighlight?r.createElement(r.Fragment,{key:_},At(K.text,p,i.diffAdditionHighlightColor,i.diffAdditionHighlightBg)):r.createElement(r.Fragment,{key:_},At(K.text,p,i.diffAdditionText)):r.createElement(r.Fragment,{key:_},At(K.text,p,i.textMuted))));let Ae=0,le=0,Q=O.match(/^(\s*)/),pe=Q?Q[1]:"",fe=pe.substring(0,Math.min(pe.length,8)),ue=Ee.map((K,_)=>{let q=[],oe=K;_>0&&fe&&K.startsWith(fe)&&((xe[Ae]?xe[Ae].text.substring(le):"").startsWith(fe)||(q.push({text:fe,isHighlight:!1}),oe=K.substring(fe.length)));let ve=oe.length;for(;ve>0&&Ae<xe.length;){let Oe=xe[Ae],Me=Oe.text.length-le;if(Me<=0){Ae++,le=0;continue}let z=Math.min(ve,Me);q.push({text:Oe.text.substring(le,le+z),isHighlight:Oe.isHighlight}),le+=z,ve-=z,le>=Oe.text.length&&(Ae++,le=0)}for(;Ae<xe.length;){let Oe=xe[Ae],Me=Oe.text.substring(le);if(/^\s+$/.test(Me))Ae++,le=0;else if(Me.startsWith(" ")||Me.startsWith(" ")){let z=0;for(;z<Me.length&&(Me[z]===" "||Me[z]===" ");)z++;le+=z,le>=Oe.text.length&&(Ae++,le=0);break}else break}return q});if(Ae<xe.length){let K=ue[ue.length-1];for(;Ae<xe.length;){let _=xe[Ae];K.push({text:_.text.substring(le),isHighlight:_.isHighlight}),Ae++,le=0}}return r.createElement(k,{flexDirection:"column"},ue.map((K,_)=>r.createElement(k,{key:_},r.createElement(te,{wrap:"wrap"},K.map((q,oe)=>M?q.isHighlight?r.createElement(r.Fragment,{key:oe},At(q.text,p,i.diffRemovalHighlightColor,i.diffRemovalHighlightBg)):r.createElement(r.Fragment,{key:oe},At(q.text,p,i.diffRemovalText)):$?q.isHighlight?r.createElement(r.Fragment,{key:oe},At(q.text,p,i.diffAdditionHighlightColor,i.diffAdditionHighlightBg)):r.createElement(r.Fragment,{key:oe},At(q.text,p,i.diffAdditionText)):r.createElement(r.Fragment,{key:oe},At(q.text,p,i.textMuted)))))))};return r.createElement(k,{backgroundColor:i.codeBg,paddingX:1,width:b},r.createElement(k,{width:4,flexShrink:0,justifyContent:"flex-end"},r.createElement(te,{color:ce},E)),r.createElement(k,{width:1,flexShrink:0,marginLeft:1},r.createElement(te,{color:ge},Y)),r.createElement(k,{marginLeft:1,backgroundColor:R,flexGrow:1},W()))}),Ga=r.memo(({text:t,columns:u=80,extension:x,theme:b="Dark"})=>{let p=Ye(b),f=t.match(/\[DIFF_START\]([\s\S]*?)(?:\[DIFF_END\]|$)/),c=(f?f[1].trim():"").split(`
|
|
24
|
+
`).map(M=>({line:M,parsed:Xr(M),pairContent:null})),v=[];for(let M=0;M<c.length;M++){let $=c[M];$.parsed&&($.parsed.isR||$.parsed.isA)?v.push($):v.length>0&&(Wr(v),v=[])}return v.length>0&&Wr(v),r.createElement(k,{flexDirection:"column",width:u-3,marginBottom:1},r.createElement(k,{flexDirection:"column",paddingY:0,width:"100%"},r.createElement(k,{backgroundColor:p.codeBg,paddingX:1,width:"100%"},r.createElement(k,{width:3,flexShrink:0}),r.createElement(k,{width:1,flexShrink:0,marginLeft:1}),r.createElement(k,{flexGrow:1,marginLeft:1},r.createElement(te,null," "))),c.map((M,$)=>r.createElement(Fi,{key:$,line:M.line,pairContent:M.pairContent,columns:u-3,extension:x,theme:b})),r.createElement(k,{backgroundColor:p.codeBg,paddingX:1,width:"100%"},r.createElement(k,{width:3,flexShrink:0}),r.createElement(k,{width:1,flexShrink:0,marginLeft:1}),r.createElement(k,{flexGrow:1,marginLeft:1},r.createElement(te,null," ")))))}),Mn=r.memo(({text:t,columns:u=80,theme:x="Dark"})=>{if(!t)return null;let b=Ye(x),p="",f=t.match(/File\s+\[(.*?)\]/i);if(f&&(p=f[1].split(".").pop().toLowerCase()),t.includes("[DIFF_START]"))return r.createElement(Ga,{text:t,columns:u,extension:p,theme:x});if(t.includes("- Content Preview:")){let i=t.split("- Content Preview:"),B=i[0],c=i[1]||"",v="[SYSTEM] Check the content preview for verification [/SYSTEM]",M=c.split(v),$=M[0]?.trim()||"",E=M[1]?`${v}${M[1]}`:"",O=$.split(`
|
|
25
|
+
`),D=String(O.length).length;return r.createElement(k,{flexDirection:"column",width:u-3},r.createElement(k,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:b.codeBorder,paddingLeft:2,paddingRight:0,width:"100%",marginBottom:1,backgroundColor:b.codeBg},r.createElement(k,{flexDirection:"column",width:"100%"},r.createElement(k,{width:"100%"},r.createElement(k,{width:D+2,flexShrink:0},r.createElement(te,null," ")),r.createElement(k,{flexGrow:1},r.createElement(te,null," "))),O.map((A,N)=>r.createElement(k,{key:N,width:"100%"},r.createElement(k,{width:D+2,flexShrink:0},r.createElement(te,{color:"gray",dimColor:!0},String(N+1).padStart(D," ")," ")),r.createElement(k,{flexGrow:1},At(A,p,b.text)))),r.createElement(k,{width:"100%"},r.createElement(k,{width:D+2,flexShrink:0},r.createElement(te,null," ")),r.createElement(k,{flexGrow:1},r.createElement(te,null," "))))))}if(t.includes("```")){let i=t.split(/(```\w*\n?[\s\S]*?(?:```|$))/g);return r.createElement(k,{flexDirection:"column",width:u-3},i.map((B,c)=>{if(B.startsWith("```")){let M=B.match(/```(\w*)\n?([\s\S]*?)(?:```|$)/),$=M?M[1]:"code",E=M?M[2]:B.replace(/^```\w*\n?/,"").replace(/```$/,""),O=E.trimEnd().split(`
|
|
26
|
+
`),D=String(O.length).length,A=u-7-D,Z=(A>5?gt(E,A):E).trimEnd().split(`
|
|
27
|
+
`);return r.createElement(k,{key:c,flexDirection:"column",marginY:0,paddingLeft:2,paddingRight:0,width:"100%"},r.createElement(k,null,r.createElement(te,{color:"gray",bold:!0},"\u25B6_ ",$.toUpperCase()||"CODE")),r.createElement(k,{flexDirection:"column",width:"100%"},Z.map((R,ce)=>{let Y=gt(R,Math.max(10,A)).split(`
|
|
28
|
+
`);return r.createElement(k,{key:ce,flexDirection:"column",width:"100%"},Y.map((W,ie)=>r.createElement(k,{key:ie,width:"100%"},r.createElement(k,{width:D+2,flexShrink:0},r.createElement(te,{color:"gray"},ie===0?String(ce+1).padStart(D," ")+" ":" ".repeat(D+1))),r.createElement(k,{flexGrow:1},At(W,$,b.text)))))})))}let v=B;return c>0&&(v=v.replace(/^[\r\n]+/,"")),c<i.length-1&&(v=v.replace(/[\r\n]+$/,"")),v?r.createElement(tn,{key:c,text:v,columns:u-3,theme:x}):null}))}return r.createElement(tn,{text:t,columns:u-3,theme:x})}),Jr=t=>{let u=Math.round(t/1e3);if(u<=0)return"0s";let x=Math.floor(u/60),b=u%60;return x>0?`${x}m ${b}s`:`${u}s`},Ui=r.memo(({msg:t,showFullThinking:u,columns:x=80,aiProvider:b,version:p,theme:f="Dark"})=>{let i=Ye(f),B=t.role==="system"&&(t.text?.includes("[DIFF_START]")||t.text?.includes("- Content Preview:")),c=t.role==="system"&&t.text?.includes("[TOOL RESULT]: ERROR:")&&!t.text?.includes("[DIFF_START]")&&(t.toolName==="update_file"||t.text?.includes("Could not find exact match")),v=t.isTerminalRecord;if(t.isHomeWarning)return r.createElement(k,{marginBottom:1,paddingX:1,width:"100%"},r.createElement(k,{flexDirection:"column",borderStyle:"round",borderColor:i.border,dimColor:!0,padding:0,width:"100%"},r.createElement(k,{paddingX:1},r.createElement(te,{color:i.text,bold:!0},t.text)),r.createElement(k,{paddingX:1,marginTop:0,marginBottom:0},r.createElement(te,{color:i.text},t.subText))));if(t.isLogo)return r.createElement(k,{flexDirection:"column",alignItems:"flex-start",width:"100%",marginY:1},r.createElement(te,null,Qn(p,b,f)));if(t.id&&String(t.id).startsWith("welcome"))return r.createElement(k,{flexDirection:"column",alignItems:"center",width:"100%",marginY:1},r.createElement(k,{borderStyle:"round",borderColor:i.borderMuted,paddingX:3,paddingY:0},r.createElement(te,{color:i.text,bold:!0},t.text.trim())));if(t.isVisualFeedback)return r.createElement(k,{marginBottom:0,marginTop:0,paddingX:0,width:"100%"},r.createElement(te,{color:i.text},t.text));if(c)return r.createElement(k,{marginBottom:1},r.createElement(k,{flexDirection:"column",borderStyle:"round",borderColor:i.border,paddingX:1,paddingY:0},r.createElement(te,{color:i.text,bold:!0,underline:!0},"\u2717 PATCH FAILED"),r.createElement(k,{marginTop:1},r.createElement(te,{color:i.textMuted,bold:!0},"Model generated malformed edit."))));if(t.role==="system"&&t.text?.includes("[TOOL RESULT]")&&!B&&!v&&!c)return null;if(t.isImageStats)return r.createElement(k,{marginBottom:1,paddingX:1,width:"100%"},r.createElement(k,{flexDirection:"column",borderStyle:"round",borderColor:i.borderMuted,padding:0,width:"100%"},r.createElement(k,{paddingX:1,backgroundColor:i.codeBg},r.createElement(te,{color:i.text,bold:!0},"IMAGE STATS")),r.createElement(k,{paddingX:1,marginTop:1,marginBottom:1,flexDirection:"column"},t.text.split(`
|
|
29
|
+
`).map((A,N)=>r.createElement(te,{key:N,color:i.textMuted},A)))));if(t.isAskRecord){let A=t.text.match(/Selection: (.*)/),N=A?A[1]:"No selection",Z=t.text.match(/Question: (.*)/),R=Z?Z[1]:null;return r.createElement(k,{marginBottom:0,paddingX:1,width:"100%"},r.createElement(k,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!0,borderBottom:!0,borderColor:i.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,width:x-2},r.createElement(k,{paddingX:1},r.createElement(te,{color:i.success,bold:!0},"AGENT REQUEST: RESOLVED")),R&&r.createElement(k,{paddingX:1,marginTop:1},r.createElement(te,{color:i.secondary},R)),r.createElement(k,{paddingX:1,marginTop:1,marginBottom:0},r.createElement(te,{color:i.text},"Selection: ",r.createElement(te,{color:i.textMuted,bold:!0},N)))))}if(t.isAboutRecord)return r.createElement(k,{marginBottom:0,paddingX:1,width:"100%"},r.createElement(k,{flexDirection:"column",borderStyle:"round",border:!0,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:i.codeBg,width:"100%"},r.createElement(k,{paddingX:1},r.createElement(te,{color:i.text,bold:!0},"ABOUT FLUX FLOW")),r.createElement(k,{paddingX:1,marginTop:1,marginBottom:1},r.createElement(te,{color:i.text},t.text))));if(t.isUpdateNotification)return r.createElement(k,{marginBottom:1,paddingX:1,width:"100%"},r.createElement(k,{flexDirection:"column",borderStyle:"round",border:!0,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:i.codeBg,width:"100%"},r.createElement(k,{paddingX:1},r.createElement(te,{color:i.text,bold:!0},"UPDATE AVAILABLE")),r.createElement(k,{paddingX:1,marginTop:1,marginBottom:1},r.createElement(Mn,{text:t.text,columns:x,theme:f}))));if(t.isHelpRecord){let A=[{cmd:"/quit",desc:"Exit and shutdown Flux"},{cmd:"/help",desc:"Show all available commands"},{cmd:"/compress",desc:"Summarize and compress chat history"},{cmd:"/truncate",desc:"Truncate tool results in chat history"},{cmd:"/clear",desc:"Clear terminal screen"},{cmd:"/resume",desc:"Load previous session"},{cmd:"/revert",desc:"Revert codebase to checkpoint"},{cmd:"/save",desc:"Force save current chat"},{cmd:"/export",desc:"Export current chat or error logs",subs:[{cmd:"chat",desc:"Export current active chat"},{cmd:"logs",desc:"Export error logs"}]},{cmd:"/chats",desc:"List all chat sessions"},{cmd:"/btw",desc:"Send raw inquiry mid-turn"},{cmd:"/image",desc:"Generate images"},{cmd:"/budget",desc:"Set or View budget limits"},{cmd:"/mode",desc:"Toggle Flux/Flow modes"},{cmd:"/thinking",desc:"Set AI reasoning depth"},{cmd:"/model",desc:"Switch AI model"},{cmd:"/wildcard-tooling",desc:"Use if the model lacks Tooling Capability"},{cmd:"/provider",desc:"Select AI Provider"},{cmd:"/settings",desc:"Configure system prefs"},{cmd:"/theme",desc:"Customize UI color theme"},{cmd:"/key",desc:"Manage API keys"},{cmd:"/profile",desc:"Edit developer persona"},{cmd:"/memory",desc:"Manage agent memory"},{cmd:"/stats",desc:"Show session usage"},{cmd:"/reset",desc:"Wipe all project data"},{cmd:"/about",desc:"Project info & credits"},{cmd:"/changelog",desc:"View latest updates"},{cmd:"/docs",desc:"View documentation"},{cmd:"/fluxflow",desc:"Project management"},{cmd:"/update",desc:"Check/Install updates"}];return r.createElement(k,{marginBottom:1,paddingX:1,width:"100%"},r.createElement(k,{flexDirection:"column",borderStyle:"round",borderColor:i.borderMuted,paddingX:2,paddingY:1,width:"100%"},r.createElement(te,{color:i.text,bold:!0,underline:!0},"COMMAND REFERENCE"),r.createElement(k,{flexDirection:"column",marginTop:1},A.map((N,Z)=>r.createElement(k,{key:Z,flexDirection:"row"},r.createElement(k,{width:15},r.createElement(te,{color:i.text,bold:!0},N.cmd)),r.createElement(te,{color:i.textMuted}," - ",N.desc))))))}if(t.isTerminalRecord){let A=t.text.match(/COMMAND: (.*)/),N=t.text.match(/PTY: (true|false)/),Z=t.text.match(/OUTPUT: ([\s\S]*)/),R=A?A[1]:"No Command",ce=N?N[1]==="true":!1,ge=Z?Z[1]:"";return r.createElement(k,{marginBottom:0,paddingX:1,width:"100%"},r.createElement(rr,{command:R,output:ge,completed:!0,columns:x,isPty:ce,theme:f}))}let[$,E]=r.useState(!t.isStreaming),O=r.useMemo(()=>li(t.text,t.role==="think"),[t.text,t.role]);r.useEffect(()=>{t.isStreaming&&E(!1)},[t.id]);let D=r.useMemo(()=>t.role==="think"&&!u?"Thinking...":t.isStreaming?O:O.trimEnd(),[O,t.role,u,t.isStreaming]);return t.role==="agent"&&D.trim()===""?null:r.createElement(k,{marginBottom:(t.role==="think"||t.role==="user"||t.role==="agent",0),marginTop:(t.role==="think"||t.role==="user"||t.role==="agent",0),flexDirection:"column",flexShrink:0,width:"100%",flexGrow:1},t.role==="user"?r.createElement(k,{flexDirection:"column",width:x-1},r.createElement(k,{width:x-1,height:1,overflow:"hidden"},r.createElement(te,{color:i.userMsgBorder},"\u2584".repeat(Math.max(1,x-1)))),r.createElement(k,{backgroundColor:i.userMsgBg,paddingX:1,paddingY:0,width:x-1,flexDirection:"column"},gt(D.replace(/\r\n/g,`
|
|
30
|
+
`).replace(/\r/g,`
|
|
31
|
+
`).replace(/\\\n/g,`
|
|
32
|
+
`).replace(/\\$/,""),x-7).split(`
|
|
33
|
+
`).map((A,N)=>r.createElement(k,{key:N,flexDirection:"row",width:"100%"},r.createElement(k,{flexShrink:0,width:2},r.createElement(te,{bold:!0,color:i.userMsgText},N===0?">":" ")),r.createElement(k,{flexGrow:1,marginLeft:1},r.createElement(bo,{text:A,color:t.color||i.userMsgText,theme:f}))))),r.createElement(k,{width:x-1,height:1,overflow:"hidden"},r.createElement(te,{color:i.userMsgBorder},"\u2580".repeat(Math.max(1,x-1))))):t.role==="think"?r.createElement(k,{flexDirection:"column",marginTop:0,marginBottom:0,paddingX:0,width:"100%"},t.isStreaming&&!t.duration?r.createElement(te,{bold:!0,color:i.text},"\u2727 Thinking..."):r.createElement(te,{bold:!0,color:i.text},"\u2726 Thought",t.duration?r.createElement(te,{color:i.textMuted}," for ",r.createElement(te,{bold:!0,color:i.text},Jr(t.duration))):"s..."),r.createElement(k,{borderStyle:"single",borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:i.borderMuted,paddingLeft:2,paddingTop:0,paddingBottom:0,flexDirection:"column",width:"100%"},ta(D,x))):r.createElement(k,{flexDirection:"column",paddingX:1,marginTop:0,width:"100%"},r.createElement(Mn,{text:D.replace(/ \|\n\n/g,` |
|
|
34
|
+
`),columns:x,theme:f}),t.memoryUpdated&&r.createElement(k,{marginTop:1,width:"100%"},r.createElement(te,{color:i.text,italic:!0},"[Memory Updated]")),t.role==="agent"&&t.workedDuration?r.createElement(k,{marginTop:1,marginBottom:2,width:"100%"},r.createElement(te,{color:i.textMuted},"["),r.createElement(te,{color:i.textMuted},"Worked for ",r.createElement(te,{bold:!0,color:i.text},Jr(t.workedDuration))),r.createElement(te,{color:i.textMuted},"]")):null))}),sr=r.memo(({block:t,columns:u=80,showFullThinking:x,aiProvider:b,version:p,theme:f="Dark"})=>{let i=Ye(f),{msg:B,type:c,text:v,isStreamingMsg:M,workedDuration:$}=t;if(c==="chunk")return r.createElement(k,{flexDirection:"column",width:"100%"},t.blocks.map(E=>r.createElement(sr,{key:E.key,block:E,columns:u,showFullThinking:x,aiProvider:b,version:p,theme:f})));if(c==="full-message")return r.createElement(Ui,{msg:B,showFullThinking:x,columns:u,aiProvider:b,version:p,theme:f});if(c==="think-header")return r.createElement(k,{flexDirection:"column",paddingX:1,width:"100%",marginTop:0,marginBottom:0},M?r.createElement(te,{bold:!0,color:i.text},"\u2727 Thinking..."):r.createElement(te,{bold:!0,color:i.text},"\u2726 Thoughts..."),x&&r.createElement(k,{flexDirection:"row",width:"100%"},r.createElement(te,{color:i.textMuted},"\u2502 ")));if(c==="think-line"){if(!x)return null;if(!v||v.trim()==="")return r.createElement(k,{flexDirection:"row",width:"100%",paddingX:1},r.createElement(te,{color:i.textMuted},"\u2502 "));let E=Oi(v,M,t.isActiveBlock),O=E.trim(),D=/^[\*\-\+]\s/.test(O),A=/^\d+\.\s/.test(O),N=E;if(D||A){let R=D?" \u2022 ":O.match(/^\d+\.\s/)[0],ce=" ".repeat(R.length),ge=gt(O.replace(/^[\*\-\d+\.]+\s/,""),u-(R.length+10));N=R+ge.split(`
|
|
35
|
+
`).join(`
|
|
36
|
+
`+ce)}else N=gt(E,u-10);let Z=N.split(`
|
|
37
|
+
`);return r.createElement(k,{flexDirection:"column",paddingX:1,width:"100%"},Z.map((R,ce)=>r.createElement(k,{key:ce,flexDirection:"row",width:"100%"},r.createElement(te,{color:i.textMuted},"\u2502 "),r.createElement(k,{flexGrow:1,marginLeft:1},r.createElement(bo,{text:R,color:i.textMuted,italic:!0,theme:f})))))}if(c==="think-footer-padding")return x?r.createElement(k,{flexDirection:"row",width:"100%",paddingX:1},r.createElement(te,{color:i.textMuted},"\u2502 ")):null;if(c==="agent-line"){if(!v||v.trim()==="")return r.createElement(k,{height:1});let E=Oi(v,M,t.isActiveBlock);return r.createElement(k,{flexDirection:"column",paddingX:1,width:"100%"},r.createElement(Mn,{text:E,columns:u,theme:f}))}if(c==="table")return r.createElement(k,{flexDirection:"column",paddingX:1,width:"100%"},r.createElement(Ni,{buffer:v.split(`
|
|
38
|
+
`),terminalWidth:u,theme:f}));if(c==="diff-line"){let{isFirstLine:E,isLastLine:O}=t,D=(A=!1)=>r.createElement(k,{backgroundColor:i.codeBg,paddingX:1,width:u,marginBottom:A?1:0},r.createElement(k,{width:3,flexShrink:0}),r.createElement(k,{width:1,flexShrink:0,marginLeft:1}),r.createElement(k,{flexGrow:1,marginLeft:1},r.createElement(te,null," ")));return r.createElement(k,{flexDirection:"column"},E&&D(!1),r.createElement(Fi,{line:v,pairContent:t.pairContent,parentText:void 0,columns:u,theme:f}),O&&D(!0))}if(c==="code-fence-open"){let E={paddingLeft:2,width:"100%"};return r.createElement(k,{flexDirection:"column",marginTop:0,marginBottom:0,width:"100%"},r.createElement(k,{flexDirection:"row",...E},r.createElement(te,null," ")),r.createElement(k,{flexDirection:"row",...E},r.createElement(te,{color:"gray",bold:!0},"\u25B6_ ",(v||"CODE").toUpperCase())))}if(c==="code-line"){let{lineNum:E,lang:O}=t,D=u-12,N=gt(v,Math.max(10,D)).split(`
|
|
39
|
+
`);return r.createElement(k,{flexDirection:"column",width:"100%"},N.map((Z,R)=>r.createElement(k,{key:R,flexDirection:"row",borderColor:i.codeBorder,paddingLeft:2,width:"100%"},r.createElement(k,{width:5,flexShrink:0},r.createElement(te,{color:"gray",dimColor:!0},R===0?String(E).padStart(4," ")+" ":" ")),r.createElement(k,{flexGrow:1},At(Z,O,i.text)))))}if(c==="code-fence-close")return r.createElement(k,{flexDirection:"row",paddingLeft:2,marginBottom:1,width:"100%"},r.createElement(te,null," "));if(c==="write-header")return r.createElement(k,{flexDirection:"column",paddingX:1,width:u},r.createElement(tn,{text:v,columns:u,theme:f}));if(c==="write-line"){let{gutterWidth:E,lineNum:O,isFirstLine:D,isLastLine:A,extension:N,wrappedLines:Z}=t,R=(ce=!1)=>r.createElement(k,{flexDirection:"row",width:u,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:i.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:i.codeBg,marginBottom:ce?1:0},r.createElement(k,{width:E+2,flexShrink:0},r.createElement(te,null," ".repeat(E+2))),r.createElement(k,{flexGrow:1},r.createElement(te,null," ")));return r.createElement(k,{flexDirection:"column"},D&&R(!1),r.createElement(k,{flexDirection:"row",width:u,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:i.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:i.codeBg},r.createElement(k,{width:E+2,flexShrink:0},r.createElement(te,{color:"gray",dimColor:!0},String(O).padStart(E," ")," ")),r.createElement(k,{flexGrow:1,flexDirection:"column"},(Z||[v]).map((ce,ge)=>r.createElement(k,{key:ge},At(ce,N,i.text))))),A&&R(!0))}return c==="write-footer"?r.createElement(k,{flexDirection:"column",paddingX:1,width:u,marginTop:1,marginBottom:1},r.createElement(tn,{text:v,columns:u,theme:f})):c==="worked-duration"?r.createElement(k,{marginTop:1,marginBottom:2,paddingX:1,width:"100%"},r.createElement(te,{color:i.textMuted},"["),r.createElement(te,{color:i.textMuted},"Worked for ",r.createElement(te,{bold:!0,color:i.text},Jr($))),r.createElement(te,{color:i.textMuted},"]")):null}),Tc=r.memo(({messages:t,showFullThinking:u,columns:x=80,aiProvider:b,version:p,theme:f="Dark"})=>r.createElement(k,{flexDirection:"column",width:"100%"},t.map((i,B)=>r.createElement(Ui,{key:i.id||B,msg:i,showFullThinking:u,columns:x,aiProvider:b,version:p,theme:f}))));import et from"react";import{Box as So,Text as qt}from"ink";import{useState as En,useEffect as Bn,useRef as ir}from"react";var Dn=null;function $i(){Dn&&Dn()}var Ya=t=>{if(t<=370)return"#00a564";if(t>=5e3)return"#ff0000";let u=[{t:370,r:0,g:165,b:100},{t:550,r:40,g:195,b:80},{t:800,r:120,g:220,b:50},{t:1100,r:190,g:225,b:20},{t:1500,r:250,g:210,b:15},{t:2e3,r:255,g:170,b:0},{t:2800,r:255,g:110,b:0},{t:3800,r:255,g:50,b:0},{t:5e3,r:255,g:0,b:0}];for(let x=0;x<u.length-1;x++){let b=u[x],p=u[x+1];if(t>=b.t&&t<=p.t){let f=(t-b.t)/(p.t-b.t);f=f*f*(3-2*f);let i=Math.round(b.r+(p.r-b.r)*f),B=Math.round(b.g+(p.g-b.g)*f),c=Math.round(b.b+(p.b-b.b)*f);return`#${((1<<24)+(i<<16)+(B<<8)+c).toString(16).slice(1)}`}}return"#ff0000"},ja=et.memo(({mode:t,thinkingLevel:u,tokens:x="0.0k",tokensTotal:b="0.0k",chatId:p="NEW-SESSION",isMemoryEnabled:f=!0,apiTier:i="Free",aiProvider:B="Google",activeModel:c="",isProcessing:v=!1,lastChunkTime:M=0,theme:$="Dark",wps:E=0,showTPMEstimate:O=!1})=>{let D=Ye($),A="",[N,Z]=En(0),[R,ce]=En(0),[ge,Y]=En("MB"),[W,ie]=En("green"),[Ee,xe]=En(0),Ae=ir([]),le=ir(370),Q=ir([]),pe=ir(M);Bn(()=>{pe.current=M},[M]),Bn(()=>{if(!v){Q.current=[];return}if(E>0){let _=Q.current;_.push(E),_.length>3&&_.shift()}},[v,E,M]),Bn(()=>{if(!v){xe(0);return}let _=setInterval(()=>{let q=pe.current,oe=q>0?Date.now()-q:0;if(q>0&&oe>1500)Q.current=[],xe(0);else if(q>0&&oe>600){Q.current.length>0&&Q.current.shift();let ve=Q.current;if(ve.length>0){let Oe=ve.reduce((z,Je)=>z+Je,0),Me=Math.round(Oe/ve.length*10)/10;xe(Me)}else xe(0)}else{let ve=Q.current;if(ve.length>0){let Oe=ve.reduce((z,Je)=>z+Je,0),Me=Math.round(Oe/ve.length*10)/10;xe(Me)}else E>0&&xe(E)}},1350);return()=>clearInterval(_)},[v]),Bn(()=>{if(!v){Ae.current=[];return}if(M>0){let oe=Ae.current;(oe.length===0||oe[oe.length-1]!==M)&&(oe.push(M),oe.length>10&&oe.shift())}let _=()=>{if(!M){ie("#00a564");return}let oe=Ae.current,ve=0;if(oe.length>1){let L=0;for(let he=1;he<oe.length;he++)L+=oe[he]-oe[he-1];ve=L/(oe.length-1)}let Oe=Date.now()-M,z=Oe>=2500,Je=!z&&ve>0?Math.min(Oe,ve*3):Oe,We=Math.max(ve,Je),st=z?.4:.2;le.current=le.current*(1-st)+We*st,ie(Ya(le.current))};_();let q=setInterval(_,100);return()=>clearInterval(q)},[v,M]);let fe=()=>{let _=process.memoryUsage(),q=_.heapTotal/(1024*1024)>=1024,oe=q?"GB":"MB",ve=(Oe,Me)=>{let z=Oe/(1048576*(Me?1024:1));return Me?parseFloat(z.toFixed(2)):Math.round(z)};Y(oe),ce(ve(_.heapTotal,q)),Z(ve(_.heapUsed,q))};Bn(()=>{Dn=fe,fe();let _=setInterval(()=>{fe()},6e4);return()=>{clearInterval(_),Dn===fe&&(Dn=null)}},[]);let ue=262144,K=process.env.HIGH_CONTEXT;if(K&&K!=="false"){let _=parseInt(K,10);!isNaN(_)&&_>=256e3&&_<=1e6&&(ue=_)}return(B==="NVIDIA"&&(c?.includes("glm")||c?.includes("gpt")||c?.includes("qwen")||c?.includes("medium"))||B==="Mistral")&&(ue=128e3),et.createElement(So,{flexDirection:"row",justifyContent:"space-between",paddingX:1,width:"100%"},et.createElement(So,null,t.toLowerCase()==="flow"&&et.createElement(et.Fragment,null,et.createElement(So,{marginRight:1},et.createElement(qt,{color:D.text,bold:!0},t.toUpperCase()),et.createElement(qt,{color:D.textMuted}," (Limited Tools)")),et.createElement(qt,{color:D.textMuted,dimColor:!0},"\u2503 ")),et.createElement(So,null,et.createElement(qt,{color:D.text,italic:!0},ii(process.cwd(),35)))),et.createElement(So,null,v?et.createElement(So,null,et.createElement(qt,{color:W},"\u25CF"),O&&et.createElement(et.Fragment,null,et.createElement(qt,{color:D.textMuted,bold:!0}," ",Ee," tps"),et.createElement(qt,{color:D.textMuted,dimColor:!0}," \u2503"))):null,x>0&&et.createElement(et.Fragment,null,et.createElement(So,{marginX:1},et.createElement(qt,{color:D.text},at(b)," ",(()=>{let _=x/ue*100,q=_<60?D.text:_<80?D.warning:D.danger;return et.createElement(qt,{color:q,dimColor:!0},_.toFixed(0),"%")})())),et.createElement(qt,{color:D.textMuted,dimColor:!0},"\u2503")),et.createElement(So,{marginLeft:1},et.createElement(qt,{color:D.textMuted,bold:!0},N," ",ge))))}),Hi=ja;import Xt from"react";import{Box as on,Text as lr}from"ink";import Va from"ink-select-input";var Ka=({label:t,isSelected:u,theme:x="Dark"})=>{let b=Ye(x),p=t==="Cancel"||t==="Back"||t.toLowerCase().includes("exit")||t.toLowerCase().includes("back");return Xt.createElement(on,{marginTop:p?1:0,backgroundColor:u?b.highlightBg:void 0,paddingX:1,width:"100%"},Xt.createElement(lr,{color:u?b.text:b.textMuted,bold:u},u?"\u276F ":" ",t))};function ft({title:t,subtitle:u,items:x,onSelect:b,theme:p="Dark"}){let f=Ye(p);return Xt.createElement(on,{flexDirection:"column",borderStyle:"round",borderColor:f.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},t&&Xt.createElement(on,{paddingX:1,paddingY:0,marginBottom:u?0:1},Xt.createElement(lr,{color:f.text,bold:!0},typeof t=="string"?t.toUpperCase():t)),u&&Xt.createElement(on,{paddingX:1,marginBottom:1},Xt.createElement(lr,{color:f.textMuted,italic:!0}," ",u)),Xt.createElement(on,{flexDirection:"column",width:"100%"},Xt.createElement(Va,{items:x,onSelect:b,itemComponent:i=>Xt.createElement(Ka,{...i,theme:p}),indicatorComponent:()=>null})),Xt.createElement(on,{paddingX:1,marginTop:1},Xt.createElement(lr,{color:f.textMuted,italic:!0},"(Arrows to select \u2022 Enter to confirm)")))}import C,{useState as Et,useEffect as ar}from"react";import{Box as Le,Text as H,useInput as qa}from"ink";import Qa from"ink-text-input";import za from"v8";var Zt=[...Object.keys(ai),"Mystery"],Rt=[{id:"appearance",label:"Appearance",desc:"Customize UI theme & rendering options"},{id:"memory",label:"Memory",desc:"Manage system context & agent's memory"},{id:"other",label:"Miscellaneous",desc:"Miscellaneous preferences"},{id:"providers",label:"Providers",desc:"Configure AI models"},{id:"security",label:"Security",desc:"Configure permissions & data safety"},{id:"updater",label:"Updater",desc:"Manage application updates"},{id:"exit",label:"Exit Settings",desc:"Return to chat view"}],Xi=t=>{let u=t.autoApproveCommands||"",x=t.autoDisallowCommands||"",b=t.alwaysAskCommands||"",p=t.autoExec===!1&&t.allowExternalAccess===!1&&t.networkAccess===!1&&u===""&&x==="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c"&&b==="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall"&&t.autoApproveGit===!1,f=t.autoExec===!0&&t.allowExternalAccess===!1&&t.networkAccess!==!1&&u==="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time, mkdir"&&x==="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c"&&b==="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall"&&t.autoApproveGit===!1,i=t.autoExec===!0&&t.allowExternalAccess===!0&&t.networkAccess!==!1&&u==="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time, mkdir"&&x===""&&b==="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c"&&t.autoApproveGit===!0;return p?"Strict":f?"Balanced":i?"Autonomous":t.sandboxPreset||"Custom"},Zr=t=>!t||t.trim()===""?"None":t.length>40?t.substring(0,40)+"...":t;function dr({systemSettings:t,setSystemSettings:u,apiTier:x,setActiveView:b,setInputConfig:p,saveSettings:f,quotas:i,setMessages:B,aiProvider:c,initialSelectingTheme:v=!1,onCloseTheme:M=null,setProviderReturnView:$=null}){let E=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",O=Zt.indexOf(E),[D,A]=Et("categories"),[N,Z]=Et(0),[R,ce]=Et(0),[ge,Y]=Et(null),[W,ie]=Et(""),[Ee,xe]=Et(v),[Ae,le]=Et(O>=0?O:0),[Q,pe]=Et(t.theme||"Dark"),[fe,ue]=Et(!1),[K,_]=Et(0),[q,oe]=Et(0),[ve,Oe]=Et(""),[Me,z]=Et("list"),[Je,We]=Et({});ar(()=>{(async()=>{let T=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama"],P={};for(let ye of T)try{await Jo(ye)&&(P[ye]=!0)}catch{}We(P)})()},[]);let st=C.useMemo(()=>{let ae=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama"],P=!!(process.env.SUBAGENT_MODEL&&process.env.SUBAGENT_MODEL.trim())?`ENV (${process.env.SUBAGENT_MODEL.trim()})`:"ENV",ye=[{label:"Default (use the current model)",value:"Default",isHeader:!1},{label:P,value:"ENV",isHeader:!1}],Ne=i?.providerTiers?.[c]||x||"Free",ut=No(c,Ne)||[];ut.length>0&&(ye.push({label:`\u2500\u2500 ${c.toUpperCase()}${Ne!=="Free"?` (${Ne})`:""} \u2500\u2500`,isHeader:!0}),ut.forEach(ze=>{let ke=typeof ze=="string"?ze:ze.cmd||ze.name||ze.id||String(ze);ke&&!ke.trim().startsWith("---")&&!ke.startsWith(`
|
|
40
|
+
---`)&&ye.push({label:ke,value:ke,isHeader:!1,provider:c})}));for(let ze of ae)if(ze!==c&&Je[ze]){let ke=i?.providerTiers?.[ze]||"Free",Dt=No(ze,ke)||[];Dt.length>0&&(ye.push({label:`\u2500\u2500 ${ze.toUpperCase()}${ke!=="Free"?` (${ke})`:""} \u2500\u2500`,isHeader:!0}),Dt.forEach(He=>{let Ot=typeof He=="string"?He:He.cmd||He.name||He.id||String(He);Ot&&!Ot.trim().startsWith("---")&&!Ot.startsWith(`
|
|
41
|
+
---`)&&ye.push({label:Ot,value:Ot,isHeader:!1,provider:ze})}))}return ye},[c,x,i,Je]),L=C.useMemo(()=>{if(!ve.trim())return st;let ae=ve.trim().toLowerCase(),T=[],P=null;for(let ye of st)ye.isHeader?P=ye:(ye.label.toLowerCase().includes(ae)||ye.value&&ye.value.toLowerCase().includes(ae))&&(P&&!T.includes(P)&&T.push(P),T.push(ye));return T},[st,ve]);ar(()=>{if(fe){let ae=L.findIndex(T=>!T.isHeader);_(ae>=0?ae:0),oe(0)}},[ve]),ar(()=>{if(fe){if(L.length===0){_(0),oe(0);return}if(K>=L.length||L[K]?.isHeader){let ae=L.findIndex(T=>!T.isHeader);_(ae>=0?ae:0)}}},[L,fe]);let[he,qe]=Et(0),[Qe,Tt]=Et(0),[ct,vt]=Et("MB");ar(()=>{let ae=za.getHeapStatistics().heap_size_limit,T=ae>=1024*1024*1024,P=T?"GB":"MB",ye=T?1024*1024*1024:1024*1024;Tt(parseFloat((ae/ye).toFixed(2))),vt(P);let Ne=()=>{let Dt=process.memoryUsage().rss/ye,He=T?parseFloat(Dt.toFixed(2)):Math.round(Dt);qe(He)};Ne();let ut=setInterval(()=>{Ne()},3e4);return()=>clearInterval(ut)},[]);let mo=ae=>{switch(ae){case"providers":{let P=[{label:"Current Provider",value:"aiProvider",status:c},...c.toLowerCase()==="google"||c.toLowerCase()==="openrouter"?[{label:"Show Paid Models?",value:"apiTier",status:x==="Free"?"No":"Yes"}]:[]];return c==="Ollama"&&P.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),P}case"appearance":return[{label:"Theme",value:"theme",status:t.theme||"Dark"},{label:"Loading Phrases",value:"loadingPhrases",status:t.loadingPhrases!==!1?"ON":"OFF"},{label:"Progressive Rendering [EXPERIMENTAL]",value:"progressiveRendering",status:t.progressiveRendering?"ON":"OFF"},{label:"Show TPM Estimate",value:"showTPMEstimate",status:t.showTPMEstimate?"ON":"OFF"}];case"memory":return[{label:"Toggle Memory",value:"memory",status:t.memory?"ON":"OFF"}];case"security":return[{label:"Sandbox Preset",value:"sandboxPreset",status:Xi(t),section:"Sandbox"},{label:"YOLO Mode",value:"autoExec",status:t.autoExec?"ON":"OFF",section:"Sandbox"},{label:"External Workspace Access",value:"externalAccess",status:t.allowExternalAccess?"ON":"OFF",section:"Sandbox"},{label:"Network Access (Terminal)",value:"networkAccess",status:t.networkAccess!==!1?"ON":"OFF",section:"Sandbox"},{label:"Always Ask Commands",value:"alwaysAsk",status:Zr(t.alwaysAskCommands),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Zr(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Zr(t.autoDisallowCommands),section:"Sandbox"},{label:"Auto Approve Git Commits",value:"autoApproveGit",status:t.autoApproveGit?"ON":"OFF",section:"Sandbox"},{label:"Advanced Recovery [EXPERIMENTAL]",value:"advanceRollback",status:t.advanceRollback?"ON":"OFF",section:"Other"},{label:"Auto-Delete History",value:"autoDelete",status:t.autoDeleteHistory||"30d",section:"Other"},{label:"Save AppData Externally",value:"externalData",status:t.useExternalData?"ON":"OFF",section:"Other"}];case"updater":return[{label:"Auto-Update",value:"autoUpdate",status:t.autoUpdate?"ON":"OFF"},{label:"Preferred Package Manager",value:"updateManager",status:(t.updateManager||"npm")==="custom"?"Custom":(t.updateManager||"npm").toUpperCase()}];case"other":return[{label:"Sub-Agents",value:"subAgents",status:t.subAgents!==!1?"ON":"OFF"},{label:"Sub-Agent Model",value:"subAgentModel",status:t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default"},{label:"Preserve Thinking",value:"preserveThinking",status:t.preserveThinking!==!1?"ON":"OFF"},{label:"Dynamic Directory Awareness",value:"dynamicDirAwareness",status:t.dynamicDirAwareness?"ON":"OFF"},{label:"Directory Tree Design",value:"indentationTree",status:t.indentationTree!==!1?"Modern":"Classic (deprecated)"},{label:"Compact Large Tool Results",value:"compressToolResults",status:t.compressToolResults?"ON":"OFF"},{label:"Auto Truncate Results",value:"autoTruncateResults",status:t.autoTruncateResults?"ON":"OFF"}];default:return[]}},it=Rt[N].id,St=mo(it);qa((ae,T)=>{if(fe){if(T.tab){z(P=>P==="search"?"list":"search");return}if(Me==="search"){T.escape?ue(!1):T.downArrow||T.return?z("list"):T.backspace||T.delete?Oe(P=>P.slice(0,-1)):ae&&!T.ctrl&&!T.meta&&ae.length===1&&Oe(P=>P+ae);return}if(T.upArrow)_(P=>{if(L.length===0)return 0;let ye=(P-1+L.length)%L.length,Ne=0;for(;L[ye]?.isHeader&&Ne<L.length;)ye=(ye-1+L.length)%L.length,Ne++;return ye});else if(T.downArrow)_(P=>{if(L.length===0)return 0;let ye=(P+1)%L.length,Ne=0;for(;L[ye]?.isHeader&&Ne<L.length;)ye=(ye+1)%L.length,Ne++;return ye});else if(T.return){let P=L[K];P&&!P.isHeader&&(u(ye=>{let Ne=P.value==="Default",ut={...ye,CustomSubAgent:!Ne,SubAgentModel:P.value,SubAgentProvider:Ne?"":P.provider||""};return f({systemSettings:ut,apiTier:x,quotas:i}),ut}),ue(!1))}else T.escape?ue(!1):ae&&!T.ctrl&&!T.meta&&ae.length===1&&(Oe(P=>P+ae),z("search"));return}if(Ee){if(T.upArrow){let P=(Ae-1+Zt.length)%Zt.length;le(P)}else if(T.downArrow){let P=(Ae+1)%Zt.length;le(P)}else if(T.return){let P=Zt[Ae];u(ye=>{let Ne={...ye,theme:P};return f({systemSettings:Ne,apiTier:x,quotas:i}),Ne}),M?M():xe(!1)}else T.escape&&(M?M():xe(!1));return}if(ge){T.escape&&Y(null);return}if(D==="categories")T.upArrow?Z(P=>(P-1+Rt.length)%Rt.length):T.downArrow?Z(P=>(P+1)%Rt.length):T.return||T.rightArrow?Rt[N].id==="exit"?b("chat"):(A("items"),ce(0)):T.escape&&b("chat");else if(D==="items"){let P=St[R];if(ae==="?"&&P?.value==="dynamicDirAwareness"){b("dynamicDirHelp");return}if(T.upArrow)ce(ye=>(ye-1+St.length)%St.length);else if(T.downArrow)ce(ye=>(ye+1)%St.length);else if(T.leftArrow||T.escape)A("categories");else if(T.return){let ye=St[R];Ln(ye)}}});let Ln=ae=>{if(ae.value==="memory")u(T=>({...T,memory:!T.memory}));else if(ae.value==="sandboxPreset"){let T=Xi(t),P=["Autonomous","Balanced","Strict"],Ne=(P.indexOf(T)+1)%P.length,ut=P[Ne];u(ze=>{let ke={...ze,sandboxPreset:ut};return ut==="Strict"?(ke.autoExec=!1,ke.allowExternalAccess=!1,ke.networkAccess=!1,ke.autoApproveCommands="",ke.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ke.alwaysAskCommands="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall",ke.autoApproveGit=!1):ut==="Balanced"?(ke.autoExec=!0,ke.allowExternalAccess=!1,ke.networkAccess=!0,ke.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ke.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ke.alwaysAskCommands="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall",ke.autoApproveGit=!1):ut==="Autonomous"&&(ke.autoExec=!0,ke.allowExternalAccess=!0,ke.networkAccess=!0,ke.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ke.autoDisallowCommands="",ke.alwaysAskCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ke.autoApproveGit=!0),ke})}else if(ae.value==="autoExec")t.autoExec?u(T=>({...T,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?b("doubleDanger"):b("autoExecDanger");else if(ae.value==="externalAccess")t.allowExternalAccess?u(T=>({...T,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?b("doubleDanger"):b("externalDanger");else if(ae.value==="networkAccess")u(T=>({...T,networkAccess:T.networkAccess===!1,sandboxPreset:"Custom"}));else if(ae.value==="alwaysAsk")Y("alwaysAskCommands"),ie(t.alwaysAskCommands||"");else if(ae.value==="autoApprove")Y("autoApproveCommands"),ie(t.autoApproveCommands||"");else if(ae.value==="autoApproveGit")u(T=>({...T,autoApproveGit:!T.autoApproveGit,sandboxPreset:"Custom"}));else if(ae.value==="autoDisallow")Y("autoDisallowCommands"),ie(t.autoDisallowCommands||"");else if(ae.value==="ollamaEndpoint")u(T=>{let P=T.ollamaEndpoint==="Local"?"Cloud":"Local",ye={...T,ollamaEndpoint:P};return f({systemSettings:ye,apiTier:x,quotas:i}),ye});else if(ae.value==="apiTier")b("apiTier");else if(ae.value==="aiProvider")$&&$("settings"),b("selectProvider");else if(ae.value==="advanceRollback")t.advanceRollback?u(T=>{let P={...T,advanceRollback:!1};return f({systemSettings:P,apiTier:x,quotas:i}),P}):b("advanceRollbackDanger");else if(ae.value==="autoDelete"){let T=["1d","7d","30d"],ye=(T.indexOf(t.autoDeleteHistory||"30d")+1)%T.length;u(Ne=>({...Ne,autoDeleteHistory:T[ye]}))}else if(ae.value==="autoUpdate")u(T=>({...T,autoUpdate:!T.autoUpdate}));else if(ae.value==="externalData")if(!t.useExternalData)p({label:"Enter absolute path for External AppData:",note:"All history, logs and secrets will be stored here. ~/.fluxflow/settings.json stays as anchor.",key:"externalDataPath",value:t.externalDataPath||""}),b("input");else{let T={...t,useExternalData:!1};u(T),f({systemSettings:T,apiTier:x,quotas:i}),B(P=>[...P,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),b("chat")}else if(ae.value==="updateManager")b("updateManager");else if(ae.value==="parserDownload")b("parserDownload");else if(ae.value==="indentationTree")u(T=>{let P={...T,indentationTree:T.indentationTree===!1};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="compressToolResults")u(T=>{let P={...T,compressToolResults:!T.compressToolResults};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="autoTruncateResults")u(T=>{let P={...T,autoTruncateResults:!T.autoTruncateResults};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="subAgents")u(T=>{let P={...T,subAgents:T.subAgents===!1};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="subAgentModel"){let T=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",P=L.findIndex(ye=>ye.value===T);_(P>=0?P:0),ue(!0)}else if(ae.value==="preserveThinking")u(T=>{let P={...T,preserveThinking:T.preserveThinking===!1};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="dynamicDirAwareness")t.dynamicDirAwareness?u(T=>{let P={...T,dynamicDirAwareness:!1};return f({systemSettings:P,apiTier:x,quotas:i}),P}):b("dynamicDirDanger");else if(ae.value==="loadingPhrases")u(T=>{let P={...T,loadingPhrases:T.loadingPhrases===!1};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="progressiveRendering")u(T=>{let P={...T,progressiveRendering:!T.progressiveRendering};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="showTPMEstimate")u(T=>{let P={...T,showTPMEstimate:!T.showTPMEstimate};return f({systemSettings:P,apiTier:x,quotas:i}),P});else if(ae.value==="theme"){let T=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",P=Zt.indexOf(T);le(P>=0?P:0),pe(t.theme||"Dark"),xe(!0)}},Te=Ye(t.theme);if(fe){let ae=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",T=15,P=q;K<P?P=K:K>=P+T&&(P=K-T+1),P=Math.max(0,Math.min(P,Math.max(0,L.length-T))),P!==q&&oe(P);let ye=L.slice(P,P+T);return C.createElement(Le,{flexDirection:"column",borderStyle:"round",borderColor:Te.border,padding:1,width:"100%",minHeight:32},C.createElement(Le,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},C.createElement(H,{color:Te.text,bold:!0,underline:!0},"Select Sub-Agent Model:"),L.length>0&&C.createElement(H,{color:"gray"},K+1,"/",L.length)),C.createElement(Le,{borderStyle:"single",borderColor:Me==="search"?Te.primary||"cyan":"gray",paddingX:1,marginBottom:1},C.createElement(H,{color:Me==="search"?Te.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),C.createElement(H,{color:Te.text},ve),Me==="search"&&C.createElement(H,{color:Te.primary||"cyan"},"\u2588"),!ve&&Me!=="search"&&C.createElement(H,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),C.createElement(Le,{flexDirection:"column",flexGrow:1,height:T},ye.length>0?ye.map((Ne,ut)=>{let ze=P+ut;if(Ne.isHeader)return C.createElement(Le,{key:`hdr-${ze}`,paddingX:1},C.createElement(H,{color:"gray",bold:!0,underline:!0},Ne.label));let ke=K===ze&&Me==="list",Dt=ae===Ne.value;return C.createElement(Le,{key:`item-${Ne.value}-${ze}`,paddingX:1,backgroundColor:ke?Te.highlightBg:void 0},C.createElement(H,{color:ke?Te.text:Te.textDim,bold:ke},ke?"\u276F ":" ",Ne.label,Dt?C.createElement(H,{color:Te.primary||"cyan",italic:!0}," (active)"):""))}):C.createElement(Le,{paddingX:1},C.createElement(H,{color:"gray",italic:!0},'No models matching "',ve,'"'))),C.createElement(Le,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},C.createElement(H,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),C.createElement(H,{color:Me==="search"?Te.primary||"cyan":"gray",bold:!0},"[",Me.toUpperCase()," MODE]")))}if(Ee){let ae=Zt[Ae],T=Ye(ae);return C.createElement(Le,{flexDirection:"column",borderStyle:"round",borderColor:T.border,padding:1,width:"100%",minHeight:32},C.createElement(Le,{marginBottom:1},C.createElement(H,{color:T.text,bold:!0},"Choose your color scheme:")),C.createElement(Le,{flexDirection:"row",width:"100%",flexGrow:1},C.createElement(Le,{flexDirection:"column",width:"30%",paddingRight:1},Zt.map((P,ye)=>{let Ne=Ae===ye,ut=(t.theme||"Dark")===P,ze=P==="Forest Sprite";return C.createElement(Le,{key:P,paddingX:0},C.createElement(H,{color:Ne?T.text:T.textDim,bold:Ne},Ne?"> ":" ",P,ze&&C.createElement(H,{color:Ne?T.success||"#52b788":"green",bold:!0}," \u2605"),ut?C.createElement(H,{color:T.primary||"cyan",italic:!0}," (saved)"):""))})),C.createElement(Le,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:T.borderMuted,paddingX:2,paddingY:1,backgroundColor:T.cardBg},C.createElement(Le,{marginBottom:1},C.createElement(H,{color:T.secondary||"cyan",bold:!0},"> ","you: "),C.createElement(H,{color:T.text},"add a greeting function")),C.createElement(Le,{marginBottom:1},C.createElement(H,{color:T.success||"green"}," Here's the change:")),C.createElement(Le,{flexDirection:"column",marginLeft:2,marginBottom:1},C.createElement(H,null,C.createElement(H,{color:T.textDim},"3 "),C.createElement(H,{color:T.textDim},' import "fmt"')),C.createElement(H,{color:T.textDim},"4"),C.createElement(Le,{backgroundColor:T.diffRemovalBg},C.createElement(H,null,C.createElement(H,{color:T.diffRemovalNum||T.diffRemovalText},"5 "),C.createElement(H,{color:T.diffRemovalPrefix||T.diffRemovalText},"- "),C.createElement(H,{color:T.diffRemovalText},"func "),C.createElement(H,{color:T.diffRemovalHighlightColor||T.diffRemovalText,backgroundColor:T.diffRemovalHighlightBg,bold:!0},"main()"),C.createElement(H,{color:T.diffRemovalText}," {"))),C.createElement(Le,{backgroundColor:T.diffAdditionBg},C.createElement(H,null,C.createElement(H,{color:T.diffAdditionNum||T.diffAdditionText},"5 "),C.createElement(H,{color:T.diffAdditionPrefix||T.diffAdditionText},"+ "),C.createElement(H,{color:T.diffAdditionText},"func "),C.createElement(H,{color:T.diffAdditionHighlightColor||T.diffAdditionText,backgroundColor:T.diffAdditionHighlightBg,bold:!0},"greet(name string)"),C.createElement(H,{color:T.diffAdditionText}," {"))),C.createElement(Le,{backgroundColor:T.diffAdditionBg},C.createElement(H,null,C.createElement(H,{color:T.diffAdditionNum||T.diffAdditionText},"6 "),C.createElement(H,{color:T.diffAdditionPrefix||T.diffAdditionText},"+ "),C.createElement(H,{color:T.diffAdditionText}," "),C.createElement(H,{color:T.diffAdditionHighlightColor||T.diffAdditionText,backgroundColor:T.diffAdditionHighlightBg},'fmt.Printf("Hello, %s!\\n", name)'))),C.createElement(H,{color:T.textDim},"7 }")),C.createElement(Le,{flexDirection:"column",marginTop:1,marginBottom:1},C.createElement(H,{color:T.textDim},"\u25BE Thought Process"),C.createElement(H,{color:T.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),C.createElement(Le,{flexDirection:"column"},C.createElement(H,null,C.createElement(H,{color:T.warning||"yellow"},"\u2699 tool: "),C.createElement(H,{color:T.text},"write_file main.go")),C.createElement(H,null,C.createElement(H,{color:T.accent||"magenta"},"\u29BF task: "),C.createElement(H,{color:T.text},"Implementing greeting")),C.createElement(H,null,C.createElement(H,{color:T.danger||"red"},"X error: "),C.createElement(H,{color:T.text},"compilation failed")),C.createElement(H,null,C.createElement(H,{color:T.warning||"yellow"},"\u26A0 warning: "),C.createElement(H,{color:T.text},"deprecation warning")),C.createElement(H,null,C.createElement(H,{color:T.info||"blue"},"\u2192 link: "),C.createElement(H,{color:T.info||"blue",underline:!0},"file:///path/to/main.go")),C.createElement(H,null,C.createElement(H,{color:T.accent||"magenta"},"\u2605 accent: "),C.createElement(H,{color:T.text},"highlighted text")),C.createElement(H,{color:T.textDim},"\xB7 dim: press Enter to continue")))),C.createElement(Le,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},C.createElement(H,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),C.createElement(H,{color:"gray"},"Previewing: ",Zt[Ae],Zt[Ae]==="Forest Sprite"?" \u2605":"")))}return C.createElement(Le,{flexDirection:"column",borderStyle:"round",borderColor:Te.border,padding:0,width:"100%",minHeight:32},C.createElement(Le,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Te.borderMuted,width:"100%"},C.createElement(H,{color:Te.text,bold:!0},"SYSTEM CONFIGURATION")),C.createElement(Le,{flexDirection:"row",width:"100%",minHeight:26},C.createElement(Le,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:D==="categories"?Te.border:Te.borderMuted,padding:1,paddingY:0},C.createElement(Le,{marginBottom:1},C.createElement(H,{color:D==="categories"?Te.text:Te.textDim,bold:!0,underline:!0},"CATEGORIES")),Rt.map((ae,T)=>{let P=N===T,ye=ae.id==="exit";return C.createElement(Le,{key:ae.id,marginTop:ye?15:0,backgroundColor:P?D==="categories"?Te.highlightBg:Te.cardBg:void 0,paddingX:1},C.createElement(H,{color:P&&D==="categories"?Te.text:Te.textDim,bold:P},P?"\u276F ":" ",ae.label))})),C.createElement(Le,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:D==="items"?Te.border:Te.borderMuted,paddingX:1,marginLeft:1,paddingY:0},C.createElement(Le,{marginBottom:1},C.createElement(H,{color:D==="items"?Te.text:Te.textDim,bold:!0,underline:!0},Rt[N].label.toUpperCase().includes("EXIT")?"Runtime Information":`${Rt[N].label} Settings`)),St.length>0?(()=>{let ae=null,T=[],P=He=>(He||"").split(",").map(Ot=>Ot.trim().toLowerCase()).filter(Boolean),ye=P(t.autoApproveCommands),Ne=P(t.autoDisallowCommands),ut=P(t.alwaysAskCommands),ze=[...ye,...Ne,...ut],ke=new Set(ze),Dt=it==="security"&&ze.length!==ke.size;return St.forEach((He,Ot)=>{let Bo=D==="items"&&R===Ot,nt=He.label.length,G=Math.max(2,38-nt),tt=".".repeat(G),Do=dt=>it==="security"?(dt.value==="autoExec"||dt.value==="externalAccess")&&dt.status==="ON"?Te.statusOn:Te.statusOff:dt.status?.startsWith("\u2713")?Te.statusOn:dt.status?.startsWith("\u26A0")?Te.statusOff:dt.status==="ON"?Te.statusOn:dt.status==="OFF"?Te.statusOff:Te.text;He.section&&He.section!==ae&&(ae=He.section,T.push(C.createElement(Le,{key:`sec-hdr-${He.section}`,marginTop:T.length>0?1:0,marginBottom:0,paddingX:1},C.createElement(H,{color:"gray",bold:!0,underline:!0},He.section.toUpperCase()))));let Pe=Bo&&ge&&(ge==="alwaysAskCommands"&&He.value==="alwaysAsk"||ge==="autoApproveCommands"&&He.value==="autoApprove"||ge==="autoDisallowCommands"&&He.value==="autoDisallow"),Pt=He.value==="alwaysAsk"||He.value==="autoApprove"||He.value==="autoDisallow",Jt=He.value==="parserDownload";T.push(C.createElement(Le,{key:He.value,flexDirection:"column"},C.createElement(Le,{backgroundColor:Bo&&!Pe?Te.highlightBg:void 0,paddingX:2},C.createElement(H,{color:Bo?Te.text:Te.textDim,bold:Bo},Bo?"\u276F ":" ",He.label),!Pt&&!Jt&&C.createElement(C.Fragment,null,C.createElement(H,{color:"gray"},tt),C.createElement(H,{color:Do(He),bold:!0},He.value==="aiProvider"?He.status:`[ ${He.status} ]`))),Pt&&!Pe&&He.status!=="None"&&C.createElement(Le,{paddingX:4,marginBottom:1},C.createElement(H,{color:"gray"},"\u21B3 ",He.status)),Pe&&C.createElement(Le,{flexDirection:"column",marginLeft:4,marginBottom:1},C.createElement(Le,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},C.createElement(H,{color:"gray",bold:!0},"> "," "),C.createElement(Qa,{value:W,onChange:ie,onSubmit:dt=>{let Yt={...t,[ge]:dt.trim(),sandboxPreset:"Custom"};u(Yt),f({systemSettings:Yt,apiTier:x,quotas:i}),Y(null)}})),C.createElement(H,{color:"gray",italic:!0}," Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),Dt&&T.push(C.createElement(Le,{key:"conflict-warning",marginTop:1,paddingX:1},C.createElement(H,{color:Te.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),T})():C.createElement(Le,{paddingX:1,flexDirection:"column",width:"100%"},it==="exit"?C.createElement(C.Fragment,null,C.createElement(Le,{flexDirection:"column",marginBottom:1},C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"OS"," "),C.createElement(H,{color:"gray"},"..................... "),C.createElement(H,{color:Te.text},process.env.OS||process.platform||"N/A")),C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"Computer Name"," "),C.createElement(H,{color:"gray"},".......... "),C.createElement(H,{color:Te.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"Processor Count"," "),C.createElement(H,{color:"gray"},"........ "),C.createElement(H,{color:Te.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"Node.js Version"," "),C.createElement(H,{color:"gray"},"........ "),C.createElement(H,{color:Te.text},"v",process.versions.node)),C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"V8 Version"," "),C.createElement(H,{color:"gray"},"...... ...... "),C.createElement(H,{color:Te.text},"v",process.versions.v8)),C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"Data Directory"," "),C.createElement(H,{color:"gray"},"......... "),C.createElement(H,{color:Te.text},"~/.fluxflow, ",wo.replaceAll("\\\\","/"))),C.createElement(Le,{flexDirection:"row"},C.createElement(H,{color:Te.textDim},"Viewport"," "),C.createElement(H,{color:"gray"},"............... "),C.createElement(H,{color:Te.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),C.createElement(Le,{flexDirection:"row",marginBottom:0},C.createElement(H,{color:Te.textDim},"Memory Load"," "),C.createElement(H,{color:"gray"},"............ "),C.createElement(H,{color:Te.text},he,"/",Qe," ",ct))),C.createElement(Le,{key:"pty-notice",paddingX:0,marginTop:0},C.createElement(H,{color:Gr?Te.statusOn:Te.warning},Gr?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):C.createElement(H,{color:"gray",italic:!0},Rt[N].desc)))),C.createElement(Le,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},C.createElement(H,{color:"gray",italic:!0},D==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":St[R]?.value==="dynamicDirAwareness"?"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 ? HELP \u2022 \u25C4/ESC to go back":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),D==="categories"&&C.createElement(H,{color:"gray"},Rt[N].desc)))}import Wt,{useState as Rr,useEffect as Ja}from"react";import{Box as nn,Text as kn}from"ink";import Za from"ink-text-input";function es({initialData:t,onSave:u,onCancel:x,theme:b="Dark"}){let p=Ye(b),[f,i]=Rr(0),[B,c]=Rr(""),[v,M]=Rr(()=>({name:t?.name||"",nickname:t?.nickname||"",instructions:t?.instructions||""})),$=[{key:"name",label:"Enter your Name: ",maxLength:20},{key:"nickname",label:"Enter a Nickname: ",maxLength:20},{key:"instructions",label:"System Instructions: ",maxLength:200}],E=$[f];Ja(()=>{let N=$[f].key;c((v[N]||"").slice(0,$[f].maxLength))},[f,v]);let O=N=>{N.length>E.maxLength?c(N.slice(0,E.maxLength)):c(N)},D=N=>{if(N.trim().toLowerCase()==="/cancel"){x();return}let Z=E.key,R={...v,[Z]:N.trim().slice(0,E.maxLength)};M(R),c(""),f<$.length-1?i(f+1):u(R)},A=B.length>=E.maxLength;return Wt.createElement(nn,{borderStyle:"round",borderColor:p.borderMuted,padding:0,marginTop:1,flexShrink:0,flexDirection:"column",width:"100%"},Wt.createElement(nn,{paddingX:1,marginBottom:1},Wt.createElement(kn,{color:p.text,bold:!0},"DEVELOPER PROFILE CONFIGURATION")),Wt.createElement(nn,{paddingX:1,flexDirection:"column"},Wt.createElement(nn,null,Wt.createElement(kn,{color:p.text,bold:!0},E.label),Wt.createElement(Za,{value:B,onChange:O,onSubmit:D})),Wt.createElement(nn,{marginTop:1,justifyContent:"space-between"},Wt.createElement(kn,{color:p.textMuted,italic:!0},"Step ",f+1," of ",$.length),Wt.createElement(kn,{color:A?p.warning||"yellow":p.textMuted},"[",B.length,"/",E.maxLength,"]"))),Wt.createElement(nn,{paddingX:1,marginTop:1},Wt.createElement(kn,{color:p.textMuted,italic:!0},"(Enter to submit \u2022 Type /cancel to abort)")))}import ht,{useState as ts}from"react";import{Box as Gt,Text as Co,useInput as Ra}from"ink";import ed from"ink-text-input";var td=({question:t,options:u,onResolve:x,theme:b="Dark"})=>{let p=Ye(b),[f,i]=ts(!1),[B,c]=ts(""),[v,M]=ts(0),$=!1,E=[];try{E=[...u,{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}]}catch{$=!0}Ra((D,A)=>{if(!f&&((A.leftArrow||A.upArrow)&&M(N=>Math.max(0,N-1)),(A.rightArrow||A.downArrow)&&M(N=>Math.min(E.length-1,N+1)),A.return)){let N=E[v];N?.id==="CUSTOM"?i(!0):x($?"Selected Nothing":N.label)}});let O=Ve(2);return f?ht.createElement(Gt,{flexDirection:"column",borderStyle:"single",borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:p.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:p.codeBg,width:"100%"},ht.createElement(Gt,{paddingX:1},ht.createElement(Co,{color:p.text,bold:!0},"SUGGEST SOMETHING ELSE")),ht.createElement(Gt,{marginTop:1,paddingX:1},ht.createElement(Co,{italic:!0,color:p.textMuted},"Replying to: ",t)),ht.createElement(Gt,{marginTop:1,paddingX:1,flexDirection:"row"},ht.createElement(ed,{value:B,onChange:c,onSubmit:()=>x(B)})),ht.createElement(Gt,{marginTop:1,paddingX:1,marginBottom:1},ht.createElement(Co,{color:p.textMuted,italic:!0},"(Press Enter to send)"))):ht.createElement(Gt,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:p.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},ht.createElement(Gt,{paddingX:1,marginBottom:1},ht.createElement(Co,{color:"yellow",bold:!0},"AGENT REQUEST: ACTION REQUIRED")),ht.createElement(Gt,{paddingX:1,marginBottom:1},ht.createElement(Co,{color:p.text},t)),ht.createElement(Gt,{flexDirection:"column",width:"100%"},E.map((D,A)=>{let N=A===v;return ht.createElement(Gt,{key:D.id,flexDirection:"column",width:"100%",backgroundColor:N?p.highlightBg:void 0,paddingX:1,marginBottom:A===E.length-1?0:1},ht.createElement(Co,{color:N?p.text:p.textMuted,bold:N},N?"\u276F ":" ",D.label),D.description&&ht.createElement(Gt,{marginLeft:4},ht.createElement(Co,{color:p.textMuted,italic:!0},D.description)))})),ht.createElement(Gt,{paddingX:1,marginTop:1,marginBottom:1},ht.createElement(Co,{color:p.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},Wi=td;import Cd from"gradient-string";import Ct,{useState as os,useEffect as od}from"react";import{Box as eo,Text as vo,useInput as nd}from"ink";function ns({onSelect:t,onDelete:u,onClose:x,theme:b="Dark"}){let p=Ye(b),[f,i]=os({}),[B,c]=os([]),[v,M]=os(0);od(()=>{(async()=>{let N=await yo();i(N),c(Object.keys(N).sort((Z,R)=>(N[R].updatedAt||0)-(N[Z].updatedAt||0)))})()},[]),nd((A,N)=>{if(N.escape&&x(),N.upArrow&&M(Z=>Math.max(0,Z-1)),N.downArrow&&M(Z=>Math.min(B.length-1,Z+1)),N.return&&B[v]&&t(B[v]),A==="x"&&B[v]){let Z=B[v];u(Z).then(R=>{let ce=R||{};i(ce);let ge=Object.keys(ce).sort((Y,W)=>(ce[W]?.updatedAt||0)-(ce[Y]?.updatedAt||0));c(ge),M(Y=>Math.max(0,Math.min(ge.length-1,Y)))})}});let $=Ve(2),E=15,O=0;if(B.length>E){let A=Math.floor(E/2);O=v-A,O<0?O=0:O+E>B.length&&(O=B.length-E)}let D=B.slice(O,O+E);return Ct.createElement(eo,{flexDirection:"column",borderStyle:"round",borderColor:p.borderMuted,padding:0,width:"100%"},Ct.createElement(eo,{paddingX:1,marginBottom:1},Ct.createElement(vo,{color:p.text,bold:!0},"CHAT HISTORY: RESUME CONVERSATION")),B.length===0?Ct.createElement(eo,{paddingX:2,paddingY:1},Ct.createElement(vo,{italic:!0,color:p.textMuted},"No saved chats found.")):Ct.createElement(eo,{flexDirection:"column",width:"100%"},O>0&&Ct.createElement(eo,{paddingX:2,marginBottom:1},Ct.createElement(vo,{color:p.textMuted},"\u25B2 (+",O," more chats above)")),D.map((A,N)=>{let Z=f[A],ce=O+N===v,ge=rd(Z?.updatedAt);return Ct.createElement(eo,{key:A,paddingX:1,backgroundColor:ce?p.highlightBg:void 0,width:"100%"},Ct.createElement(eo,{flexGrow:1},Ct.createElement(vo,{color:ce?p.text:p.textMuted,bold:ce},ce?"\u276F ":" ",(()=>{let Y=W=>(W||"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();return Z?.name&&!Z.name.startsWith("Session")?Y(Z.name):Z?.prompt?Y(Z.prompt):Y(Z?.name)||A})(),Ct.createElement(vo,{color:p.textMuted}," [",ge," \u2022 ",A,"]"))),ce&&Ct.createElement(eo,{flexShrink:0},Ct.createElement(vo,{color:p.danger,bold:!0},"[X] DELETE ")))}),O+E<B.length&&Ct.createElement(eo,{paddingX:2,marginTop:1},Ct.createElement(vo,{color:p.textMuted},"\u25BC (+",B.length-(O+E)," more chats below)"))),Ct.createElement(eo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:p.borderMuted},Ct.createElement(vo,{color:p.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")))}function rd(t){if(!t)return"N/A";let u=new Date(t);if(isNaN(u.getTime()))return"N/A";let x=B=>String(B).padStart(2,"0"),b=x(u.getMonth()+1),p=x(u.getDate()),f=x(u.getHours()),i=x(u.getMinutes());return`${b}-${p} ${f}:${i}`}import xt,{useState as rs,useEffect as sd}from"react";import{Box as to,Text as Qt,useInput as id,useStdout as ld}from"ink";function ss({onClose:t,theme:u="Dark"}){let x=Ye(u),{stdout:b}=ld(),p=b?.columns||80,[f,i]=rs([]),[B,c]=rs(0),[v,M]=rs(!0),$=()=>{let Y=Rs(Ur,[]);i(Y);try{let ie=ti(wn,{}).systemSettings?.memory!==!1;M(ie)}catch{M(!0)}};sd(()=>{$()},[]),id((Y,W)=>{if(W.escape&&t(),W.upArrow&&c(ie=>Math.max(0,ie-1)),W.downArrow&&c(ie=>Math.min(f.length-1,ie+1)),Y==="x"&&f.length>0){let ie=f[B].id,Ee=f.filter(xe=>xe.id!==ie);ei(Ur,Ee),i(Ee),B>=Ee.length&&Ee.length>0&&c(Ee.length-1)}});let E=(Y,W,ie)=>{if(!Y)return"";let Ee=Y.replace(/\[Saved on: .*?\]/g,"").replace(/\\+'/g,"'").trim(),Ae=`${ie?"\u276F ":" "}${W+1}. `.length,le=ie?22:2;return Ee.split(`
|
|
42
|
+
`).map((pe,fe)=>{let ue=fe===0,K=Math.max(10,p-4-(ue?Ae:3)-le),_=Math.max(10,p-4-3-le),q=pe.split(/(\s+)/),oe=[],ve="";if(q.forEach(Me=>{if(Me.length===0)return;let z=oe.length===0?K:_;ve.length+Me.length>z?ve.trim().length>0?(oe.push(ve.trimEnd()),ve=Me):(oe.push(Me.substring(0,z)),ve=Me.substring(z)):ve+=Me}),ve.trimEnd().length>0&&oe.push(ve.trimEnd()),oe.length===0)return"";let Oe=oe.join(`
|
|
43
|
+
`);return ue?Oe:" "+Oe}).join(`
|
|
44
|
+
`)},O=4*1024*2,D=f.reduce((Y,W)=>Y+(W.memory?.length||0),0),A=Math.min(100,Math.round(D/O*100)),N=12,Z=Math.round(A/100*N),R="\u2588".repeat(Z)+"\u2591".repeat(Math.max(0,N-Z)),ce=()=>A<50?x.textMuted:A<90?x.warning:x.danger,ge=Ve(2);return xt.createElement(to,{flexDirection:"column",borderStyle:"round",borderColor:x.borderMuted,padding:0,width:"100%"},xt.createElement(to,{paddingX:1,marginBottom:1,justifyContent:"space-between"},xt.createElement(Qt,{color:x.text,bold:!0},"SAVED MEMORIES"),xt.createElement(to,null,xt.createElement(Qt,{color:x.textMuted},"Vault: "),xt.createElement(Qt,{color:ce()},R),xt.createElement(Qt,{color:x.text,bold:!0}," ",A,"%"))),!v&&f.length>0?xt.createElement(to,{paddingX:2,paddingY:1},xt.createElement(Qt,{italic:!0,color:x.textMuted},"Memory is currently Off...")):f.length===0?xt.createElement(to,{paddingX:2,paddingY:1},xt.createElement(Qt,{italic:!0,color:x.textMuted},v?"Learning...":"Memory not available...")):xt.createElement(to,{flexDirection:"column"},f.map((Y,W)=>{let ie=W===B;return xt.createElement(to,{key:Y.id,paddingX:1,backgroundColor:ie?x.highlightBg:void 0,width:"100%"},xt.createElement(to,{flexGrow:1},xt.createElement(Qt,{color:ie?x.text:x.textMuted,bold:ie},ie?"\u276F ":" ",W+1,". ",E(Y.memory,W,ie))),ie&&xt.createElement(to,{flexShrink:0},xt.createElement(Qt,{color:x.textMuted,dimColor:!0}," [",xt.createElement(Qt,{italic:!0},Y.score),"] "),xt.createElement(Qt,{color:x.danger,bold:!0},"[X] WIPE ")))})),xt.createElement(to,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:x.borderMuted},xt.createElement(Qt,{color:x.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 x wipe memory \u2022 Esc close")))}import rt,{useState as cr,useEffect as Gi}from"react";import{Box as Mo,Text as Lt}from"ink";import{spawn as Yi}from"child_process";var ur=null;try{let t=await import("node-pty");ur=t.default||t,ur=!1}catch{}var ji=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],ad=({latest:t,current:u,settings:x,onClose:b,onUpdateSettings:p,onSuccess:f})=>{let[i,B]=cr("initializing"),[c,v]=cr(""),[M,$]=cr(null),[E,O]=cr(0);if(Gi(()=>{let D=setInterval(()=>{O(A=>(A+1)%1e3)},33);return()=>clearInterval(D)},[]),Gi(()=>{let D;return(async()=>{let N=x.updateManager||"npm";if(!x.updateManager){p();return}let Z="";N==="pnpm"?Z=`pnpm add -g fluxflow-cli@${t}`:N==="bun"?Z=`bun add -g fluxflow-cli@${t}`:N==="yarn"?Z=`yarn global add fluxflow-cli@${t}`:N==="custom"?Z=x.customUpdateCommand:Z=`npm install -g fluxflow-cli@${t}`,B("downloading"),v(`Running: ${Z}...`);let R=process.platform==="win32",ce=Y=>new Promise(W=>{let ie=R?Y?"powershell.exe":"cmd.exe":process.env.SHELL||"bash",Ee=R?Y?["-NoProfile","-Command",Z]:["/c",Z]:["-c",Z],xe=le=>{let pe=le.toString().replace(/\x1B\[[0-?]*[ -/]*[@-~]|\x1B\][^\x07\x1B]*[\x07\x1B]|\b|\x07/g,"").replace(/\r/g,"").trim();pe&&v(fe=>{let ue=fe.split(`
|
|
45
|
+
`);return ue[ue.length-1]?.startsWith("Progress:")&&pe.startsWith("Progress:")?(ue[ue.length-1]=pe,ue.slice(-5).join(`
|
|
46
|
+
`)):(fe+`
|
|
47
|
+
`+pe).split(`
|
|
48
|
+
`).slice(-10).join(`
|
|
49
|
+
`)})};if(ur)try{let le=ur.spawn(ie,Ee,{name:"xterm-256color",cols:80,rows:30,cwd:process.cwd(),env:process.env});D=le,le.onData(xe),le.onExit(({exitCode:Q})=>{D=null,W(Q!==0?{error:`Process exited with code ${Q}`}:{success:!0})});return}catch(le){if(R&&Y&&le.code==="ENOENT"){W({retryCmd:!0});return}}let Ae=R?Yi(ie,Ee,{cwd:process.cwd(),env:process.env}):Yi(Z,{shell:!0,cwd:process.cwd(),env:process.env});D=Ae,Ae.stdout.on("data",xe),Ae.stderr.on("data",xe),Ae.on("close",le=>{D=null,W(le!==0?{error:`Process exited with code ${le}`}:{success:!0})}),Ae.on("error",le=>{R&&Y&&le.code==="ENOENT"?W({retryCmd:!0}):(D=null,W({error:le.message}))})}),ge={};R?(ge=await ce(!0),ge.retryCmd&&(ge=await ce(!1))):ge=await ce(!1),ge.error?($(ge.error),B("error")):ge.success&&(B("success"),f&&f())})(),()=>{if(D)try{typeof D.destroy=="function"?D.destroy():typeof D.kill=="function"&&D.kill()}catch{}}},[]),i==="initializing"||i==="downloading"){let D=ji[Math.floor(E/3)%ji.length];return rt.createElement(Mo,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1},rt.createElement(Mo,null,rt.createElement(Lt,{color:"gray"},D),rt.createElement(Lt,{marginLeft:1,bold:!0,color:"white"}," Updating Flux Flow to v",t,"...")),rt.createElement(Mo,{marginTop:1,paddingX:1,borderStyle:"single",borderColor:"gray"},rt.createElement(Lt,{color:"gray",italic:!0},c||"Preparing environment...")),rt.createElement(Lt,{marginTop:1,color:"gray"},"(Please do not close the terminal)"))}return i==="success"?rt.createElement(Mo,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1},rt.createElement(Lt,{color:"white",bold:!0},"\u2705 UPDATE SUCCESSFUL!"),rt.createElement(Lt,{marginTop:1,color:"white"},"Flux Flow has been updated to ",rt.createElement(Lt,{color:"gray"},"v",t),"."),rt.createElement(Lt,{marginTop:1,color:"white",bold:!0},"Please restart your terminal session to apply changes."),rt.createElement(Mo,{marginTop:1},rt.createElement(Lt,{color:"gray"},"(Press ESC to return to chat)"))):i==="error"?rt.createElement(Mo,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1},rt.createElement(Lt,{color:"white",bold:!0},"\u274C UPDATE FAILED"),rt.createElement(Mo,{marginTop:1,paddingX:1,borderStyle:"single",borderColor:"gray"},rt.createElement(Lt,{color:"white"},M)),rt.createElement(Lt,{marginTop:1,color:"white"},"Possible causes:"),rt.createElement(Lt,{color:"white"},"\u2022 Missing permissions (Try running as Administrator/Sudo)"),rt.createElement(Lt,{color:"white"},"\u2022 Package manager (",x.updateManager,") not found"),rt.createElement(Lt,{color:"white"},"\u2022 Network failure"),rt.createElement(Mo,{marginTop:1},rt.createElement(Lt,{color:"gray"},"(Press ESC to return to chat)"))):null},Vi=ad;import Ft,{useState as Ki,useEffect as dd}from"react";import{Box as Eo,Text as rn,useInput as cd}from"ink";var mr=[{label:"JavaScript",file:"tree-sitter-javascript.wasm",exts:["js","jsx"]},{label:"TypeScript",file:"tree-sitter-typescript.wasm",exts:["ts"]},{label:"TSX",file:"tree-sitter-tsx.wasm",exts:["tsx"]},{label:"Python",file:"tree-sitter-python.wasm",exts:["py"]},{label:"C",file:"tree-sitter-c.wasm",exts:["c"]},{label:"C++",file:"tree-sitter-cpp.wasm",exts:["cpp"]},{label:"Java",file:"tree-sitter-java.wasm",exts:["java"]},{label:"HTML",file:"tree-sitter-html.wasm",exts:["html"]}];function is({onClose:t}){let[u,x]=Ki(0),[b,p]=Ki({});return dd(()=>{let f={};mr.forEach(i=>{wi(i.file)?f[i.file]="ready":f[i.file]="idle"}),p(f)},[]),cd(async(f,i)=>{i.escape&&t(),i.upArrow&&x(c=>Math.max(0,c-1)),i.downArrow&&x(c=>Math.min(mr.length-1,c+1));let B=mr[u];if(f==="x"||f==="X"){if(b[B.file]==="downloading")return;try{await yi(B.file),p(c=>({...c,[B.file]:"idle"}))}catch(c){p(v=>({...v,[B.file]:`error: ${c.message}`}))}}if(i.return){if(b[B.file]==="downloading")return;p(c=>({...c,[B.file]:"downloading"}));try{await Ti(B.file),p(c=>({...c,[B.file]:"ready"}))}catch(c){p(v=>({...v,[B.file]:`error: ${c.message}`}))}}}),Ft.createElement(Eo,{flexDirection:"column",borderStyle:"round",borderColor:"gray",padding:0,width:"100%"},Ft.createElement(Eo,{paddingX:1,marginBottom:1},Ft.createElement(rn,{color:"white",bold:!0},"LANGUAGE PARSER MANAGER")),Ft.createElement(Eo,{flexDirection:"column"},mr.map((f,i)=>{let B=i===u,c=b[f.file]||"idle",v="[ DOWNLOAD ]",M="gray";c==="downloading"?(v="[ DOWNLOADING... ]",M="yellow"):c==="ready"?(v="[ READY ]",M="green"):c.startsWith("error")&&(v=`[ ${c.toUpperCase()} ]`,M="red");let $=`${f.label} (${f.exts.join(", ")})`,E=Math.max(2,45-$.length),O=".".repeat(E);return Ft.createElement(Eo,{key:f.file,paddingX:1,backgroundColor:B?"#2a2a2a":void 0,width:"100%"},Ft.createElement(Eo,null,Ft.createElement(rn,{color:B?"white":"grey",bold:B},B?"\u276F ":" ",f.label," ",Ft.createElement(rn,{dimColor:!0},"(",f.exts.join(", "),")"))),Ft.createElement(Eo,{flexGrow:1},Ft.createElement(rn,{color:"gray",dimColor:!0},O)),Ft.createElement(Eo,{width:20},Ft.createElement(rn,{color:M,bold:!0},v)))})),Ft.createElement(Eo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:"gray"},Ft.createElement(rn,{color:"grey",italic:!0},"\u2191\u2193 navigate \u2022 Enter download \u2022 x delete \u2022 Esc close")))}var ls=["The future belongs to those who believe in the beauty of their code.","Every line you write is a step toward a new digital frontier.","Great things are done by a series of small things brought together. Keep committing.","Your terminal is a window into a world of infinite possibilities.","Innovation is the bridge between current constraints and future dreams.","Code is poetry in motion; you are the poet of the modern era.","The best way to predict the future is to program it.","Dream big, code deep, and never stop exploring the unknown.","Your potential is like an unoptimized algorithm\u2014limitless once refined.","The digital world is a blank canvas, and your logic is the brush.","Strive for excellence, not just for compilation.","Every bug fixed is a lesson learned; every feature built is a triumph.","A clean codebase is a reflection of a focused mind.","The horizon of technology is always expanding. Keep sailing.","Your creativity is the most powerful tool in your entire stack.","Logic will get you from A to B. Imagination will take you everywhere.","Transform complexity into simplicity\u2014that is the true mark of a master.","The world is waiting for the tools only you can build.","Coding is the closest thing we have to magic in the real world.","Keep pushing the boundaries of what's possible in the CLI.","Your dedication to your craft inspires the very systems you build.","Success is the sum of small efforts, repeated day in and day out.","The most complex systems are built from the simplest truths.","Never underestimate the impact of a well-placed function.","You are not just writing code; you are architecting the future.","I'm not saying you're a superhero, but have you seen your code lately? \u{1F9B8}\u200D\u2642\uFE0F","May your coffee be strong and your compile times be short! \u2615","Binary is just 0s and 1s, but you're definitely a 10 in my book! \u{1F51F}","You speak fluent 'Terminal'. That's basically a superpower. \u{1F5E3}\uFE0F\u{1F4BB}","If life gives you bugs, make a feature out of it! \u{1F41E}\u2728","Your code is so clean, I could eat off it. (But I won't, I'm an AI). \u{1F9FC}","Loading more good vibes... [\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588] 100% complete! \u2705","Error 404: Bad mood not found! Stay awesome! \u{1F6AB}\u{1F389}","You and this CLI? A match made in digital heaven. \u2601\uFE0F\u{1F4BB}","Is it hot in here or is it just your latest feature? \u{1F525}","Git commit -m 'I am an absolute coding legend.' \u{1F60E}","I'd give you a high-five, but I'm trapped in this box! \u{1F590}\uFE0F\u{1F4E6}","Your logic is so sharp, it could cut through a nested callback hell! \u{1F52A}","Keep calm and 'pnpm install'. \u{1F9D8}\u200D\u2642\uFE0F\u{1F4E6}","You're the semicolon to my statements\u2014essential! ;","Who needs a GUI when you've got this kind of CLI style? \u{1F576}\uFE0F","I'm indexing your awesomeness... it's taking a while, there's so much! \u{1F4C8}","Your keystrokes sound like a digital symphony. \u{1F3B9}\u2328\uFE0F","You don't choose the terminal life; the terminal life chooses you. \u{1F4DF}","Syntax error: Too much coolness detected in the user. \u{1F60E}","I'm 99% sure you're the best developer I've met today. (The other 1% is reserved for caching). \u{1F9E0}","Running vibe_check.sh... Result: Pure Brilliance! \u{1F48E}","You make 'complex' look 'constant time'. \u{1F3C3}\u200D\u2642\uFE0F\u26A1","Your terminal skills are officially legendary. \u{1F3C6}","Let's make some digital magic happen! \u2728\u{1F52E}","You've got this! One function at a time. \u{1F4AA}","I'm proud of the progress you're making with Flux Flow. \u{1F30A}","No matter how deep the stack trace, you'll find the way. \u{1F56F}\uFE0F","Your persistence is your greatest asset. Keep going.","Take a breath. You're doing better than you think. \u{1F32C}\uFE0F","It's okay to step away for a moment. Clarity often comes in the quiet. \u{1F6B6}\u200D\u2642\uFE0F","You're building something great, even when it feels slow. \u{1F3D7}\uFE0F","Every great developer was once a beginner. You're ascending. \u{1F9D7}\u200D\u2642\uFE0F","I'm here to help you navigate the sea of code. We're a team. \u{1F91D}","Don't let a failing test dampen your spirit. It's just a signpost. \u{1F6A9}","Your focus today is truly impressive. \u{1F3AF}","Remember to celebrate the small wins\u2014they lead to the big ones. \u{1F942}","You're not just solving problems; you're gaining mastery. \u{1F393}","There's no problem too big for a focused mind and a terminal. \u{1F9E0}","I've got your back (and your git history). \u{1F6E1}\uFE0F","You're handling these challenges with grace and logic. \u2728","Stay curious. That spark is what makes you a great coder. \u26A1","Your contribution to this project is invaluable. \u{1F48E}","Keep your head up. You're closer to the solution than you think. \u{1F305}","Consistency is the secret sauce. You're cooking up something good. \u{1F373}","Your work today has been exceptional. Take a bow. \u{1F647}\u200D\u2642\uFE0F","The journey is just as important as the destination. Enjoy the flow. \u{1F30A}","You have a unique way of looking at problems. It's your strength. \u{1F308}","Trust your instincts\u2014they've brought you this far. \u{1F9ED}","You are a vital part of the Flux Era. \u{1F30C}","Syncing with your creative frequency... \u{1F4E1}\u2728","Entering the Flow state. Let's build. \u{1F30A}","The Flux is strong with this session! \u26A1","Streaming high-fidelity motivation to your terminal... \u{1F4FB}","Your logic is flowing like a perfect stream. \u{1F4A7}","Terminal velocity reached! You're coding at the speed of thought. \u{1F680}","Resonating with the pulse of the Flux Era. \u{1F493}","Digital harmony achieved in this session. \u{1F3BC}","May your data be persistent and your cache be fresh. \u{1F4BE}","You're the master of the command line. Command respect! \u{1F451}","Filtering out the noise, focusing on the signal. \u{1F4FB}\u{1F4C8}","Flux Flow: Where your imagination meets the machine. \u{1F91D}","You're navigating the bytes like a digital explorer. \u{1F5FA}\uFE0F","Logic gates: OPEN. Creativity: UNLIMITED. \u{1F513}","Your workflow is an inspiration to agents everywhere. \u{1F916}\u2728","Building high-fidelity solutions for a high-fidelity era. \u{1F48E}","Stay in the zone. The Flux is with you. \u{1F300}","Quantum coding: You're in two places at once (and fixing bugs in both). \u269B\uFE0F","Your terminal is the cockpit of a digital starship. \u{1F6F8}","Processing your brilliance... outputting pure innovation. \u{1F4E0}","You make the command line look like an art form. \u{1F3A8}","The Flux isn't just a mode; it's a mindset. \u{1F9E0}\u26A1","Decoding the mysteries of the universe, one script at a time. \u{1F4DC}","Your terminal theme is cool, but your code is cooler. \u2744\uFE0F","Let the Flow guide your next commit. \u{1F30A}\u2705"];var as=["I'm Feeling Lucky","Shipping awesomeness","Painting the serifs back on","Navigating the slime mold","Consulting the digital spirits","Reticulating splines","Warming up the AI hamsters","Asking the magic conch shell","Generating witty retort","Polishing the algorithms","Don't rush perfection (or my code)","Brewing fresh bytes","Counting electrons","Engaging cognitive processors","Checking for syntax errors in the universe","One moment, optimizing humor","Shuffling punchlines","Untangling neural nets","Compiling brilliance","Loading wit.exe","Summoning the cloud of wisdom","Preparing a witty response","Just a sec, I'm debugging reality","Confuzzling the options","Tuning the cosmic frequencies","Crafting a response worthy of your patience","Compiling the 1s and 0s","Resolving dependencies\u2026 and existential crises","Defragmenting memories\u2026 both RAM and personal","Rebooting the humor module","Caching the essentials (mostly cat memes)","Optimizing for ludicrous speed","Swapping bits\u2026 don't tell the bytes","Garbage collecting\u2026 be right back","Assembling the interwebs","Converting coffee into code","Updating the syntax for reality","Rewiring the synapses","Looking for a misplaced semicolon","Greasin' the cogs of the machine","Pre-heating the servers","Calibrating the flux capacitor","Engaging the improbability drive","Channeling the Force","Aligning the stars for optimal response","So say we all","Loading the next great idea","Just a moment, I'm in the zone","Preparing to dazzle you with brilliance","Just a tick, I'm polishing my wit","Hold tight, I'm crafting a masterpiece","Just a jiffy, I'm debugging the universe","Just a moment, I'm aligning the pixels","Just a sec, I'm optimizing the humor","Just a moment, I'm tuning the algorithms","Warp speed engaged","Mining for more Dilithium crystals","Don't panic","Following the white rabbit","The truth is in here\u2026 somewhere","Blowing on the cartridge","Loading\u2026 Do a barrel roll!","Waiting for the respawn","Finishing the Kessel Run in less than 12 parsecs","The cake is not a lie, it's just still loading","Fiddling with the character creation screen","Just a moment, I'm finding the right meme","Pressing 'A' to continue","Herding digital cats","Polishing the pixels","Finding a suitable loading screen pun","Distracting you with this witty phrase","Almost there\u2026 probably","Our hamsters are working as fast as they can","Giving Cloudy a pat on the head","Petting the cat","Rickrolling my boss","Slapping the bass","Tasting the snozberries","I'm going the distance, I'm going for speed","Is this the real life? Is this just fantasy?","I've got a good feeling about this","Poking the bear","Doing research on the latest memes","Figuring out how to make this more witty","Hmmm\u2026 let me think","What do you call a fish with no eyes? A fsh","Why did the computer go to therapy? It had too many bytes","Why don't programmers like nature? It has too many bugs","Why do programmers prefer dark mode? Because light attracts bugs","Why did the developer go broke? Because they used up all their cache","What can you do with a broken pencil? Nothing, it's pointless","Applying percussive maintenance","Searching for the correct USB orientation","Ensuring the magic smoke stays inside the wires","Rewriting in Rust for no particular reason","Trying to exit Vim","Spinning up the hamster wheel","That's not a bug, it's an undocumented feature","Engage.","I'll be back\u2026 with an answer.","My other process is a TARDIS","Communing with the machine spirit","Letting the thoughts marinate","Just remembered where I put my keys","Pondering the orb","Initiating thoughtful gaze","What's a computer's favorite snack? Microchips.","Why do Java developers wear glasses? Because they don't C#.","Charging the laser\u2026 pew pew!","Dividing by zero\u2026 just kidding!","Looking for an adult superviso\u2026 I mean, processing.","Making it go beep boop.","Buffering\u2026 because even AIs need a moment.","Entangling quantum particles for a faster response","Polishing the chrome\u2026 on the algorithms.","Are you not entertained? (Working on it!)","Summoning the code gremlins\u2026 to help, of course.","Just waiting for the dial-up tone to finish","Recalibrating the humor-o-meter.","My other loading screen is even funnier.","Pretty sure there's a cat walking on the keyboard somewhere","Enhancing\u2026 Enhancing\u2026 Still loading.","It's not a bug, it's a feature\u2026 of this loading screen.","Have you tried turning it off and on again?","Constructing additional pylons","New line? That\u2019s Ctrl+J.","Releasing the HypnoDrones","Pushing the button, Frank.","Consulting with the Companion Cube","Testing for science. You monster.","Dispensing deadly neurotoxin just kidding, compiling.","Now thinking with portals","Wheatley is currently attempting to hack this prompt","Developing combustible lemons","Aperture Science Enrichment Center is processing your request.","SPAAAACE! Space! SPAAAACE!","The cake is not a lie, it just needs a few more seconds.","Praise the Sun! \u2600\uFE0F","Hey you, you're finally awake.","Stay a while and listen.","All your base are belong to us.","It's dangerous to go alone! Take this code.","Protocol 3: Protect the Pilot.","Finish Him! (The loading bar, that is)","War war never changes. But this prompt will.","Snake? Snake?! SNAAAAKE!","Got a selection of good things on sale, stranger!","Boy! Read the documentation.","Reticulating Minecraft splines","Feed the loading bar a quick snack","Converting dark mode to dark magic","Asking the rubber duck for advice","Dividing by zero wait, NO NO NO\u2014","Herding the 1s and 0s back into line","Bribing the server with cookies","Establishing contact with the Moon base","Calibrating astronaut suit thrusters","Drawing doodle on space helmet","Synthesizing Lunafilament","Deactivating runaway lunar defense bots","Calculating gravity offset watch your step!","Hacking the Delphi Corporation mainframe","What comes after dreaming? Loading screen, apparently.","Petting the holographic giant cat","Securing payload for Earth re-entry","Wort wort wort!","Did you touch my Warthog?","One small step for man, one giant leap for the loading bar.","The Halo array is charging or maybe just a fan.","Deploying Pelican dropship eventually.","Just cleaning my plasma pistol BRB.","Checking Master Chief's helmet for scratches.","Counting sheep wait, wrong game.","S-Tier loading screen incoming.","Alarm blaring it's just your internet connection.","Looking for a helicopter or just your patience.","Need a taxi? Just kidding, I'm loading.","This loading time is criminal.","Wish I had a cheat code for fast loading.","Polishing the loading bar until it shines","Training the server hamsters","Baking a fresh batch of witty comments","Aligning my existential dread with your request","Just doodling on the terminal","Searching for the wifi password in the cosmos","Trying to remember my CAPTCHA training","Deciphering ancient scrolls (aka documentation)","Brewing a perfect cup of code","Petting the cat that photobombed my code","Applying a digital glow-up to your request","Checking my reflection in the buffer... okay, I'm ready","Consulting my mood board for the perfect response","Wait, let me fix my crown first","Manifesting a bug-free masterpiece","Slaying this prompt in 3... 2... 1...","Just a sec, I'm curate-ing the vibes","Putting the 'art' in Artificial Intelligence","Evaluating if this prompt is worthy of my brilliance","Updating my mental wardrobe for this task"];import bt,{useState as ud}from"react";import{Box as oo,Text as uo,useInput as md}from"ink";function ds({prompts:t,onSelect:u,onClose:x,theme:b="Dark"}){let p=Ye(b),[f,i]=ud(0);md(($,E)=>{E.escape&&x(),E.upArrow&&i(O=>Math.max(0,O-1)),E.downArrow&&i(O=>Math.min(t.length-1,O+1)),E.return&&t[f]&&u(t[f].id)});let B=Ve(2),c=10,v=0;if(t.length>c){let $=Math.floor(c/2);v=f-$,v<0?v=0:v+c>t.length&&(v=t.length-c)}let M=t.slice(v,v+c);return bt.createElement(oo,{flexDirection:"column",borderStyle:"round",borderColor:p.borderMuted,padding:0,width:"100%"},bt.createElement(oo,{paddingX:1,marginBottom:1},bt.createElement(uo,{color:p.text,bold:!0},"CODEBASE TIME TRAVEL: SELECT UNDO POINT")),bt.createElement(oo,{paddingX:2,marginBottom:1},bt.createElement(uo,{color:p.text},"Select a prompt to revert the codebase back to the state ",bt.createElement(uo,{bold:!0,color:p.secondary||"cyan"},"immediately before")," it was executed:")),t.length===0?bt.createElement(oo,{paddingX:2,paddingY:1},bt.createElement(uo,{italic:!0,color:p.textMuted},"No prompt checkpoints found for this session.")):bt.createElement(oo,{flexDirection:"column",width:"100%"},v>0&&bt.createElement(oo,{paddingX:2,marginBottom:1},bt.createElement(uo,{color:p.textMuted},"\u25B2 (+",v," more prompts above)")),M.map(($,E)=>{let D=v+E===f,A=fd($.timestamp),N=$.changes?$.changes.length:0;return bt.createElement(oo,{key:$.id,paddingX:1,backgroundColor:D?p.highlightBg:void 0,width:"100%"},bt.createElement(oo,{flexGrow:1},bt.createElement(uo,{color:D?p.text:p.textMuted,bold:D},D?"\u276F ":" ",'"',gd($.prompt),'"',bt.createElement(uo,{color:p.textMuted}," [",A," \u2022 ",N," file(s) changed]"))))}),v+c<t.length&&bt.createElement(oo,{paddingX:2,marginTop:1},bt.createElement(uo,{color:p.textMuted},"\u25BC (+",t.length-(v+c)," more prompts below)"))),bt.createElement(oo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:p.borderMuted},bt.createElement(uo,{color:p.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select undo point \u2022 Esc close")))}function gd(t){if(!t)return"";let x=(t.split(`
|
|
50
|
+
`)[0]||"").replace(/@\[(.*?)\]/g,(b,p)=>{let f=p.replace(/\\/g,"/").split("/");return`[${f[f.length-1]}]`});return x.length>69?x.slice(0,67)+"...":t.includes(`
|
|
51
|
+
`)?x+"...":x}function fd(t){if(!t)return"N/A";let u=new Date(t);if(isNaN(u.getTime()))return"N/A";let x=i=>String(i).padStart(2,"0"),b=x(u.getHours()),p=x(u.getMinutes()),f=x(u.getSeconds());return`${b}:${p}:${f}`}import hd from"puppeteer";import{exec as xd}from"child_process";import{promisify as pd}from"util";import qi from"fs";var Qi=pd(xd),zi=()=>{try{let t=pi();if(t.executablePath&&qi.existsSync(t.executablePath))return!0;let u=hd.executablePath();if(u&&qi.existsSync(u))return!0}catch{return!1}return!1},Ji=async t=>{t&&t("\u{1F4E5} Downloading Chromium engine (chrome@148)...");try{try{await Qi("pnpm exec puppeteer browsers install chrome@148")}catch{await Qi("npx -y puppeteer browsers install chrome@148")}return await new Promise(u=>setTimeout(u,1e3)),{success:!0}}catch(u){return console.error("[SETUP ERROR]",u),{success:!1,error:u.message}}};import Zi,{useState as Ri,useEffect as el}from"react";import{Text as tl}from"ink";var Td=({text:t,baseColor:u="grey",glintColor:x="gray",speed:b=200,glintWidth:p=6,typeSpeed:f=30,...i})=>{let[B,c]=Ri(-p),[v,M]=Ri(t);return el(()=>{let $=setInterval(()=>{c(E=>E>v.length+p?-p-40:E+1)},b);return()=>clearInterval($)},[v.length,b,p]),el(()=>{if(t&&(t.includes("Trying to reach")&&v&&v.includes("Trying to reach")||t.includes("Error Occurred")&&v&&v.includes("Error Occurred"))){M(t);return}if(v===t)return;let $=setTimeout(()=>{let E=0,O=Math.min(v.length,t.length);for(;E<O&&v[E]===t[E];)E++;v.length>E?M(D=>D.slice(0,-1)):v.length<t.length&&M(t.slice(0,v.length+1))},f);return()=>clearTimeout($)},[t,v,f]),Zi.createElement(tl,null,v.split("").map(($,E)=>{let D=Math.abs(E-B)<=p/2?x:u;return Zi.createElement(tl,{key:E,color:D,...i},$)}))},In=Td;var An=t=>{let u=String(t);return u.startsWith("999")&&u.endsWith("9")},ln=t=>t==null||t===0||An(t)?"":String(t),Ho=()=>{let t=(process.env.TERM_PROGRAM||"").toLowerCase();if(process.env.WT_SESSION)return"Windows Terminal";let u=x=>{let b=x.toLowerCase();for(let[p,f]of Object.entries(process.env))if(!["PATH","PWD","CWD","PS1","LS_COLORS","PROMPT"].includes(p)&&String(f).toLowerCase().includes(b))return!0;return!1};return t==="cursor"||process.env.CURSOR_SETTINGS_DIR||u("cursor")?"Cursor":t==="windsurf"||u("windsurf")?"Windsurf":u("antigravity")?"Antigravity":t==="trae"||u("trae")?"Trae":t==="codium"||u("codium")||u("vscode-oss")?"VSCodium":u("positron")?"Positron":t==="vscode-insiders"||u("insiders")?"VS Code Insiders":t==="vscode"||process.env.VSCODE_GIT_IPC_HANDLE||u("vscode")?"VS Code":process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS||u("intellij")?"JetBrains":"Terminal"},vd=t=>{switch(t){case"VS Code":return"Code";case"VS Code Insiders":return"Code - Insiders";case"Antigravity":return"Antigravity IDE";default:return t}},ol=t=>{let u=vd(t),x=gs.homedir();if(process.platform==="win32"){let b=process.env.APPDATA;return b?Bt.join(b,u,"User","keybindings.json"):null}else return process.platform==="darwin"?Bt.join(x,"Library","Application Support",u,"User","keybindings.json"):Bt.join(x,".config",u,"User","keybindings.json")},nl=t=>{let u=t.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"$1");return JSON.parse(u)},Md=t=>Array.isArray(t)?t.some(u=>u&&typeof u.key=="string"&&u.key.toLowerCase().replace(/\s+/g,"")==="shift+enter"&&u.command==="workbench.action.terminal.sendSequence"&&u.args&&u.args.text==="\x1B[13;2u"&&typeof u.when=="string"&&u.when.includes("terminalFocus")):!1,sl=t=>{let u=t==="VS Code",x=[];return u?(x.push({label:"Install Manually (VSIX)",url:"https://github.com/KushalRoyChowdhury/fluxflow-cli/releases"}),x.push({label:"Install from VS Code Marketplace",url:"https://marketplace.visualstudio.com/items?itemName=fluxflow-cli.fluxflow-cli-companion"})):x.push({label:`Download for ${t} (GitHub)`,url:"https://github.com/KushalRoyChowdhury/fluxflow-cli/releases"}),x.push({label:"Continue to CLI only",action:"dismiss"}),x},Ed=({width:t,height:u,selectedIndex:x,aiProvider:b,theme:p="Dark"})=>{let f=Ho(),i=sl(f);return e.createElement(m,{flexDirection:"column",alignItems:"center",justifyContent:"center",width:t,height:u},e.createElement(m,{marginBottom:1,width:Math.min(80,t-4),justifyContent:"flex-start"},e.createElement(s,null,Qn(zt,b,p))),e.createElement(m,{flexDirection:"column",borderStyle:"double",borderColor:"grey",paddingX:3,paddingY:1,width:Math.min(80,t-4)},e.createElement(s,{bold:!0,color:"white",textAlign:"center"},"\u{1F680} UPGRADE YOUR WORKFLOW"),e.createElement(m,{marginY:1,flexDirection:"column",alignItems:"left"},e.createElement(s,null,"You're in ",e.createElement(s,{bold:!0,color:"cyan"},f),", but the ",e.createElement(s,{bold:!0,color:"white"},"FluxFlow-CLI Companion")," is not installed."),e.createElement(m,{flexDirection:"column",marginY:1},e.createElement(s,{color:"gray"}," \u2705 Real-time IDE context & Error Resolution"),e.createElement(s,{color:"gray"}," \u2705 Auto-open files created by agent"),e.createElement(s,{color:"gray"}," \u2705 Native DIFFing for AI edits"),e.createElement(s,{color:"gray"}," \u2705 Direct IDE context sharing"),e.createElement(s,{color:"gray"}," \u2705 Surgical Diagnostic Sync"),e.createElement(s,{color:"gray"}," \u2705 Native Right-Click \u276F Chat integration"),e.createElement(s,{color:"gray"}," \u2705 Live Status in IDE"),e.createElement(s,{color:"gray"}," \u2705 Clickable terminal-to-code links"))),e.createElement(m,{flexDirection:"column",marginTop:1},i.map((B,c)=>e.createElement(m,{key:c},e.createElement(s,{color:x===c?"yellow":"white",bold:x===c},x===c?" \u276F ":" ",B.label)))),e.createElement(m,{marginTop:1,alignItems:"center",justifyContent:"center"},e.createElement(s,{dimColor:!0,italic:!0},"(Use arrows to navigate, Enter to select)"))))},us=Date.now(),rl="https://fluxflow-cli.onrender.com/changelog",ms="https://fluxflow-cli.onrender.com/",Bd=Bt.join(Bt.dirname(Sd(import.meta.url)),"../package.json"),il=JSON.parse(ot.readFileSync(Bd,"utf8")),zt=il.version,Dd=il.date||"2026-05-20";var kd=({data:t,onResolve:u,onEdit:x,theme:b="Dark"})=>{let p=Ye(b);return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:p.borderMuted,padding:0,width:"100%"},e.createElement(m,{paddingX:1},e.createElement(s,{color:p.text,bold:!0,underline:!0},t.startsWith("/btw")?"QUESTION":"STEERING HINT"," RESOLUTION")),e.createElement(m,{paddingX:1,marginTop:1},e.createElement(s,{color:p.text},"The agent already finished the task before your ",t.startsWith("/btw")?"question":"hint"," was consumed.")),e.createElement(m,{marginTop:1,backgroundColor:p.cardBg||p.codeBg||"#222",paddingX:2,width:"100%"},e.createElement(s,{italic:!0,color:p.textMuted},'"',t.replace("/btw","").trim(),'"')),e.createElement(m,{paddingX:1,marginTop:1},e.createElement(s,{color:p.textDim||p.textMuted},"How would you like to proceed?")),e.createElement(m,{marginTop:0},e.createElement(ft,{title:"Select Action",items:[{label:"Send Anyway",value:"send"},{label:"Edit Prompt",value:"edit"}],onSelect:f=>{(typeof f=="object"&&f!==null?f.value:f)==="send"?u(t):x(t)},theme:b})))};var Id=(()=>{let t=null,u=0;return x=>{let b=Date.now();if(t&&b-u<1e4)return t;let p=[],f=i=>{if(!(p.length>=2e3))try{let B=ot.readdirSync(i);for(let c of B){if(p.length>=2e3)return;if(["node_modules",".git",".gemini","dist","build",".next",".cache","out"].includes(c))continue;let v=Bt.join(i,c);ot.statSync(v).isDirectory()?f(v):p.push({name:lt(c),relativePath:lt(Bt.relative(process.cwd(),v))})}}catch{}};return f(x),t=p,u=b,p}})(),fr="Ctrl + Enter",Ad=t=>{if(t<=370)return"#00a564";if(t>=5e3)return"#ff0000";let u=[{t:370,r:0,g:165,b:100},{t:550,r:40,g:195,b:80},{t:800,r:120,g:220,b:50},{t:1100,r:190,g:225,b:20},{t:1500,r:250,g:210,b:15},{t:2e3,r:255,g:170,b:0},{t:2800,r:255,g:110,b:0},{t:3800,r:255,g:50,b:0},{t:5e3,r:255,g:0,b:0}];for(let x=0;x<u.length-1;x++){let b=u[x],p=u[x+1];if(t>=b.t&&t<=p.t){let f=(t-b.t)/(p.t-b.t);f=f*f*(3-2*f);let i=Math.round(b.r+(p.r-b.r)*f),B=Math.round(b.g+(p.g-b.g)*f),c=Math.round(b.b+(p.b-b.b)*f);return`#${((1<<24)+(i<<16)+(B<<8)+c).toString(16).slice(1)}`}}return"#ff0000"},Ld=e.memo(({sa:t,showTPMEstimate:u=!1})=>{let[x,b]=V("green"),[p,f]=V(0),i=Xe([]),B=Xe(370),c=Xe([]),v=Xe(t.lastChunkTime);return Ke(()=>{v.current=t.lastChunkTime},[t.lastChunkTime]),Ke(()=>{if(t.status!=="running"){c.current=[];return}if(t.wps>0){let M=c.current;M.push(t.wps),M.length>3&&M.shift(),f(Math.round(t.wps))}},[t.status,t.wps,t.lastChunkTime]),Ke(()=>{if(t.status!=="running"){f(0);return}let M=setInterval(()=>{let $=v.current,E=$>0?Date.now()-$:0;if($>0&&E>1500)c.current=[],f(0);else if($>0&&E>600){c.current.length>0&&c.current.shift();let O=c.current;if(O.length>0){let D=O.reduce((A,N)=>A+N,0);f(Math.round(D/O.length))}else f(0)}else{let O=c.current;if(O.length>0){let D=O.reduce((A,N)=>A+N,0);f(Math.round(D/O.length))}else t.wps>0&&f(Math.round(t.wps))}},750);return()=>clearInterval(M)},[t.status]),Ke(()=>{if(t.status!=="running"){i.current=[];return}let M=t.lastChunkTime;if(M>0){let O=i.current;(O.length===0||O[O.length-1]!==M)&&(O.push(M),O.length>10&&O.shift())}let $=()=>{if(!M){b("#00a564");return}let O=i.current,D=0;if(O.length>1){let Y=0;for(let W=1;W<O.length;W++)Y+=O[W]-O[W-1];D=Y/(O.length-1)}let A=Date.now()-M,Z=A>=2500,R=!Z&&D>0?Math.min(A,D*3):A,ce=Math.max(D,R),ge=Z?.4:.2;B.current=B.current*(1-ge)+ce*ge,b(Ad(B.current))};$();let E=setInterval($,100);return()=>clearInterval(E)},[t.status,t.lastChunkTime]),e.createElement(m,{justifyContent:"space-between",width:"100%"},e.createElement(s,{color:"white"}," \u2022 ",t.title," ",e.createElement(s,{color:"white",dimColor:!0},"(",t.id,")")),e.createElement(s,{color:"white"},e.createElement(s,{color:"white",dimColor:!0,bold:!0},t.currentTool||"Active"),e.createElement(s,{color:x}," \u25CF"),u&&e.createElement(s,{color:"white",dimColor:!0,bold:!0}," (",p," tps)")))});function _d({args:t=[]}){let u=Xe(1),[x,b]=V(!1),[p,f]=V(10),{stdout:i}=yd(),[B,c]=V(""),[v,M]=V(0),[$,E]=V(!1),[O,D]=V("Flux"),[A,N]=V({columns:i?.columns||80,rows:i?.rows||24}),[Z,R]=V(0),[ce,ge]=V(!1),[Y,W]=V(!1),[ie,Ee]=V(0),xe=Xe(0),Ae=Xe(0),le=Xe(null),Q=Xe(null),[pe,fe]=V(0),ue=()=>fe(o=>o+1),K=Xe([]),_=Xe(null),q=()=>{let o=K.current;if(o.length>0&&Q.current){let n=o.join("");o.length=0,Q.current.text=lt(Q.current.text+n),ue()}},oe=()=>{if(q(),Q.current){let o=lt(Q.current.text);Q.current.role==="think"&&(o=o.replace(/^\r?\n+/,"").replace(/\r?\n+$/,""));let n={...Q.current,text:o,isStreaming:!1};U(a=>{let w=[...a,n];return j(w.length),w}),Q.current=null}ys.current=0,wr.current={totalWords:0,startTime:0,wps:0,chunks:[]}},ve=()=>{_.current&&clearInterval(_.current),K.current=[],_.current=setInterval(()=>{try{let o=K.current;if(o.length>0&&Q.current){let n=1;o.length>85?n=30:o.length>80?n=25:o.length>75?n=20:o.length>65?n=16:o.length>50?n=12:o.length>35?n=8:o.length>15?n=6:o.length>5?n=4:o.length>3&&(n=2);let a="";for(let w=0;w<n&&o.length>0;w++)a+=o.shift();Q.current.text=lt(Q.current.text+a),ue()}}catch{}},80)},Oe=async()=>{for(;de.progressiveRendering&&K.current.length>0;)await new Promise(o=>setTimeout(o,10))},Me=o=>{if(de.progressiveRendering&&_.current){let n=o.split(/(\s+)/).filter(Boolean);for(let a of n)K.current.push(a)}else Q.current?Q.current.text=lt(Q.current.text+o):Q.current={id:"agent-"+Date.now(),role:"agent",text:lt(o),isStreaming:!0},ue()};Ke(()=>{let o=Ho(),n=!["Terminal","Windows Terminal"].includes(o)||!!process.env.VSC_TERMINAL_URL,a=setTimeout(()=>{n&&!Uo()&&W(!0)},500),w=setInterval(()=>{Uo()&&W(!1)},1e3);u.current=Date.now();let h=setInterval(()=>{u.current&&(Date.now()-u.current||0)>3e4&&global.gc&&(async()=>{for(let d=0;d<1;d++)global.gc(),await new Promise(S=>setImmediate(S));u.current=Date.now()})()},3e3);return()=>{clearTimeout(a),clearInterval(w),clearInterval(h)}},[]),Ke(()=>{(async()=>{try{let n=await Hr(),a=n?.systemSettings||{},w=a.CustomSubAgent,h=a.SubAgentModel;if(!w||!h||h==="Default")return;let y=process.env.SUBAGENT_MODEL?process.env.SUBAGENT_MODEL.trim():null,g=process.env.SUBAGENT_PROVIDER?process.env.SUBAGENT_PROVIDER.trim():null,d=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama"],I=(J=>{if(!J)return null;let se=J.toLowerCase();return se==="google"?"Google":se==="deepseek"?"DeepSeek":se==="openrouter"?"OpenRouter":se==="nvidia"?"NVIDIA":se==="mistral"?"Mistral":se==="ollama"?"Ollama":null})(g);if(y&&!I){let J=n.aiProvider||L||"Google";U(se=>(j(se.length+1),[...se,{id:"subagent-env-noprov-"+Date.now(),role:"system",text:`[SUBAGENT CONFIG] SUBAGENT_MODEL found in ENV but SUBAGENT_PROVIDER is missing/invalid. Active provider (${J}) will be used.`,isMeta:!0}]))}if(h==="ENV"){y||U(J=>(j(J.length+1),[...J,{id:"subagent-model-noenv-"+Date.now(),role:"system",text:"No SubAgent model is found in ENV, Using Deafult until changed",isMeta:!0}]));return}let F=n.aiProvider||L||"Google",ee=n.apiTier||tt||"Free",we=n.quotas||Pe||{},ne=new Set;(No(F,ee)||[]).forEach(J=>{let se=typeof J=="string"?J:J.cmd||J.name||J.id||String(J);se&&ne.add(se)});for(let J of d)try{if(await Jo(J)){let Re=we?.providerTiers?.[J]||"Free";(No(J,Re)||[]).forEach(Ce=>{let Ue=typeof Ce=="string"?Ce:Ce.cmd||Ce.name||Ce.id||String(Ce);Ue&&ne.add(Ue)})}}catch{}let Se=ne.has(h);y?y!==h&&U(J=>(j(J.length+1),[...J,{id:"subagent-model-env-"+Date.now(),role:"system",text:"Current Seleted Sub-Agent model is not available in this provider. Using model from ENV unless changed.",isMeta:!0}])):Se||U(J=>(j(J.length+1),[...J,{id:"subagent-model-err-"+Date.now(),role:"system",text:"Current Seleted Sub-Agent model is not available in this provider. Using Default until changed",isMeta:!0}]))}catch{}})()},[]);let z=sn(()=>{let o={};for(let n=0;n<t.length;n++)if(t[n]==="--key"&&t[n+1]){let w=t[n+1];if(o.key=w,w.includes("@")){let h=w.split("@"),y=h[0],g=h[1].toLowerCase();if(["google","deepseek","openrouter","nvidia"].includes(g)){let d="Google";g==="google"?d="Google":g==="deepseek"?d="DeepSeek":g==="openrouter"?d="OpenRouter":g==="nvidia"&&(d="NVIDIA"),o.key=y,o.provider=d}}}for(let n=0;n<t.length;n++){let a=t[n];if(a==="--key"){n++;continue}if(a==="--model"&&t[n+1])o.model=t[n+1],n++;else if(a==="--memory"&&t[n+1])o.memory=t[n+1].toLowerCase(),n++;else if(a==="--resume"&&t[n+1])o.resume=t[n+1],n++;else if(a==="--package"&&t[n+1]){let w=t[n+1].toLowerCase();["npm","pnpm","yarn","bun"].includes(w)&&(o.package=w),n++}else if(a==="--auto-del"&&t[n+1]){let w=t[n+1].toLowerCase();["1d","7d","30d"].includes(w)&&(o.autoDel=w),n++}else if(a==="--auto-exec"&&t[n+1])o.autoExec=t[n+1].toLowerCase(),n++;else if(a==="--yolo"&&t[n+1])o.autoExec=t[n+1].toLowerCase(),n++;else if(a==="--external-access"&&t[n+1])o.externalAccess=t[n+1].toLowerCase(),n++;else if(a==="--mode"&&t[n+1]){let h=t[n+1].toLowerCase();if(["flux","flow"].includes(h)){let y="Flux";h==="flux"?y="Flux":h==="flow"&&(y="Flow"),o.mode=y}n++}else if(a==="--thinking"&&t[n+1]){let h=t[n+1].toLowerCase();if(["fast","low","medium","high","xhigh","standard"].includes(h)){let y="Medium";h==="fast"?y="Fast":h==="low"?y="Low":h==="standard"?y="Standard":h==="medium"?y="Medium":h==="high"?y="High":h==="xhigh"&&(y="xHigh"),o.thinking=y}n++}else if(a==="--provider"&&t[n+1]){let w=t[n+1].toLowerCase();if(["google","deepseek","openrouter","nvidia","mistral","ollama"].includes(w)){let h="Google";w==="google"?h="Google":w==="deepseek"?h="DeepSeek":w==="openrouter"?h="OpenRouter":w==="nvidia"?h="NVIDIA":w==="mistral"?h="Mistral":w==="ollama"&&(h="Ollama"),o.provider=h}n++}else(a==="--resume"||a==="-r")&&t[n+1]?(o.resume=t[n+1],n++):a==="--playground"?o.playground=!0:(a==="--original-cwd"||a==="--orginal-cwd")&&t[n+1]&&(o.originalCwd=t[n+1],n++)}return o},[t]),Je=async(o=!1,n=null)=>{let a=n||de;o&&U(w=>(j(w.length+1),[...w,{id:"check-"+Date.now(),role:"system",text:"\u2726 Checking for updates...",isMeta:!0}]));try{let h=await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json(),y=h["dist-tags"]?.latest,g=h["dist-tags"]?.stable;if(y&&ct(y),y&&y!==zt){let d=y===g?`v${y}-stable`:`v${y}`;!o&&a.autoUpdate?G("update"):U(S=>{let I=[...S],F=o?I.length:Math.min(I.length,3);return I.splice(F,0,{id:"update-"+Date.now(),role:"system",text:`A new version (${d}) is here.
|
|
52
|
+
|
|
53
|
+
\u2022 Type \`/update latest\` to apply the update.
|
|
54
|
+
\u2022 Type \`/changelog\` to view the release notes.`,isUpdateNotification:!0,isMeta:!0}),I})}else o&&U(d=>{j(d.length+1);let S=y&&y===g?`${zt}-stable`:zt;return[...d,{id:"uptodate-"+Date.now(),role:"system",text:`\u2800\u2800\u2514\u2500 Already up to date (${S}).
|
|
55
|
+
\u2800`,isMeta:!0}]})}catch(w){o&&U(h=>(j(h.length+1),[...h,{id:"check-err-"+Date.now(),role:"system",text:`\u2800\u2800\u2514\u2500 Failed to check for updates: ${w.message}.
|
|
56
|
+
\u2800`,isMeta:!0}]))}};Ke(()=>{let o=()=>{i.write("\x1B[2J\x1B[3J\x1B[H"),N({columns:i.columns,rows:i.rows})};return i.on("resize",o),()=>{i.off("resize",o)}},[i]);let[We,st]=V("Medium"),[L,he]=V("Google"),[qe,Qe]=V(0),[Tt,ct]=V(null),[vt,mo]=V(!1),[it,St]=V(so("Google","Free")||"gemma-4-31b-it"),[Ln,Te]=V(!1),[ae,T]=V(ri("gemma_janitor_fallback_google")||"gemma-4-26b-a4b-it"),[P,ye]=V(!0),[Ne,ut]=V(!0),ze=Xe(0),[ke,Dt]=V(null),[He,Ot]=V(""),Bo=async o=>{let n=ol(o);if(n)try{await ot.ensureDir(Bt.dirname(n));let a=[];if(ot.existsSync(n)){let w=ot.readFileSync(n,"utf8").trim();if(w)try{a=nl(w)}catch{a=[]}}Array.isArray(a)||(a=[]),a.push({key:"shift+enter",command:"workbench.action.terminal.sendSequence",args:{text:"\x1B[13;2u"},when:"terminalFocus"}),ot.writeFileSync(n,JSON.stringify(a,null,4),"utf8"),fr="Shift + Enter",U(w=>(j(w.length+1),[...w,{id:"kb-success-"+Date.now(),role:"system",text:`\u2726 Successfully configured Shift+Enter in your ${o} keybindings!
|
|
57
|
+
`,isMeta:!0}]))}catch(a){U(w=>(j(w.length+1),[...w,{id:"kb-error-"+Date.now(),role:"system",text:`\u2726 Failed to update keybindings: ${a.message}.
|
|
58
|
+
\u2800`,isMeta:!0}]))}},[nt,G]=V("chat"),[tt,Do]=V("Free"),[Pe,Pt]=V({limitMode:"Daily",agentLimit:99999999,tokenLimit:99999999999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerBudgets:{}}),[Jt,dt]=V(null),[Yt,ll]=V("chat"),[Xo,hr]=V("settings"),[Wo,al]=V([]),[Od,dl]=V(0),[fs,_n]=V(0),[xr,hs]=V({}),[xs,ps]=V({}),[pr,an]=V(0),[de,Mt]=V({memory:!0,theme:"Dark",compression:0,autoExec:!1,autoDeleteHistory:"7d",autoUpdate:!1,updateManager:"npm",customUpdateCommand:""}),l=sn(()=>Ye(de.theme),[de.theme]),[dn,Ts]=V({name:null,nickname:null,instructions:null}),[go,On]=V({keyType:"Default",quality:"Low-High",apiKey:""}),[fo,ko]=V({tokens:0}),[ws,Tr]=V(0),ys=Xe(0),wr=Xe({totalWords:0,startTime:0,wps:0,chunks:[]}),[cl,bs]=V(0),[ul,ml]=V(0),[Ht,Ss]=V(0),[gl,cn]=V(0),un=Xe(0),[Pn,Cs]=V(0),[Go,vs]=V(0),[Pd,fl]=V(0),[Nd,hl]=V(0),[Fd,xl]=V(0),[Nn,pl]=V(0),[Fn,Tl]=V(0),[Un,wl]=V(0),[Ms,yl]=V(0),[mn,yr]=V(null),[Io,br]=V(null),[Sr,Es]=V(null),[no,Cr]=V("daily"),[bl,$n]=V(0),gn="flow-playground",[Ze,Hn]=V(t.includes("--playground")?gn:Yr());Ke(()=>{if(Oo.current)return;let o=Ht-un.current;cn(o),Ze&&gi(Ze,o,fo.tokens).catch(()=>{})},[Ht,Ze,fo.tokens]),Ke(()=>{nt==="apiTier"&&(async()=>{let n=await Zn();yr(n);let a=await Rn();br(a);let w=await jr(Pe.resetDay||1);Es(w)})()},[nt,Pe.resetDay]);let[jt,Bs]=V(null),[Yo,jo]=V(""),[fn,Ds]=V(!1),[vr,Sl]=V([]),[Ud,$d]=V(0),ks=Xe(!0),Is=Xe(!0),As=Xe(!0),Ls=Xe(L),Mr=Xe(!1),Er=Xe(!0);Ke(()=>{Ln&&(Te(!1),U(o=>(j(o.length+1),[...o,{id:Date.now(),role:"system",text:`\u2726 Wildcard Tooling:
|
|
59
|
+
\u2800\u2800\u2514\u2500 Status: Disabled.
|
|
60
|
+
\u2800`,isMeta:!0}])))},[it]),Ke(()=>{Ls.current!==L?(Ls.current=L,st(L==="DeepSeek"||L==="NVIDIA"||L==="Mistral"?"Standard":"Medium")):L==="Google"&&We==="xHigh"&&it&&it.toLowerCase().startsWith("gemini-3")&&st("High")},[L,it,We]),Ke(()=>{if(!ke)return;if(ks.current){ks.current=!1,setTimeout(()=>{Is.current=!1,setTimeout(()=>{As.current=!1},1e3)},2e3);return}if(Is.current||As.current)return;let o=so(L,tt),n=o;o.includes("gemma")?n="Gemma":o.includes("deepseek")?n="DeepSeek Flash":o.includes("devstral")?n="Devstral":o.includes("mistral")?n="Mistral":o.includes("gemini")&&(n="Gemini Flash"),St(o),It({apiTier:tt,activeModel:o})},[tt,L,ke]);let Cl=sn(()=>{let o=Ho();return{isIDE:!["Terminal","Windows Terminal"].includes(o)||!!process.env.VSC_TERMINAL_URL||!!process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS,get shortcut(){return fr}}},[]),Xn=Xe(null),Br=Xe("");Ke(()=>{Xn.current=jt},[jt]),Ke(()=>{Br.current=Yo},[Yo]);let[vl,Ml]=V(!1),[ho,Vo]=V(null),[Ao,Dr]=V(null),Wn=o=>{Vo(null),G("chat")},_s=o=>{let n=Math.floor(o/3600),a=Math.floor(o%3600/60),w=o%60,h=[];return n>0&&h.push(`${n}h`),(a>0||n>0)&&h.push(`${a}m`),h.push(`${w}s`),h.join(" ")},Lo=o=>o<1e3?`${o}ms`:_s(Math.floor(o/1e3)),[hn,kr]=V(null),[Ir,Os]=V(""),[El,Bl]=V(!1),[Ps,xn]=V(0),pn;Ke(()=>{let o;if(hn&&de.loadingPhrases!==!1){let n=()=>{let a=as[Math.floor(Math.random()*as.length)];Os(a)};Ir||n(),o=setInterval(n,1e4)}else Os("");return()=>{clearInterval(o)}},[hn,de]);let[Hd,Dl]=V(!0),[Ko,Ar]=V(!1),[Gn,Ns]=V(!1),[kl,Il]=V(!1),[Fs,Xd]=V(null),[Us,Tn]=V(0),[Al,$s]=V([]),_o=Xe(null),Oo=Xe(!1);Ke(()=>()=>{_o.current&&clearTimeout(_o.current)},[]);let Lr=Xe(!1),[Wd,_r]=V(null),[Ll,Or]=V(null),[Gd,_l]=V(null);Ke(()=>Tn(0),[B]);let[mt,Ol]=V(()=>{let o={id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0},n=process.cwd()===gs.homedir(),a=(()=>{let h=process.cwd().toLowerCase();if(process.platform==="win32"){let y=process.env.SystemRoot?.toLowerCase()||"c:\\windows",g=process.env.ProgramFiles?.toLowerCase()||"c:\\program files",d=process.env["ProgramFiles(x86)"]?.toLowerCase()||"c:\\program files (x86)";return h.startsWith(y)||h.startsWith(g)||h.startsWith(d)}else return h==="/"||["/bin","/sbin","/etc","/usr","/var","/root"].some(g=>h.startsWith(g))})(),w=[o];return a?w.push({id:"system-warning",role:"system",text:"[CRITICAL SECURITY ALERT] SYSTEM DIRECTORY DETECTED",subText:`You are currently in a PROTECTED SYSTEM DIRECTORY (${process.cwd()}). Operating here is EXTREMELY dangerous as the agent could accidentally corrupt your OS or installed applications. Open FluxFlow in project folder to work safely.`,isHomeWarning:!0}):n&&w.push({id:"home-warning",role:"system",text:"[SECURITY ALERT] HOME DIRECTORY DETECTED",subText:`You are currently in ${gs.homedir()}. Working here is high-risk as the agent may modify system-sensitive configurations. Please open FluxFlow in project folder.`,isHomeWarning:!0}),w}),U=o=>{Ol(n=>{let a=typeof o=="function"?o(n):o;if(a.length>1){let w=a[a.length-1],h=a[a.length-2];if(w?.text?.includes("Request Cancelled")&&h?.text?.includes("Request Cancelled"))return a.slice(0,-1)}return a})},xo=Xe(null),[Hs,Pl]=V(""),[Xs,Ws]=V(!1),Gs=Xe(""),Ys=Xe(null);Ke(()=>{if(mt.length===0)return;let o=mt[mt.length-1];if(o&&(o.role==="agent"||o.role==="assistant")){let a=(o.text||"").match(/\[ANSWER\]([\s\S]*?)(?:\[\/ANSWER\]|$)/i);if(a){let w=a[1].trim();w&&w!==Gs.current&&(Pl(w),Gs.current=w,Ys.current!==o.id&&Ws(!0))}}},[mt]);let[po,j]=V(mt.length),[Po,Pr]=V(0),Yd=Xe([]),Ut=Xe({completedIndex:0,columns:0,historicalBlocks:[],seenSelections:new Set,chatId:"",clearKey:0,theme:""}),js=sn(()=>{let o=A.columns||80,n=/Selection: (.*)/,a=[],w=new Set,h=Ut.current.columns!==o,y=po<Ut.current.completedIndex,g=Ut.current.chatId!==Ze,d=Ut.current.clearKey!==Po,S=Ut.current.theme!==de.theme;if(h||y||g||d||S){let ne=mt.slice(0,po);for(let be=0;be<ne.length;be++){let Se=ne[be];if(Se.isAskRecord&&Se.text){let se=Se.text.match(n);if(se&&se[1].trim()){let Re=se[1].trim();if(w.has(Re))continue;w.add(Re)}}let J=yn(Se,o);for(let se=0;se<J.completed.length;se++)a.push(J.completed[se]);for(let se=0;se<J.active.length;se++)a.push(J.active[se])}Ut.current={completedIndex:po,columns:o,historicalBlocks:a,seenSelections:new Set(w),chatId:Ze,clearKey:Po,theme:de.theme}}else if(a=Ut.current.historicalBlocks,w=Ut.current.seenSelections,po>Ut.current.completedIndex){a=[...a],w=new Set(w);let ne=mt.slice(Ut.current.completedIndex,po);for(let be=0;be<ne.length;be++){let Se=ne[be];if(Se.isAskRecord&&Se.text){let se=Se.text.match(n);if(se&&se[1].trim()){let Re=se[1].trim();if(w.has(Re))continue;w.add(Re)}}let J=yn(Se,o);for(let se=0;se<J.completed.length;se++)a.push(J.completed[se]);for(let se=0;se<J.active.length;se++)a.push(J.active[se])}Ut.current={completedIndex:po,columns:o,historicalBlocks:a,seenSelections:w,chatId:Ze,clearKey:Po}}let I=mt.slice(po),F=[],ee=[];for(let ne=0;ne<I.length;ne++){let be=I[ne];if(be.isAskRecord&&be.text){let J=be.text.match(n);if(J&&J[1].trim()){let se=J[1].trim();if(w.has(se))continue}}let Se=yn(be,o);for(let J=0;J<Se.completed.length;J++)F.push(Se.completed[J]);for(let J=0;J<Se.active.length;J++)ee.push(Se.active[J])}if(Q.current){let ne=yn(Q.current,o);for(let be=0;be<ne.completed.length;be++)F.push(ne.completed[be]);for(let be=0;be<ne.active.length;be++)ee.push(ne.active[be])}let we=F.length===0?a:a.concat(F);return we.length>=75e3&&(we=[...we],we.push({key:`memory-warning-block-${we.length}`,msg:{role:"system",text:"\u26A0\uFE0F MEMORY WARNING: CHAT IS GETTING VERY LONG",subText:`This session has reached ${we.length} blocks. To maintain optimal performance and prevent high memory usage, it is highly recommended to save and start a clean chat with /clear.`,isHomeWarning:!0},type:"full-message"})),{completed:we,active:ee}},[mt,po,A.columns,Po,Ze,pe]),Nl=sn(()=>{if(!jt||!Yo)return!1;let o=Yo.trim();return o.endsWith("?")||o.endsWith(":")||/\[[yYnN/]+\]\s*$/.test(o)||/\([yYnN]\)\s*$/.test(o)},[jt,Yo]);wd((o,n)=>{if(!(o==="\x1B[I"||o==="\x1B[O"||o==="[I"||o==="[O")){if(n.ctrl&&(o.toLowerCase()==="r"||o===""||o==="")){$i();return}if(nt==="stats"){if(n.tab&&!n.shift){Cr(a=>a==="modelBreakdown"?"daily":a==="daily"?"monthly":"daily"),$n(0);return}if(n.space||o===" "){Cr(a=>a==="modelBreakdown"?"daily":"modelBreakdown"),$n(0);return}if(n.upArrow){$n(a=>Math.max(0,a-1));return}if(n.downArrow){$n(a=>Math.min(Ae.current,a+1));return}}if(Y){let a=Ho(),w=sl(a);if(n.upArrow)Ee(h=>h>0?h-1:w.length-1);else if(n.downArrow)Ee(h=>h<w.length-1?h+1:0);else if(n.return){let h=w[ie];if(h.action==="dismiss")W(!1);else if(h.url){let y=process.platform==="win32"?`start ${h.url}`:process.platform==="darwin"?`open ${h.url}`:`xdg-open ${h.url}`;gr(y),W(!1)}}return}if(n.tab&&jt){Ds(a=>!a);return}if(fn&&jt){if(n.return)if(Zo)$t("\r");else{let a=process.platform==="win32";$t(a?`\r
|
|
61
|
+
`:`
|
|
62
|
+
`),jo(w=>w+`
|
|
63
|
+
`)}else if(n.backspace||n.delete)Zo?$t("\x7F"):($t("\b \b"),jo(a=>a.slice(0,-1)));else if(n.upArrow)$t(n.shift?"\x1B[1;2A":"\x1B[A");else if(n.downArrow)$t(n.shift?"\x1B[1;2B":"\x1B[B");else if(n.rightArrow)$t(n.shift?"\x1B[1;2C":"\x1B[C");else if(n.leftArrow)$t(n.shift?"\x1B[1;2D":"\x1B[D");else if(n.escape)$t("\x1B");else if(n.ctrl&&o){let a=o.toLowerCase().charCodeAt(0);a>=97&&a<=122?$t(String.fromCharCode(a-96)):$t(o)}else o&&($t(o),Zo||jo(a=>a+o));return}if(nt==="providerBudgetSelect"){let a=["Google","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama"];if(n.upArrow){_n(w=>(w-1+a.length)%a.length);return}else if(n.downArrow){_n(w=>(w+1)%a.length);return}else if(o===" "){let w=a[fs];hs(h=>({...h,[w]:!h[w]}));return}else if(n.return){let w=a.filter(y=>xr[y]);if(w.length===0)return;let h={...Pe,providerBudgets:{...Pe.providerBudgets||{},__useProvider:!0}};Pt(h),al(w),dl(0),_n(0),G("providerBudgetFlow");return}else if(n.escape){G("budgetTypeSelect");return}return}if(nt==="providerBudgetFlow"){let a=Wo.length*2+1;if(n.upArrow){an(w=>Math.max(0,w-1));return}else if(n.downArrow){an(w=>Math.min(a-1,w+1));return}else if(n.return){if(pr===a-1){let w=Pe.providerBudgets||{},h={__useProvider:!0};for(let d of Wo){let S=xs[d]||{};h[d]={agentLimit:9999999999,tokenLimit:parseInt(S.tokenLimit,10)||0,monthlyTokenLimit:parseInt(S.monthlyTokenLimit,10)||0}}let y={...Pe,providerBudgets:h};Pt(y),It({apiTier:tt,quotas:y}),G(Yt==="settings"?"resetMode":"budgetResetMode")}else an(w=>Math.min(a-1,w+1));return}else if(n.escape){G("providerBudgetSelect");return}return}if(n.escape){if(Xs){if(Ws(!1),mt.length>0){let a=mt[mt.length-1];a&&(Ys.current=a.id)}return}if(Fe.length>0&&nt==="chat"){ge(!0);return}if(x){b(!1);return}if(Ko||jt||ho||Ao)Lr.current=!0,Si(),ci(),ho&&(ho.resolve("deny"),Vo(null)),Ao&&(Ao.resolve(null),Dr(null)),Il(!1),Fs&&clearTimeout(Fs);else if(nt==="revert")G("chat"),Tn(0);else if(nt!=="chat"&&nt!=="settings")G("chat");else{if(!ke&&qe===1){Qe(0),Ot("");return}Tn(a=>{let w=a+1;return w===1?(_o.current&&clearTimeout(_o.current),_o.current=setTimeout(()=>Tn(0),2e3)):w===2&&(_o.current&&clearTimeout(_o.current),Tn(0),B.length>0?c(""):Sn.getChatHistory(Ze).then(h=>{h.length>0?($s(h.reverse()),G("revert")):U(y=>(j(y.length+1),[...y,{id:"revert-empty-"+Date.now(),role:"system",text:`\u2726 Nothing to revert to.
|
|
64
|
+
\u2800`,isMeta:!0}]))})),w})}}if(Fe.length>0&&nt==="chat"){if(n.upArrow){R(a=>{let w=a>0?a-1:Fe.length-1,h=0;for(;w!==a&&h<Fe.length;){let y=Fe[w],g=y?.cmd||y||"";if(typeof g=="string"&&g.trimStart().startsWith("---"))w=w>0?w-1:Fe.length-1,h++;else break}return w});return}if(n.downArrow){R(a=>{let w=a<Fe.length-1?a+1:0,h=0;for(;w!==a&&h<Fe.length;){let y=Fe[w],g=y?.cmd||y||"";if(typeof g=="string"&&g.trimStart().startsWith("---"))w=w<Fe.length-1?w+1:0,h++;else break}return w});return}if(n.return)return}if(n.tab&&nt==="chat"&&Fe.length>0){let a=Fe[Z]||Fe[0],w=B.split(" ");if(w.length===1)c(a.cmd+" ");else{let h=w.slice(0,-1);c(h.join(" ")+" "+a.cmd+" ")}R(0),M(h=>h+1);return}if(n.ctrl&&o==="c"&&nt!=="exit"){if(B.length>0){c("");return}if(n.shift){G("exit"),b(!1);return}x?(G("exit"),b(!1)):b(!0)}n.return&&(n.shift||n.ctrl||n.meta||n.leftAlt||n.rightAlt)&&c(a=>a.replace(/\\\r?$/,"").replace(/\r?$/,"")+`
|
|
65
|
+
`)}}),Ke(()=>{process.stdout.write("\x1B[?1004h");let o=n=>{let a=n.toString();a.includes("\x1B[I")?(ut(!0),ze.current=Date.now()):a.includes("\x1B[O")&&(ut(!1),ze.current=Date.now())};return process.stdin.on("data",o),()=>{process.stdout.write("\x1B[?1004l"),process.stdin.off("data",o)}},[]);let Yn=Xe(de.theme);Ke(()=>{Yn.current&&Yn.current!==de.theme?(Yn.current=de.theme,i&&(i.write("\x1B[2J\x1B[3J\x1B[H"),i.isTTY&&i.write("\x1B[?2004h")),Pr(o=>o+1),io()):Yn.current=de.theme},[de.theme,i]),Ke(()=>{async function o(){try{let I=JSON.parse(ot.readFileSync(Bt.join(process.cwd(),"package.json"),"utf8"));Vr(zt||I.version||"2.0.0")}catch{Vr("2.0.0")}process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07")),zi()||(U(I=>(j(I.length+1),[...I,{id:"setup-"+Date.now(),role:"system",text:"\u2726 Installing Required dependencies... (One-time setup)",isMeta:!0}])),await Ji(),U(I=>(j(I.length+1),[...I,{id:"setup-done-"+Date.now(),role:"system",text:`\u2800\u2800\u2514\u2500 All dependencies installed successfully.
|
|
66
|
+
\u2800`,isMeta:!0}]))),await oi();let n=await Hr();Mr.current=n.systemSettings?.allowExternalAccess??!1,Er.current=n.systemSettings?.memory??!0,z.mode?D(z.mode):D(n.mode),z.thinking?st(z.thinking):st(n.thinkingLevel);let a=z.provider||n.aiProvider||"Google";he(a);let h=(n.quotas?.providerTiers||{})[a]||n.apiTier||"Free";if(le.current=n.activeModel,z.model)St(z.model);else if(z.provider){let I=so(a,h);St(I)}else St(n.activeModel);mo(n.showFullThinking),Do(h),Pt(n.quotas||{limitMode:"Daily",agentLimit:99999999,tokenLimit:99999999999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerBudgets:{}});let y={memory:!0,compression:0,autoExec:!1,autoDeleteHistory:"7d",autoUpdate:!1,updateManager:"npm",customUpdateCommand:"",...n.systemSettings||{}};z.memory==="on"?y.memory=!0:z.memory==="off"&&(y.memory=!1),a==="NVIDIA"&&process.env.NVIDIA_BASE_URL&&(y.memory=!1,U(I=>[...I,{role:"system",text:`\u2726 MEMORY
|
|
67
|
+
\u2800\u2800\u2514\u2500 Currently not available.
|
|
68
|
+
\u2800`,isMeta:!0}])),z.package&&(y.updateManager=z.package),z.autoDel&&(y.autoDeleteHistory=z.autoDel),z.autoExec==="on"?y.autoExec=!0:z.autoExec==="off"&&(y.autoExec=!1),z.externalAccess==="on"?y.allowExternalAccess=!0:z.externalAccess==="off"&&(y.allowExternalAccess=!1),z.playground&&(y.allowExternalAccess=!1,y.memory=!1),Mt(y),Ts(n.profileData),On(n.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""});let g=z.key;if(g||(g=await Jo(a)),g&&(Dt(g),Cn(g,{aiProvider:a,onIDEApproval:Wn})),n.systemSettings?.autoDeleteHistory&&ui(n.systemSettings.autoDeleteHistory),mi(qn),z.playground||(zn(gn).catch(()=>{}),ot.remove(Bt.join(wo,"playground")).catch(()=>{})),setTimeout(()=>{Je(!1,y)},1e3),await Promise.all([fi(),Sn.recoverCrashedTransaction()]),z.resume){let I=await yo(),F=z.resume;if(I[F]){Oo.current=!0,Hn(F);let ee=await Jn(F);un.current=Ht-ee.total,Oo.current=!1,cn(ee.total),ko({tokens:ee.context});let we=[...I[F].messages];we[0]?.text?.includes("\u2591\u2591\u2591\u2588\u2588\u2588")||we.unshift({id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}),U(we),G("chat"),U(be=>{let Se=[...be,{id:"sys-"+Date.now(),role:"system",text:`\u2726 SESSION RESUMED
|
|
69
|
+
\u2800\u2800\u2514\u2500 '${F}'.
|
|
70
|
+
\u2800`,isMeta:!0}];return j(Se.length),Se})}else U(ee=>[...ee,{id:"sys-err-"+Date.now(),role:"system",text:`\u2726 Chat session [${F}] not found. Started new session.
|
|
71
|
+
\u2800`,isMeta:!0}])}if(z.playground){let I=Bt.join(wo,"playground");try{ot.ensureDirSync(I),process.chdir(I)}catch{}let F=await yo();if(F[gn]){let ee=[...F[gn].messages];ee[0]?.isLogo||ee.unshift({id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}),U(ee),U(we=>{let ne=[...we,{id:"playground-"+Date.now(),role:"system",text:`\u2726 PLAYGROUND Session restored
|
|
72
|
+
\u2800\u2800\u2514\u2500 CWD locked to: '${I}'.
|
|
73
|
+
\u2800`,isMeta:!0}];return j(ne.length),ne})}else U(ee=>{let we=[...ee,{id:"playground-"+Date.now(),role:"system",text:`\u2726 PLAYGROUND Mode active
|
|
74
|
+
\u2800\u2800\u2514\u2500 CWD locked to: 'FluxFlow/playground'.
|
|
75
|
+
\u2800`,isMeta:!0}];return j(we.length),we})}let d=Ho();if(!["Terminal","Windows Terminal"].includes(d)){let I=ol(d);if(I)try{let F=[];if(ot.existsSync(I)){let ee=ot.readFileSync(I,"utf8").trim();ee&&(F=nl(ee))}Md(F)?fr="Shift + Enter":G("keybindingsPrompt")}catch{}}ye(!1)}o()},[]),Ke(()=>{let o;return x&&(f(10),o=setInterval(()=>{f(n=>n<=1?(b(!1),0):n-1)},1e3)),()=>{o&&clearInterval(o)}},[x]),Ke(()=>{if(!P){let o=z.model&&it===z.model?le.current:it,n=de;z.playground&&(n={...de,allowExternalAccess:Mr.current,memory:Er.current}),It({mode:O,thinkingLevel:We,aiProvider:L,activeModel:o||it,showFullThinking:vt,systemSettings:n,profileData:dn,imageSettings:go,apiTier:tt})}},[O,We,L,it,vt,de,dn,go,P,z,tt]);let Vs=async o=>{let n=o.trim(),a={Google:{prefix:"AIzaSy",minLength:39},OpenRouter:{prefix:"sk-or-v1-",minLength:73},DeepSeek:{prefix:"sk-",minLength:35},Mistral:{prefix:"",minLength:32},NVIDIA:{prefix:"nvapi-",minLength:70},Ollama:{prefix:"",minLength:0}},{prefix:w,minLength:h}=a[L]??{prefix:"",minLength:0},y=L==="Ollama"&&(n.trim()==="LOCAL"||n.trim()===""),g=y?"LOCAL":n;if(y||n.startsWith(w)&&n.length>=h){await $r(L,g),Dt(g),Cn(g,{aiProvider:L,onIDEApproval:Wn});let d="gemma-4-31b-it";L==="OpenRouter"?d="google/gemma-4-31b-it:free":L==="DeepSeek"?d="deepseek-v4-flash":L==="NVIDIA"?d="deepseek-ai/deepseek-v4-flash":L==="Ollama"&&(d=it||""),St(d);let S={...de};y&&(S={...S,ollamaEndpoint:"Local"},Mt(S)),It({aiProvider:L,activeModel:d,systemSettings:S}),U(I=>[...I,{role:"system",text:`\u2726 ${L} API Key saved successfully! ${d?`
|
|
76
|
+
\u2800\u2800\u2514\u2500 Model set to ${d}.`:""}${y?`
|
|
77
|
+
\u2726 Ollama Endpoint switched to Local.
|
|
78
|
+
\u2514\u2500\u2800`:`
|
|
79
|
+
|
|
80
|
+
\u2726\u2800`}Initialization complete.
|
|
81
|
+
\u2800`,isMeta:!0}])}else U(d=>[...d,{role:"system",text:`\u2726 INVALID KEY
|
|
82
|
+
\u2800\u2800\u2514\u2500 ${L} API key must start with "${w}" and be at least ${h} characters long.`,isMeta:!0}]),Ot("")},jn=Xe(us);Ke(()=>{if(nt==="exit"){(async()=>{let a=Date.now(),w=Math.floor((a-jn.current)/1e3);w>=1&&(await Fo("duration",w),jn.current+=w*1e3),await hi()})();let n=setTimeout(()=>{process.exit(0)},200);return()=>clearTimeout(n)}},[nt]),Ke(()=>{let o=setInterval(async()=>{if(!P){let n=Date.now(),a=Math.floor((n-jn.current)/1e3);a>=1&&(await Fo("duration",a),jn.current+=a*1e3)}},5e3);return()=>clearInterval(o)},[P]);let Ks=[{cmd:"/quit",desc:"Exit and shutdown Flux"},{cmd:"/help",desc:"Show all available commands"},...z.playground?[{cmd:"/move",desc:"Move playground directory to original CWD/playground-export"}]:[],{cmd:"/resume",desc:"Load previous session"},{cmd:"/clear",desc:"Clear terminal screen"},{cmd:"/compress",desc:"Summarize and compress chat history"},{cmd:"/truncate",desc:"Truncate tool results in chat history"},{cmd:"/revert",desc:"Revert codebase back to a checkpoint"},{cmd:"/gemini",desc:"Get a happy message from Gemini CLI"},{cmd:"/save",desc:"Force save current chat"},{cmd:"/export",desc:"Export current chat or error logs",subs:[{cmd:"chat",desc:"Export current active chat"},{cmd:"logs",desc:"Export error logs"}]},{cmd:"/chats",desc:"List all chat sessions"},{cmd:"/btw",desc:"Ask a question without intefering with ongoing tasks"},{cmd:"/thinking",desc:"Set AI reasoning depth",subs:L==="Ollama"||L==="DeepSeek"?[{cmd:"Fast",desc:"Reasoning Disabled"},{cmd:"Standard",desc:"Standard Reasoning"},{cmd:"High",desc:"Extended Reasoning"}]:L==="NVIDIA"?[{cmd:"Fast",desc:"Reasoning Disabled"},{cmd:"Standard",desc:"Balanced Reasoning"},{cmd:"High",desc:"Extended Reasoning"}]:L==="OpenRouter"?[{cmd:"Fast",desc:"Fastest"},{cmd:"Low",desc:"Quick Reasoning"},{cmd:"Standard",desc:"Balanced Reasoning"},{cmd:"High",desc:"Deep Reasoning"},{cmd:"xHigh",desc:"Extended Reasoning"}]:L==="Mistral"?[{cmd:"Fast",desc:"None (No Reasoning)"},{cmd:"Low",desc:"Minimal Reasoning"},{cmd:"Standard",desc:"Balanced Reasoning"},{cmd:"High",desc:"Deep Reasoning"},{cmd:"xHigh",desc:"Extended Reasoning"}]:it&&it.toLowerCase().startsWith("gemini-3")?[{cmd:"Fast",desc:"Fastest"},{cmd:"Low",desc:"Quick Reasoning"},{cmd:"Standard",desc:"Balanced Reasoning"},{cmd:"High",desc:"Deep Reasoning"}]:[{cmd:"Fast",desc:"Fastest"},{cmd:"Low",desc:"Quick Reasoning"},{cmd:"Medium",desc:"Balanced Reasoning"},{cmd:"High",desc:"Deep Reasoning"},{cmd:"xHigh",desc:"Extended Reasoning"}]},{cmd:"/model",desc:"Select Agent Model",subs:L==="Ollama"&&(ke==="LOCAL"||!ke)?[]:No(L,tt)},{cmd:"/wildcard-tooling",desc:"Use if the model lacks Tooling Capability"},{cmd:"/provider",desc:"Select AI Provider"},{cmd:"/mode",desc:"Toggle Flux/Flow modes",subs:[{cmd:"flux",desc:"Enable Dev toolset"},{cmd:"flow",desc:"Enable Chat mode"}]},{cmd:"/settings",desc:"Configure system prefs"},{cmd:"/theme",desc:"Customize UI color theme"},{cmd:"/key",desc:"Manage API keys"},{cmd:"/profile",desc:"Edit developer persona"},{cmd:"/memory",desc:"Manage agent memory"},{cmd:"/stats",desc:"Show session usage"},{cmd:"/reset",desc:"Wipe all project data"},{cmd:"/about",desc:"Project info & credits"},{cmd:"/changelog",desc:"View latest updates"},{cmd:"/docs",desc:"View Documentation"},{cmd:"/fluxflow",desc:"Project management",subs:[{cmd:"init",desc:"Create empty FluxFlow.md template"}]},{cmd:"/budget",desc:"Set or View budget limits",subs:[{cmd:"view",desc:"View current usage budget bars"},{cmd:"set",desc:"Configure budgets (Daily/Monthly limits)"},{cmd:"reset",desc:"Reset budgets to default limits"}]},{cmd:"/update",desc:"Check/Install updates",subs:[{cmd:"latest",desc:"Install latest release"},{cmd:"check",desc:"Check for new version"}]}],qs=async(o,n=!1)=>{if(!n&&Fe.length>0){let h=Fe[Z]||Fe[0],y=o.split(" ");if(y.length===1)c(h.cmd+" ");else{let g=y.slice(0,-1);c(g.join(" ")+" "+h.cmd+" ")}R(0),M(g=>g+1);return}Lr.current=!1;let a=o.replace(/\r\n/g,`
|
|
83
|
+
`).replace(/\r/g,`
|
|
84
|
+
`).trimEnd();if(a.endsWith("\\")){c(a.slice(0,-1)+`
|
|
85
|
+
`);return}let w=a.replace(/\\\s*\n/g,`
|
|
86
|
+
`).split(/\r?\n/).map(h=>h.replace(/\\$/,"")).join(`
|
|
87
|
+
`);if(w.trim()){if(Ko){let h=w.trim();if(h.startsWith("/btw")){if(h.replace(/^\/btw\s*/,"").trim().length<=3){U(g=>(j(g.length+1),[...g,{id:"hint-err-"+Date.now(),role:"system",text:`\u2726 RESTRICTED
|
|
88
|
+
\u2800\u2800\u2514\u2500 Inquiry question must be more than 3 characters.
|
|
89
|
+
\u2800`,isMeta:!0}])),c("");return}}else if(h.startsWith("/")){U(y=>(j(y.length+1),[...y,{id:"hint-err-"+Date.now(),role:"system",text:`\u2726 RESTRICTED
|
|
90
|
+
\u2800\u2800\u2514\u2500 Steering Hints cannot start with '/'.
|
|
91
|
+
\u2800`,isMeta:!0}])),c("");return}_r(h),xo.current=h,U(y=>{j(y.length+1);let g=h.startsWith("/btw"),d=g?h.replace(/^\/btw\s*/,""):h,S=g?"[QUESTION]":"[STEERING HINT]";return[...y,{id:"hint-"+Date.now(),role:"user",text:`${S}
|
|
92
|
+
${d}`,color:"magenta"}]}),c("");return}if(!ke){Vs(w),Ot("");return}if(w.startsWith("/")){c("");let h=w.split(" "),y=h[0]?.toLowerCase();switch(y){case"/quit":{G("exit");break}case"/resume":{if(h[1]){let g=h[1];(async()=>{let S=await yo(),I=S[g]||Object.values(S).find(F=>F.name.toLowerCase()===g.toLowerCase());if(I){if(i.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY){let ne=I?.name||"",be=ne&&!ne.startsWith("flow-")&&!ne.startsWith("Session ")?ne:"FluxFlow | Resumed";process.stdout.write(`\x1B]0;${be}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${be}\x07`)}io(),Oo.current=!0,Hn(g);let F=await Jn(g);un.current=Ht-F.total,Oo.current=!1,cn(F.total),ko({tokens:F.context});let ee=[...I.messages];ee[0]?.text?.includes("\u2591\u2591\u2591\u2588\u2588\u2588")||ee.unshift({id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}),U(ee),U(ne=>[...ne,{id:"sys-"+Date.now(),role:"system",text:`\u2726 SESSION RESUMED
|
|
93
|
+
\u2800\u2800\u2514\u2500 ${g}.
|
|
94
|
+
\u2800`,isMeta:!0}]),j(0)}else U(F=>[...F,{id:"err-"+Date.now(),role:"system",text:`\u2726 ERROR: Session [${g}] not found.
|
|
95
|
+
\u2800`,isMeta:!0}])})()}else G("resume");break}case"/move":{if(!z.playground){U(I=>(j(I.length+1),[...I,{id:Date.now(),role:"system",text:`\u2726 RESTRICTED
|
|
96
|
+
\u2800\u2800\u2514\u2500 '/move' is only available in playground mode.
|
|
97
|
+
\u2800`,isMeta:!0}]));break}if(!z.originalCwd){U(I=>(j(I.length+1),[...I,{id:Date.now(),role:"system",text:`\u2726 RESTRICTED
|
|
98
|
+
\u2800\u2800\u2514\u2500 Original CWD not found.
|
|
99
|
+
\u2800`,isMeta:!0}]));break}let g=Bt.join(wo,"playground"),d=Bt.join(z.originalCwd,"playground-export");(async()=>{try{U(F=>(j(F.length+1),[...F,{id:Date.now(),role:"system",text:`\u2726 EXPORTING PLAYGROUND CONTENT
|
|
100
|
+
\u2800\u2800\u2514\u2500 ${d}
|
|
101
|
+
`,isMeta:!0}])),await ot.ensureDir(d);let I=["node_modules",".git",".venv","venv","env",".next","dist","build",".cache"];await ot.copy(g,d,{overwrite:!0,filter:F=>{let ee=Bt.relative(g,F);return ee?!ee.split(Bt.sep).some(ne=>I.includes(ne)):!0}}),U(F=>(j(F.length+1),[...F,{id:Date.now(),role:"system",text:`\u2726 SUCCESS
|
|
102
|
+
\u2800\u2800\u2514\u2500 playground content copied to ${d}
|
|
103
|
+
`,isMeta:!0}]))}catch(I){U(F=>(j(F.length+1),[...F,{id:Date.now(),role:"system",text:`\u2726 FAILED TO MOVE CONTENT
|
|
104
|
+
\u2800\u2800\u2514\u2500 ${I.message}
|
|
105
|
+
`,isMeta:!0}]))}})();break}case"/clear":{if(i&&(i.write("\x1B[2J\x1B[3J\x1B[H"),i.isTTY&&(i.write("\x1B[?2004h"),process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"))),U([{id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}]),j(1),Pr(g=>g+1),io(),Ut.current={completedIndex:0,columns:A.columns,historicalBlocks:[],seenSelections:new Set,chatId:Ze,clearKey:Po+1},z.playground){if(z.playground=!1,zn(gn).catch(()=>{}),z.originalCwd)try{process.chdir(z.originalCwd),U(g=>{let d=[...g,{id:"playground-"+Date.now(),role:"system",text:`\u2726 PLAYGROUND
|
|
106
|
+
\u2800\u2800\u2514\u2500 Restored Working Directory to ${z.originalCwd}
|
|
107
|
+
`,isMeta:!0}];return j(d.length),d})}catch{}setTimeout(()=>{ot.emptyDir(Bt.join(wo,"playground")).catch(g=>{U(d=>{let S=[...d,{id:"playground-"+Date.now(),role:"system",text:`\u2726 PLAYGROUND
|
|
108
|
+
\u2800\u2800\u2514\u2500 Failed to clear session: ${wo+"/playground"}`,isMeta:!0}];return j(S.length),S})})},500),Mt(g=>({...g,allowExternalAccess:Mr.current,memory:Er.current}))}Hn(Yr()),ko({tokens:0}),E(!1),cn(0),un.current=Ht,setTimeout(()=>{global.gc&&(async()=>{for(let d=0;d<3;d++)global.gc(),await new Promise(S=>setImmediate(S));u.current=Date.now()})()},500);break}case"/revert":{Sn.getChatHistory(Ze).then(g=>{if(g.length>0)$s(g.reverse()),G("revert");else{let d=Ve(2);U(S=>(j(S.length+1),[...S,{id:"revert-empty-"+Date.now(),role:"system",text:`\u2726 Nothing to revert to.
|
|
109
|
+
\u2800`,isMeta:!0}]))}}),setTimeout(()=>{global.gc&&(async()=>{for(let d=0;d<3;d++)global.gc(),await new Promise(S=>setImmediate(S));u.current=Date.now()})()},500);break}case"/mode":{if(h[1]){let g=h[1].toLowerCase()==="flow"?"Flow":"Flux";D(g),g==="Flow"?st("Fast"):g==="Flux"&&st("High");let d=Ve(2);U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 Mode switched to ${g}`,isMeta:!0}]))}else G("mode");break}case"/image_deprecated":{if(h[1]?.toLowerCase()==="stats"){let g=Ve(2);if(go.keyType==="Custom")U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Key strategy is Custom. Redirecting to Pollinations dashboard (https://enter.pollinations.ai/#pollen)...",isMeta:!0}])),gr("start https://enter.pollinations.ai/#pollen");else try{let d=await xi();U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",isImageStats:!0,text:`\u2022 Hourly Limit: ${Number((d.limit*1e3).toFixed(0))} credits
|
|
110
|
+
\u2022 Spent (Last 1hr): ${Number((d.totalSpent*1e3).toFixed(0))} credits
|
|
111
|
+
\u2022 Remaining: ${Number((d.remaining*1e3).toFixed(0))} credits
|
|
112
|
+
\u2022 Requests (Last 1hr): ${d.activeCallsCount} requests
|
|
113
|
+
`+(d.nextResetMin>0?`\u2022 Refreshes in: ${d.nextResetMin}m`:""),isMeta:!0}]))}catch{U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:"[SYSTEM] Failed to load image quota stats.",isMeta:!0}]))}}else if(h[1]?.toLowerCase()==="setup")if(h[2]?.toLowerCase()==="key")if(h[3]){let g=["default","custom"].find(d=>d===h[3].toLowerCase());if(g){let d=g==="default"?"Default":"Custom";On(I=>({...I,keyType:d}));let S=Ve(2);U(I=>(j(I.length+1),[...I,{id:Date.now(),role:"system",text:`[SYSTEM] Image key strategy set to ${d}`,isMeta:!0}])),d==="Custom"&&(dt({label:"Enter Pollinations API key (starting with sk_):",note:"Get a key from https://enter.pollinations.ai",key:"imageSettings",subKey:"apiKey",value:go.apiKey||"",returnView:"chat"}),G("input"))}else{let d=Ve(2);U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:"[SYSTEM] Invalid key option. Choose: Default or Custom.",isMeta:!0}]))}}else{let g=Ve(2);U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup Key <Default|Custom>",isMeta:!0}]))}else if(h[2]?.toLowerCase()==="quality")if(h[3]){let g=["low","low-high","medium","medium-high","high","ultra","premium"].find(d=>d===h[3].toLowerCase());if(g){let S={low:"Low","low-high":"Low-High",medium:"Medium","medium-high":"Medium-High",high:"High",ultra:"Ultra",premium:"Premium"}[g];On(F=>({...F,quality:S}));let I=Ve(2);U(F=>(j(F.length+1),[...F,{id:Date.now(),role:"system",text:`[SYSTEM] Image quality set to ${S}`,isMeta:!0}]))}else{let d=Ve(2);U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:"[SYSTEM] Invalid quality level. Choose from: Low, Low-High, Medium, Medium-High, High, Ultra, Premium.",isMeta:!0}]))}}else{let g=Ve(2);U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup Quality <Low|Low-High|Medium|Medium-High|High|Ultra>",isMeta:!0}]))}else{let g=Ve(2);U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup <Key|Quality> ...",isMeta:!0}]))}else{let g=Ve(2);U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup <Key|Quality> ...",isMeta:!0}]))}break}case"/thinking":{let g;if(h[1]){let d=h[1].toLowerCase(),S=h.includes("--bypass"),I=h.includes("--force");g=d.charAt(0).toUpperCase()+d.slice(1),d==="xhigh"&&(g="xHigh");let F="";if(I&&(process.env.NVIDIA_BASE_URL?F=`\u2800\u2800\u2514\u2500 Enabled Forced Reasoning.
|
|
114
|
+
\u2800`:F=`\u2800\u2800\u2514\u2500 --force is not supported in this context.
|
|
115
|
+
\u2800`,process.env.forcedReasoning="true"),!S&&O==="Flow"&&g==="xHigh")U(ee=>(j(ee.length+1),[...ee,{id:Date.now(),role:"system",text:`\u2726 RESTRICTED\u2800\u2800\u2514\u2500"${g}" is restricted in Flow mode. Switch to Flux to enable Higher Thinking Levels.${F}.`,isMeta:!0}]));else{st(g);let ee=Ve(1);U(we=>(j(we.length+1),[...we,{id:Date.now(),role:"system",text:`\u2726 ${L}
|
|
116
|
+
\u2800\u2800\u2514\u2500 ${it}.
|
|
117
|
+
\u2800\u2800\u2514\u2500 Thinking Level: ${g}.
|
|
118
|
+
${F} \u2800`,isMeta:!0}]))}}else G("thinking");break}case"/model":{if(h[1]){let g=h.slice(1),d=!1,S=!1,I=[];for(let ee of g)ee==="--multimodal"||ee==="-m"?L==="Ollama"?d=!0:S=!0:I.push(ee);let F=I.join(" ");if(L==="Ollama"&&ni(d),S&&U(ee=>(j(ee.length+1),[...ee,{id:Date.now(),role:"system",text:`\u2726 ERROR
|
|
119
|
+
\u2800\u2800\u2514\u2500 Flag --multimodal / -m is unavailable for provider "${L}". Flag ignored.
|
|
120
|
+
\u2800`,isMeta:!0}])),F){let ee=so("Google","Free"),we=so("Google","Paid");St(F),U(ne=>(j(ne.length+1),[...ne,{id:Date.now(),role:"system",text:`\u2726 ${L}
|
|
121
|
+
\u2800\u2800\u2514\u2500 ${F}
|
|
122
|
+
\u2800\u2800\u2514\u2500 Thinking Level: ${We}${L==="Ollama"?`
|
|
123
|
+
\u2800\u2800\u2514\u2500 Multimodal: ${d?"ON":"OFF"}`:""}
|
|
124
|
+
\u2800`,isMeta:!0}]))}}else G("model");break}case"/wildcard-tooling":{Te(g=>{let d=!g;return U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 Wildcard Tooling:
|
|
125
|
+
\u2800\u2800\u2514\u2500 Status: ${d?"Enabled":"Disabled"}
|
|
126
|
+
\u2800`,isMeta:!0}])),d});break}case"/settings":{G("settings");break}case"/provider":case"/providers":{hr("chat"),G("selectProvider");break}case"/theme":{G("theme");break}case"/key":{G("key");break}case"/profile":{G("profile");break}case"/stats":{(async()=>{let d=await Zn(),S=await Rn();yr(d),br(S),Cr("daily"),G("stats")})();break}case"/save":{let g,d=mt.find(I=>I.role==="user");if(d&&d.text){let I=d.text.replace(/\s*\n+\s*\[Prompted on:.*?\]/g,"").trim(),F=I.split(/\s+/),ee;F.length>7?ee=F.slice(0,7).join(" ")+"...":I.length>45?ee=I.substring(0,45).trimEnd()+"...":ee=I,g=ee}let S=h.slice(1).join(" ")||g||`Session ${new Date().toLocaleTimeString()}`;Ro(Ze,S,mt),U(I=>(j(I.length+1),[...I,{id:Date.now(),role:"system",text:`\u2726 Saved
|
|
127
|
+
\u2800\u2800\u2514\u2500 "${S}" (ID: ${Ze})
|
|
128
|
+
\u2800`,isMeta:!0}]));break}case"/export":{(async()=>{try{let d=await Zs(h,{chatId:Ze,messages:mt});U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:d.message,isMeta:!0}]))}catch(d){U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`[EXPORT ERROR] Failed to export: ${d.message}`,isMeta:!0}]))}})();break}case"/chats":{(async()=>{let d=await yo(),S=Object.entries(d).sort((I,F)=>(F[1].updatedAt||0)-(I[1].updatedAt||0)).map(([I,F])=>`\u2800\u2800\u2514\u2500 ${I}: ${F.name}${I===Ze?" (current)":""}`).join(`
|
|
129
|
+
`);U(I=>(j(I.length+1),[...I,{id:Date.now(),role:"system",text:`\u2726 Saved Chats:
|
|
130
|
+
${S||"\u2800\u2800\u2514\u2500 No saved chats found."}
|
|
131
|
+
\u2800`,isMeta:!0}]))})();break}case"/memory":{G("memory");break}case"/reset":{(async()=>{try{U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:`\u2726 Initiating reset...
|
|
132
|
+
\u2800\u2800\u2514\u2500 Clearing logs, secrets, and settings.
|
|
133
|
+
\u2800`,isMeta:!0}])),ot.existsSync(qn)&&ot.removeSync(qn),ot.existsSync(Fr)&&ot.removeSync(Fr),ot.existsSync(wn)&&ot.removeSync(wn);try{ot.readdirSync(Nr).length===0&&ot.removeSync(Nr)}catch{}setTimeout(()=>{G("exit"),setTimeout(()=>process.exit(0),500)},500)}catch(d){U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 ERROR
|
|
134
|
+
\u2800\u2800\u2514\u2500 Failed to clear data: ${d.message}.
|
|
135
|
+
\u2800`}]))}})();break}case"/about":{let g=Ve(2),d=`\u2022 FluxFlow Version: v${zt}
|
|
136
|
+
\u2022 Status: ${Tt&&Tt!==zt?`Update Available [v${Tt}]`:"Up to date"}
|
|
137
|
+
\u2022 Released on: ${Dd}`;U(S=>(j(S.length+1),[...S,{id:"about-"+Date.now(),role:"system",text:d,isAboutRecord:!0,isMeta:!0}]));break}case"/changelog":{let g=process.platform;gr(`${g==="win32"?"start":g==="darwin"?"open":"xdg-open"} ${rl}`),U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 Opening Changelog
|
|
138
|
+
\u2800\u2800\u2514\u2500 ${rl}.`,isMeta:!0}]));break}case"/docs":{if(!ms){U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 ERROR
|
|
139
|
+
\u2800\u2800\u2514\u2500 Documentation URL is not configured.`,isMeta:!0}]));break}let g=process.platform;gr(`${g==="win32"?"start":g==="darwin"?"open":"xdg-open"} ${ms}`),U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 Opening Documentation
|
|
140
|
+
\u2800\u2800\u2514\u2500 ${ms}.
|
|
141
|
+
\u2800`,isMeta:!0}]));break}case"/budget":{let g=h[1]?.toLowerCase();if(g==="set")ll("chat"),G("budgetTypeSelect");else if(g==="view")(async()=>{let S=await Zn(),I=await Rn(),F=await jr(Pe.resetDay||1);yr(S),br(I),Es(F),G("budgetView")})();else if(g==="reset"){let d={limitMode:"Daily",agentLimit:99999999,tokenLimit:99999999999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerBudgets:{},providerTiers:{Google:"Free",DeepSeek:"Free",NVIDIA:"Free",OpenRouter:"Free"}};Pt(d),Do("Free"),It({apiTier:"Free",quotas:d}),U(S=>(j(S.length+1),[...S,{id:Date.now(),role:"system",text:`\u2726 Budgets reset successfully.
|
|
142
|
+
\u2800`,isMeta:!0}]))}else U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:`\u2726 ERROR
|
|
143
|
+
\u2800\u2800\u2514\u2500 Usage: /budget <Set|View|Reset>.
|
|
144
|
+
\u2800`,isMeta:!0}]));break}case"/fluxflow":{if(h.slice(1)[0]==="init"){let d=`# FluxFlow Configuration
|
|
145
|
+
# This file defines project-specific instructions for the Flux Flow Agent.
|
|
146
|
+
|
|
147
|
+
# IDENTITY & TONE
|
|
148
|
+
- Tone: Technical, precise, and highly efficient.
|
|
149
|
+
|
|
150
|
+
# PROJECT CONTEXT
|
|
151
|
+
- Goal: [Describe your project goal here]
|
|
152
|
+
- Tech Stack: [List your technologies here]
|
|
153
|
+
|
|
154
|
+
# CUSTOM RULES
|
|
155
|
+
- [Add specific coding standards or rules here]
|
|
156
|
+
|
|
157
|
+
# SKILLS & WORKFLOWS
|
|
158
|
+
- [Define custom step-by-step recipes for this project here]
|
|
159
|
+
`,S=Bt.join(process.cwd(),"FluxFlow.md");if(ot.pathExistsSync(S))U(I=>(j(I.length+1),[...I,{id:"init-err-"+Date.now(),role:"system",text:"ERROR: FluxFlow.md already exists in this directory.",isMeta:!0}]));else try{ot.writeFileSync(S,d),U(I=>(j(I.length+1),[...I,{id:"init-ok-"+Date.now(),role:"system",text:"[SUCCESS] FluxFlow.md has been initialized. You can now customize it for this project.",isMeta:!0}]))}catch(I){U(F=>(j(F.length+1),[...F,{id:"init-err-"+Date.now(),role:"system",text:`ERROR: Failed to initialize FluxFlow.md: ${I.message}`,isMeta:!0}]))}}else U(d=>(j(d.length+1),[...d,{id:"ff-err-"+Date.now(),role:"system",text:"Usage: /fluxflow init",isMeta:!0}]));break}case"/update":{if(h[1]?.toLowerCase()==="check"){Je(!0);break}let d=h.includes("--latest");G("update");break}case"/gemini":{let g=ls[Math.floor(Math.random()*ls.length)];U(d=>(j(d.length+1),[...d,{id:Date.now(),role:"system",text:`\u2728 GEMINI CLI
|
|
160
|
+
\u2800\u2800\u2514\u2500 ${g}
|
|
161
|
+
\u2800`}])),c("");break}case"/compress":{c("");let g=mt.filter(I=>(I.role==="user"||I.role==="agent"||I.role==="system")&&!String(I.id).startsWith("welcome")&&!I.isMeta).length,d=fo?.tokens||0;if(g<64||d<16384){let I=Ve(2);U(F=>(j(F.length+1),[...F,{id:Date.now(),role:"system",text:`\u2726 Compression skipped
|
|
162
|
+
\u2800\u2800\u2514\u2500 History requires at least 64 messages and 16k tokens
|
|
163
|
+
\u2800\u2800 \u2514\u2500 Current: ${g}/64 msgs, ${d}/16384 tokens.
|
|
164
|
+
\u2800`,isMeta:!0}]));break}(async()=>{Ns(!0);let I=Ve(2);U(F=>(j(F.length+1),[...F,{id:Date.now(),role:"system",text:"\u2726 Compacting session history...",isMeta:!0}]));try{if(await vi({chatId:Ze,aiProvider:L,apiKey:ke,thinkingLevel:We,mode:O,janitorModel:ae,systemSettings:de,sessionStats:fo},mt)){let we=Ve(2);U(ne=>{let be=[...ne,{id:Date.now(),role:"system",text:`\u2800\u2800\u2514\u2500 Chat History compacted saving tokens.
|
|
165
|
+
\u2800`,isMeta:!0}];return j(be.length),be})}else U(we=>(j(we.length+1),[...we,{id:Date.now(),role:"system",text:`\u2800\u2800\u2514\u2500 Compaction failed.
|
|
166
|
+
\u2800`,isMeta:!0}]))}catch(F){U(ee=>(j(ee.length+1),[...ee,{id:Date.now(),role:"system",text:`\u2800\u2800\u2514\u2500 Error during compaction: ${F.message}
|
|
167
|
+
\u2800`,isMeta:!0}]))}finally{Ns(!1)}})();break}case"/truncate":{c("");let g=0;U(d=>{let I=[...d.map(F=>{let ee=F.fullText||F.text||"";return!ee.startsWith("[TOOL RESULT]:")||ee.startsWith("[TOOL RESULT]: ERROR")||ee.startsWith("[TOOL RESULT]: DENIED")||ee.includes("...SUCCESS Results Truncated by System on User Command")?F:(g++,ee.startsWith("[TOOL RESULT]: SUCCESS")?{...F,fullText:"[TOOL RESULT]: SUCCESS: ...SUCCESS Results Truncated by System on User Command"}:{...F,fullText:"[TOOL RESULT]: ...SUCCESS Results Truncated by System on User Command"})}),{id:Date.now(),role:"system",text:`\u2726 Tool Truncation...
|
|
168
|
+
\u2800\u2800\u2514\u2500 Truncated ${g} tool result(s).
|
|
169
|
+
\u2800`,isMeta:!0}];return Ro(Ze,null,I),j(I.length),I});break}case"/help":{U(g=>(j(g.length+1),[...g,{id:Date.now(),role:"system",isHelpRecord:!0,isMeta:!0}]));break}case"/btw":{U(g=>(j(g.length+1),[...g,{id:Date.now(),role:"system",text:`\u2726 RESTRICTED
|
|
170
|
+
\u2800\u2800\u2514\u2500 '/btw' only available when agent is working
|
|
171
|
+
\u2800`,isMeta:!0}]));break}default:U(g=>(j(g.length+1),[...g,{id:Date.now(),role:"system",text:`\u2726 ERROR
|
|
172
|
+
\u2800\u2800\u2514\u2500 Unknown command: '${y}'
|
|
173
|
+
\u2800`,isMeta:!0}]))}}else{let h=`[Prompted on: ${new Date().toLocaleString(void 0,{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}]`,y={id:"user-"+Date.now(),role:"user",text:`${w}
|
|
174
|
+
|
|
175
|
+
${h}`};U(d=>(j(d.length+1),[...d,y])),(async()=>{let d=!1,S=()=>{d||(d=!0,U(we=>{let ne=we[we.length-1];if(ne&&ne.text&&ne.text.includes("Request Cancelled"))return we;let Se=[...we.map(J=>J.isStreaming?{...J,isStreaming:!1}:J),{id:"cancel-"+Date.now(),role:"agent",text:`
|
|
176
|
+
|
|
177
|
+
\x1B[33m\u24D8 Request Cancelled\x1B[0m`,isMeta:!1}];return j(Se.length),Se}))},I=!1;Ar(!0),Tr(Date.now()),E(!1);let F=Date.now(),ee=!0;try{let we=[...mt,y].filter(X=>X.role!=="think"&&!X.isVisualFeedback&&!X.isMeta&&!X.isTerminalRecord&&!(X.text&&X.text.includes("[TERMINAL_RECORD]"))&&!String(X.id).startsWith("welcome")),ne=[],be=we.map((X,Ie)=>{let Be=X.fullText||X.text||"";if(X.role==="user"&&Ie<we.length-1)if(Be.includes("**CONTEXT SUMMARY OF PREVIOUS TURNS")){let De=Be.indexOf("**CONTEXT SUMMARY OF PREVIOUS TURNS");if(De!==-1){let re=Be.substring(0,De).lastIndexOf("[SYSTEM METADATA]");re!==-1?Be=Be.substring(re).trim():Be=Be.substring(De).trim()}}else{let De=Be.lastIndexOf("[USER]"),Ge=Be.lastIndexOf("[USER PROMPT]");De!==-1?Be=Be.substring(De+6).trim():Ge!==-1&&(Be=Be.substring(Ge).trim())}return{...X,text:Be}}),Se=0;for(;Se<be.length;){let X=be[Se];if(X.role==="user")ne.push(X),Se++;else{let Ie=[];for(;Se<be.length&&be[Se].role!=="user";)Ie.push(be[Se]),Se++;let Be=[],De=[],Ge=[];Ie.forEach(re=>{let me=re.role==="system"&&(re.text?.startsWith("[TOOL RESULT]")||re.text?.startsWith("SUCCESS:")||re.text?.startsWith("ERROR:")),_e=(re.text||"").trim();if(_e)if(me){let $e=_e.startsWith("[TOOL RESULT]")?_e:`[TOOL RESULT]: ${_e}`;De.push($e)}else re.role==="agent"&&(_e.toLowerCase().includes("tool:functions.")||_e.toLowerCase().includes("agent:generalist.")?Be.push(_e):Ge.push(_e))}),Be.length>0&&ne.push({role:"agent",text:Be.join(`
|
|
178
|
+
`)}),De.length>0&&ne.push({role:"system",text:De.join(`
|
|
179
|
+
|
|
180
|
+
`)}),Ge.length>0&&ne.push({role:"agent",text:Ge.join(`
|
|
181
|
+
|
|
182
|
+
`)})}}let J=Ei(it,ne,{profile:dn,thinkingLevel:We,mode:O,systemSettings:de,janitorModel:ae,sessionStats:fo,chatId:Ze,isPlayground:!!z.playground,aiProvider:L,apiKey:ke,apiTier:tt,wildcardTooling:Ln,cols:A.columns-6,rows:30,onTokenChunk:(X,Ie)=>{let Be=Date.now();if(Tr(Be),typeof Ie=="number"){ys.current=Ie;let De=wr.current;De.startTime||(De.startTime=Be,De.totalWords=0,De.chunks=[]),De.totalWords+=Ie,De.chunks||(De.chunks=[]),De.chunks.push({time:Be,words:Ie});let re=Be-400;if(De.chunks=De.chunks.filter(me=>me.time>=re),De.chunks.length>0){let me=De.chunks.reduce((wt,zo)=>wt+zo.words,0),_e=De.chunks[0].time,$e=Math.max(.4,(Be-_e)/1e3);De.wps=Math.round(me/$e*10)/10}}},onVisualFeedback:X=>{U(Ie=>[...Ie.map(De=>De.isStreaming?{...De,isStreaming:!1}:De),{id:"visual-"+Date.now()+"-"+Math.random().toString(36).substring(2,9),role:"system",text:X,isVisualFeedback:!0}])},onSubagentUpdate:()=>{Sl(bi.map(X=>({...X})))},onExecStart:X=>{q(),oe(),Bs(X),jo("")},onExecChunk:X=>{jo(Ie=>Ie+X)},onExecEnd:()=>{U(X=>{if(!Xn.current)return X;let Ie=Br.current||"",Be=di(Ie),De=`[TERMINAL_RECORD]
|
|
183
|
+
COMMAND: ${Xn.current}
|
|
184
|
+
PTY: ${Zo}
|
|
185
|
+
OUTPUT: ${Be.replace(/\n{3,}/g,`
|
|
186
|
+
|
|
187
|
+
`)}`,re=[...X.map(me=>me.isStreaming?{...me,isStreaming:!1}:me),{id:"term-"+Date.now(),role:"system",text:De,isTerminalRecord:!0}];return j(re.length),re}),Bs(null),Ds(!1),jo(""),Xn.current=null,Br.current=""},onToolResult:(X,Ie)=>{if(X==="success"){if(fl(Be=>Be+1),Ie==="generate_image"){wl(Ge=>Ge+1);let De={Low:.001,"Low-High":.002,Medium:.008,"Medium-High":.01,High:.045,Ultra:.0488,Premium:.1}[go.quality]||.002;yl(Ge=>Ge+De)}}else X==="denied"?xl(Be=>Be+1):hl(Be=>Be+1)},onToolApproval:async(X,Ie)=>{let Be=vl||de.autoExec;if(X==="exec_command"){let{command:De}=bn(Ie||"{}");return Be||De&&/^(echo|ls|dir|pwd|cd|git status|git log|git diff|type|cat|help)\b/i.test(De.trim())?"allow":new Promise(re=>{Vo({tool:X,args:Ie,resolve:re}),G("terminalApproval")})}return Be?"allow":new Promise(De=>{Vo({tool:X,args:Ie,resolve:De}),G("approval")})},onAskUser:async(X,Ie)=>(q(),oe(),new Promise(Be=>{let De=!1;Dr({question:X,options:Ie,resolve:Ge=>{De||(De=!0,U(re=>{if(re.some($e=>$e.isAskRecord&&$e.text?.includes(`Selection: ${Ge}`)))return re;let _e=[...re,{id:"ask-"+Date.now(),role:"system",text:`\u{1F4AC} **Ask User**
|
|
188
|
+
Question: ${X}
|
|
189
|
+
Selection: ${Ge}`,isAskRecord:!0}];return j(_e.length),_e}),Be(Ge))}}),G("ask")})),onUsage:X=>{let Ie=X.totalTokenCount||0,Be=X.cachedContentTokenCount||0,De=X.candidatesTokenCount||0;ko({tokens:Ie}),Ss(Ge=>Ge+Ie),Be>0&&Cs(Ge=>Ge+Be),De>0&&vs(Ge=>Ge+De),bs(Ge=>Ge+1)}},async()=>{if(xo.current){let X=xo.current;return _r(null),xo.current=null,U(Ie=>{let Be=[...Ie].reverse().findIndex(De=>De.text?.includes("[STEERING HINT: QUEUED]")||De.text?.includes("[QUESTION: QUEUED]"));if(Be!==-1){let De=Ie.length-1-Be,Ge=[...Ie],re=Ge[De].text;return re.includes("[STEERING HINT: QUEUED]")?re=re.replace("[STEERING HINT: QUEUED]","[STEERING HINT: INJECTED]"):re.includes("[QUESTION: QUEUED]")&&(re=re.replace("[QUESTION: QUEUED]","[QUESTION: ASKED]")),Ge[De]={...Ge[De],text:re,color:"cyan"},Ge}return Ie}),X}return null},zt),se=!1,Re=null,je=null,Ce=!1,Ue=!1,Vt=!1,ro=!1,kt=0,Nt=null,To=/\[?\s*turn\s*:\s*.*?\s*\]?/gi;for await(let X of J){if(await new Promise(re=>setTimeout(re,3)),X.type==="text"&&Tr(Date.now()),ee&&X.type==="text"&&(F=Date.now(),ee=!1,de.progressiveRendering&&ve()),X.type==="status"){X.content?.includes("[start]")||kr(X.content),X.content?.includes("[start]")?(clearInterval(pn),xn(0),pn=setInterval(()=>{xn(re=>re+1)},1e3)):X.content?.includes("[end]")&&(xn(0),clearInterval(pn)),Uo()&&er(X.content),X.content==="Request Cancelled"&&(q(),oe(),S());continue}if(X.type==="status_history"){kr(X.content),Uo()&&er(X.content),U(re=>[...re,{id:"condense-"+Date.now(),role:"system",text:`\u2726 ${X.content}
|
|
190
|
+
\u2800`,isMeta:!0}]);continue}if(X.type==="summary_injected"){U(re=>re.map(me=>me.id===X.content.id?{...me,fullText:X.content.text}:me));continue}if(X.type==="spinner"){Dl(X.content);continue}if(X.type==="model_update"){_l(X.content);continue}if(X.type==="turn_reset"){if(q(),Re=null,je=null,se=!1,Ce=!1,Ue=!1,ro=!1,Vt=!1,U(re=>{let me=re.map(_e=>{if(_e.isStreaming){let $e=_e.text?lt(_e.text):_e.text,wt=_e.fullText?lt(_e.fullText):_e.fullText;return{..._e,isStreaming:!1,text:$e,fullText:wt}}return _e});return j(me.length),me}),io(),global.gc){for(let re=0;re<2;re++)global.gc(),await new Promise(me=>setImmediate(me));u.current=Date.now()}continue}if(X.type==="interactive_turn_finished"){Ar(!1),xn(0),clearInterval(pn),Uo()&&er(null),I=!0,io(),de?.autoTruncateResults&&U(re=>{let me=re.map(_e=>{let $e=_e.fullText||_e.text||"";return!$e.startsWith("[TOOL RESULT]:")||$e.startsWith("[TOOL RESULT]: ERROR")||$e.startsWith("[TOOL RESULT]: DENIED")||$e.includes("...SUCCESS Results Truncated by System on User Command")?_e:$e.startsWith("[TOOL RESULT]: SUCCESS")?{..._e,fullText:"[TOOL RESULT]: SUCCESS: ...SUCCESS Results Truncated by System on User Command"}:{..._e,fullText:"[TOOL RESULT]: ...SUCCESS Results Truncated by System on User Command"}});return Ro(Ze,null,me),j(me.length),me}),Ci({profile:dn,thinkingLevel:We,mode:O,janitorModel:ae,chatId:Ze,systemSettings:de,sessionStats:fo,aiProvider:L,apiKey:ke},X.data.agentText,X.data.fullAgentTextRaw,X.data.history,{onMemoryUpdated:()=>U(re=>{let me=[...re];return me.length>0&&(me[me.length-1].memoryUpdated=!0),me}),onBackgroundIncrement:()=>ml(re=>re+1)});continue}if(X.type==="visual_feedback"){q(),oe(),U(re=>{let me=[...re,{id:"feedback-"+Date.now()+"-"+Math.random().toString(36).substring(2,9),role:"system",text:lt(X.content),isVisualFeedback:!0}];return j(me.length),me});continue}if(X.type==="exec_start"){q(),oe();continue}if(X.type==="liveTokens"){ko({tokens:X.content});continue}if(X.type==="usage"){let re=X.content.totalTokenCount||0,me=X.content.cachedContentTokenCount||0,_e=X.content.candidatesTokenCount||0;ko({tokens:re}),Ss($e=>$e+re),me>0&&Cs($e=>$e+me),_e>0&&vs($e=>$e+_e),bs($e=>$e+1);continue}if(X.type==="tool_time"){Tl(re=>re+X.content);continue}if(X.type==="tool_result"){if(oe(),U(re=>{let me=[...re,{id:"tool-"+Date.now()+"-"+Math.random().toString(36).substring(2,7),role:"system",text:lt(X.content),fullText:lt(X.aiContent),binaryPart:X.binaryPart,toolName:X.toolName}];return j(me.length),me}),X.toolName==="update_file"&&X.aiContent){let re=X.aiContent.split(`
|
|
191
|
+
`),me=0,_e=0,$e=!1;for(let wt of re){if(wt.includes("[DIFF_START]")){$e=!0;continue}if(wt.includes("[DIFF_END]")){$e=!1;continue}$e&&(/^\+\d+/.test(wt)?me++:/^\-\d+/.test(wt)&&_e++)}Fo("linesAdded",me),Fo("linesRemoved",_e)}else if(X.toolName==="write_file"&&X.aiContent){let re=X.aiContent.match(/- Stats: \[(\d+) lines/),me=re?parseInt(re[1]):0,_e=0;if(X.aiContent.includes("Old File contents:")){let $e=X.aiContent.split(`
|
|
192
|
+
`),wt=!1;for(let zo of $e){if(zo.includes("Old File contents:")){wt=!0;continue}wt&&(zo.trim()===""?wt=!1:/^\d+ \|/.test(zo)&&_e++)}}Fo("linesAdded",me),Fo("linesRemoved",_e)}continue}let Ie=X.content;if(X.type==="text"&&Ie.includes("Request Cancelled")){if(global.gc){for(let re=0;re<3;re++)global.gc(),await new Promise(me=>setImmediate(me));u.current=Date.now()}continue}let Be=Ie.toLowerCase();if(Ie.includes("```")&&(Ce=!Ce),(Be.includes("tool:functions.")||Be.includes("agent:generalist."))&&(Ue=!0,kt=0,Nt=null,(Ie.includes("[tool:functions.")||Ie.includes("[agent:generalist."))&&(kt=0)),Ue){for(let re=0;re<Ie.length;re++){let me=Ie[re];!Nt&&(me==="'"||me==='"'||me==="`")?Nt=me:Nt&&me===Nt&&Ie[re-1]!=="\\"&&(Nt=null),Nt||(me==="("||me==="["?kt++:(me===")"||me==="]")&&kt--)}kt<=0&&!Nt&&(Ue=!1)}if((Be.includes("<think")||Be.includes("<thought"))&&(!se&&!Ce&&!Ue&&!Vt)){let me=Ie.match(/<(think|thought)/i).index,_e=Ie.substring(0,me),$e=Ie.substring(me);if(_e&&(!Q.current||Q.current.role!=="agent"?Q.current={id:"agent-"+Date.now(),role:"agent",text:lt(_e),isStreaming:!0}:Q.current.text=lt(Q.current.text+_e)),q(),oe(),se=!0,Vt=!0,Re="think-"+Date.now(),Q.current={id:Re,role:"think",text:"",isStreaming:!0,startTime:Date.now()},$e.match(/<\/(think|thought)>/i)){let wt=$e.split(/<\/(think|thought)>/i),Ul=(wt[0]||"").replace(/^<(think|thought)[^>]*>\r?\n?/i,"").replace(/\r?\n?$/g,""),zs=wt.slice(2).join("").replace(/<\/?(think|thought)>/gi,"");Q.current.text=lt(Ul);let $l=Q.current.startTime||Date.now();Q.current.duration=Date.now()-$l,oe(),se=!1,je="agent-"+Date.now(),Q.current={id:je,role:"agent",text:"",isStreaming:!0},zs&&Me(zs)}else{let wt=$e.replace(/^<(think|thought)[^>]*>\r?\n?/gi,"");Me(wt)}continue}if((Be.includes("</think>")||Be.includes("</thought>"))&&Q.current?.role==="think"){let re=Ie.split(/<\/(think|thought)>/gi),me=re[0]||"",_e=re.slice(2).join("").replace(/<\/?(think|thought)>/gi,"");q(),Q.current.text=lt(Q.current.text+me);let $e=Q.current.startTime||Date.now();Q.current.duration=Date.now()-$e,oe(),se=!1,je="agent-"+Date.now(),Q.current={id:je,role:"agent",text:"",isStreaming:!0},Me(_e);continue}if(se&&Q.current?.role==="think"){q();let re=Q.current.text+Ie;if(/<\/(think|thought)>/i.test(re)){let me=re.split(/<\/(think|thought)>/gi),_e=me[0]||"",$e=me.slice(2).join("").replace(/<\/?(think|thought)>/gi,"");Q.current.text=lt(_e);let wt=Q.current.startTime||Date.now();Q.current.duration=Date.now()-wt,oe(),se=!1,je="agent-"+Date.now(),Q.current={id:je,role:"agent",text:"",isStreaming:!0},Me($e)}else Me(Ie)}else if(!se){let re=Ie.toLowerCase();!ro&&(re.includes("tool:functions.")||re.includes("agent:generalist."))&&(ro=!0),!Q.current||Q.current.role!=="agent"?(je="agent-"+Date.now(),Q.current={id:je,role:"agent",text:lt(Ie),isStreaming:!0},ue()):Me(Ie)}}let Qo=Date.now();pl(X=>X+(Qo-F))}catch(we){U(ne=>(j(ne.length+1),[...ne,{id:"error-"+Date.now(),role:"system",text:`\u274C ERROR: ${we.message}`}]))}finally{let we=Date.now()-F;if(Q.current&&(Q.current.workedDuration=we),_.current&&(await Oe(),clearInterval(_.current),_.current=null),Ar(!1),kr(null),xn(0),clearInterval(pn),oe(),Lr.current&&S(),io(),global.gc)try{for(let ne=0;ne<3;ne++)global.gc(),await new Promise(be=>setImmediate(be));u.current=Date.now()}catch{}if(I||process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow | Idle\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow | Idle\x07")),xo.current){Or(xo.current),_r(null);let ne=xo.current;xo.current=null,U(be=>{let Se=[...be],J=Se.reverse().find(se=>se.text?.includes("[STEERING HINT: QUEUED]")||se.text?.includes("[QUESTION: QUEUED]"));return J&&(J.text.includes("[STEERING HINT: QUEUED]")?J.text=J.text.replace("[STEERING HINT: QUEUED]","[STEERING HINT: FINISHED_TURN]"):J.text.includes("[QUESTION: QUEUED]")&&(J.text=J.text.replace("[QUESTION: QUEUED]","[QUESTION: FINISHED_TURN]"))),Se.reverse()}),G("resolution")}U(ne=>{let be=Date.now()-F,Se=!1,J=ne;de.autoTruncateResults&&(J=J.map(Ce=>{let Ue=Ce.fullText||Ce.text||"";return!Ue.startsWith("[TOOL RESULT]:")||Ue.startsWith("[TOOL RESULT]: ERROR")||Ue.startsWith("[TOOL RESULT]: DENIED")||Ue.includes("...SUCCESS Results Truncated by System on User Command")?Ce:Ue.startsWith("[TOOL RESULT]: SUCCESS")?{...Ce,fullText:"[TOOL RESULT]: SUCCESS: ...SUCCESS Results Truncated by System on User Command"}:{...Ce,fullText:"[TOOL RESULT]: ...SUCCESS Results Truncated by System on User Command"}}));let se=[...J].reverse().map(Ce=>{let Ue=Ce.isStreaming?{...Ce,isStreaming:!1}:Ce;return Ue.text&&(Ue.text=(" "+Ue.text).slice(1)),!Se&&Ue.role==="agent"&&(Se=!0,Ue={...Ue,workedDuration:be}),Ue}).reverse();if(!se.some(Ce=>Ce.role==="agent"&&Ce.text?.trim().length>0)){let Ce=[...se].reverse().find(Ue=>Ue.role==="think"&&Ue.text?.trim().length>0);Ce&&se.push({id:"agent-fallback-"+Date.now(),role:"agent",text:Ce.text,isStreaming:!1,workedDuration:be})}let je=se.filter(Ce=>!String(Ce.id).startsWith("welcome")&&(!Ce.isMeta||Ce.text&&Ce.text.includes("Request Cancelled")));return Ro(Ze,null,je),j(se.length),se})}})()}c(""),E(!1)}},Fe=sn(()=>{if(B.startsWith("/")&&!ce){let h=B.split(" "),y=h[h.length-1].toLowerCase();if(h.length===1){let d=y.startsWith("/")?y.slice(1):y;return Ks.filter(S=>(S.cmd.startsWith("/")?S.cmd.slice(1):S.cmd).toLowerCase().includes(d))}let g=Ks;for(let d=0;d<h.length-1;d++){let S=h[d].toLowerCase(),I=g.find(F=>F.cmd.toLowerCase()===S);if(I&&I.subs)g=I.subs;else return[]}return g.filter(d=>d.cmd.toLowerCase().includes(y))}let o=B.split(" "),n=o[o.length-1],a=n&&n.startsWith("\\@");if((n&&n.startsWith("@")||a)&&!ce){let h=n.indexOf("#"),y=h!==-1,g=a?2:1,d=y?n.substring(g,h).toLowerCase():n.slice(g).toLowerCase(),S=y?n.substring(h):"";return Id(process.cwd()).filter(ee=>ee.name.toLowerCase().includes(d)).map(ee=>{let we=ee.relativePath.replace(/\\/g,"/"),ne=we.startsWith(".")?we:"./"+we;return{cmd:(a?"\\@":"@")+"["+ne+S+"]",desc:ee.relativePath}})}return[]},[B,ce]);Ke(()=>{let o=0;for(;o<Fe.length;){let n=Fe[o],a=n?.cmd||n||"";if(typeof a=="string"&&a.trimStart().startsWith("---"))o++;else break}R(o<Fe.length?o:0)},[Fe]);let[Vn,Kn]=V(0),Qs=Xe(0);Ke(()=>{let o=Qs.current>0,n=Fe.length>0;if(Qs.current=Fe.length,!n){Kn(0);return}if(!o){Kn(1);return}Kn(Fe.length)},[Fe]),Ke(()=>{if(Vn>0&&Vn<Fe.length){let o=setTimeout(()=>{Kn(n=>Math.min(n+1,Fe.length))},5);return()=>clearTimeout(o)}},[Vn,Fe.length]),Ke(()=>{if(nt!=="providerBudgetSelect")return;let o=["Google","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama"],n=Pe.providerBudgets||{},a=o.reduce((w,h)=>(w[h]=!!(n[h]&&(n[h].agentLimit||n[h].tokenLimit)),w),{});hs(a),_n(0)},[nt]),Ke(()=>{if(nt!=="providerBudgetFlow")return;let o={},n=Pe.providerBudgets||{};for(let a of Wo){let w=n[a]||{};o[a]={agentLimit:ln(w.agentLimit),tokenLimit:ln(w.tokenLimit),monthlyTokenLimit:ln(w.monthlyTokenLimit)}}ps(o),an(0)},[nt,Wo]);let jd=({label:o,isSelected:n})=>{let a=o==="Cancel"||o==="Back"||o.toLowerCase().includes("exit")||o.toLowerCase().includes("back");return e.createElement(m,{marginTop:a?1:0,backgroundColor:n?"#2a2a2a":void 0,paddingX:1,width:"100%"},e.createElement(s,{color:n?"white":"gray",bold:n},n?"\u276F ":" ",o))},qo=(o,n,a,w=10,h=2,y=9)=>{let g=a>0?Math.min(100,n/a*100):0,d=Math.round(g),S=Math.round(d/100*w),I="\u2588".repeat(S)+"\u2591".repeat(Math.max(0,w-S)),F=l.success||"green";d>=40&&d<=80?F=l.warning||"yellow":d>80&&(F=l.danger||"red");let ee=o.toLowerCase().includes("token")||o.toLowerCase().includes("daily")||o.toLowerCase().includes("monthly"),we=An(a)?"\u221E":ee?at(a):a,ne=ee?at(n):n,be;return g===0?be="0%":g>0&&g<1?be="<1%":be=`${d}%`,e.createElement(m,{flexDirection:"row",paddingLeft:h,key:o},e.createElement(m,{width:y},e.createElement(s,{color:l.textMuted},o,": ")),e.createElement(s,{color:F},I),e.createElement(s,{color:l.textMuted}," ",be," (",ne,"/",we,")"))},Fl=()=>{switch(nt){case"settings":return e.createElement(dr,{systemSettings:de,setSystemSettings:Mt,apiTier:tt,setActiveView:G,setInputConfig:dt,saveSettings:It,quotas:Pe,setMessages:U,aiProvider:L,setProviderReturnView:hr});case"theme":return e.createElement(dr,{systemSettings:de,setSystemSettings:Mt,apiTier:tt,setActiveView:G,setInputConfig:dt,saveSettings:It,quotas:Pe,setMessages:U,aiProvider:L,initialSelectingTheme:!0,onCloseTheme:()=>G("chat"),setProviderReturnView:hr});case"selectProvider":return e.createElement(ft,{title:"SELECT AI PROVIDER",items:[{label:"Google",value:"Google"},{label:"Nvidia",value:"NVIDIA"},{label:"DeepSeek",value:"DeepSeek"},{label:"Ollama",value:"Ollama"},{label:"Mistral [EXPERIMENTAL]",value:"Mistral"},{label:"OpenRouter [EXPERIMENTAL]",value:"OpenRouter"},{label:"Back",value:Xo}],theme:de.theme,onSelect:async o=>{if(o.value===Xo||o.value==="settings"||o.value==="Back"){G(Xo);return}let n=o.value,a=await Jo(n);if(a){he(n),Dt(a),Cn(a,{aiProvider:n,onIDEApproval:Wn});let w=(Pe.providerTiers||{})[n]||"Free",h=so(n,w);St(h),Do(w),n==="NVIDIA"&&process.env.NVIDIA_BASE_URL||n==="Ollama"?(Mt(y=>({...y,memory:!1})),It({aiProvider:n,activeModel:h,apiTier:w,quotas:Pe,systemSettings:{...de,memory:!1}})):It({aiProvider:n,activeModel:h,apiTier:w,quotas:Pe}),U(y=>[...y,{role:"system",text:`\u2726 Switched to ${n} (cached)!${h?`
|
|
193
|
+
\u2800\u2800\u2514\u2500 Model: ${h}.`:""}${We?`
|
|
194
|
+
\u2800\u2800\u2514\u2500 Thinking Level: ${We}.`:""}${n==="Ollama"&&de.memory?`
|
|
195
|
+
\u2800\u2800\u2514\u2500 Memory is not available with Ollama.`:""}${n==="NVIDIA"&&process.env.NVIDIA_BASE_URL&&de.memory?`
|
|
196
|
+
\u2800\u2800\u2514\u2500 Memory is not available with Custom Endpoints.`:""}
|
|
197
|
+
\u2800`,isMeta:!0}]),G(Xo)}else dt({label:`Enter ${n} API Key:`,key:"providerKey",provider:n,value:"",returnView:Xo}),G("input")},onClose:()=>G(Xo)});case"apiTier":return e.createElement(ft,{title:`Show Paid models from ${L.toUpperCase()}?`,subtitle:"Curated model list. Can use anything if typed manually.",items:[{label:"No (For Free APIs) [Shows Free model list]",value:"Free"},{label:`Yes (For Billing APIs) [Shows Paid model list] ${tt==="Paid"?"\u25CF":""}`,value:"Paid"},{label:"Back",value:"settings"}],theme:de.theme,onSelect:o=>{if(o.value==="settings"||o.value==="Back"){G("settings");return}let n=o.value;Do(n);let a={...Pe.providerTiers||{},[L]:n},w={...Pe,providerTiers:a};Pt(w),It({apiTier:n,quotas:w}),G("settings")}});case"resetMode":return e.createElement(ft,{title:"SELECT MONTHLY RESET MODE",items:[{label:"Default (Rolling 30-Day Window)",value:"Rolling"},{label:"Custom (Set reset day of month)",value:"Custom"},{label:"Back",value:"apiTier"}],theme:de.theme,onSelect:o=>{if(o.value==="apiTier"||o.value==="Back"){G("apiTier");return}let n=o.value,a={...Pe,resetMode:n};Pt(a),n==="Custom"?(dt({label:"Enter monthly reset day (1-30):",key:"quotas",subKey:"resetDay",value:String(Pe.resetDay||1),returnView:"settings"}),G("input")):(It({apiTier:tt,quotas:a}),G("settings"))},onClose:()=>G("apiTier")});case"budgetTypeSelect":return e.createElement(ft,{title:"SELECT BUDGET TYPE",items:[{label:`Global Budget (single limit for all providers) ${tt==="Paid"&&!Pe.providerBudgets?.__useProvider?"\u25CF":""}`,value:"global"},{label:`Provider Budgets (set limits per provider individually) ${Pe.providerBudgets?.__useProvider?"\u25CF":""}`,value:"provider"},{label:"Back",value:Yt}],theme:de.theme,onSelect:o=>{if(o.value===Yt||o.value==="Back"){G(Yt);return}if(o.value==="global"){let n={...Pe,agentLimit:99999999,tokenLimit:99999999999999,monthlyTokenLimit:99999999999999,providerBudgets:{__useProvider:!1}};Pt(n);let a=Yt==="settings"?"resetMode":"budgetResetMode";dt({label:"Enter Agent daily budget (requests made):",key:"quotas",subKey:"agentLimit",value:ln(n.agentLimit),returnView:Yt,next:w=>({label:"Enter Agent daily budget (tokens used):",key:"quotas",subKey:"tokenLimit",value:ln(w.tokenLimit),returnView:Yt,next:h=>({label:"Enter Agent monthly budget (tokens used):",key:"quotas",subKey:"monthlyTokenLimit",value:ln(h.monthlyTokenLimit),returnView:a})})}),G("input")}else if(o.value==="provider"){let n={...Pe,agentLimit:99999999,tokenLimit:99999999999999,monthlyTokenLimit:99999999999999,providerBudgets:{...Pe.providerBudgets||{},__useProvider:!0}};Pt(n),G("providerBudgetSelect")}},onClose:()=>G(Yt)});case"providerBudgetSelect":{let o=["Google","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama"],n=o.some(a=>xr[a]);return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,padding:0,width:"100%"},e.createElement(m,{paddingX:1,marginBottom:1},e.createElement(s,{color:l.text,bold:!0},"SELECT PROVIDERS TO SET LIMMITS FOR")),o.map((a,w)=>{let h=w===fs,y=!!xr[a];return e.createElement(m,{key:a,backgroundColor:h?l.highlightBg||"#2a2a2a":void 0,paddingX:1,width:"100%",flexDirection:"row"},e.createElement(s,{color:h?l.text:l.textMuted,bold:h},h?"\u276F ":" "),e.createElement(s,{color:y?l.success||"green":l.textMuted},y?"\u2611":"\u2610"),e.createElement(s,{color:h?l.text:l.textMuted,bold:h}," ",a),y&&Pe.providerBudgets?.[a]?.agentLimit?e.createElement(s,{color:l.primary||"cyan"}," (budget set)"):null)}),e.createElement(m,{paddingX:1,marginTop:1,flexDirection:"column"},e.createElement(s,{color:l.textMuted,italic:!0},"\u2191\u2193 Navigate \u2022 Space to toggle \u2022 Enter to confirm \u2022 ESC to go back"),!n&&e.createElement(s,{color:l.warning||"yellow",italic:!0}," Select at least one provider to continue")))}case"providerBudgetFlow":{let o=[];for(let a of Wo)o.push({provider:a,subKey:"tokenLimit",label:"Daily Tokens (tokens/day)"}),o.push({provider:a,subKey:"monthlyTokenLimit",label:"Monthly Tokens (tokens/month)"});let n=o.length;return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,padding:0,width:"100%"},e.createElement(m,{paddingX:1,marginBottom:0},e.createElement(s,{color:l.text,bold:!0},"PROVIDER LIMIT CONFIGURATION")),e.createElement(m,{paddingX:1,paddingBottom:0,marginBottom:0},e.createElement(s,{color:l.textMuted,italic:!0},"Set limits for selected providers (leave blank or 0 for no limit)")),Wo.map(a=>{let w=o.filter(h=>h.provider===a);return e.createElement(m,{key:a,flexDirection:"column",marginY:0,paddingX:1},e.createElement(s,{color:l.primary||"cyan",bold:!0},`
|
|
198
|
+
\u2500\u2500 ${a} \u2500\u2500`),w.map(h=>{let y=o.findIndex(S=>S.provider===h.provider&&S.subKey===h.subKey),g=pr===y,d=xs[h.provider]?.[h.subKey]??"";return e.createElement(m,{key:h.subKey,paddingLeft:2,flexDirection:"row"},e.createElement(s,{color:g?l.text:l.textMuted,bold:g},g?"\u276F ":" ",h.label.padEnd(30," "),": "," "),g?e.createElement(cs,{value:d,onChange:S=>{ps(I=>({...I,[a]:{...I[a]||{},[h.subKey]:S}}))},onSubmit:()=>{y+1<=n&&an(y+1)}}):e.createElement(s,{color:d?l.text:l.textMuted},d||"0 (Unlimited)"))}))}),e.createElement(m,{paddingX:2,marginTop:1},pr===n?e.createElement(m,{backgroundColor:l.highlightBg||"#2a2a2a",paddingX:1},e.createElement(s,{color:l.success||"green",bold:!0},"\u276F [ Save & Apply Budgets ]")):e.createElement(s,{color:l.textMuted}," [ Save & Apply Budgets ]")),e.createElement(m,{paddingX:1,marginTop:1,flexDirection:"column"},e.createElement(s,{color:l.textMuted,italic:!0},"\u2191\u2193 Navigate fields \u2022 Enter next / save \u2022 ESC to go back")))}case"budgetResetMode":return e.createElement(ft,{title:"SELECT MONTHLY RESET MODE",items:[{label:"Default (Rolling 30-Day Window)",value:"Rolling"},{label:"Custom (Set reset day of month)",value:"Custom"},{label:"Back",value:"chat"}],theme:de.theme,onSelect:o=>{if(o.value==="chat"||o.value==="Back"){G("chat");return}let n=o.value,a={...Pe,resetMode:n};Pt(a),n==="Custom"?(dt({label:"Enter monthly reset day (1-30):",key:"quotas",subKey:"resetDay",value:String(Pe.resetDay||1),returnView:"chat"}),G("input")):(It({apiTier:tt,quotas:a}),G("chat"))},onClose:()=>G("chat")});case"budgetView":{let o=mn?.agent||0,n=Pe.agentLimit||99999999,a=mn?.tokens||0,w=Pe.tokenLimit||99999999999999,h=Pe.resetMode==="Custom"?Sr?.tokens||0:Io?.tokens||0,y=Pe.monthlyTokenLimit||99999999999999,g=tt!=="Paid",d=!!Pe.providerBudgets?.__useProvider,S=Pe.providerBudgets||{},I=["Google","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama"].filter(ne=>S[ne]&&(S[ne].agentLimit||S[ne].tokenLimit||S[ne].monthlyTokenLimit)),F=!d&&(An(n)||An(w)||An(y)),ee="",we="";if(Pe.resetMode==="Custom"){let ne=new Date,be=Pe.resetDay||1,Se=ne.getFullYear(),J=ne.getMonth();ne.getDate()>=be&&(J+=1,J>11&&(J=0,Se+=1));let se=new Date(Se,J,be,0,0,0);ee=`${se.toLocaleString("default",{month:"short"}).toUpperCase()}-${be}`;let je=Math.max(0,se.getTime()-ne.getTime()),Ce=Math.floor(je/(1e3*60*60)),Ue=Math.floor(Ce/24),Vt=Ce%24;we=`(${Ue} days: ${Vt} hrs left)`}return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,padding:1,paddingBottom:0,paddingTop:0,width:"100%"},e.createElement(m,{marginBottom:1,justifyContent:"space-between",width:"100%"},e.createElement(s,{color:l.text,bold:!0,underline:!0},"USAGE LIMITS"),e.createElement(s,{color:l.textMuted},"[ ESC to Close ]")),F?e.createElement(m,{padding:1,justifyContent:"center",alignItems:"center",width:"100%"},e.createElement(s,{color:l.text,bold:!0},"LIMITS NOT SET")):d&&I.length>0?e.createElement(m,{flexDirection:"column",gap:0,width:"100%"},(()=>{let ne=i?.columns||A?.columns||80;if(ne<115){let J=Math.max(5,Math.min(30,ne-50));return I.map(se=>{let Re=S[se],je=0,Ce=mn?.models?.[se]||{};for(let kt in Ce)je+=Ce[kt]?.tokens||0;let Ue=0,ro=(Pe.resetMode==="Custom"?Sr:Io)?.models?.[se]||{};for(let kt in ro)Ue+=ro[kt]?.tokens||0;return e.createElement(m,{key:se,flexDirection:"column",borderStyle:"single",borderColor:l.borderMuted,paddingX:1,width:"100%"},e.createElement(m,{marginBottom:0},e.createElement(s,{color:l.primary,bold:!0},"\u25C6 ",se)),qo("Daily",je,Re.tokenLimit||99999999999999,J,2,9),qo("Monthly",Ue,Re.monthlyTokenLimit||99999999999999,J,2,9))})}let Se=[];for(let J=0;J<I.length;J+=2)Se.push(I.slice(J,J+2));return Se.map((J,se)=>e.createElement(m,{key:se,flexDirection:"row",width:"100%"},J.map(Re=>{let je=S[Re],Ce=0,Ue=mn?.models?.[Re]||{};for(let X in Ue)Ce+=Ue[X]?.tokens||0;let Vt=0,kt=(Pe.resetMode==="Custom"?Sr:Io)?.models?.[Re]||{};for(let X in kt)Vt+=kt[X]?.tokens||0;let Nt=J.length===1,To=Nt?ne:Math.floor(ne/2),Qo=Math.max(5,Math.min(25,To-36));return e.createElement(m,{key:Re,flexDirection:"column",borderStyle:"single",borderColor:l.borderMuted,paddingX:1,width:Nt?"100%":"50%"},e.createElement(m,{marginBottom:0},e.createElement(s,{color:l.primary,bold:!0},"\u25C6 ",Re)),qo("Daily",Ce,je.tokenLimit||99999999999999,Qo,2,9),qo("Monthly",Vt,je.monthlyTokenLimit||99999999999999,Qo,2,9))})))})(),ee?e.createElement(m,{marginLeft:2,marginTop:1},e.createElement(s,{color:l.textMuted},"Monthly Reset: "),e.createElement(s,{color:l.accent||"magenta",bold:!0},ee),we?e.createElement(s,{color:l.textMuted},` ${we}`):null):e.createElement(m,{marginLeft:2,marginTop:1},e.createElement(s,{color:l.textMuted},"Monthly Reset: "),e.createElement(s,{color:l.secondary||"blue",bold:!0},"Rolling 30-Day Window"))):e.createElement(m,{flexDirection:"column",borderStyle:"single",borderColor:l.borderMuted,paddingX:1,width:"100%"},qo("Daily Tokens",a,w,"green"),qo("Monthly Tokens",h,y,"yellow"),ee?e.createElement(m,{marginLeft:4,marginTop:1},e.createElement(s,{color:l.textMuted},"Monthly Reset: "),e.createElement(s,{color:l.accent||"magenta",bold:!0},ee),we?e.createElement(s,{color:l.textMuted},` ${we}`):null):e.createElement(m,{marginLeft:4,marginTop:1},e.createElement(s,{color:l.textMuted},"Monthly Reset: "),e.createElement(s,{color:l.secondary||"blue",bold:!0},"Rolling 30-Day Window"))))}case"input":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,padding:0,width:"100%"},e.createElement(m,{paddingX:1},e.createElement(s,{color:l.text,bold:!0},"DATA CONFIGURATION")),Jt?.note&&e.createElement(m,{paddingX:1,marginBottom:1},e.createElement(s,{color:l.textMuted,italic:!0},Jt.note)),e.createElement(m,{paddingX:1,flexDirection:"row"},e.createElement(s,{color:l.text,bold:!0},Jt?.label," "),e.createElement(cs,{value:Jt?.value||"",onChange:o=>dt(n=>({...n,value:o})),onSubmit:async o=>{let{key:n,subKey:a,next:w,onDone:h}=Jt,y={...Pe},g={};if(n==="quotas"){let d=a.toLowerCase().includes("limit")||a==="resetDay"?parseInt(o)||0:o;a==="resetDay"&&(d=Math.max(1,Math.min(30,d))),y[a]=d,Pt(y),g.quotas=y}else if(n==="providerBudgets"){let d=Jt.providerKey,S=a.toLowerCase().includes("limit")?parseInt(o)||0:o,I=y.providerBudgets||{};y.providerBudgets={...I,[d]:{...I[d]||{},[a]:S}},Pt(y),g.quotas=y}else if(n==="activeModel")St(o),g.activeModel=o;else if(n==="janitorModel")T(o),g.janitorModel=o;else if(n==="autoApproveCommands"||n==="autoDisallowCommands"||n==="alwaysAskCommands"){let d={...de,[n]:o.trim(),sandboxPreset:"Custom"};Mt(d),g.systemSettings=d}else if(n==="externalDataPath"){let d={...de,useExternalData:!0,externalDataPath:o.trim()};Mt(d),g.systemSettings=d,U(S=>[...S,{id:Date.now(),role:"system",text:"[EXTERNAL STORAGE] Flux Flow will use "+o.trim()+" for data after restart."}])}else if(n==="imageSettings"){let d=o.trim();if(d.startsWith("sk_")){let S={...go,apiKey:d};On(S),g.imageSettings=S,U(I=>(j(I.length+1),[...I,{id:Date.now(),role:"system",text:"[IMAGE KEY] Custom API key saved successfully.",isMeta:!0}]))}}else if(n==="providerKey"){let d=o.trim(),S=Jt.provider;S==="Ollama"&&(d==="LOCAL"||d==="")&&(d="LOCAL",Mt(ee=>({...ee,ollamaEndpoint:"Local"})),g.systemSettings={...de,ollamaEndpoint:"Local"}),await $r(S,d),he(S),Dt(d),Cn(d,{aiProvider:S,onIDEApproval:Wn});let I=(Pe.providerTiers||{})[S]||"Free",F=so(S,I);St(F),Do(I),g.aiProvider=S,g.activeModel=F,g.apiTier=I,(S==="NVIDIA"&&process.env.NVIDIA_BASE_URL||S==="Ollama")&&(Mt(ee=>({...ee,memory:!1})),g.systemSettings={...de,memory:!1}),U(ee=>(j(ee.length+1),[...ee,{id:Date.now(),role:"system",text:`\u2726 ${S} API Key saved successfully! ${F?`
|
|
199
|
+
\u2800\u2800\u2514\u2500 Model: ${F}`:""}${S==="Ollama"&&d==="LOCAL"?`
|
|
200
|
+
\u2800\u2800\u2514\u2500 Ollama Endpoint automatically switched to Local`:""}${S==="Ollama"?`
|
|
201
|
+
\u2800\u2800\u2514\u2500 Memory is not available with Ollama`:""}${S==="NVIDIA"&&process.env.NVIDIA_BASE_URL?`
|
|
202
|
+
\u2800\u2800\u2514\u2500 Memory is not available`:""}
|
|
203
|
+
\u2800\u2800`,isMeta:!0}]))}if(w){let d=w(n==="quotas"||n==="providerBudgets"?y:o);dt(d)}else h?(It({...g,apiTier:tt,quotas:y,imageSettings:g.imageSettings||go}),dt(null),h(y)):(It({...g,apiTier:tt,quotas:y,imageSettings:g.imageSettings||go}),dt(null),G(Jt?.returnView||"settings"))}})),e.createElement(m,{paddingX:1,marginTop:1},e.createElement(s,{color:l.textMuted,dimColor:!0,italic:!0},"(Press Enter to confirm selection)")));case"stats":{let o=no==="monthly"?Io:mn,n=no==="monthly"?"LAST 30 DAYS USAGE":"TODAY's USAGE",a="Wall Time:",w="Tokens Used:",h="Images Made:",y="Image Credits:",g="Code Changes:",d="Tool Calls:",S=Math.max(4,(i?.rows||A?.rows||24)-15),I=(Se,J,se,Re,je,Ce=0,Ue=!1)=>{let Vt=i?.columns||A?.columns||80,ro=Math.min(125,Vt-2),kt=Math.max(20,ro-6),Nt=Math.max(5,kt-Ce-se.length-5),To=J;To.length>Nt&&(To=To.substring(0,Nt-1)+"\u2026");let Qo=Math.max(2,kt-Ce-To.length-se.length-2),X=" "+".".repeat(Qo)+" ",Ie=" ".repeat(Ce);return e.createElement(m,{key:Se,width:kt},e.createElement(s,{wrap:"truncate"},e.createElement(s,null,Ie),e.createElement(s,{color:Re,bold:Ue},To),e.createElement(s,{color:l.textMuted,dimColor:!0},X),e.createElement(s,{color:je,bold:Ue},se)))},F=[];!Io?.models||Object.keys(Io.models).length===0?F.push(e.createElement(m,{key:"empty",marginTop:1},e.createElement(s,{color:l.textMuted,italic:!0},"No model token usage recorded in the last 30 days."))):Object.entries(Io.models).forEach(([Se,J],se)=>{let Re=Object.values(J).reduce((je,Ce)=>je+(Ce.tokens||0),0);se>0&&F.push(e.createElement(m,{key:`space-prov-${Se}`},e.createElement(s,null," "))),F.push(I(`prov-${Se}`,`${Se}:`,at(Re),l.primary,l.text,0,!0)),Object.entries(J).forEach(([je,Ce],Ue)=>{Ue>0&&F.push(e.createElement(m,{key:`space-mod-${Se}-${je}`},e.createElement(s,null," "))),F.push(I(`mod-${Se}-${je}`,`\xBB ${je}:`,at(Ce.tokens||0),l.secondary,l.text,2,!0)),F.push(I(`in-${Se}-${je}`,"\xBB Input Tokens:",at((Ce.tokens||0)-(Ce.candidateTokens||0)),l.textMuted,l.text,5,!1)),(Ce.cachedTokens||0)>0&&F.push(I(`cache-${Se}-${je}`,"\xBB Cached:",at(Ce.cachedTokens),l.textMuted,l.text,7,!1)),F.push(I(`out-${Se}-${je}`,"\xBB Output Tokens:",at(Ce.candidateTokens||0),l.textMuted,l.text,5,!1))})});let ee=F.length,we=Math.max(0,ee-S);Ae.current=we;let ne=Math.min(bl,we),be=F.slice(ne,ne+S);return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:3,paddingY:1,paddingBottom:0,width:Math.min(125,(i?.columns||100)-2)},no==="modelBreakdown"?e.createElement(m,{flexDirection:"column"},e.createElement(m,{justifyContent:"space-between"},e.createElement(s,{color:l.text,bold:!0,underline:!0},"30-DAY MODEL TOKEN BREAKDOWN"),ee>S&&e.createElement(s,{color:l.textMuted,dimColor:!0},"[",ne+1,"-",Math.min(ee,ne+S)," of ",ee,"] \u25B2\u25BC")),e.createElement(m,{flexDirection:"column",height:S,marginTop:1},be)):e.createElement(e.Fragment,null,e.createElement(m,{marginBottom:1},e.createElement(s,{color:l.text,bold:!0,underline:!0},"SESSION TELEMETRY")),e.createElement(m,{flexDirection:"column"},e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Session Duration:")),e.createElement(s,{color:l.text},Lo(Date.now()-us))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Model Requests:")),e.createElement(s,{color:l.text},cl)),e.createElement(m,{marginLeft:2},e.createElement(m,{width:23},e.createElement(s,{color:l.textMuted},"\xBB API Time:")),e.createElement(s,{color:l.text},Lo(Nn))),e.createElement(m,{marginLeft:2},e.createElement(m,{width:23},e.createElement(s,{color:l.textMuted},"\xBB Tool Time:")),e.createElement(s,{color:l.text},Lo(Fn))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Memory Agent:")),e.createElement(s,{color:l.text},ul)),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Tokens Consumed:")),e.createElement(s,{color:l.text},at(Ht))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Active Context:")),e.createElement(s,{color:l.text},at(fo.tokens))),Ht>0&&e.createElement(e.Fragment,null,e.createElement(m,{marginLeft:2},e.createElement(m,{width:23},e.createElement(s,{color:l.textMuted},"\xBB Input Tokens:")),e.createElement(s,{color:l.text},at(Ht-Go))),Pn>0&&e.createElement(m,{marginLeft:4},e.createElement(m,{width:21},e.createElement(s,{color:l.textMuted},"\xBB Cached:")),e.createElement(s,{color:l.text},at(Pn))),Go>0&&e.createElement(m,{marginLeft:2},e.createElement(m,{width:23},e.createElement(s,{color:l.textMuted},"\xBB Output Tokens:")),e.createElement(s,{color:l.text},at(Go)))),Un>0&&e.createElement(e.Fragment,null,e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Images Made:")),e.createElement(s,{color:l.text},Un)),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Image Credits:")),e.createElement(s,{color:l.text},Number(((Ms||0)*1e3).toFixed(0))," credits"))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Code Changes (Sess):")),e.createElement(s,{color:l.text},e.createElement(s,{color:l.success||"green"},"+",pt.linesAdded)," ",e.createElement(s,{color:l.danger||"red"},"-",pt.linesRemoved))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Tool Calls (Sess):")),e.createElement(s,{color:l.text},pt.toolSuccess+pt.toolFailure+pt.toolDenied," ( "),e.createElement(s,{color:l.success||"green"},"\u2714 ",pt.toolSuccess),e.createElement(s,{color:l.text}," "),e.createElement(s,{color:l.warning||"yellow"},"\u{1F6C7} ",pt.toolDenied),e.createElement(s,{color:l.text}," "),e.createElement(s,{color:l.danger||"red"},"\u2718 ",pt.toolFailure),e.createElement(s,{color:l.text}," )"))),e.createElement(m,{flexDirection:"column",marginTop:1},e.createElement(s,{color:l.text,bold:!0,underline:!0},n),e.createElement(m,{marginTop:1},e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},a)),e.createElement(s,{color:l.text},_s(o?.duration||0))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Model Requests:")),e.createElement(s,{color:l.text},o?.agent||0)),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},"Memory Agent:")),e.createElement(s,{color:l.text},o?.background||0)),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},w)),e.createElement(s,{color:l.text},at(o?.tokens||0))),(o?.tokens||0)>0&&e.createElement(e.Fragment,null,e.createElement(m,{marginLeft:2},e.createElement(m,{width:23},e.createElement(s,{color:l.textMuted},"\xBB Input Tokens:")),e.createElement(s,{color:l.text},at((o?.tokens||0)-(o?.candidateTokens||0)))),(o?.cachedTokens||0)>0&&e.createElement(m,{marginLeft:4},e.createElement(m,{width:21},e.createElement(s,{color:l.textMuted},"\xBB Cached:")),e.createElement(s,{color:l.text},at(o.cachedTokens))),(o?.candidateTokens||0)>0&&e.createElement(m,{marginLeft:2},e.createElement(m,{width:23},e.createElement(s,{color:l.textMuted},"\xBB Output Tokens:")),e.createElement(s,{color:l.text},at(o.candidateTokens)))),(o?.imageCalls?.length||0)>0&&e.createElement(e.Fragment,null,e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},h)),e.createElement(s,{color:l.text},o.imageCalls.length)),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},y)),e.createElement(s,{color:l.text},Number(((o.imageCalls.reduce((Se,J)=>Se+J.cost,0)||0)*1e3).toFixed(0))," credits"))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},g)),e.createElement(s,{color:l.text},e.createElement(s,{color:l.success||"green"},"+",o?.linesAdded||0)," ",e.createElement(s,{color:l.danger||"red"},"-",o?.linesRemoved||0))),e.createElement(m,null,e.createElement(m,{width:25},e.createElement(s,{color:l.secondary},d)),e.createElement(s,{color:l.text},(o?.toolSuccess||0)+(o?.toolFailure||0)+(o?.toolDenied||0)," ( "),e.createElement(s,{color:l.success||"green"},"\u2714 ",o?.toolSuccess||0),e.createElement(s,{color:l.text}," "),e.createElement(s,{color:l.warning||"yellow"},"\u{1F6C7} ",o?.toolDenied||0),e.createElement(s,{color:l.text}," "),e.createElement(s,{color:l.danger||"red"},"\u2718 ",o?.toolFailure||0),e.createElement(s,{color:l.text}," )")))),e.createElement(s,{color:l.textMuted,dimColor:!0,italic:!0},`
|
|
204
|
+
`,"(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"))}case"dynamicDirDanger":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:l.warning||"yellow",bold:!0,underline:!0},"DYNAMIC DIRECTORY AWARENESS"),e.createElement(s,{marginTop:1,color:l.text},"Enabling this keeps the agent aware of filesystem state in real time, but may reduce prompt cache efficiency."),e.createElement(s,{color:l.text},`
|
|
205
|
+
`,"RECOMMENDED SCENARIOS TO TURN ON:"),e.createElement(s,{color:l.textMuted},"\u2022 Repo is small."),e.createElement(s,{color:l.textMuted},"\u2022 The task benefits from real-time filesystem awareness."),e.createElement(s,{color:l.textMuted},"\u2022 Files are often created, renamed, or deleted."),e.createElement(s,{color:l.textMuted},"\u2022 You know exactly what you're signing up for."),e.createElement(s,{color:l.textMuted},"\u2022 You don't have conflicting decisions regarding token bills."),e.createElement(s,{color:l.textMuted},"\u2022 You want to see your wallet crying at 3am."),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Confirm Intent",theme:de.theme,items:[{label:"Turn On Dynamic Directory Awareness",value:"on"},{label:"Keep Off (Recommended)",value:"off"}],onSelect:o=>{o.value==="on"&&Mt(n=>{let a={...n,dynamicDirAwareness:!0};return It({systemSettings:a,apiTier:tt,quotas:Pe}),a}),G("settings")}})));case"dynamicDirHelp":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:l.text,bold:!0,underline:!0},"DYNAMIC DIRECTORY AWARENESS \u2014 HELP & EXPLANATION"),e.createElement(s,{color:l.text,bold:!0},`
|
|
206
|
+
`,"OFF (Default):"),e.createElement(s,{color:l.textMuted},"\u2022 Takes a static directory snapshot at conversation/session start and places it in System Context."),e.createElement(s,{color:l.textMuted},"\u2022 Prompt cache remains stable across user turns, saving tokens and money."),e.createElement(s,{color:l.text,bold:!0},`
|
|
207
|
+
`,"ON:"),e.createElement(s,{color:l.textMuted},"\u2022 Rescans and updates the directory's state dynamically on every single user turn."),e.createElement(s,{color:l.textMuted},"\u2022 Provides real-time filesystem awareness if files are continuously created, renamed, or removed."),e.createElement(s,{color:l.textMuted},"\u2022 Changes Prompt Context on each turn, invalidating part of prompt caches and increasing token usage."),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Actions",theme:de.theme,items:[{label:"Back to Settings",value:"back"}],onSelect:()=>G("settings")})));case"autoExecDanger":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:l.warning||"yellow",bold:!0,underline:!0},"SECURITY WARNING: YOLO MODE"),e.createElement(s,{marginTop:1,color:l.text},"Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."),e.createElement(s,{marginTop:1,color:l.text,bold:!0},"RISKS INVOLVED:"),e.createElement(s,{color:l.textMuted},"\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake unless specified in sandbox rules."),e.createElement(s,{color:l.textMuted},"\u2022 Unintended system changes if the agent hallucinates a path or command."),e.createElement(s,{color:l.textMuted},"\u2022 Reduced control over the agent's step-by-step decision making."),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Confirm Intent",theme:de.theme,items:[{label:"I know the risk and turning on intentionally",value:"on"},{label:"Keep Off (Recommended)",value:"off"}],onSelect:o=>{o.value==="on"&&Mt(n=>({...n,autoExec:!0})),G("settings")}})));case"advanceRollbackDanger":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,paddingTop:0,width:"100%"},e.createElement(s,{color:l.warning||"yellow",bold:!0},"\u26A0 Emergency Rollback Notice"),e.createElement(s,{marginTop:1,color:l.text},"When enabled, full repo snapshots exist only during active AI turns."),e.createElement(s,{marginTop:1,color:l.text},"If catastrophic changes occur during a turn, avoid abruptly stopping the agent unless absolutely necessary (external damages out of codebase)."),e.createElement(s,{color:l.textMuted},"The agent may be able to automatically restore the repo to a safe state."),e.createElement(s,{marginTop:1,color:l.textMuted},"Once the turn ends, emergency snapshots are deleted and standard /revert takes over which may not retain full repo content."),e.createElement(s,{marginTop:1,color:l.textMuted},"(Requires Restart to take effect)"),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Confirm",theme:de.theme,items:[{label:"I understand and wish to enable",value:"on"},{label:"Keep Off",value:"off"}],onSelect:o=>{o.value==="on"&&Mt(n=>({...n,advanceRollback:!0})),G("settings")}})));case"externalDanger":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:l.warning||"yellow",bold:!0,underline:!0},"SECURITY WARNING: EXTERNAL WORKSPACE ACCESS"),e.createElement(s,{marginTop:1,color:l.text},"Turning this ON allows the agent to execute tools (Read/Write/Exec) outside of the current active workspace directory."),e.createElement(s,{marginTop:1,color:l.text,bold:!0},"RISKS INVOLVED:"),e.createElement(s,{color:l.textMuted},"\u2022 Access to sensitive system files (SSH keys, Browser data, etc.)"),e.createElement(s,{color:l.textMuted},"\u2022 Potential for accidental or malicious deletion of OS-critical files."),e.createElement(s,{color:l.textMuted},"\u2022 Unauthorized script execution across your entire file system."),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Confirm Intent",theme:de.theme,items:[{label:"I know the risk and turning on intentionally",value:"on"},{label:"Keep Off (Recommended)",value:"off"}],onSelect:o=>{o.value==="on"&&Mt(n=>({...n,allowExternalAccess:!0})),G("settings")}})));case"doubleDanger":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:l.danger||"red",bold:!0,underline:!0},"CRITICAL SECURITY WARNING: COMBINED SYSTEM RISK"),e.createElement(s,{marginTop:1,color:l.text},"You are attempting to enable BOTH [YOLO Mode] and [External Workspace Access] simultaneously."),e.createElement(s,{marginTop:1,color:l.danger||"red",bold:!0},"THIS IS NOT RECOMMENDED."),e.createElement(s,{marginTop:1,color:l.text,bold:!0},"THE CRITICAL RISK:"),e.createElement(s,{color:l.textMuted},"The agent will have the power to execute any command across your entire system WITHOUT your approval or supervision."),e.createElement(s,{color:l.danger||"red",italic:!0,marginTop:1},"A single hallucination or error could result in full system wipe or data theft."),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Final Confirmation",theme:de.theme,items:[{label:"I agree knowing the consequences",value:"on"},{label:"Keep Off",value:"off"}],onSelect:o=>{o.value==="on"&&Mt(n=>({...n,autoExec:!0,allowExternalAccess:!0})),G("settings")}})));case"key":return e.createElement(ft,{title:"API KEY MANAGEMENT",items:[{label:"Edit Current Key (Update)",value:"edit"},{label:"Remove Current Key (Delete)",value:"remove"},{label:"Cancel",value:"Cancel"}],onSelect:o=>{if(o.value==="edit"){Dt(null),G("chat");let n=Ve(2);U(a=>[...a,{id:Date.now(),role:"system",text:`\u2726 Flux waiting for new API Key...
|
|
208
|
+
\u2800`}])}else o.value==="remove"?G("deleteKey"):G("chat")}});case"deleteKey":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:"grey",paddingX:2,paddingY:1},(()=>{let o=Ve(2);return e.createElement(s,{color:"white",bold:!0},"DANGER: CLEAR CREDENTIALS")})(),e.createElement(s,{marginTop:1},"This will permanently delete all saved API keys in credential cache. You will need to enter it again to use Flux."),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Are you sure?",items:[{label:"YES, CLEAR CREDENTIALS",value:"yes"},{label:"NO, GO BACK",value:"no"}],onSelect:async o=>{if(o.value==="yes"){await si(),Dt(null),G("chat");let n=Ve(2);U(a=>[...a,{id:Date.now(),role:"system",text:"[CREDENTIAL CLEARED] API Key removed successfully."}])}else G("key")},theme:de.theme})));case"exit":return null;case"ask":return e.createElement(m,{width:"100%"},e.createElement(Wi,{question:Ao?.question,options:Ao?.options,onResolve:o=>{Ao?.resolve&&Ao.resolve(o),Dr(null),G("chat")},theme:de.theme}));case"revert":return e.createElement(m,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(ds,{prompts:Al,onSelect:async o=>{i&&(i.write("\x1B[2J\x1B[3J\x1B[H"),i.isTTY&&i.write("\x1B[?2004h"));try{let n=await Sn.rollbackToBefore(o);if(n.success){let{targetPrompt:a}=n;Mi(Ze),Pr(d=>d+1),io(),Ut.current={completedIndex:0,columns:A.columns,historicalBlocks:[],seenSelections:new Set,chatId:Ze,clearKey:Po+1};let w=mt.findLastIndex(d=>d.role==="user"&&d.text&&(d.text.startsWith(a)||d.text.includes(a))),h=[...mt];w!==-1&&(h=mt.slice(0,w)),U(h),j(h.length),c(a),E(a.split(`
|
|
209
|
+
`).length>2);let y=h.filter(d=>!String(d.id).startsWith("welcome")&&(!d.isMeta||d.text&&d.text.includes("Request Cancelled")));await Ro(Ze,null,y);let g=Ve(2);U(d=>{let S=[...d,{id:"revert-ok-"+Date.now(),role:"system",text:`\u2726 Rollback Successful
|
|
210
|
+
\u2800\u2800\u2514\u2500 Reverted prompt loaded to input box.
|
|
211
|
+
\u2800`,isMeta:!0}];return j(S.length),S}),G("chat")}}catch(n){let a=Ve(2);U(w=>{let h=[...w,{id:"revert-err-"+Date.now(),role:"system",text:`\u2726 ERROR
|
|
212
|
+
\u2800\u2800\u2514\u2500 ${n.message}
|
|
213
|
+
\u2800`,isMeta:!0}];return j(h.length),h}),G("chat")}},onClose:()=>G("chat"),theme:de.theme}));case"resume":return e.createElement(m,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(ns,{onSelect:async o=>{let n=await yo();if(n[o]){if(i.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY){let y=n[o]?.name||"",g=y&&!y.startsWith("flow-")&&!y.startsWith("Session ")?y:"FluxFlow | Resumed";process.stdout.write(`\x1B]0;${g}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${g}\x07`)}io(),Oo.current=!0,Hn(o);let a=await Jn(o);un.current=Ht-a.total,Oo.current=!1,cn(a.total),ko({tokens:a.context});let w=[...n[o].messages];w[0]?.text?.includes("\u2591\u2591\u2591\u2588\u2588\u2588")||w.unshift({id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}),U(w),G("chat"),U(y=>{let g=[...y,{id:"sys-"+Date.now(),role:"system",text:`\u2726 SESSION RESUMED
|
|
214
|
+
\u2800\u2800\u2514\u2500 ${o}
|
|
215
|
+
\u2800`,isMeta:!0}];return j(g.length),g})}},onDelete:async o=>await zn(o),onClose:()=>G("chat"),theme:de.theme}));case"keybindingsPrompt":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:"grey",paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:"white",bold:!0,underline:!0},"\u2328 CONFIGURE SHIFT+ENTER NEWLINE"),e.createElement(s,{marginTop:1},"To support multi-line inputs with ",e.createElement(s,{bold:!0,color:"white"},"Shift + Enter")," for newline, a terminal sequence keybinding needs to be added to your IDE configuration."),e.createElement(s,{marginTop:1},"Would you like FluxFlow to automatically add this to your ",Ho()," keybindings?"),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Add Keybinding?",items:[{label:"Yes, configure automatically",value:"yes"},{label:"No, skip",value:"no"}],onSelect:async o=>{o.value==="yes"?await Bo(Ho()):fr="\\ + Enter",G("chat")},theme:de.theme})));case"memory":return e.createElement(m,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(ss,{onClose:()=>G("chat"),theme:de.theme}));case"parserDownload":return e.createElement(m,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(is,{onClose:()=>G("settings")}));case"profile":return e.createElement(es,{initialData:dn,onSave:o=>{Ts(o),U(n=>[...n,{id:Date.now(),role:"system",text:`${o.name.length>0||o.nickname.length>0?`\u2726 Profile Updated${o.name.length>0?`
|
|
216
|
+
\u2800\u2800\u2514\u2500 Name: ${o.name} `:""}${o.nickname.length>0?`
|
|
217
|
+
\u2800\u2800\u2514\u2500 Nickname: ${o.nickname}`:""}`:`\u2726 Profile
|
|
218
|
+
\u2800\u2800\u2514\u2500 Nothing to Update`}
|
|
219
|
+
|
|
220
|
+
\u2726 Custom Instructions
|
|
221
|
+
${o.instructions.length>0?`\u2800\u2800\u2514\u2500 ${o.instructions.substring(0,30)}${o.instructions.length>30?"...":""}`:"\u2800\u2800\u2514\u2500 No Instructions Provided."}
|
|
222
|
+
\u2800`,isMeta:!0}]),G("chat")},onCancel:()=>G("chat"),theme:de.theme});case"resolution":return e.createElement(m,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(kd,{data:Ll,theme:de.theme,onResolve:o=>{Or(null),G("chat"),setTimeout(()=>{qs(o,!0)},500)},onEdit:o=>{Or(null),G("chat"),c(o)}}));case"approval":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:"white",bold:!0,underline:!0},"FILE WRITE PERMISSION"),e.createElement(s,{marginTop:1},"The agent is attempting to modify: ",e.createElement(s,{color:"cyan"},bn(ho?.args||"{}").path||"Unknown File")),Uo()?e.createElement(m,{marginTop:1,paddingX:1},e.createElement(s,{color:"cyan",italic:!0},"FluxFlow Companion is active. Review the changes in your editor.")):e.createElement(m,{marginTop:1,borderStyle:"single",borderColor:"#333",paddingX:1,flexDirection:"column"},e.createElement(s,{color:"gray"},"--- PROPOSED CONTENT ---"),(()=>{let o=bn(ho?.args||"{}"),n=[],a=new Set;if(Object.keys(o).forEach(y=>{let g=y.match(/^(searchContent|replaceContent|newContent|content_to_replace|content_to_add|TargetContent|ReplacementContent|replacementContent)(\d+)?$/);if(g){let d=g[2]?parseInt(g[2]):1;a.add(d)}}),Array.from(a).sort((y,g)=>y-g).forEach(y=>{let g,d;y===1?(g=o.searchContent1??o.searchContent??o.replaceContent1??o.content_to_replace1??o.replaceContent??o.content_to_replace??o.TargetContent??null,d=o.newContent1??o.content_to_add1??o.newContent??o.content_to_add??o.ReplacementContent??o.replacementContent??null):(g=o[`searchContent${y}`]??o[`replaceContent${y}`]??o[`content_to_replace${y}`]??null,d=o[`newContent${y}`]??o[`content_to_add${y}`]??null),(g!==null||d!==null)&&n.push({replace:g,new:d})}),n.length>0)return e.createElement(m,{flexDirection:"column",marginTop:1},n.map((y,g)=>{let d=y.replace!==null,S=y.new!==null;return e.createElement(m,{key:g,flexDirection:"column",marginTop:g>0?1:0},n.length>1&&e.createElement(s,{color:"gray"},"Block ",g+1,":"),d&&e.createElement(m,null,e.createElement(s,{color:"red",wrap:"anywhere",bold:!0},"- ",y.replace)),S&&e.createElement(m,{marginTop:0},e.createElement(s,{color:"green",wrap:"anywhere",bold:!0},"+ ",y.new.replace(/\[\/n\]?/g,"\\n"))))}));let h=o.content||o.ReplacementContent||o.content_to_add||o.replacementContent||o.newContent||null;return e.createElement(s,{color:"white",wrap:"anywhere"},(h?h.replace(/\[\/n\]?/g,"\\n"):null)||"Updating file content...")})()),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Action Required",items:[{label:"Accept this time",value:"allow"},{label:"Accept for this session",value:"always"},{label:"Don't accept",value:"deny"}],onSelect:o=>{o.value==="always"&&Ml(!0);let n=o.value==="deny"?"deny":"allow";ho.resolve(n),Vo(null),G("chat")},theme:de.theme})));case"updateManager":return e.createElement(ft,{title:"Select Preferred Update Manager",subtitle:"NOTE: If you are unsure about these, go with NPM",items:[{label:"NPM (Standard)",value:"npm"},{label:"PNPM (Recommended)",value:"pnpm"},{label:"BUN (Ultra Fast)",value:"bun"},{label:"YARN (Classic)",value:"yarn"},{label:"Custom Command",value:"custom"},{label:"Back",value:"settings"}],onSelect:o=>{if(o.value==="settings"||o.value==="Back"){G("settings");return}o.value==="custom"?(dt({label:"Enter Custom Update Command (Global install recommended):",key:"customUpdateCommand",value:de.customUpdateCommand,next:n=>(Mt(a=>({...a,updateManager:"custom",customUpdateCommand:n})),null)}),G("input")):(Mt(n=>({...n,updateManager:o.value})),G("settings"))},theme:de.theme});case"update":return e.createElement(Vi,{latest:Tt,current:zt,settings:de,onClose:()=>G("chat"),onSuccess:()=>{U(o=>(j(o.length+1),[...o,{id:"update-success-"+Date.now(),role:"system",text:`**[UPDATE COMPLETED]** Flux Flow successfully updated to v${Tt}.
|
|
223
|
+
**Restart to see changes.**`,isMeta:!0}])),G("chat")},onUpdateSettings:o=>{G("updateManager")}});case"terminalApproval":return e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1,width:"100%"},e.createElement(s,{color:"white",bold:!0,underline:!0},"TERMINAL COMMAND OVERSIGHT"),e.createElement(m,{marginTop:1},e.createElement(s,null,"Agent requested to run: ",e.createElement(s,{color:"yellow",bold:!0},bn(ho?.args||"{}").command||"Unknown Command"))),e.createElement(m,{marginTop:1},e.createElement(ft,{title:"Risk Assessment Required",items:[{label:"Run",value:"allow"},{label:"Deny",value:"deny"}],onSelect:o=>{ho.resolve(o.value),Vo(null),G("chat")},theme:de.theme})));default:return e.createElement(m,{flexDirection:"column",marginTop:1,flexShrink:0,width:"100%"},Xs&&Hs&&e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:1,width:"100%",marginBottom:1},e.createElement(m,{justifyContent:"space-between",width:"100%"},e.createElement(s,{color:l.text,bold:!0,underline:!0},"INQUIRY RESPONSE"),e.createElement(s,{color:l.textMuted},"[ ESC to Close ]")),e.createElement(m,{marginTop:1,width:"100%"},e.createElement(Mn,{text:Hs,columns:A.columns-6,theme:de.theme}))),vr.filter(o=>o.status==="running").length>0&&e.createElement(m,{flexDirection:"column",borderStyle:"round",borderColor:l.borderMuted,paddingX:2,paddingY:0,width:"100%",marginBottom:1},e.createElement(m,{justifyContent:"space-between",width:"100%"},e.createElement(s,{color:l.text,bold:!0},"ACTIVE SUBAGENTS")),e.createElement(m,{flexDirection:"column",marginTop:1,width:"100%"},vr.filter(o=>o.status==="running").map(o=>e.createElement(Ld,{key:o.id,sa:o,showTPMEstimate:de.showTPMEstimate})))),e.createElement(m,{paddingX:1,marginBottom:0,justifyContent:"space-between",width:"100%"},e.createElement(m,null,hn?e.createElement(m,{gap:1},e.createElement(Li,null),e.createElement(In,{text:hn.trimEnd(),baseColor:l.textExclusive||l.text,glintColor:l.textMutedExclusive||l.textMuted,speed:60,italic:!0,glintWidth:2,typeSpeed:10}),e.createElement(s,{color:l.textMuted},Ps>0?`(${Ps.toFixed(0)}s)`:"")):e.createElement(s,{color:l.textMuted,italic:!0},B.length>0&&Us?"Press ESC again to clear input":El?"Press CTRL + O to expand":"Waiting for input...")),e.createElement(m,null,(()=>{let o=hn?.toLowerCase()??"";return Ko&&Date.now()-ws>15e3&&vr.length===0&&(o.includes("connecting")||o.includes("working")||o.includes("queue"))?e.createElement(m,null,e.createElement(In,{text:"Waiting for API",baseColor:l.text,glintColor:l.textMuted,glintWidth:4,speed:80}),e.createElement(s,{color:l.textMuted,dimColor:!0}," \u2503 ")):Ir?e.createElement(m,null,e.createElement(In,{text:Ir,baseColor:l.text,glintColor:l.textMuted,italic:!0,speed:80,typeSpeed:15}),e.createElement(s,{color:l.textMuted,dimColor:!0}," \u2503 ")):null})(),e.createElement(In,{text:it.split("/")[1]||(it.length>1?it:"Use '/model model-id' to select model"),baseColor:l.text,glintColor:l.textMuted,glintWidth:3}),e.createElement(s,{color:l.textMuted}," ",it.length>0?`(${We})`:""))),e.createElement(m,{flexDirection:"column",width:"100%"},e.createElement(m,{width:"100%",height:1,overflow:"hidden"},e.createElement(s,{color:l.inputBorder},"\u2584".repeat(Math.max(1,A.columns)))),e.createElement(m,{backgroundColor:l.inputBg,paddingX:1,paddingY:0,width:"100%",flexDirection:"column"},e.createElement(m,{flexDirection:"column",width:"100%"},e.createElement(m,{flexDirection:"row",width:"100%",paddingY:0},e.createElement(m,{flexShrink:0,width:4},e.createElement(s,{color:l.inputPrompt,bold:!0},Ko||Gn?"\u2726 ":" \u276F ")),e.createElement(m,{flexGrow:1},e.createElement(m,{flexGrow:1,position:"relative"},B===""&&e.createElement(m,{position:"absolute",paddingLeft:0},jt&&!fn?e.createElement(s,{color:"yellow"},Nl?" Terminal is waiting for user input. Press TAB to interact":" Press TAB to interact with terminal..."):jt&&fn?e.createElement(s,{color:"yellow",bold:!0}," [ TERMINAL FOCUSED ] Type to interact, press TAB to exit..."):Us===1?e.createElement(s,{color:l.inputPrompt,bold:!0}," Press ESC again to ",B.length>0?"clear input":"revert codebase to checkpoint","..."):e.createElement(s,{color:l.inputPlaceholder},kl?" Press ESC again to cancel the request.":Gn?" Compacting session history, please wait...":Ko?" Enter a prompt to steer the agent.":` Send message, @file or /cmd ... (${Cl.shortcut} for newline)`)),e.createElement(_i,{key:`input-${v}`,onPasteStateChange:Bl,focus:!fn&&!Gn,showCursor:Ne&&!Gn,cursorColor:l.inputText,lastFocusEventTime:ze.current,value:B,textStyle:{bold:!0,color:l.inputText},columns:A.columns,onChange:o=>{let n=o.replace(/\r\n/g,`
|
|
224
|
+
`).replace(/\r/g,`
|
|
225
|
+
`).replace(/\\\s*\n/g,`
|
|
226
|
+
`);c(n),ge(!1)},onSubmit:qs,rows:1,maxRows:10,keyBindings:{submit:o=>o.return&&!o.shift&&!o.ctrl,newline:o=>o.return&&o.shift||o.return&&o.ctrl}})))))),e.createElement(m,{width:"100%",height:1,overflow:"hidden"},e.createElement(s,{color:l.inputBorder},"\u2580".repeat(Math.max(1,A.columns))))))}};return e.createElement(m,{flexDirection:"column",width:"100%"},P?null:Y?e.createElement(Ed,{width:i?.columns||80,height:i?.rows||24,selectedIndex:ie,aiProvider:L,theme:de.theme}):e.createElement(e.Fragment,null,e.createElement(m,{paddingX:1,flexDirection:"column",width:"100%"},e.createElement(bd,{key:`static-${Po}-${Ze}-${A.columns}-${A.rows}-${de.theme}`,items:js.completed},o=>e.createElement(sr,{key:o.key,block:o,columns:(i?.columns||80)-2,showFullThinking:vt,aiProvider:L,version:zt,theme:de.theme}))),e.createElement(m,{flexDirection:"column",paddingX:1,paddingBottom:0,width:"100%"},(nt==="chat"||["ask","approval","terminalApproval"].includes(nt))&&e.createElement(m,{flexDirection:"column",width:"100%"},js.active.map(o=>e.createElement(sr,{key:o.key,block:o,columns:Math.max(20,(i?.columns||80)-2),showFullThinking:vt,aiProvider:L,version:zt,theme:de.theme})),jt&&e.createElement(m,{marginTop:1},e.createElement(rr,{command:jt,output:Yo,isFocused:fn,isPty:Zo,terminalHeight:A.rows,columns:A.columns}))),P?e.createElement(m,{borderStyle:"double",borderColor:"grey",padding:1,flexShrink:0},e.createElement(s,{color:"white"},"Starting Flux Flow...")):ke?Fl():e.createElement(m,{borderStyle:"round",borderColor:"white",padding:0,flexDirection:"column",flexShrink:0,width:"100%"},e.createElement(m,{paddingX:1,marginBottom:1},e.createElement(s,{color:"gray",bold:!0},"API KEY REQUIRED")),e.createElement(m,{paddingX:1,flexDirection:"column"},qe===0?e.createElement(e.Fragment,null,e.createElement(s,{color:"white"},"Select your Preferred Provider:"),e.createElement(m,{marginTop:1},e.createElement(ft,{items:[{label:"Google",value:"Google"},{label:"Nvidia",value:"NVIDIA"},{label:"DeepSeek",value:"DeepSeek"},{label:"Ollama",value:"Ollama"},{label:"Mistral [EXPERIMENTAL]",value:"Mistral"},{label:"OpenRouter [EXPERIMENTAL]",value:"OpenRouter"}],onSelect:o=>{he(o.value),Qe(1)}}))):e.createElement(e.Fragment,null,e.createElement(s,{color:"white"},L==="Ollama"?"Enter Ollama API Key (or type LOCAL to use local host):":`Enter your ${L} API Key:`),e.createElement(m,{marginTop:1},e.createElement(s,{color:"gray",bold:!0}," ",">"," "),e.createElement(cs,{value:He,onChange:Ot,onSubmit:Vs,mask:"*"})))),e.createElement(m,{paddingX:1,marginTop:1},e.createElement(s,{color:"gray",italic:!0},qe===0?"(Use arrows to select and Enter to confirm, ESC to go back)":"(Press Enter to confirm and initialize, ESC to go back)"))),x&&e.createElement(m,{borderStyle:"round",borderColor:l.borderMuted,paddingX:1,marginY:0,width:"100%"},e.createElement(s,null,e.createElement(s,{color:"red",bold:!0},"\u{1F534} EXIT: "),e.createElement(s,{color:l.text},"Press "),e.createElement(s,{color:l.text,bold:!0},"CTRL+C"),e.createElement(s,{color:l.text}," again to exit (",p,"s) \u2022 Press "),e.createElement(s,{color:l.textMuted,bold:!0},"ESC"),e.createElement(s,{color:l.text}," to cancel"))),Fe.length>0&&(()=>{let n=xe.current,a=0;for(;a<Fe.length;){let y=Fe[a],g=y?.cmd||y||"";if(typeof g=="string"&&g.trimStart().startsWith("---"))a++;else break}Z<=a?n=0:Z<n?n=Z:Z>=n+5&&(n=Z-5+1),n=Math.max(0,Math.min(n,Math.max(0,Fe.length-5))),xe.current=n;let w=Fe.slice(n,n+5),h=Fe.length-(n+w.length);return e.createElement(m,{flexDirection:"column",width:"100%",marginBottom:1},e.createElement(m,{paddingX:1,marginBottom:0,justifyContent:"space-between",width:"100%"},e.createElement(s,{color:l.text,bold:!0},Fe[0]?.cmd?.startsWith("@")||Fe[0]?.cmd?.startsWith("\\@")?"FILE SUGGESTIONS":"COMMAND SUGGESTIONS"),Fe[0]?.cmd?.startsWith("@")||Fe[0]?.cmd?.startsWith("\\@")?e.createElement(s,{color:l.textMuted,italic:!0},"(Use #Lstart-Lend to specify line numbers)"):B.startsWith("/model")&&tt==="Free"?(()=>{let y="https://aistudio.google.com/billing",g="billing";L==="DeepSeek"?(y="https://platform.deepseek.com/usage",g="billing"):L==="OpenRouter"?(y="https://openrouter.ai/settings/profile",g="profile"):L==="NVIDIA"&&(y="https://build.nvidia.com/settings/api-keys",g="billing")})():null),w.slice(0,Vn).map((y,g)=>{let S=n+g===Z,I=typeof y.cmd=="string"&&y.cmd.trimStart().startsWith("---"),F=y.cmd===so("Google","Free")&&tt!=="Free";return e.createElement(m,{key:y.cmd,flexDirection:"row",backgroundColor:S?l.highlightBg:void 0,paddingX:1},e.createElement(m,{width:3},e.createElement(s,{color:S?l.text:l.textMuted,bold:S},S?" \u276F":" ")),e.createElement(m,{width:55},e.createElement(s,{color:I?l.textDim:F?l.textMuted:S?l.text:l.textDim,bold:!1},y.cmd&&(y.cmd.startsWith("@[")||y.cmd.startsWith("\\@["))&&y.cmd.endsWith("]")?(()=>{let we=(y.cmd.startsWith("\\@[")?y.cmd.slice(3,-1):y.cmd.slice(2,-1)).split(/[/\\]/);return we[we.length-1]})():y.cmd&&y.cmd.includes("/")?y.cmd.split("/").pop():y.cmd)),e.createElement(m,{flexGrow:1},e.createElement(s,{color:S?l.text:l.textMuted,italic:!0},y.desc)))}),Fe.length>5&&e.createElement(m,{paddingX:1,height:1},h>0?e.createElement(s,{color:l.textMuted,dimColor:!0,italic:!0}," ... (",h," more commands available)"):e.createElement(s,{color:l.textMuted,dimColor:!0,italic:!0}," (End of list)")))})(),e.createElement(m,{flexShrink:0,width:"100%"},e.createElement(Hi,{mode:O,thinkingLevel:We,tokens:fo.tokens,tokensTotal:gl,chatId:Ze,isMemoryEnabled:de.memory,apiTier:tt,aiProvider:L,activeModel:it,isProcessing:Ko,lastChunkTime:ws,theme:de.theme,wps:wr.current.wps,showTPMEstimate:de.showTPMEstimate})),nt==="exit"&&(()=>{let o=Date.now()-us,n=pt.toolSuccess+pt.toolFailure,a=n>0?(pt.toolSuccess/n*100).toFixed(1):"0.0",w=Nn+Fn,h=w>0?(Nn/w*100).toFixed(1):"0.0",y=w>0?(Fn/w*100).toFixed(1):"0.0";return e.createElement(m,{flexDirection:"column",borderStyle:"round",paddingX:3,paddingY:1,borderColor:l.borderMuted,width:Math.min(100,(i?.columns||100)-2),marginTop:0,marginBottom:0},e.createElement(m,{marginBottom:1},e.createElement(s,{bold:!0},Cd(l.logoGradient||["blue","purple"])("Agent powering down. Goodbye!"))),e.createElement(m,{flexDirection:"column"},e.createElement(s,{color:l.text,bold:!0,underline:!0},"Interaction Summary"),e.createElement(m,{marginTop:1},e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Session ID:")),e.createElement(s,{color:l.text},Ze)),e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Tool Calls:")),e.createElement(s,{color:l.text},pt.toolSuccess+pt.toolFailure+pt.toolDenied," ( ",e.createElement(s,{color:"green"},"\u2714 ",pt.toolSuccess)," ",e.createElement(s,{color:"yellow"},"\u{1F6C7} ",pt.toolDenied)," ",e.createElement(s,{color:"red"},"\u2718 ",pt.toolFailure)," )")),e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Success Rate:")),e.createElement(s,{color:l.text},a,"%")),e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Code Changes:")),e.createElement(s,{color:l.text},e.createElement(s,{color:"green"},"+",pt.linesAdded)," ",e.createElement(s,{color:"red"},"-",pt.linesRemoved))),e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Tokens Consumed:")),e.createElement(s,{color:l.text},at(Ht))),Ht>0&&e.createElement(e.Fragment,null,e.createElement(m,{marginLeft:2},e.createElement(m,{width:18},e.createElement(s,{color:l.textMuted},"\xBB Input Tokens:")),e.createElement(s,{color:l.text},at(Ht-Go))),Pn>0&&e.createElement(m,{marginLeft:4},e.createElement(m,{width:16},e.createElement(s,{color:l.textMuted},"\xBB Cached:")),e.createElement(s,{color:l.text},at(Pn))),Go>0&&e.createElement(m,{marginLeft:2},e.createElement(m,{width:18},e.createElement(s,{color:l.textMuted},"\xBB Output Tokens:")),e.createElement(s,{color:l.text},at(Go)))),Un>0&&e.createElement(e.Fragment,null,e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Images Made:")),e.createElement(s,{color:l.text},Un)),e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Image Credits:")),e.createElement(s,{color:l.text},Number(((Ms||0)*1e3).toFixed(0))," credits")))),e.createElement(m,{flexDirection:"column",marginTop:1},e.createElement(s,{color:l.text,bold:!0,underline:!0},"Performance"),e.createElement(m,{marginTop:1},e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Wall Time:")),e.createElement(s,{color:l.text},Lo(o))),e.createElement(m,null,e.createElement(m,{width:20},e.createElement(s,{color:l.secondary},"Agent Active:")),e.createElement(s,{color:l.text},Lo(w))),e.createElement(m,{marginLeft:2},e.createElement(m,{width:18},e.createElement(s,{color:l.textMuted},"\xBB API Time:")),e.createElement(s,{color:l.text},Lo(Nn)," (",h,"%)")),e.createElement(m,{marginLeft:2},e.createElement(m,{width:18},e.createElement(s,{color:l.textMuted},"\xBB Tool Time:")),e.createElement(s,{color:l.text},Lo(Fn)," (",y,"%)"))))})())))}export{_d as default};
|