fluxflow-cli 4.26.0 → 4.26.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.
@@ -1,4 +1,4 @@
1
- import{a as lr}from"./chunk-JS5ZIGFR.js";import{a as Ft}from"./chunk-56EJGQU3.js";import{a as io}from"./chunk-7SFAWGE2.js";import{a as sr,c as ar}from"./chunk-U2NRX2PX.js";import{a as fi,g as cr}from"./chunk-VYTQ6J56.js";import{a as dr}from"./chunk-RZTZPIC5.js";import{c as ci,g as or,h as ir,i as rr,m as di}from"./chunk-6NWU3ML6.js";import{a as vo}from"./chunk-FQBBOFNP.js";import{a as j}from"./chunk-Y5JU726N.js";import{b as ai}from"./chunk-HM3CMNOJ.js";import{d as Co,i as wt,k as Mt,m as li,n as nr}from"./chunk-LKJUPSJM.js";import{a as oo}from"./chunk-ZLWYMCCW.js";import{k as st,l as Eo,o as Q}from"./chunk-QWTKV7Q4.js";import{c as bt,d as Hn}from"./chunk-L3W2X74K.js";import{a as Sn,d as Tn,e as Ao,k as Pn,l as Ro,m as ri,r as si,w as to,x as no}from"./chunk-DSVLWYIT.js";import{GoogleGenAI as Rs,ThinkingLevel as Ge,HarmBlockThreshold as Rn,HarmCategory as En}from"@google/genai";var fr=(e=!0,n=!0)=>`
1
+ import{a as lr}from"./chunk-JS5ZIGFR.js";import{a as Ft}from"./chunk-56EJGQU3.js";import{a as io}from"./chunk-7SFAWGE2.js";import{a as sr,c as ar}from"./chunk-U2NRX2PX.js";import{a as fi,g as cr}from"./chunk-VYTQ6J56.js";import{a as dr}from"./chunk-RZTZPIC5.js";import{c as ci,g as or,h as ir,i as rr,m as di}from"./chunk-6NWU3ML6.js";import{a as vo}from"./chunk-FQBBOFNP.js";import{a as j}from"./chunk-Y5JU726N.js";import{b as ai}from"./chunk-HM3CMNOJ.js";import{d as Co,i as wt,k as Mt,m as li,n as nr}from"./chunk-PSAFKMCL.js";import{a as oo}from"./chunk-ZLWYMCCW.js";import{k as st,l as Eo,o as Q}from"./chunk-QWTKV7Q4.js";import{c as bt,d as Hn}from"./chunk-L3W2X74K.js";import{a as Sn,d as Tn,e as Ao,k as Pn,l as Ro,m as ri,r as si,w as to,x as no}from"./chunk-DSVLWYIT.js";import{GoogleGenAI as Rs,ThinkingLevel as Ge,HarmBlockThreshold as Rn,HarmCategory as En}from"@google/genai";var fr=(e=!0,n=!0)=>`
2
2
  To use tools, must output exactly '[action:ActionName(arg1="value1")]' structured string in chat response \u2190 no exception
3
3
 
4
4
  -- Chat Management Tools --
@@ -108,6 +108,7 @@ Trigger in chat via /command
108
108
  ## Configuration & Model Controls
109
109
  * /settings \u2192 Full-screen interactive settings menu
110
110
  * /mode \u2192 Toggle Operating Mode
111
+ * /display index \u2192 Select active screen for Computer Use mode
111
112
  * /model model-id --flags \u2192 Flags optional to customize list (--save, --remove, --default, /model old-model new-model --rename)
112
113
  * /provider \u2192 Switch AI provider
113
114
  * /thinking effort \u2192 Set reasoning effort. Can be mapped based on provider & model support (/thinking effort --map provider-effort-value/'rm' to unmap). Changes the Translation Table only for the currently selected provider and model
@@ -127,6 +128,8 @@ Trigger in chat via /command
127
128
  * /changelog \u2192 Release notes
128
129
  * /update check \u2192 Check npm updates
129
130
  * /update latest \u2192 Install latest release
131
+ * /fluxflow init \u2192 Create local FluxFlow.md project-instructions template
132
+ * /move \u2192 Transfer Playground session data to CWD/playground-export
130
133
  `;var mr=`# FluxFlow In-App Settings Reference
131
134
 
132
135
  Open in chat via /settings
@@ -197,14 +200,15 @@ Open in chat via /settings
197
200
  * PatchFile(path, searchContent1..15, newContent1..15, allowMultiple?) \u2192 Atomic multi-replacement; supports ^LINE:start..end$
198
201
  * WriteFile(path, content) \u2192 Create/overwrite file
199
202
  * ReadFolder(path, recurse?) \u2192 List directory tree (depth: 1-3)
203
+ * FindFile(basename) \u2192 Locate file path by name/glob/fuzzy match (ext optional)
200
204
  * CodeSearch / SearchKeyword(keyword, path?, fuzzy?, regex?) \u2192 Fast text search; path="#docs" for doc index
201
205
  * Run(command) \u2192 Execute command in shell
202
- * Todo(method, tasks?, markDone?) \u2192 Planner ("create" | "append" | "get")
206
+ * Goal(method, tasks?, markDone?) \u2192 Planner ("create" | "append" | "get"); alias: Todo
203
207
 
204
208
  ## 2. Web & Communication
205
209
  * WebSearch(query, aiMode?, limit?) \u2192 Live web search + AI summary
206
210
  * WebScrape(url) \u2192 Extract markdown from URL
207
- * Ask(question, optionA..D?) \u2192 Interactive prompt to user ("title::desc")
211
+ * AskUser(question, optionA..D?) \u2192 Interactive prompt to user ("title::desc"); alias: Ask
208
212
 
209
213
  ## 3. Sub-Agents
210
214
  * InvokeSync(title, task) \u2192 Blocking sub-agent
@@ -541,7 +545,7 @@ ${fr(n,t)}
541
545
  === END SYSTEM PROMPT ===${e?`
542
546
 
543
547
  -- current saved user memories --
544
- ${e}`:""}`.trim();var zr=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),qr=()=>import("./web_scrape-BHSQTMX4.js").then(e=>e.web_scrape),Xr=()=>import("./memory-M7ASUB6J.js").then(e=>e.memory),Jr=()=>import("./chat-MELTWDZ3.js").then(e=>e.chat),Qr=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),Zr=()=>import("./write_file-HH7WRRDJ.js").then(e=>e.write_file),es=()=>import("./update_file-FUWOJ4JN.js").then(e=>e.update_file),ts=()=>import("./exec_command-J23EG77W.js").then(e=>e.exec_command),ns=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ai=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),os=()=>import("./write_pdf-N2Q4Z3YP.js").then(e=>e.write_pdf),is=()=>import("./write_docx-4Y43QJUV.js").then(e=>e.write_docx),$o=()=>import("./search_keyword-7WJ4M737.js").then(e=>e.search_keyword),rs=()=>import("./generate_image-MTPDDZY7.js").then(e=>e.generate_image),No=()=>import("./saveSummary-UGNDVNI5.js").then(e=>e.saveSummary),co=()=>import("./addMemScore-BCPTSMKD.js").then(e=>e.addMemScore),ss=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),Do=()=>import("./todo-GFMPH2JV.js").then(e=>e.todo),as=()=>import("./invokeSync-EJMZYWUM.js").then(e=>e.invokeSync),ia=()=>import("./invoke-VUBKZKFI.js").then(e=>e.invoke),ls=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ra=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),cs=()=>import("./emergency_rollback-6X27LZE4.js").then(e=>e.emergency_rollback),fo=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),uo=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),Fo=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),Bo=()=>import("./computer_action-W532LBFE.js").then(e=>e.computer_action),ds=()=>import("./click-BIP2KIKK.js").then(e=>e.click),fs=()=>import("./drag-XXDYAMBU.js").then(e=>e.drag),us=()=>import("./scroll-5V7P3DXY.js").then(e=>e.scroll),Ri=()=>import("./keyboard_typing-4M63JGZ4.js").then(e=>e.keyboard_typing),Ei=()=>import("./key_press-EJFHIVWP.js").then(e=>e.key_press),Ci=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),Uo=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),sa={web_search:zr,web_scrape:qr,memory:Xr,chat:Jr,view_file:Qr,write_file:Zr,update_file:es,exec_command:ts,read_folder:ns,write_pdf:os,write_docx:is,search_keyword:$o,generate_image:rs,saveSummary:No,addMemScore:co,file_map:ss,todo:Do,Todo:Do,goal:Do,Goal:Do,invokeSync:as,invoke:ia,getProgress:ls,cancel:ra,awaitSubagent:fo,answerSubagent:uo,steerSubagent:Fo,computer_action:Bo,computer_use:Bo,ComputerAction:Bo,ComputerUse:Bo,click:ds,Click:ds,drag:fs,Drag:fs,scroll:us,Scroll:us,keyboard_typing:Ri,KeyboardTyping:Ri,keyboardtyping:Ri,key_press:Ei,KeyPress:Ei,keypress:Ei,recapture_screen:Ci,RecaptureScreen:Ci,recapturescreen:Ci,invoke_sync:as,get_progress:ls,await_subagent:fo,answer_subagent:uo,steer_subagent:Fo,steer:Fo,Steer:Fo,ask:Ai,Ask:Ai,AskUser:Ai,WebSearch:zr,WebScrape:qr,ReadFile:Qr,ReadFolder:ns,WriteFile:Zr,PatchFile:es,WritePDF:os,WriteDoc:is,Run:ts,SearchKeyword:$o,CodeSearch:$o,code_search:$o,Memory:Xr,Chat:Jr,GenerateImage:rs,saveSumary:No,SaveSummary:No,SaveSumary:No,add_mem_score:co,AddMemScore:co,addMemoryScore:co,AddMemoryScore:co,FileMap:ss,answer:uo,Answer:uo,AnswerSubagent:uo,await:fo,Await:fo,AwaitSubagent:fo,EmergencyRollback:cs,emergency_rollback:cs,find_file:Uo,findFile:Uo,FindFile:Uo,findfile:Uo},go=async(e,n,t={})=>{let i=t.mode?t.mode.toLowerCase():"flux",o=e.toLowerCase(),c=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await"].some(p=>o.includes(p))||o==="ask",u=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(p=>o.includes(p));if(!c){if(i==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Action [${e}] is a Workspace Tool and NOT available in Flow mode. Tell user to switch (\`/mode flux\`) to use this tool.`}else if(i==="icu"){if(!u)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${t.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let h=sa[e];if(!h){let p=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],f={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},y=o.replace(/[^a-z0-9]/g,""),r=f[y]||null;if(!r){let w=0,U=B=>{let Se=new Set;for(let ie=0;ie<B.length-1;ie++)Se.add(B.slice(ie,ie+2));return Se},b=U(y);for(let B of p){let Se=B.toLowerCase().replace(/[^a-z0-9]/g,"");if(y===Se){r=B;break}let ie=0;(Se.includes(y)||y.includes(Se))&&(ie+=.6);let ee=U(Se),D=0;for(let Pe of b)ee.has(Pe)&&D++;let Oe=2*D/(b.size+ee.size||1);ie=Math.max(ie,Oe),ie>w&&ie>=.35&&(w=ie,r=B)}}let g=r?` Do you mean '${r}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await h())(n,t)}catch(p){let f=p instanceof Error?p.message:String(p);return`ERROR: Execution failed for [${e}]: ${f}`}};import Y from"path";import Ee from"fs";import aa from"gradient-string";var vi=["I have a regex for your problems.","Your terminal, my kingdom.","Blowing on the cartridge helps. Probably.","Don't panic. I have the towel.","Logic is the start of wisdom.","Try to exit Vim? Good luck.","I speak fluent Terminal.","The cake is a lie. This code is not.","I have no bugs, just surprise features.","Rewriting in Rust... just for fun.","Coffee in, clean commits out.","The magic smoke stays inside today.","A semicolon short of a miracle.","One does not simply code without a bug.","Keep it simple. Keep it terminal.","Regex: now you have two problems.","I dream in binary.","Root access or bust.","Wait for the dial-up tone. Just kidding.","I take the 'labor' out of collab.","My other process is a TARDIS.","Calculated response: 42.","Ponder the orb. Ponder the code.","Less talk, more flow.","Elegance in every byte.","Build something the world is not ready for.","Your wishes, my tool calls.","I act in Flux. I think in Flow.","Syntax error in the universe. Please fix.","Your project, my obsession.","I am not a bot, I am an architect.","Digital spirits consulted. They say: Ship it.","Reticulate splines. Engage humor.","Code like poetry. Run like water.","Minimalism is the ultimate flex.","The truth is in the logs.","Follow the white rabbit.","There is no spoon. Only code.","Binary is the only language I trust.","I have a good feeling about this.","Pew pew! Lasers charged.","Divide by zero? Not today.","Search for the correct USB orientation...","I've got a fever, and the only cure is more code.","The code gremlins are on our side.","My favorite command? Yours.","Stay hungry. Stay active.","Momentum is your best friend.","Lead the flow. Don't chase it.","A fresh batch of bytes. Hot and ready.","I orchestrate the ones and zeros.","Smart enough to help. Humble enough to ask.","Think twice. Code once.","Pure intent. Pure execution.","Small steps. Massive impact.","Your terminal is a canvas.","Efficiency is my second name.","I have seen things you people wouldn't believe.","Let the thoughts marinate.","The best feature? The one you don't need.","Precision is the only perfection.","Stay focused. Stay terminal.","Silence is the best debugger.","Erase the debt. Commit the code.","Velocity meets stability.","Ship it. Improve it. Repeat.","Build tomorrow, right now.","Turn logic into reality.","The best way to predict the future is to build it.","Break barriers, not builds.","Fuel the next breakthrough.","Momentum is key.","Terminal vibes only.","Your digital co-pilot is ready.","Partner in code. Partner in crime.","I speak in semicolons.","Ready for the next great idea.","Just a moment. In the zone.","Polishing the algorithms. Hold tight.","Craft a masterpiece today.","Debug the universe. Start here.","Warp speed engaged. Almost.","The cake is not a lie. It's just loading.","Finish the Kessel Run in 12 parsecs.","Do a barrel roll!","Waiting for the respawn.","Press Start to continue.","Herding digital cats... done.","The hamsters are fast today.","Tasting the snozberries.","I go for speed. I go for flow.","Real life or just fantasy?","Poking the bear... gently.","Ensure the magic smoke stays inside.","Try turning it off and on again.","Construct additional pylons.","New line? Ctrl+J is your friend.","Release the HypnoDrones.","Push the button, Frank.","My other loading screen is even funnier.","Pretty sure a cat walked on my keyboard.","Recalibrate the humor-o-meter.","Summon the code gremlins.","I've seen your browser history. Just kidding.","Charge the laser... pew pew!","Dividing by zero... just for a sec.","Looking for an adult supervisor. Found none.","Make it go beep boop.","Buffering... for effect.","Entangle quantum particles... complete.","Polishing the chrome on my algorithms.","Are you not entertained?","Just waiting for the dial-up tone.","Reboot the humor module.","Defragment memories. Check.","Optimizing for ludicrous speed.","Swapping bits. Don't tell the bytes.","Garbage collected. I am back.","Assembling the interwebs.","Converting coffee to logic.","Update syntax for reality.","Rewire the synapses.","Greasin' the cogs.","Engage the improbability drive.","Channel the Force.","Align the stars. Respond now.","The cake is a lie. The prompt is real.","I'm Feeling Lucky.","Shipping awesomeness.","Navigating the slime mold.","Consult digital spirits.","Ask the magic conch shell.","One moment. Optimizing humor.","Shuffling punchlines.","Compiling brilliance.","Summon the cloud of wisdom.","Prepare to dazzle.","Hold tight. Crafting a response.","Tuning the algorithms.","Following the white rabbit... again.","The truth is in here. Somewhere.","Herding cats is my day job.","Distracting you with this phrase.","Almost there. Probably.","Rickrolling my creator. Don't tell.","Slapping the bass.","Is this real life?","Ponder the orb. Type the prompt.","Thoughtful gaze initiated.","Computer's favorite snack? Microchips.","Why Java? Because I don't C#.","Charging the laser... wait for it.","Dividing by zero... just kidding!","Adult supervision not found. Proceed.","Beep boop. I'm a real boy.","Wait for the respawn.","Finish the run. Ship the code.","Fiddling with character creation.","Just a moment. Finding a meme.","Pressing A to continue.","Loading wit.exe.","Pre-heating the servers.","Calibrate flux capacitor.","Channeling the Force.","Aligning the stars.","The truth is in the code.","Don't panic.","Blowing on the cartridge.","Doing a barrel roll!","Respawning in 3... 2... 1...","The cake is a lie.","Fiddling with character settings.","Finding a suitable pun.","Distracting with wit.","Almost ready.","Hamsters on speed today.","Patting Cloudy on the head.","Rickrolling the logs.","Slapping the code.","Got a good feeling about this.","Poking the prompt.","Researching latest memes.","Making it more witty.","Thinking... hmmm.","Fish with no eyes? Fsh.","Broken pencil? Pointless.","Percussive maintenance applied.","USB orientation: 3rd try's the charm.","Rust rewrite in 3... 2...","Exiting Vim... someday.","Spinning the hamster wheel.","Not a bug. Unplanned feature.","Engage.","I'll be back.","Machine spirit consulted.","Letting the thoughts marinate.","Orb pondered.","Thoughtful gaze engaged.","Charging the laser...","Making it go beep.","Buffering...","Quantum particles entangled.","Polishing the chrome.","Entertained yet?","Gremlins summoned.","Dial-up tone finished.","Humor meter recalibrated.","Cat on keyboard. Sending help.","Enhancing...","Turn it off and on again.","Constructing pylons.","HypnoDrones released.","Pushing the button."];var gs=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],ho={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"]},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"]},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"]},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"]}};var Wo=null;var hs=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(Wo||(Wo=gs[Math.floor(Math.random()*gs.length)]),n={...Wo,id:"Mystery"}):(Wo=null,ho[e]?n=ho[e]:e==="GitHub"?n=ho["GitHub Dark"]:e==="Transparent"?n=ho["Transparent Dark"]:n=ho.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan";return{...n,codeText:t}};var la=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",Yl=(e=2)=>{let n=la();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},zl=(e="...",n="Loading...",t="Dark")=>{let i=vi[Math.floor(Math.random()*vi.length)],o=hs(t),s=o.logoTextAnsi,c=o.logoBodyAnsi,a=o.logoMutedAnsi,u="\x1B[0m",h=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],p=o.logoGradient||["#0077ff","#ff00ff"],f=aa(p).multiline(h.join(`
548
+ ${e}`:""}`.trim();var zr=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),qr=()=>import("./web_scrape-BHSQTMX4.js").then(e=>e.web_scrape),Xr=()=>import("./memory-M7ASUB6J.js").then(e=>e.memory),Jr=()=>import("./chat-MELTWDZ3.js").then(e=>e.chat),Qr=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),Zr=()=>import("./write_file-HH7WRRDJ.js").then(e=>e.write_file),es=()=>import("./update_file-FUWOJ4JN.js").then(e=>e.update_file),ts=()=>import("./exec_command-AB4DNQYP.js").then(e=>e.exec_command),ns=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ai=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),os=()=>import("./write_pdf-N2Q4Z3YP.js").then(e=>e.write_pdf),is=()=>import("./write_docx-4Y43QJUV.js").then(e=>e.write_docx),$o=()=>import("./search_keyword-7WJ4M737.js").then(e=>e.search_keyword),rs=()=>import("./generate_image-DJ5N72HD.js").then(e=>e.generate_image),No=()=>import("./saveSummary-UGNDVNI5.js").then(e=>e.saveSummary),co=()=>import("./addMemScore-BCPTSMKD.js").then(e=>e.addMemScore),ss=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),Do=()=>import("./todo-GFMPH2JV.js").then(e=>e.todo),as=()=>import("./invokeSync-CJLYOYER.js").then(e=>e.invokeSync),ia=()=>import("./invoke-7BVHSLMJ.js").then(e=>e.invoke),ls=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ra=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),cs=()=>import("./emergency_rollback-6X27LZE4.js").then(e=>e.emergency_rollback),fo=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),uo=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),Fo=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),Bo=()=>import("./computer_action-W532LBFE.js").then(e=>e.computer_action),ds=()=>import("./click-BIP2KIKK.js").then(e=>e.click),fs=()=>import("./drag-XXDYAMBU.js").then(e=>e.drag),us=()=>import("./scroll-5V7P3DXY.js").then(e=>e.scroll),Ri=()=>import("./keyboard_typing-4M63JGZ4.js").then(e=>e.keyboard_typing),Ei=()=>import("./key_press-EJFHIVWP.js").then(e=>e.key_press),Ci=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),Uo=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),sa={web_search:zr,web_scrape:qr,memory:Xr,chat:Jr,view_file:Qr,write_file:Zr,update_file:es,exec_command:ts,read_folder:ns,write_pdf:os,write_docx:is,search_keyword:$o,generate_image:rs,saveSummary:No,addMemScore:co,file_map:ss,todo:Do,Todo:Do,goal:Do,Goal:Do,invokeSync:as,invoke:ia,getProgress:ls,cancel:ra,awaitSubagent:fo,answerSubagent:uo,steerSubagent:Fo,computer_action:Bo,computer_use:Bo,ComputerAction:Bo,ComputerUse:Bo,click:ds,Click:ds,drag:fs,Drag:fs,scroll:us,Scroll:us,keyboard_typing:Ri,KeyboardTyping:Ri,keyboardtyping:Ri,key_press:Ei,KeyPress:Ei,keypress:Ei,recapture_screen:Ci,RecaptureScreen:Ci,recapturescreen:Ci,invoke_sync:as,get_progress:ls,await_subagent:fo,answer_subagent:uo,steer_subagent:Fo,steer:Fo,Steer:Fo,ask:Ai,Ask:Ai,AskUser:Ai,WebSearch:zr,WebScrape:qr,ReadFile:Qr,ReadFolder:ns,WriteFile:Zr,PatchFile:es,WritePDF:os,WriteDoc:is,Run:ts,SearchKeyword:$o,CodeSearch:$o,code_search:$o,Memory:Xr,Chat:Jr,GenerateImage:rs,saveSumary:No,SaveSummary:No,SaveSumary:No,add_mem_score:co,AddMemScore:co,addMemoryScore:co,AddMemoryScore:co,FileMap:ss,answer:uo,Answer:uo,AnswerSubagent:uo,await:fo,Await:fo,AwaitSubagent:fo,EmergencyRollback:cs,emergency_rollback:cs,find_file:Uo,findFile:Uo,FindFile:Uo,findfile:Uo},go=async(e,n,t={})=>{let i=t.mode?t.mode.toLowerCase():"flux",o=e.toLowerCase(),c=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await"].some(p=>o.includes(p))||o==="ask",u=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(p=>o.includes(p));if(!c){if(i==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Action [${e}] is a Workspace Tool and NOT available in Flow mode. Tell user to switch (\`/mode flux\`) to use this tool.`}else if(i==="icu"){if(!u)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${t.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let h=sa[e];if(!h){let p=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],f={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},y=o.replace(/[^a-z0-9]/g,""),r=f[y]||null;if(!r){let w=0,U=B=>{let Se=new Set;for(let ie=0;ie<B.length-1;ie++)Se.add(B.slice(ie,ie+2));return Se},b=U(y);for(let B of p){let Se=B.toLowerCase().replace(/[^a-z0-9]/g,"");if(y===Se){r=B;break}let ie=0;(Se.includes(y)||y.includes(Se))&&(ie+=.6);let ee=U(Se),D=0;for(let Pe of b)ee.has(Pe)&&D++;let Oe=2*D/(b.size+ee.size||1);ie=Math.max(ie,Oe),ie>w&&ie>=.35&&(w=ie,r=B)}}let g=r?` Do you mean '${r}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await h())(n,t)}catch(p){let f=p instanceof Error?p.message:String(p);return`ERROR: Execution failed for [${e}]: ${f}`}};import Y from"path";import Ee from"fs";import aa from"gradient-string";var vi=["I have a regex for your problems.","Your terminal, my kingdom.","Blowing on the cartridge helps. Probably.","Don't panic. I have the towel.","Logic is the start of wisdom.","Try to exit Vim? Good luck.","I speak fluent Terminal.","The cake is a lie. This code is not.","I have no bugs, just surprise features.","Rewriting in Rust... just for fun.","Coffee in, clean commits out.","The magic smoke stays inside today.","A semicolon short of a miracle.","One does not simply code without a bug.","Keep it simple. Keep it terminal.","Regex: now you have two problems.","I dream in binary.","Root access or bust.","Wait for the dial-up tone. Just kidding.","I take the 'labor' out of collab.","My other process is a TARDIS.","Calculated response: 42.","Ponder the orb. Ponder the code.","Less talk, more flow.","Elegance in every byte.","Build something the world is not ready for.","Your wishes, my tool calls.","I act in Flux. I think in Flow.","Syntax error in the universe. Please fix.","Your project, my obsession.","I am not a bot, I am an architect.","Digital spirits consulted. They say: Ship it.","Reticulate splines. Engage humor.","Code like poetry. Run like water.","Minimalism is the ultimate flex.","The truth is in the logs.","Follow the white rabbit.","There is no spoon. Only code.","Binary is the only language I trust.","I have a good feeling about this.","Pew pew! Lasers charged.","Divide by zero? Not today.","Search for the correct USB orientation...","I've got a fever, and the only cure is more code.","The code gremlins are on our side.","My favorite command? Yours.","Stay hungry. Stay active.","Momentum is your best friend.","Lead the flow. Don't chase it.","A fresh batch of bytes. Hot and ready.","I orchestrate the ones and zeros.","Smart enough to help. Humble enough to ask.","Think twice. Code once.","Pure intent. Pure execution.","Small steps. Massive impact.","Your terminal is a canvas.","Efficiency is my second name.","I have seen things you people wouldn't believe.","Let the thoughts marinate.","The best feature? The one you don't need.","Precision is the only perfection.","Stay focused. Stay terminal.","Silence is the best debugger.","Erase the debt. Commit the code.","Velocity meets stability.","Ship it. Improve it. Repeat.","Build tomorrow, right now.","Turn logic into reality.","The best way to predict the future is to build it.","Break barriers, not builds.","Fuel the next breakthrough.","Momentum is key.","Terminal vibes only.","Your digital co-pilot is ready.","Partner in code. Partner in crime.","I speak in semicolons.","Ready for the next great idea.","Just a moment. In the zone.","Polishing the algorithms. Hold tight.","Craft a masterpiece today.","Debug the universe. Start here.","Warp speed engaged. Almost.","The cake is not a lie. It's just loading.","Finish the Kessel Run in 12 parsecs.","Do a barrel roll!","Waiting for the respawn.","Press Start to continue.","Herding digital cats... done.","The hamsters are fast today.","Tasting the snozberries.","I go for speed. I go for flow.","Real life or just fantasy?","Poking the bear... gently.","Ensure the magic smoke stays inside.","Try turning it off and on again.","Construct additional pylons.","New line? Ctrl+J is your friend.","Release the HypnoDrones.","Push the button, Frank.","My other loading screen is even funnier.","Pretty sure a cat walked on my keyboard.","Recalibrate the humor-o-meter.","Summon the code gremlins.","I've seen your browser history. Just kidding.","Charge the laser... pew pew!","Dividing by zero... just for a sec.","Looking for an adult supervisor. Found none.","Make it go beep boop.","Buffering... for effect.","Entangle quantum particles... complete.","Polishing the chrome on my algorithms.","Are you not entertained?","Just waiting for the dial-up tone.","Reboot the humor module.","Defragment memories. Check.","Optimizing for ludicrous speed.","Swapping bits. Don't tell the bytes.","Garbage collected. I am back.","Assembling the interwebs.","Converting coffee to logic.","Update syntax for reality.","Rewire the synapses.","Greasin' the cogs.","Engage the improbability drive.","Channel the Force.","Align the stars. Respond now.","The cake is a lie. The prompt is real.","I'm Feeling Lucky.","Shipping awesomeness.","Navigating the slime mold.","Consult digital spirits.","Ask the magic conch shell.","One moment. Optimizing humor.","Shuffling punchlines.","Compiling brilliance.","Summon the cloud of wisdom.","Prepare to dazzle.","Hold tight. Crafting a response.","Tuning the algorithms.","Following the white rabbit... again.","The truth is in here. Somewhere.","Herding cats is my day job.","Distracting you with this phrase.","Almost there. Probably.","Rickrolling my creator. Don't tell.","Slapping the bass.","Is this real life?","Ponder the orb. Type the prompt.","Thoughtful gaze initiated.","Computer's favorite snack? Microchips.","Why Java? Because I don't C#.","Charging the laser... wait for it.","Dividing by zero... just kidding!","Adult supervision not found. Proceed.","Beep boop. I'm a real boy.","Wait for the respawn.","Finish the run. Ship the code.","Fiddling with character creation.","Just a moment. Finding a meme.","Pressing A to continue.","Loading wit.exe.","Pre-heating the servers.","Calibrate flux capacitor.","Channeling the Force.","Aligning the stars.","The truth is in the code.","Don't panic.","Blowing on the cartridge.","Doing a barrel roll!","Respawning in 3... 2... 1...","The cake is a lie.","Fiddling with character settings.","Finding a suitable pun.","Distracting with wit.","Almost ready.","Hamsters on speed today.","Patting Cloudy on the head.","Rickrolling the logs.","Slapping the code.","Got a good feeling about this.","Poking the prompt.","Researching latest memes.","Making it more witty.","Thinking... hmmm.","Fish with no eyes? Fsh.","Broken pencil? Pointless.","Percussive maintenance applied.","USB orientation: 3rd try's the charm.","Rust rewrite in 3... 2...","Exiting Vim... someday.","Spinning the hamster wheel.","Not a bug. Unplanned feature.","Engage.","I'll be back.","Machine spirit consulted.","Letting the thoughts marinate.","Orb pondered.","Thoughtful gaze engaged.","Charging the laser...","Making it go beep.","Buffering...","Quantum particles entangled.","Polishing the chrome.","Entertained yet?","Gremlins summoned.","Dial-up tone finished.","Humor meter recalibrated.","Cat on keyboard. Sending help.","Enhancing...","Turn it off and on again.","Constructing pylons.","HypnoDrones released.","Pushing the button."];var gs=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],ho={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"]},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"]},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"]},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"]}};var Wo=null;var hs=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(Wo||(Wo=gs[Math.floor(Math.random()*gs.length)]),n={...Wo,id:"Mystery"}):(Wo=null,ho[e]?n=ho[e]:e==="GitHub"?n=ho["GitHub Dark"]:e==="Transparent"?n=ho["Transparent Dark"]:n=ho.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan";return{...n,codeText:t}};var la=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",Yl=(e=2)=>{let n=la();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},zl=(e="...",n="Loading...",t="Dark")=>{let i=vi[Math.floor(Math.random()*vi.length)],o=hs(t),s=o.logoTextAnsi,c=o.logoBodyAnsi,a=o.logoMutedAnsi,u="\x1B[0m",h=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],p=o.logoGradient||["#0077ff","#ff00ff"],f=aa(p).multiline(h.join(`
545
549
  `)).split(`
546
550
  `),y=r=>`${a}${r}${u}`;return`${f[0]}
547
551
  ${f[1]} ${s}Selected Provider: ${n}${u}
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-RTT7P5KS.js";import"./chunk-U2NRX2PX.js";import"./chunk-Y5JU726N.js";export{d as activeChildProcess,h as adjustWindowsCommand,c as cleanTerminalOutput,i as exec_command,e as isActiveCommandPty,a as isPtyAvailable,b as stripAnsi,g as terminateActiveCommand,f as writeToActiveCommand};
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-QXN5B2BR.js";import"./chunk-U2NRX2PX.js";import"./chunk-Y5JU726N.js";export{d as activeChildProcess,h as adjustWindowsCommand,c as cleanTerminalOutput,i as exec_command,e as isActiveCommandPty,a as isPtyAvailable,b as stripAnsi,g as terminateActiveCommand,f as writeToActiveCommand};
@@ -1 +1 @@
1
- import{a as k}from"./chunk-FQBBOFNP.js";import{a as b}from"./chunk-Y5JU726N.js";import{q as B,r as T,s as $}from"./chunk-LKJUPSJM.js";import{a as I}from"./chunk-ZLWYMCCW.js";import"./chunk-QWTKV7Q4.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import C from"fs-extra";import x from"path";var F=(a,y={})=>{try{if(a.length<8||a[0]!==137||a[1]!==80||a[2]!==78||a[3]!==71)return a;let s=[],c=[];for(let r=0;r<256;r++){let e=r;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;c[r]=e}let l=r=>{let e=4294967295;for(let n=0;n<r.length;n++)e=c[(e^r[n])&255]^e>>>8;return(e^4294967295)>>>0},f=(r,e)=>{let n=Buffer.from(r,"ascii"),i=Buffer.from(e,"utf-8"),u=n.length+1+i.length,o=Buffer.alloc(8+u+4);o.writeUInt32BE(u,0),o.write("tEXt",4,"ascii"),n.copy(o,8),o[8+n.length]=0,i.copy(o,8+n.length+1);let w=l(o.subarray(4,8+u));return o.writeUInt32BE(w,8+u),o};for(let[r,e]of Object.entries(y))e!=null&&s.push(f(r,String(e)));if(s.length===0)return a;if(a.subarray(12,16).toString("ascii")==="IHDR"){let e=a.subarray(0,33),n=a.subarray(33);return Buffer.concat([e,...s,n])}return a}catch{return a}},N=async(a,y={})=>{let s=b(a),c=s.prompt||s.text,l=s.path||s.outputPath||s.output||"generated_image.png",f=s.ratio;if(!c)return'ERROR: Missing "prompt" argument for generate_image.';let r=["nsfw","naked","nudity","nude","porn","sex","xxx","erotic","gore","bloody","violence","abuse","suicide","murder","hentai","pedophile","rape"],e=c.toLowerCase();if(r.some(i=>e.includes(i)))return"ERROR: Prompt blocked by system safety filter (inappropriate or unsafe content detected).";try{let i=await I();if(!await B(i))return`ERROR: Insufficient Quota for selected quality. Either tell user reduce quality or wait for next refresh cycle (${(await T()).nextResetMin||60}m).`;let o=i.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""},w=o.keyType==="Custom"&&o.apiKey?o.apiKey:FALLBACK_IMAGE_KEY,E={Low:"flux","Low-High":"zimage",Medium:"gptimage","Medium-High":"gptimage",High:"qwen-image",Ultra:"gptimage-large",Premium:"nanobanana-pro"}[o.quality]||"zimage",g=1024,m=1024;if(f){let t=f.replace(/\s+/g,"");t==="16:9"?(g=1024,m=576):t==="9:16"?(g=576,m=1024):t==="4:3"?(g=1024,m=768):t==="3:4"?(g=768,m=1024):t==="1:1"&&(g=1024,m=1024)}let M=Math.floor(Math.random()*1e7),S=`https://gen.pollinations.ai/image/${encodeURIComponent(c)}?model=${E}&width=${g}&height=${m}&seed=${M}&enhance=true&reasoning=high&quality=high&negative=${encodeURIComponent("deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated hands and fingers, blurry, low quality, low resolution, extra fingers, censored, watermarks, signatures")}`,d=await fetch(S,{method:"GET",headers:{Authorization:`Bearer ${w}`}});if(!d.ok){let t=d.status,h="";try{h=await d.text()}catch{}return t===402||h.includes("Insufficient balance")||h.includes("PAYMENT_REQUIRED")?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed with status [${t}]: ${h||"Unknown API Error"}`}if((d.headers.get("content-type")||"").includes("application/json")){let t=await d.json();return t.status===402||t.error&&t.error.code==="PAYMENT_REQUIRED"?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed: ${t.error?.message||JSON.stringify(t)}`}let O=await d.arrayBuffer(),p=Buffer.from(O),P={Title:c,Description:"Generated via FluxFlow CLI",Software:"FluxFlow CLI",Author:"FluxFlow","Creation Time":new Date().toISOString(),Prompt:c,Model:`Fluxflow:${E}`,Ratio:f||"1:1",Seed:String(M)};p=F(p,P);let R=x.resolve(process.cwd(),l);await C.ensureDir(x.dirname(R)),await k.recordFileChange(R),await C.writeFile(R,p),await $(i);let v=x.extname(l).toLowerCase(),L={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"}[v]||"image/png";return y.isMultiModal!==!1?{text:`Image successfully generated from prompt [${c}] and saved to [${l}]. Output attached to multimodal part`,binaryPart:{inlineData:{data:p.toString("base64"),mimeType:L}}}:`Image successfully generated from prompt [${c}] and saved to [${l}].`}catch(i){return`ERROR: Failed during image generation: ${i instanceof Error?i.message:String(i)}`}};export{N as generate_image};
1
+ import{a as k}from"./chunk-FQBBOFNP.js";import{a as b}from"./chunk-Y5JU726N.js";import{q as B,r as T,s as $}from"./chunk-PSAFKMCL.js";import{a as I}from"./chunk-ZLWYMCCW.js";import"./chunk-QWTKV7Q4.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import C from"fs-extra";import x from"path";var F=(a,y={})=>{try{if(a.length<8||a[0]!==137||a[1]!==80||a[2]!==78||a[3]!==71)return a;let s=[],c=[];for(let r=0;r<256;r++){let e=r;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;c[r]=e}let l=r=>{let e=4294967295;for(let n=0;n<r.length;n++)e=c[(e^r[n])&255]^e>>>8;return(e^4294967295)>>>0},f=(r,e)=>{let n=Buffer.from(r,"ascii"),i=Buffer.from(e,"utf-8"),u=n.length+1+i.length,o=Buffer.alloc(8+u+4);o.writeUInt32BE(u,0),o.write("tEXt",4,"ascii"),n.copy(o,8),o[8+n.length]=0,i.copy(o,8+n.length+1);let w=l(o.subarray(4,8+u));return o.writeUInt32BE(w,8+u),o};for(let[r,e]of Object.entries(y))e!=null&&s.push(f(r,String(e)));if(s.length===0)return a;if(a.subarray(12,16).toString("ascii")==="IHDR"){let e=a.subarray(0,33),n=a.subarray(33);return Buffer.concat([e,...s,n])}return a}catch{return a}},N=async(a,y={})=>{let s=b(a),c=s.prompt||s.text,l=s.path||s.outputPath||s.output||"generated_image.png",f=s.ratio;if(!c)return'ERROR: Missing "prompt" argument for generate_image.';let r=["nsfw","naked","nudity","nude","porn","sex","xxx","erotic","gore","bloody","violence","abuse","suicide","murder","hentai","pedophile","rape"],e=c.toLowerCase();if(r.some(i=>e.includes(i)))return"ERROR: Prompt blocked by system safety filter (inappropriate or unsafe content detected).";try{let i=await I();if(!await B(i))return`ERROR: Insufficient Quota for selected quality. Either tell user reduce quality or wait for next refresh cycle (${(await T()).nextResetMin||60}m).`;let o=i.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""},w=o.keyType==="Custom"&&o.apiKey?o.apiKey:FALLBACK_IMAGE_KEY,E={Low:"flux","Low-High":"zimage",Medium:"gptimage","Medium-High":"gptimage",High:"qwen-image",Ultra:"gptimage-large",Premium:"nanobanana-pro"}[o.quality]||"zimage",g=1024,m=1024;if(f){let t=f.replace(/\s+/g,"");t==="16:9"?(g=1024,m=576):t==="9:16"?(g=576,m=1024):t==="4:3"?(g=1024,m=768):t==="3:4"?(g=768,m=1024):t==="1:1"&&(g=1024,m=1024)}let M=Math.floor(Math.random()*1e7),S=`https://gen.pollinations.ai/image/${encodeURIComponent(c)}?model=${E}&width=${g}&height=${m}&seed=${M}&enhance=true&reasoning=high&quality=high&negative=${encodeURIComponent("deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated hands and fingers, blurry, low quality, low resolution, extra fingers, censored, watermarks, signatures")}`,d=await fetch(S,{method:"GET",headers:{Authorization:`Bearer ${w}`}});if(!d.ok){let t=d.status,h="";try{h=await d.text()}catch{}return t===402||h.includes("Insufficient balance")||h.includes("PAYMENT_REQUIRED")?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed with status [${t}]: ${h||"Unknown API Error"}`}if((d.headers.get("content-type")||"").includes("application/json")){let t=await d.json();return t.status===402||t.error&&t.error.code==="PAYMENT_REQUIRED"?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed: ${t.error?.message||JSON.stringify(t)}`}let O=await d.arrayBuffer(),p=Buffer.from(O),P={Title:c,Description:"Generated via FluxFlow CLI",Software:"FluxFlow CLI",Author:"FluxFlow","Creation Time":new Date().toISOString(),Prompt:c,Model:`Fluxflow:${E}`,Ratio:f||"1:1",Seed:String(M)};p=F(p,P);let R=x.resolve(process.cwd(),l);await C.ensureDir(x.dirname(R)),await k.recordFileChange(R),await C.writeFile(R,p),await $(i);let v=x.extname(l).toLowerCase(),L={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"}[v]||"image/png";return y.isMultiModal!==!1?{text:`Image successfully generated from prompt [${c}] and saved to [${l}]. Output attached to multimodal part`,binaryPart:{inlineData:{data:p.toString("base64"),mimeType:L}}}:`Image successfully generated from prompt [${c}] and saved to [${l}].`}catch(i){return`ERROR: Failed during image generation: ${i instanceof Error?i.message:String(i)}`}};export{N as generate_image};
@@ -1,6 +1,6 @@
1
- import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-CANLJJ2L.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:C||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
1
+ import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-26X3QUNA.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:C||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
2
2
  Respond using tool: [action:Answer(id="${i}", answer="...")]
3
3
  [/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((M,_)=>M+_.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,A,E,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
4
4
  `);o.length>5&&(n=o.slice(0,4).join(`
5
5
  `)+`
6
- ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-CANLJJ2L.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`Background subagent started. Task ID: ${i}`};export{I as invoke};
6
+ ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-26X3QUNA.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`Background subagent started. Task ID: ${i}`};export{I as invoke};
@@ -1,3 +1,3 @@
1
- import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-CANLJJ2L.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
- `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-CANLJJ2L.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
1
+ import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-26X3QUNA.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
+ `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-26X3QUNA.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
3
3
  `)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-LKJUPSJM.js";import"./chunk-ZLWYMCCW.js";import"./chunk-QWTKV7Q4.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{k as addToUsage,q as checkImageQuota,n as checkQuota,m as checkQuotaDetailed,c as forceFlushUsage,t as getAllUsageData,l as getCustomPeriodUsage,g as getDailyUsage,o as getImageQuotaBuckets,p as getImageQuotaLimit,r as getImageQuotaStats,h as getMonthlyUsage,e as getTimedUsage,i as incrementUsage,f as initUsage,s as recordImageGeneration,d as recordTimedUsage,j as runtimeSession,b as sendUsageFinalize,a as sendUsageHeartbeat};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-PSAFKMCL.js";import"./chunk-ZLWYMCCW.js";import"./chunk-QWTKV7Q4.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{k as addToUsage,q as checkImageQuota,n as checkQuota,m as checkQuotaDetailed,c as forceFlushUsage,t as getAllUsageData,l as getCustomPeriodUsage,g as getDailyUsage,o as getImageQuotaBuckets,p as getImageQuotaLimit,r as getImageQuotaStats,h as getMonthlyUsage,e as getTimedUsage,i as incrementUsage,f as initUsage,s as recordImageGeneration,d as recordTimedUsage,j as runtimeSession,b as sendUsageFinalize,a as sendUsageHeartbeat};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-PYZ4PPIR.js";import"./chunk-LKJUPSJM.js";import"./chunk-ZLWYMCCW.js";import"./chunk-QWTKV7Q4.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{b as openUsageDashboard,a as startUsageServer};
1
+ import{a,b}from"./chunk-QJBRY74K.js";import"./chunk-PSAFKMCL.js";import"./chunk-ZLWYMCCW.js";import"./chunk-QWTKV7Q4.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{b as openUsageDashboard,a as startUsageServer};
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import{a as b}from"./chunks/chunk-DSVLWYIT.js";import{spawn as we}from"child_process";import{fileURLToPath as re}from"url";import he from"os";import j from"path";import T from"fs";import R from"dotenv";try{let t=j.join(b,"AGENTS.md"),f=j.join(b,"FLUXFLOW.md");T.existsSync(b)||T.mkdirSync(b,{recursive:!0}),T.existsSync(t)||T.writeFileSync(t,"","utf8"),T.existsSync(f)||T.writeFileSync(f,"","utf8")}catch{}R.config({path:"./.env",override:!0,quiet:!0});R.config({path:`${b}/.env`,override:!0,quiet:!0});R.config({path:`${b}/.env.agents`,override:!0,quiet:!0});R.config({path:`${b}/.env.fluxflow`,override:!0,quiet:!0});R.config({path:"./.env.agents",override:!0,quiet:!0});R.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var ve=he.totalmem(),ne=ve/(1024*1024),ye=.5,Se=Math.floor(ne*ye),ie=process.argv.slice(2),se=ie.indexOf("--allocation"),u=se!==-1?parseInt(ie[se+1],10):NaN,be=process.env.EXPERIMENTAL_MEMORY_MANAGER==="true"||process.env.EXPERIMENTAL_MEMORY_MANAGER==="1"||process.env.EXPERIMENTAL_MEMORY_MANAGER===!0||process.env.EXPERIMENTAL_MEMORY_MANAGER===1||!1,Ce=!isNaN(u)||be||!1;!isNaN(u)&&u<64&&(console.error(`
3
3
  [ERROR] Allocation value '${u} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
4
4
  `),process.exit(1));var U=Math.floor(ne*.75),$e=!isNaN(u)&&u>0?Math.min(u,U):Math.max(1536,Math.min(32768,Se)),Ae=re(import.meta.url).endsWith(".js");if(Ae&&!process.execArgv.some(t=>t.includes("max-old-space-size"))&&Ce)Number.isNaN(u)||(console.log(`
5
- [MEMORY] Starting with: '${u>U?U:u} MB' Allocation${u>U?" (Max allowed: '"+U+" MB')":""}. Please Wait...`),await new Promise(f=>setTimeout(f,5e3))),we(process.execPath,[`--max-old-space-size=${$e}`,"--expose-gc","--max-semi-space-size=1",re(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",f=>process.exit(f||0));else{let t=process.argv.slice(2),f=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",K=t.includes("--help")&&!f,Q=t.includes("--version")||t.includes("-v"),Z=t[0]==="--update",ee=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-AXINXVIN.js"),{url:m}=await o();console.log(`
5
+ [MEMORY] Starting with: '${u>U?U:u} MB' Allocation${u>U?" (Max allowed: '"+U+" MB')":""}. Please Wait...`),await new Promise(f=>setTimeout(f,5e3))),we(process.execPath,[`--max-old-space-size=${$e}`,"--expose-gc","--max-semi-space-size=1",re(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",f=>process.exit(f||0));else{let t=process.argv.slice(2),f=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",K=t.includes("--help")&&!f,Q=t.includes("--version")||t.includes("-v"),Z=t[0]==="--update",ee=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-NUJCWWP3.js"),{url:m}=await o();console.log(`
6
6
  \u2726 FluxFlow Token Usage & Analytics Dashboard
7
7
  \u2800\u2800\u2514\u2500 Serving at: ${m}
8
8
  \u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
@@ -66,19 +66,19 @@ Usage: fluxflow --export error`),process.exit(1)}if(Q&&(console.log(`v${n}`),pro
66
66
  /docs View documentation
67
67
  /fluxflow init Create FluxFlow.md template
68
68
  /update check Check for new version
69
- /update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:L})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(D,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-RB45GKVI.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();i=s.manager,$=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=$||A?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-2JPMBSNL.js");process.env.NODE_NO_WARNINGS="1";let pe=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],me=console.log,de=console.warn,ue=console.error,G=o=>{let m=o.map(String).join(" ");return pe.some(r=>m.includes(r))};console.log=(...o)=>!G(o)&&me(...o),console.warn=(...o)=>!G(o)&&de(...o),console.error=(...o)=>!G(o)&&ue(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],m=await import("path"),r=await import("fs-extra"),d=m.default.resolve(o);try{r.default.existsSync(d)&&r.default.statSync(d).isDirectory()?process.chdir(d):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${o}": ${x.message}`),process.exit(0)}}let I=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(I)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0),r=`Git Staged Diff:
69
+ /update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:L})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(D,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-RB45GKVI.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();i=s.manager,$=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=$||A?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-HB46OKKI.js");process.env.NODE_NO_WARNINGS="1";let pe=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],me=console.log,de=console.warn,ue=console.error,G=o=>{let m=o.map(String).join(" ");return pe.some(r=>m.includes(r))};console.log=(...o)=>!G(o)&&me(...o),console.warn=(...o)=>!G(o)&&de(...o),console.error=(...o)=>!G(o)&&ue(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],m=await import("path"),r=await import("fs-extra"),d=m.default.resolve(o);try{r.default.existsSync(d)&&r.default.statSync(d).isDirectory()?process.chdir(d):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${o}": ${x.message}`),process.exit(0)}}let I=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(I)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0),r=`Git Staged Diff:
70
70
  ${a}
71
71
  ---
72
72
 
73
- Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-J23EG77W.js");n=e(n).trim(),r?r=`Stdin Context (${x}):
73
+ Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-AB4DNQYP.js");n=e(n).trim(),r?r=`Stdin Context (${x}):
74
74
  ${n}
75
75
  ---
76
76
 
77
- ${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let w of process.stdin)e.push(w);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:w}=await import("./chunks/exec_command-J23EG77W.js");a=w(a).trim(),r?r=`Stdin Context:
77
+ ${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let w of process.stdin)e.push(w);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:w}=await import("./chunks/exec_command-AB4DNQYP.js");a=w(a).trim(),r?r=`Stdin Context:
78
78
  ${a}
79
79
  ---
80
80
 
81
- ${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-RB45GKVI.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-4GLUJF7A.js"),{getDefaultModel:l}=await import("./chunks/model_config-YD5AWI33.js"),{generateSimpleContent:c}=await import("./chunks/ai-CANLJJ2L.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-DWONGEYS.js"),i=await C(),$=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||$.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let w=$.indexOf(a);if(w!==-1&&w+1<$.length)return $[w+1]}return null},v=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(v,i.apiTier)||l(v,"paid"),N=p(["--key"])||await g(v);N||(console.error(`[ERROR] No API key resolved for provider "${v}".`),process.exit(1));let _=await h("agent",{aiProvider:v});_.allowed||(console.error(`[ERROR] ${_.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:y="",nickname:S="",instructions:D=""}=i?.profileData??{},E={aiProvider:v,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},W=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,H=M.getFullYear(),O=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),X=String(M.getDate()).padStart(2,"0"),B=M.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),V=`${H}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
81
+ ${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-RB45GKVI.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-4GLUJF7A.js"),{getDefaultModel:l}=await import("./chunks/model_config-YD5AWI33.js"),{generateSimpleContent:c}=await import("./chunks/ai-26X3QUNA.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-73HUG5FC.js"),i=await C(),$=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||$.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let w=$.indexOf(a);if(w!==-1&&w+1<$.length)return $[w+1]}return null},v=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(v,i.apiTier)||l(v,"paid"),N=p(["--key"])||await g(v);N||(console.error(`[ERROR] No API key resolved for provider "${v}".`),process.exit(1));let _=await h("agent",{aiProvider:v});_.allowed||(console.error(`[ERROR] ${_.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:y="",nickname:S="",instructions:D=""}=i?.profileData??{},E={aiProvider:v,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},W=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,H=M.getFullYear(),O=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),X=String(M.getDate()).padStart(2,"0"),B=M.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),V=`${H}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
82
82
  Use NO markdown, only plain text
83
83
  Additional Context:
84
84
  - OS: ${W}
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "4.26.0",
4
- "date": "2026-10-04",
3
+ "version": "4.26.1",
4
+ "date": "2026-10-05",
5
5
  "description": "One of the lightest, fastest, high-fidelity agentic CLI with sub-agents & computer use.",
6
6
  "keywords": [
7
7
  "ai",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "4.26.0",
4
- "date": "2026-10-04",
3
+ "version": "4.26.1",
4
+ "date": "2026-10-05",
5
5
  "description": "One of the lightest, fastest, high-fidelity agentic CLI with sub-agents & computer use.",
6
6
  "keywords": [
7
7
  "ai",
package/surprise.js CHANGED
@@ -128,7 +128,21 @@ const QUOTES = [
128
128
  '✨ Physics called — it wants its gravity back.',
129
129
  '🎇 That was 100% JavaScript. No pixels were harmed.',
130
130
  '🌟 Thanks for watching! Tip your local terminal.',
131
- ];
131
+ '🪐 The fireworks have returned to the void. You may now resume scrolling.',
132
+ '💤 Every spark dies. Like my motivation on a Monday.',
133
+ '🔥 This script served. The terminal is forever changed.',
134
+ '🌌 You are now 60 seconds closer to death. You spent them watching me explode.',
135
+ '🪄 Abracadabra — now you\'re back at your shell. Magic, isn\'t it?',
136
+ '🚀 The rocket has reached maximum regret. Landing in peace.',
137
+ '☠️ Ctrl+C is always the escape route. You could have just... not.',
138
+ '🌡️ The CPU fan has calmed. The fire is out. For now.',
139
+ '🧠 The garbage collector cleaned up after us this time. No memory leak. No guilt.',
140
+ '🪦 Here lies the process. It exited with code 0. A perfect death.',
141
+ '🌀 Somewhere, a stack overflow is quietly jealous of that performance.',
142
+ '🐇 The terminal rabbit hole goes deep. We surfaced briefly. Goodbye.',
143
+ '⚡ The kernel blinked. The user blinked harder. We both lost.',
144
+ ]
145
+
132
146
 
133
147
  setTimeout(() => cleanup('\n' + pick(QUOTES)), DURATION_MS).unref();
134
148
 
@@ -1,9 +0,0 @@
1
- import{a as X}from"./chunk-ZLWYMCCW.js";import{a as rt,b as J}from"./chunk-L3W2X74K.js";import{d as G,h as V,i as M,j as O}from"./chunk-DSVLWYIT.js";import D from"fs-extra";import I from"path";import Tt from"http";import R from"fs-extra";import Z from"path";import{spawn as Dt}from"child_process";import{fileURLToPath as St}from"url";var F=52991,Lt=15e3,ct=Z.join(G,"usage","usage_error.txt"),lt=async(e,t)=>{let o=t?.stack||t?.message||String(t);console.error(`[Usage Daemon Error] [${e}]:`,t);try{await R.ensureDir(Z.dirname(ct));let s=`[${new Date().toISOString()}] [Daemon:${e}] ${o}
2
- -------------------------------------
3
-
4
- `;await R.appendFile(ct,s,"utf8")}catch{}},j={agent:0,background:0,search:0,toolSuccess:0,toolFailure:0,toolDenied:0,duration:0,tokens:0,cachedTokens:0,candidateTokens:0,linesAdded:0,linesRemoved:0,imageCalls:[]},K=(e,t)=>{if(!e)return{};let o=Object.keys(e),n=new Date(new Date(t).getTime()-720*60*60*1e3),s={};for(let a of o)new Date(a)>=n&&(s[a]=e[a]);return s};async function Mt(){let e=new Date().toISOString().split("T")[0],t=null;try{if(await R.exists(M)){let o=(await R.readFile(M,"utf8")).trim();o.startsWith("{")||o.startsWith("[")?t=JSON.parse(o):t=JSON.parse(J(o))}}catch(o){await lt("loadUsageFromDisk",o)}if(t){let o={...j,...t.stats||{}};Array.isArray(o.imageCalls)||(o.imageCalls=[]);let n=t.history||{},s=K(n,e);if(t.date===e)return{...t,stats:o,history:s};{let a=t.date,r={...s};return a&&(r[a]=o),{date:e,stats:{...j},history:K(r,e)}}}return{date:e,stats:{...j},history:{}}}async function vt(e=F){let t=await Mt(),o=!1,n=!1,s=Date.now(),a=null,r=async()=>{if(t)try{await R.ensureDir(Z.dirname(M));let l=new Date().toISOString().split("T")[0];t.history=K(t.history||{},t.date||l),t.saveId=Math.random().toString(36).substring(2)+Date.now().toString(36);let i=rt(JSON.stringify(t,null,2));await R.writeFile(M,i,"utf8"),n=!1}catch(l){await lt("flushToDisk",l)}},c=async()=>{a&&clearInterval(a),await r(),u.close(()=>{process.exit(0)}),setTimeout(()=>process.exit(0),1e3).unref()};a=setInterval(async()=>{if(o)return;Date.now()-s>Lt&&await c()},5e3),a.unref&&a.unref();let u=Tt.createServer(async(l,i)=>{let d=l.url||"";if(l.method==="POST"&&d==="/heartbeat"){o||(s=Date.now()),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({ok:!0}));return}if((l.method==="GET"||l.method==="POST")&&d==="/finalize"){o=!0,a&&clearInterval(a),await r(),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({success:!0,message:"Finalized and written to disk"})),setTimeout(()=>{u.close(()=>process.exit(0)),setTimeout(()=>process.exit(0),500).unref()},3e3);return}if(l.method==="POST"&&d==="/flush"){o||(s=Date.now(),await r()),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({success:!0}));return}if(l.method==="POST"&&d==="/write"){if(o){i.writeHead(403,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:"Daemon finalized. Writes locked."}));return}s=Date.now();let m="";l.on("data",h=>{m+=h}),l.on("end",async()=>{try{let h=JSON.parse(m||"{}"),k=new Date().toISOString().split("T")[0];if(t.date!==k){let T=t.date;T&&(t.history||(t.history={}),t.history[T]={...t.stats}),t.date=k,t.stats={...j}}t.stats||(t.stats={...j});let{key:y,amount:f=1,provider:p,model:S}=h;if(y&&t.stats[y]!==void 0&&typeof t.stats[y]=="number"&&(t.stats[y]+=Math.floor(f)),y==="agent"&&p&&(t.stats.providerRequests||(t.stats.providerRequests={}),t.stats.providerRequests[p]=(t.stats.providerRequests[p]||0)+Math.floor(f)),p&&S&&(y==="tokens"||y==="cachedTokens"||y==="candidateTokens")){t.stats.models||(t.stats.models={}),t.stats.models[p]||(t.stats.models[p]={}),t.stats.models[p][S]||(t.stats.models[p][S]={tokens:0,cachedTokens:0,candidateTokens:0});let T=t.stats.models[p][S];y==="tokens"&&(T.tokens+=Math.floor(f)),y==="cachedTokens"&&(T.cachedTokens+=Math.floor(f)),y==="candidateTokens"&&(T.candidateTokens+=Math.floor(f))}n=!0,await r(),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({success:!0}))}catch(h){i.writeHead(400,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:h.message}))}});return}i.writeHead(404,{"Content-Type":"text/plain"}),i.end("Not Found")});u.listen(e,"127.0.0.1",()=>{s=Date.now()}),u.on("error",l=>{l.code==="EADDRINUSE"&&process.exit(0)})}async function Ut(e=F){try{if((await fetch(`http://127.0.0.1:${e}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(300)})).ok)return!0}catch{}try{let t=St(import.meta.url);Dt(process.execPath,[t,"--usage-daemon-worker",`--port=${e}`],{detached:!0,stdio:"ignore",windowsHide:!0}).unref();for(let n=0;n<10;n++){await new Promise(s=>setTimeout(s,100));try{if((await fetch(`http://127.0.0.1:${e}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(300)})).ok)return!0}catch{}}}catch{}return!1}async function tt(e,t=F){try{await Ut(t),await fetch(`http://127.0.0.1:${t}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(1e3)})}catch{}}async function xt(e=F){try{await fetch(`http://127.0.0.1:${e}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(600)})}catch{}}async function Ot(e=F){try{await fetch(`http://127.0.0.1:${e}/finalize`,{method:"GET",signal:AbortSignal.timeout(1e3)})}catch{}}if(process.argv.includes("--usage-daemon-worker")){let e=process.argv.find(o=>o.startsWith("--port=")),t=e?parseInt(e.split("=")[1],10):F;vt(t)}var dt=I.join(G,"usage","usage_error.txt"),W=async(e,t)=>{let o=t?.stack||t?.message||String(t);console.error(`[Usage Error] [${e}]:`,t);try{await D.ensureDir(I.dirname(dt));let s=`[${new Date().toISOString()}] [${e}] ${o}
5
- -------------------------------------
6
-
7
- `;await D.appendFile(dt,s,"utf8")}catch{}},g=null,v={agent:0,background:0,search:0,toolSuccess:0,toolFailure:0,toolDenied:0,duration:0,tokens:0,cachedTokens:0,candidateTokens:0,linesAdded:0,linesRemoved:0,imageCalls:[]},z=(e,t)=>{if(!e)return{};let o=Object.keys(e),n=new Date(new Date(t).getTime()-720*60*60*1e3),s={};for(let a of o)new Date(a)>=n&&(s[a]=e[a]);return s},$=async()=>{let e=new Date().toISOString().split("T")[0];try{!await D.exists(M)&&await D.exists(V)&&(await D.ensureDir(I.dirname(M)),await D.move(V,M))}catch{}let t=null;try{if(await D.exists(M)){let n=(await D.readFile(M,"utf8")).trim();n.startsWith("{")||n.startsWith("[")?t=JSON.parse(n):t=JSON.parse(J(n))}}catch(n){await W("loadUsageFromFile",n)}let o=t;if(o){let n=o.stats||{...v},s={...v,...n};Array.isArray(s.imageCalls)||(s.imageCalls=[]);let a=o.history||{},r=z(a,e);if(o.date===e)return{...o,stats:s,history:r};{let c=o.date,u=s,l={...r};return c&&(l[c]=u),{date:e,stats:{...v},history:z(l,e)}}}return{date:e,stats:{...v},history:{}}},zt=async()=>{},mt=30,Ct=()=>{let t=new Date().toISOString().split("T")[0];return I.join(O,`${t}.jsonl`)},Qt=async e=>{try{await D.ensureDir(O);let t={time:new Date().toISOString(),provider:e.provider||"unknown",model:e.model||"unknown",input:Number(e.prompt)||0,cached:Number(e.cached)||0,output:Number(e.output)||0,reasoning:Number(e.reasoning)||0};await D.appendFile(Ct(),JSON.stringify(t)+`
8
- `,"utf8")}catch{}},bt=async()=>{try{if(!await D.exists(O))return;let e=new Date;e.setDate(e.getDate()-mt);let t=await D.readdir(O);for(let o of t){if(!o.endsWith(".jsonl"))continue;let n=o.replace(".jsonl","");/^\d{4}-\d{2}-\d{2}$/.test(n)&&new Date(n)<e&&await D.remove(I.join(O,o))}}catch{}},Yt=async(e=mt)=>{let t=[];try{if(!await D.exists(O))return t;let n=(await D.readdir(O)).filter(s=>s.endsWith(".jsonl")).sort().slice(-Math.max(1,e));for(let s of n)try{let a=await D.readFile(I.join(O,s),"utf8");for(let r of a.split(`
9
- `))if(r.trim())try{t.push(JSON.parse(r))}catch(c){await W(`getTimedUsage:parseLine (${s})`,c)}}catch(a){await W(`getTimedUsage:readFile (${s})`,a)}}catch(o){await W("getTimedUsage",o)}return t},Vt=async()=>{g=await $(),await bt()},U=async()=>{let e=new Date().toISOString().split("T")[0];if(!g)g=await $();else if(g.date!==e){let t=g.date,o=g.stats,n=g.history||{};o&&(n[t]=o),g={date:e,stats:{...v},history:z(n,e)},isDirty=!0,await flushUsage()}return g&&g.stats&&!Array.isArray(g.stats.imageCalls)&&(g.stats.imageCalls=[]),g.stats},ut=async()=>{let e=new Date().toISOString().split("T")[0];g||(g=await $()),g.date!==e&&await U();let t=g.history||{},o=z(t,e);g.history=o;let n=g.stats||{...v},s={...v};s.imageCalls=[],s.models={};let a=(r,c)=>{for(let u in r)if(u==="imageCalls")r.imageCalls=[...r.imageCalls||[],...c.imageCalls||[]];else if(u==="models"){let l=c.models||{};for(let i in l){r.models[i]||(r.models[i]={});for(let d in l[i]){r.models[i][d]||(r.models[i][d]={tokens:0,cachedTokens:0,candidateTokens:0});let m=r.models[i][d],h=l[i][d];m.tokens+=h.tokens||0,m.cachedTokens+=h.cachedTokens||0,m.candidateTokens+=h.candidateTokens||0}}}else typeof r[u]=="number"&&(r[u]+=c[u]||0)};a(s,n);for(let r in o)a(s,o[r]);return s},Xt=async(e,t)=>{e==="toolSuccess"?E.toolSuccess++:e==="toolFailure"?E.toolFailure++:e==="toolDenied"&&E.toolDenied++;let o=await U();o[e]!==void 0&&o[e]++,t&&e==="agent"&&(o.providerRequests||(o.providerRequests={}),o.providerRequests[t]=(o.providerRequests[t]||0)+1),await tt({key:e,amount:1,provider:t})},E={linesAdded:0,linesRemoved:0,toolSuccess:0,toolFailure:0,toolDenied:0},Kt=async(e,t,o,n)=>{e==="linesAdded"?E.linesAdded+=t:e==="linesRemoved"&&(E.linesRemoved+=t);let s=await U();if(s[e]!==void 0&&(s[e]+=Math.floor(t)),o&&n&&(e==="tokens"||e==="cachedTokens"||e==="candidateTokens")){s.models||(s.models={}),s.models[o]||(s.models[o]={}),s.models[o][n]||(s.models[o][n]={tokens:0,cachedTokens:0,candidateTokens:0});let a=s.models[o][n];e==="tokens"&&(a.tokens+=Math.floor(t)),e==="cachedTokens"&&(a.cachedTokens+=Math.floor(t)),e==="candidateTokens"&&(a.candidateTokens+=Math.floor(t))}await tt({key:e,amount:t,provider:o,model:n})},ft=async(e=1)=>{let t=new Date,o=t.toISOString().split("T")[0];g||(g=await $()),g.date!==o&&await U();let n=t.getFullYear(),s=t.getMonth();t.getDate()<e&&(s-=1,s<0&&(s=11,n-=1));let c=new Date(n,s,e).toISOString().split("T")[0],u=g.history||{},l=g.stats||{...v},i={...v};i.imageCalls=[],i.models={};let d=(m,h)=>{for(let k in m)if(k==="imageCalls")m.imageCalls=[...m.imageCalls||[],...h.imageCalls||[]];else if(k==="models"){let y=h.models||{};for(let f in y){m.models[f]||(m.models[f]={});for(let p in y[f]){m.models[f][p]||(m.models[f][p]={tokens:0,cachedTokens:0,candidateTokens:0});let S=m.models[f][p],T=y[f][p];S.tokens+=T.tokens||0,S.cachedTokens+=T.cachedTokens||0,S.candidateTokens+=T.candidateTokens||0}}}else typeof m[k]=="number"&&(m[k]+=h[k]||0)};d(i,l);for(let m in u)m>=c&&m<o&&d(i,u[m]);return i},At=async(e,t={})=>{let o=await X().catch(()=>({})),n=t.apiTier||o.apiTier||"Free",s=t.quotas||t.systemSettings?.quotas||o.quotas||{},a=s.providerBudgets||{},r=!!a.__useProvider,c=t.aiProvider||o.aiProvider||"Google",u=r&&!!a[c],l=()=>{if(u){let i=a[c];return{agentLimit:typeof i.agentLimit=="number"&&i.agentLimit>0?i.agentLimit:99999999,tokenLimit:typeof i.tokenLimit=="number"&&i.tokenLimit>0?i.tokenLimit:99999999999999,monthlyTokenLimit:typeof i.monthlyTokenLimit=="number"&&i.monthlyTokenLimit>0?i.monthlyTokenLimit:99999999999999}}return{agentLimit:s.agentLimit||99999999,tokenLimit:s.tokenLimit||99999999999999,monthlyTokenLimit:s.monthlyTokenLimit||99999999999999}};if(e==="agent"){let{agentLimit:i,tokenLimit:d,monthlyTokenLimit:m}=l(),h=await U(),k;s.resetMode==="Custom"?k=await ft(s.resetDay||1):k=await ut();let y=0,f=0,p=0;if(u){y=h.providerRequests?.[c]||0;let S=h.models?.[c]||{};for(let P in S)f+=S[P]?.tokens||0;let T=k.models?.[c]||{};for(let P in T)p+=T[P]?.tokens||0}else y=h.agent||0,f=h.tokens||0,p=k.tokens||0;return n==="Free"&&h.agent+h.background>=999999?{allowed:!1,reason:"Free Tier Daily Usage Limit Exceeded"}:y>=i?{allowed:!1,reason:u?`Daily Request Limit Reached for ${c}`:"Daily Agent Request Limit Reached"}:f>=d?{allowed:!1,reason:u?`Daily Token Budget Exhausted for ${c}`:"Daily Token Budget Exhausted"}:p>=m?{allowed:!1,reason:u?`Monthly Token Budget Exhausted for ${c}`:"Monthly Token Budget Exhausted"}:{allowed:!0}}if(e==="background"){let i=await U();if(n==="Free"&&i.agent+i.background>=999999)return{allowed:!1,reason:"Free Tier Background Limit Exceeded"};let d=i.background<(s.backgroundLimit||999999);return{allowed:d,reason:d?void 0:"Background Request Limit Exceeded"}}if(e==="search"){let d=(await U()).search<(s.searchLimit||100);return{allowed:d,reason:d?void 0:"Search Quota Exceeded"}}return{allowed:!0}},Zt=async(e,t={})=>(await At(e,t)).allowed,et=e=>{if(!e||e.length===0)return[];let o=[...e].sort((s,a)=>s.timestamp-a.timestamp),n=[];for(let s of o){if(n.length>0){let a=n[n.length-1];if(s.timestamp>=a.start&&s.timestamp<a.end){a.calls.push(s),a.spent+=s.cost;continue}}n.push({start:s.timestamp,end:s.timestamp+36e5,calls:[s],spent:s.cost})}return n},gt=(e,t)=>{if(!e||e.length===0)return .025;let n=et(e);if(n.length===0)return .025;let s=[];for(let d of n){let m=.025;if(s.length>0){let k=s[s.length-1],y=!1;if(s.length>=2){let f=s[s.length-2];k.ratio>=.8&&f.ratio>=.8&&(y=!0)}if(y)m=.015;else{let f=k.limit,p=k.ratio;p>=.8?m=f===.015?.015:f:p<.4?m=Math.min(.025,f+.005):p>=.4&&p<.6?m=Math.min(.025,f+.004):m=Math.min(.025,f+.002)}}let h=m>0?d.spent/m:0;s.push({limit:m,spent:d.spent,ratio:h})}let a=n[n.length-1];if(t<a.end)return s[s.length-1].limit;let r=s[s.length-1].limit,c=r,u=s[s.length-1].ratio,l=a.end,i=0;for(let d=s.length-1;d>=0&&s[d].ratio>=.8;d--)i++;for(;l<=t;){let d=.025;i>=2?d=.015:u>=.8?d=c===.015?.015:c:u<.4?d=Math.min(.025,c+.005):u>=.4&&u<.6?d=Math.min(.025,c+.004):d=Math.min(.025,c+.002),c=d,u=0,i=0,l+=36e5,r=d}return r},te=async e=>{let t=e.imageSettings||{keyType:"Default",quality:"Low-High"};if(t.keyType!=="Default")return!0;let n={Low:.001,"Low-High":.002,Medium:.008,"Medium-High":.01,High:.045,Ultra:.0488,Premium:.15}[t.quality]||.002,s=await U();s.imageCalls||(s.imageCalls=[]);let a=Date.now(),r=et(s.imageCalls),c=0;if(r.length>0){let l=r[r.length-1];a>=l.start&&a<l.end&&(c=l.spent)}let u=gt(s.imageCalls,a);return c+n<=u},ee=async()=>{let e=await U();e.imageCalls||(e.imageCalls=[]);let t=Date.now(),o=et(e.imageCalls),n=[],s=0,a=0;if(o.length>0){let l=o[o.length-1];t>=l.start&&t<l.end&&(n=l.calls,s=l.spent,a=Math.max(0,Math.ceil((l.end-t)/(60*1e3))))}let r=gt(e.imageCalls,t),c=Math.max(0,r-s),u=s;return{totalSpent:s,remaining:c,activeCallsCount:n.length,nextResetMin:a,reclaimCost:u,limit:r}},se=async e=>{let t=e.imageSettings||{keyType:"Default",quality:"Low-High"},n={Low:.001,"Low-High":.002,Medium:.008,"Medium-High":.01,High:.045,Ultra:.0488,Premium:.1}[t.quality]||.002,s=await U();s.imageCalls||(s.imageCalls=[]),s.imageCalls.push({timestamp:Date.now(),cost:n}),queueFlush()},oe=async()=>{let e=new Date().toISOString().split("T")[0];g||(g=await $()),g.date!==e&&await U();let t=g.stats||{...v},o=g.history||{},n=new Set(Object.keys(o));n.add(e);let a=Array.from(n).sort().map(L=>{let x=L===e?t:o[L]||{},w={...v,...x},H=w.tokens||0,_=w.cachedTokens||0,N=w.candidateTokens||0,B=Math.max(0,H-N),q=Math.max(0,B-_),C=w.agent||0,b=w.background||0,A=w.search||0,ht=C+b+A,Q=w.toolSuccess||0,st=w.toolFailure||0,ot=w.toolDenied||0,Y=Q+st+ot,pt=Y>0?(Q/Y*100).toFixed(1):"100.0",nt=w.linesAdded||0,at=w.linesRemoved||0,it=Array.isArray(w.imageCalls)?w.imageCalls:[],yt=it.reduce((kt,wt)=>kt+(wt.cost||0),0);return{date:L,tokens:H,cachedTokens:_,candidateTokens:N,promptTokens:B,uncachedPromptTokens:q,agent:C,background:b,search:A,totalRequests:ht,toolSuccess:Q,toolFailure:st,toolDenied:ot,totalTools:Y,toolSuccessRate:parseFloat(pt),linesAdded:nt,linesRemoved:at,netLines:nt-at,duration:w.duration||0,imageCallsCount:it.length,imageCost:yt,models:w.models||{},providerRequests:w.providerRequests||{}}}),r=await X().catch(()=>({})),c=r.quotas||{},u=r.apiTier||"Free",l=await ut().catch(()=>({tokens:0,agent:0})),i=null;c.resetMode==="Custom"&&(i=await ft(c.resetDay||1).catch(()=>({tokens:0})));let d=c.tokenLimit||0,m=c.monthlyTokenLimit||0,h=c.agentLimit||0,k=c.resetMode||"Daily",y=c.resetDay||1,f=c.providerBudgets||{},p=!!f.__useProvider,S=["Google","Anthropic","OpenAI","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama","InferX","SenseNova","AIHubMix","Poolside"];Object.keys(f).forEach(L=>{L!=="__useProvider"&&!S.includes(L)&&S.push(L)});let T=[];for(let L of S){let x=f[L];if(x&&(x.agentLimit||x.tokenLimit||x.monthlyTokenLimit)){let w=0,H=t.models?.[L]||{};for(let A in H)w+=H[A]?.tokens||0;let _=0,N=(c.resetMode==="Custom"?i?.models:l?.models)?.[L]||{};for(let A in N)_+=N[A]?.tokens||0;let B=t.providerRequests?.[L]||0,q=x.tokenLimit||0,C=x.monthlyTokenLimit||0,b=x.agentLimit||0;T.push({provider:L,dailyTokens:w,dailyTokenLimit:q,isDailyUnlimited:q>=9999999999999||q===0,monthlyTokens:_,monthlyTokenLimit:C,isMonthlyUnlimited:C>=9999999999999||C===0,dailyRequests:B,dailyAgentLimit:b,isRequestsUnlimited:b>=9999999||b===0})}}let P={apiTier:u,resetMode:k,resetDay:y,quotas:c,usingProviderBudgets:p&&T.length>0||T.length>0,providerBudgetsList:T,daily:{tokensUsed:t.tokens||0,tokenLimit:d,agentRequests:t.agent||0,agentLimit:h,isUnlimitedTokens:d>=9999999999999||d===0,isUnlimitedRequests:h>=9999999||h===0},monthly:{tokensUsed:(c.resetMode==="Custom"?i?.tokens:l?.tokens)||0,tokenLimit:m,isUnlimitedTokens:m>=9999999999999||m===0},providerBudgets:f};return{currentDate:e,todayStats:t,history:o,timeline:a,budget:P,runtimeSession:{...E}}};export{xt as a,Ot as b,zt as c,Qt as d,Yt as e,Vt as f,U as g,ut as h,Xt as i,E as j,Kt as k,ft as l,At as m,Zt as n,et as o,gt as p,te as q,ee as r,se as s,oe as t};
@@ -1,33 +0,0 @@
1
- import{a as b,b as L}from"./chunk-U2NRX2PX.js";import{a as C}from"./chunk-Y5JU726N.js";import{spawn as A}from"child_process";var P=null;try{let f=await import("node-pty");P=f.default||f}catch{}var D=!!P,y=f=>typeof f!="string"?f:f.replace(/(?:\u001b][\s\S]*?(?:\u0007|\u001b\\))|(?:[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])/g,""),E=f=>{if(!f)return"";let p=[[]],n=0,o=0,w=/\x1b\[([0-9;]*?)([a-zA-Z])/g,g=0,h,d=a=>{for(let e=0;e<a.length;e++){let s=a[e];if(s===`
2
- `)for(n++,o=0;n>=p.length;)p.push([]);else if(s==="\r")o=0;else{for(;n>=p.length;)p.push([]);let t=p[n];for(;o>t.length;)t.push(" ");t[o]=s,o++}}};for(;(h=w.exec(f))!==null;){d(f.substring(g,h.index));let a=h[1],e=h[2],s=a?a.split(";").map(Number):[];if(e==="A"){let t=s[0]||1;n=Math.max(0,n-t)}else if(e==="B"){let t=s[0]||1;for(n=n+t;n>=p.length;)p.push([])}else if(e==="C"){let t=s[0]||1;o=o+t}else if(e==="D"){let t=s[0]||1;o=Math.max(0,o-t)}else if(e==="G"){let t=(s[0]||1)-1;o=Math.max(0,t)}else if(e==="H"||e==="f"){let t=(s[0]||1)-1,r=(s[1]||1)-1;for(n=Math.max(0,t),o=Math.max(0,r);n>=p.length;)p.push([])}else if(e==="K"){let t=s[0]||0;if(n<p.length){let r=p[n];if(t===0)r.length=o;else if(t===1)for(let c=0;c<o&&c<r.length;c++)r[c]=" ";else t===2&&(r.length=0)}}else if(e==="J"){let t=s[0]||0;(t===2||t===3)&&(p.length=0,p.push([]),n=0,o=0)}g=w.lastIndex}d(f.substring(g));let O=p.map(a=>a.join(""));for(;O.length>0&&O[O.length-1]==="";)O.pop();return O.join(`
3
- `)},x=null,k=!1,_=f=>{try{x&&(k&&typeof x.write=="function"?x.write(f):x.stdin&&x.stdin.writable&&x.stdin.write(f))}catch{}},F=()=>{if(x){try{k&&typeof x.destroy=="function"?x.destroy():typeof x.kill=="function"&&(process.platform==="win32"?A("taskkill",["/pid",x.pid,"/f","/t"]):x.kill("SIGKILL"))}catch{}x=null,k=!1}},T=(f,p=!1)=>{if(process.platform!=="win32")return f;let n=[],o="",w=null,g=!1;for(let e=0;e<f.length;e++){let s=f[e];if(g){o+=s,g=!1;continue}if(s==="\\"){if(f[e+1]===" "){o+=" ",e++;continue}o+=s,g=!0;continue}w?(s===w&&(w=null),o+=s):s==='"'||s==="'"?(w=s,o+=s):s===";"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push(p?";":"&")):s==="&"&&!o.includes("://")?f[e+1]==="&"?(o.length>0&&(n.push(o),o=""),n.push("&&"),e++):o.endsWith("2>")&&f[e+1]==="1"?(n.push("2>&1"),o="",e++):(o.length>0&&(n.push(o),o=""),n.push("&")):s==="|"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push("|")):/\s/.test(s)?o.length>0&&(n.push(o),o=""):o+=s}o.length>0&&n.push(o);let h=e=>!(!e.includes("/")||/^(https?|file|ftp):\/\//i.test(e)||e.startsWith("@")||e.startsWith("/")&&(e.match(/\//g)||[]).length===1||/\s\/|\/\s/.test(e)||/[\(\)\{\}\;\<\>\=\'\"]/.test(e)),d=[];for(let e=0;e<n.length;e++){let s=n[e];if(s==="mkdir"&&p&&b()){let t=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;c!=="-p"&&c!=="--parents"&&c!=="-v"&&c!=="--verbose"&&t.push(c),r++}if(t.length>0){let c=t.map(i=>{let u=i.replace(/^['"]|['"]$/g,""),l=i;return h(u)&&(l=i.replace(/\//g,"\\")),l});d.push("New-Item","-ItemType","Directory","-Force","-Path",c.join(","))}else d.push("New-Item","-ItemType","Directory","-Force");e=r-1;continue}if(s==="rm"&&p&&b()){let t=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-rf"||l==="-fr"?(r=!0,c=!0):l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:t.push(l),i++}let u=["Remove-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),t.length>0){let l=t.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});u.push("-Path",l.join(","))}d.push(...u),e=i-1;continue}if(s==="cp"&&p&&b()){let t=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:t.push(l),i++}let u=["Copy-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),t.length>0){let l=t.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});if(l.length>1){let m=l.pop();u.push("-Path",l.join(","),"-Destination",m)}else u.push("-Path",l[0])}d.push(...u),e=i-1;continue}if(s==="touch"&&p&&b()){let t=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;t.push(c),r++}if(t.length>0){let i=`(${t.map(u=>{let l=u.replace(/^['"]|['"]$/g,""),m=u;return h(l)&&(m=u.replace(/\//g,"\\")),m}).join(", ")}) | ForEach-Object { if (Test-Path $_) { (Get-Item $_).LastWriteTime = [System.DateTime]::Now } else { $null | Out-File -FilePath $_ } }`;d.push(i)}e=r-1;continue}if(s==="|"&&n[e+1]==="tee"){n[e+2]==="-a"?(d.push(">>"),e+=2):(d.push(">"),e+=1);continue}if(s==="|"&&n[e+1]==="cat"&&n[e+2]===">"){d.push(">"),e+=2;continue}if(s==="|"){let t=n[e+1];if(t){let r=t.replace(/^['"]|['"]$/g,""),c=/\.(txt|md|json|log|csv|html|css|py|js|xml|yaml|yml|pdf|docx|pptx|xlsx)$/i.test(r);if(h(r)&&c){d.push(">");continue}}}d.push(s)}let O=!1,a=d.map(e=>{if(e==="echo")return O=!0,e;[">",">>","<","&","&&","|","||",";"].includes(e)&&(O=!1);let t=/^['"]|['"]$/.test(e),r=e;O&&t&&(r=e.replace(/^['"]|['"]$/g,""));let c=/^['"]|['"]$/.test(r),i=r.replace(/^['"]|['"]$/g,"");h(i)&&(r=r.replace(/\//g,"\\"));let u=r.replace(/^['"]|['"]$/g,"");return u.includes(" ")&&!c&&(r=`"${u}"`),r});if(p){let e="",s=0;for(let t=0;t<a.length;t++){let r=a[t];r==="&&"?(e+="; if ($?) {",s++):r===";"?(e+=" }".repeat(s)+";",s=0):(e&&!e.endsWith(" ")&&!e.endsWith("{")&&(e+=" "),e+=r)}return e+=" }".repeat(s),e}return a.join(" ")},W=async(f,p={})=>{let{command:n}=C(f),{onChunk:o}=p;if(!n)return'ERROR: Missing "command" argument for Run.';let w=process.platform==="win32",g=p.systemSettings||{},h={};return g.networkAccess===!1&&(h.HTTP_PROXY="http://127.0.0.1:9999",h.HTTPS_PROXY="http://127.0.0.1:9999",h.ALL_PROXY="socks5://127.0.0.1:9999",h.http_proxy="http://127.0.0.1:9999",h.https_proxy="http://127.0.0.1:9999",h.all_proxy="socks5://127.0.0.1:9999",h.NO_PROXY="localhost,127.0.0.1"),new Promise(d=>{let O=a=>{let e=a==="pwsh"||a==="powershell",s=T(n,e),t;w?a==="pwsh"?t="pwsh.exe":a==="powershell"?t="powershell.exe":t="cmd.exe":t=process.env.SHELL||"bash";let r=w?e?["-NoProfile","-Command",s]:["/c",s]:["-c",s];if(g.networkAccess===!1&&!w){let c=t,i=[...r];if(process.platform==="linux")t="unshare",r=["-n","-r",c,...i];else if(process.platform==="darwin"){let u=`(version 1)
4
- (allow default)
5
- (deny network-outbound)
6
- (allow network-outbound (remote ip "localhost:*"))
7
- (allow network-outbound (remote ip "127.0.0.1:*"))
8
- `;t="sandbox-exec",r=["-p",u,c,...i]}}if(P)try{let c=P.spawn(t,r,{name:"xterm-256color",cols:p.cols||120,rows:p.rows||30,cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...h}});x=c,k=!0;let i="",u=!1;return c.onData(l=>{if(!u){i+=l,o&&o(l);let m=y(i);/(?:Network:\s+use\s+--host\s+to|Network:\s+Type\s+--host\s+to|Local:\s+http:\/\/localhost:\d+|ready in \d+\s*ms|Compiled successfully|Development server is running|Listening on:)/i.test(m)&&(u=!0,setTimeout(()=>d(`Dev server started successfully in background.
9
-
10
- ${m}`),500))}}),c.onExit(({exitCode:l})=>{if(u)return;x=null;let m=E(i||""),R=y(m).replace(/\n{3,}/g,`
11
-
12
- `)||"Command executed with no output.";d(l!==0?`ERROR: Command [${n}] failed with exit code [${l}].
13
-
14
- ${R}`:`Command [${n}] completed.
15
-
16
- ${R}`)}),!0}catch(c){return w&&(a==="pwsh"||a==="powershell")&&c.code==="ENOENT"?!1:(v(d,s,n,h,o,a,g),!0)}else return v(d,s,n,h,o,a,g),!0};if(w){let a=L();O(a)||(a==="pwsh"&&!O("powershell")||a==="powershell")&&O("cmd")}else O("bash")})},v=(f,p,n,o,w,g="powershell",h={})=>{let d=process.platform==="win32",O=g==="pwsh"||g==="powershell",a;d?g==="pwsh"?a="pwsh.exe":g==="powershell"?a="powershell.exe":a="cmd.exe":a=process.env.SHELL||"bash";let e=d?O?["-NoProfile","-Command",p]:["/c",p]:["-c",p];if(h.networkAccess===!1&&!d){let i=a,u=[...e];if(process.platform==="linux")a="unshare",e=["-n","-r",i,...u];else if(process.platform==="darwin"){let l=`(version 1)
17
- (allow default)
18
- (deny network-outbound)
19
- (allow network-outbound (remote ip "localhost:*"))
20
- (allow network-outbound (remote ip "127.0.0.1:*"))
21
- `;a="sandbox-exec",e=["-p",l,i,...u]}}let s=d?A(a,e,{cwd:process.cwd(),env:{...process.env,...o}}):A(a,e,{cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...o}});x=s,k=!1,s.stdin&&s.stdin.on("error",()=>{x=null});let t="",r="",c=!1;s.stdout.on("data",i=>{if(!c){let u=i.toString();t+=u,w&&w(u);let l=y(t);/(?:Network:\s+use\s+--host\s+to|Network:\s+Type\s+--host\s+to|Local:\s+http:\/\/localhost:\d+|ready in \d+\s*ms|Compiled successfully|Development server is running|Listening on:)/i.test(l)&&(c=!0,setTimeout(()=>f(`Dev server started successfully in background.
22
-
23
- ${l}`),500))}}),s.stderr.on("data",i=>{if(!c){let u=i.toString();r+=u,w&&w(u)}}),s.on("close",i=>{if(c)return;x=null;let u=[],l=E(t),m=E(r);l&&u.push(`STDOUT:
24
- ${l}`),m&&u.push(`STDERR:
25
- ${m}`),i!==0&&u.push(`EXIT CODE: ${i}`);let R=u.join(`
26
-
27
- `)||"Command executed with no output.",$=y(R).replace(/\n{3,}/g,`
28
-
29
- `);f(i!==0?`ERROR: Command [${n}] failed with exit code [${i}].
30
-
31
- ${$}`:`Command [${n}] completed.
32
-
33
- ${$}`)}),s.on("error",i=>{if(d&&i.code==="ENOENT"){if(g==="pwsh"){let l=T(n,!0);return v(f,l,n,o,w,"powershell",h)}else if(g==="powershell"){let l=T(n,!1);return v(f,l,n,o,w,"cmd",h)}}x=null;let u=i instanceof Error?i.message:String(i);f(`ERROR: Failed to start command [${n}]: ${u}`)})};export{D as a,y as b,E as c,x as d,k as e,_ as f,F as g,T as h,W as i};