fluxflow-cli 4.30.2 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-GFTW3F45.js → ai-P2QF3HPK.js} +1 -1
- package/dist/chunks/{app-6FKKEDWQ.js → app-GMBLK4TE.js} +3 -3
- package/dist/chunks/{chunk-GNYMTG45.js → chunk-5MFIJRT6.js} +204 -32
- package/dist/chunks/{chunk-RSLAMTAV.js → chunk-H4KXMWYP.js} +1 -1
- package/dist/chunks/{chunk-BEJW3JGZ.js → chunk-KHJAWDBM.js} +1 -1
- package/dist/chunks/{chunk-RVCMZTHS.js → chunk-KZTDLEUL.js} +1 -1
- package/dist/chunks/chunk-X6YW3TVC.js +12 -0
- package/dist/chunks/{chunk-LGI76ZQV.js → chunk-YBXYDH5B.js} +3 -3
- package/dist/chunks/{click-AHOXSDH6.js → click-PN3BLFOY.js} +2 -2
- package/dist/chunks/{computer_action-NNJOTL7H.js → computer_action-VMC545YJ.js} +1 -1
- package/dist/chunks/{drag-SOCUV5Z7.js → drag-NMHO3BAW.js} +1 -1
- package/dist/chunks/{generate_image-GMYCWQ4R.js → generate_image-ZNBMY2PT.js} +1 -1
- package/dist/chunks/{invoke-UECYKKCJ.js → invoke-UH2WOJRR.js} +2 -2
- package/dist/chunks/{invokeSync-AKLDZ6WL.js → invokeSync-4A2ELLCQ.js} +2 -2
- package/dist/chunks/{key_press-A5PRGC7E.js → key_press-RJIPXDAB.js} +1 -1
- package/dist/chunks/{keyboard_typing-OGUSR6BH.js → keyboard_typing-VXT53PRV.js} +1 -1
- package/dist/chunks/{screen_grid-VV7JGWQB.js → screen_grid-PMTAQA3B.js} +1 -1
- package/dist/chunks/{scroll-JDGCDDUB.js → scroll-OMBQDZHP.js} +1 -1
- package/dist/chunks/{settings-EMTQHDIH.js → settings-Q5OBKUO6.js} +1 -1
- package/dist/chunks/{update_file-WBHNB4AY.js → update_file-VIY6KSMT.js} +1 -1
- package/dist/chunks/usage-OUCURLG4.js +1 -0
- package/dist/chunks/usageServer-YPYMV3EB.js +1 -0
- package/dist/chunks/{write_file-LSRYHZN6.js → write_file-AMAYRCUC.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/chunk-QJZ24WJZ.js +0 -12
- package/dist/chunks/usage-TITGX7QI.js +0 -1
- package/dist/chunks/usageServer-FPGU2LDO.js +0 -1
|
@@ -2,4 +2,4 @@ import{screen as V}from"@nut-tree-fork/nut-js";import P from"screenshot-desktop"
|
|
|
2
2
|
<rect x="${x+1}" y="${i+1}" width="${C-2}" height="${l-2}" fill="rgba(0, 255, 255, 0.015)" stroke="rgba(255, 255, 0, 0.3)" stroke-width="1.1" rx="2"/>
|
|
3
3
|
`;let p=s.some(t=>t!==m&&t.startY+t.cellH>=i-6&&t.startY<i&&Math.max(0,Math.min(x+C,t.startX+t.cellW)-Math.max(x,t.startX))>10),w=s.some(t=>t!==m&&t.startY<=i+l+6&&t.startY>i&&Math.max(0,Math.min(x+C,t.startX+t.cellW)-Math.max(x,t.startX))>10),a;if(m.isCustomY)a=c,!p&&a<i+11&&(a=Math.max(10,Math.min(a,i+4)));else{let t=m.yOffset!==void 0?m.yOffset:3;!p&&t<0&&(t=Math.min(t,-12));let y=c+t,O=!p&&(t<0||y<i+11)?Math.max(10,i+4):i+11,D=!w&&(t>0||y>i+l-2)?Math.min(o-2,i+l+6):i+l+3;a=Math.max(O,Math.min(D,y))}Y+=`
|
|
4
4
|
<text x="${n}" y="${a}" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="600" fill="#FFFF00" stroke="#000000" stroke-width="2" paint-order="stroke fill" stroke-linejoin="round" opacity="0.8" text-anchor="middle">${u}</text>
|
|
5
|
-
`}return`<svg width="${e}" height="${o}" xmlns="http://www.w3.org/2000/svg">${Y}</svg>`}var tt=1,j=e=>new Promise(o=>setTimeout(o,e));async function et(){try{let{loadSettings:e}=await import("./settings-
|
|
5
|
+
`}return`<svg width="${e}" height="${o}" xmlns="http://www.w3.org/2000/svg">${Y}</svg>`}var tt=1,j=e=>new Promise(o=>setTimeout(o,e));async function et(){try{let{loadSettings:e}=await import("./settings-Q5OBKUO6.js"),o=await e();return Number(o.display||0)}catch{return 0}}async function lt(){let e=await et();try{let o=await P.listDisplays();if(o&&o.length>0)return{format:"png",screen:(o[e]||o[0]).id}}catch{}return{format:"png"}}async function ct(){let e=0,o=await lt();for(;e<2;){let b=await P(o);await j(500);let T=await P(o);if(b.equals(T))return T;e++,e<2&&await j(3e3)}return await j(3e3),await P(o)}function at(e=[],o=[]){if(!e||e.length===0)return o||[];if(!o||o.length===0)return e;let b=[...e],T=typeof e.getModelConfidence=="function"?e.getModelConfidence.bind(e):null;for(let s of o){if(T&&T(s.startX,s.startY,s.cellW,s.cellH)<.01)continue;let h=s.startX,d=s.startX+s.cellW,Y=s.startY,m=s.startY+s.cellH;for(let u of e){let p=u.startX,w=u.startY,a=u.startX+u.cellW,t=u.startY+u.cellH;if(Math.max(0,Math.min(m,t)-Math.max(Y,w))>s.cellH*.4&&p<d&&a>h){let O=(p+a)/2,D=(h+d)/2;O<=D?h=Math.max(h,a):d=Math.min(d,p)}}let r=d-h;if(r<18)continue;let H=h,x=Y,i=d,C=m,l=Math.floor(h+r/2),n=s.cy,c=!1;for(let u of e){let p=u.startX,w=u.startY,a=u.startX+u.cellW,t=u.startY+u.cellH;if(l>=p&&l<=a&&n>=w&&n<=t){c=!0;break}let y=Math.max(H,p),O=Math.max(x,w),D=Math.min(i,a),E=Math.min(C,t),g=Math.max(0,D-y)*Math.max(0,E-O),f=(i-H)*(C-x);if(g/(f||1)>=.25){c=!0;break}}c||b.push({...s,startX:H,cellW:r,cx:l})}return b.sort((s,h)=>Math.abs(s.startY-h.startY)>18?s.startY-h.startY:s.startX-h.startX),b.forEach((s,h)=>{s.badgeId=h+1}),b}async function pt(){try{let e=await ct(),o=null;if(st){let m=(async()=>{try{let{detectUIBoxesONNX:r}=await import("./ui_detector_onnx-YGGFMOK5.js");return await r(e,M.TARGET_WIDTH,M.TARGET_HEIGHT)}catch{return null}})();if(nt)o=await m||[];else{let r=z(e,!0),[H,x]=await Promise.all([m,r]);o=H&&H.length>0?at(H,x):await z(e,!1)}}else o=await z(e,!1);F=o;let b=rt(M.TARGET_WIDTH,M.TARGET_HEIGHT,M.COLS,M.ROWS,o),T=await Z(e).resize(M.TARGET_WIDTH,M.TARGET_HEIGHT,{fit:"fill"}).composite([{input:Buffer.from(b),top:0,left:0}]).png({quality:100}).toBuffer();if(process.env.SHOW_DEBUG_GRID)try{let m=Q.resolve(process.cwd(),"screenshots");await K.ensureDir(m);let r=Q.join(m,`${tt}.png`);await K.writeFile(r,T),tt++}catch{}let s=T.toString("base64"),h=o.length,d=e,Y=T;return d=null,Y=null,{base64:s,mimeType:"image/png",width:M.TARGET_WIDTH,height:M.TARGET_HEIGHT,detectedCount:h}}catch(e){return console.error("Failed to capture gridded screenshot:",e),null}}function it(e){if(e==null)return null;let o=null;if(typeof e=="number")o=e;else if(typeof e=="string"){let H=e.trim();if(/^\d+$/.test(H))o=parseInt(H,10);else{let x=H.match(/^([A-Z])([0-9]{1,2})$/i);if(x){let i=x[1].toUpperCase().charCodeAt(0)-65,C=parseInt(x[2],10)-1;o=i*M.COLS+C+1}}}if(o===null||isNaN(o))return null;if(F&&F.length>0){let H=F.find(x=>x.badgeId===o)||F.find(x=>x.cellNum===o);if(H){let x=Math.floor((H.cellNum-1)%M.COLS),i=Math.floor((H.cellNum-1)/M.COLS);return{x:H.cx,y:H.cy,colIdx:x>=0?x:0,rowIdx:i>=0?i:0,cellNum:o}}}let b=M.COLS*M.ROWS;if(o<1||o>b)return null;let T=o-1,s=Math.floor(T/M.COLS),h=T%M.COLS,d=M.TARGET_WIDTH/M.COLS,Y=M.TARGET_HEIGHT/M.ROWS,m=Math.floor(h*d+d/2),r=Math.floor(s*Y+Y/2);return{x:m,y:r,colIdx:h,rowIdx:s,cellNum:o}}async function yt(e,o,b){let T=null;if(typeof e=="number"||typeof e=="string"?T=it(e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(T=e),!T)return null;let s=o,h=b,d=0,Y=0,m=await et();try{let C=await P.listDisplays();if(C&&C.length>0){let l=C[m]||C[0];l.width&&l.height&&(s=l.width,h=l.height),l.left!==void 0&&(d=l.left),l.top!==void 0&&(Y=l.top)}}catch{}if(!s||!h)try{let C=await P({}),l=await Z(C).metadata();l&&l.width&&l.height?(s=l.width,h=l.height):(s=await V.width(),h=await V.height())}catch{(!s||!h)&&(s=await V.width(),h=await V.height())}let r=s/M.TARGET_WIDTH,H=h/M.TARGET_HEIGHT,x=Math.round(T.x*r)+d,i=Math.round(T.y*H)+Y;return{x,y:i,screenW:s,screenH:h,offsetX:d,offsetY:Y}}export{M as a,st as b,nt as c,et as d,pt as e,it as f,yt as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as f}from"./chunk-
|
|
1
|
+
import{g as f}from"./chunk-H4KXMWYP.js";import{mouse as c,keyboard as i,Button as u,Key as e,Point as l,clipboard as g}from"@nut-tree-fork/nut-js";c.config.autoDelayMs=50;i.config.autoDelayMs=50;async function w(){try{await i.releaseKey(e.LeftControl,e.RightControl,e.LeftAlt,e.RightAlt,e.LeftShift,e.RightShift,e.LeftSuper,e.RightSuper)}catch{}}async function h(n,t,s={}){let r=await f(t);if(!r&&(n==="move"||n==="click"||n==="drag"))return`ERROR: Invalid target location specified: ${JSON.stringify(t)}`;try{switch(n.toLowerCase()){case"move":return await c.setPosition(new l(r.x,r.y)),`Moved mouse to grid target ${typeof t=="string"?t:`(${r.x}, ${r.y})`}`;case"click":{await c.setPosition(new l(r.x,r.y));let a=s.button==="right"?u.RIGHT:s.button==="middle"?u.MIDDLE:u.LEFT;return s.clickType==="double"?await c.doubleClick(a):await c.click(a),`${s.clickType||"Single"} clicked ${s.button||"left"} button at ${typeof t=="string"?t:`(${r.x}, ${r.y})`}`}case"drag":{let a=await f(s.from||t),o=await f(s.to);return!a||!o?'ERROR: Drag requires valid "from" and "to" target coordinates/grid codes.':(await c.setPosition(new l(a.x,a.y)),await c.pressButton(u.LEFT),await c.setPosition(new l(o.x,o.y)),await c.releaseButton(u.LEFT),`Dragged mouse from (${a.x}, ${a.y}) to (${o.x}, ${o.y})`)}case"scroll":{let a=r||await f({x:640,y:360});a&&(await c.setPosition(new l(a.x,a.y)),await new Promise(d=>setTimeout(d,60)));let o=parseInt(s.amount,10);(isNaN(o)||o<=0)&&(o=5);let y=o>50?Math.min(20,Math.max(1,Math.round(o/100))):Math.min(20,o),R=s.direction==="up";for(let d=0;d<y;d++)R?await c.scrollUp(120):await c.scrollDown(120),await new Promise(L=>setTimeout(L,20));return`Scrolled ${s.direction||"down"} (${y} notches${r?` at target (${r.x}, ${r.y})`:" at screen center"})`}default:return`ERROR: Unsupported mouse action "${n}"`}}catch(a){return`ERROR: Mouse action failed: ${a.message}`}}var m={enter:e.Enter,return:e.Return,escape:e.Escape,esc:e.Escape,backspace:e.Backspace,tab:e.Tab,space:e.Space,up:e.Up,down:e.Down,left:e.Left,right:e.Right,ctrl:e.LeftControl,control:e.LeftControl,alt:e.LeftAlt,shift:e.LeftShift,cmd:e.LeftCmd,win:e.LeftWin,meta:e.LeftWin,super:e.LeftSuper,a:e.A,b:e.B,c:e.C,d:e.D,e:e.E,f:e.F,g:e.G,h:e.H,i:e.I,j:e.J,k:e.K,l:e.L,m:e.M,n:e.N,o:e.O,p:e.P,q:e.Q,r:e.R,s:e.S,t:e.T,u:e.U,v:e.V,w:e.W,x:e.X,y:e.Y,z:e.Z,0:e.Num0,1:e.Num1,2:e.Num2,3:e.Num3,4:e.Num4,5:e.Num5,6:e.Num6,7:e.Num7,8:e.Num8,9:e.Num9,f1:e.F1,f2:e.F2,f3:e.F3,f4:e.F4,f5:e.F5,f6:e.F6,f7:e.F7,f8:e.F8,f9:e.F9,f10:e.F10,f11:e.F11,f12:e.F12},p=n=>{if(!n)return;let t=String(n).toLowerCase().trim();if(m[t]!==void 0)return m[t];if(e[n]!==void 0)return e[n];if(e[t.toUpperCase()]!==void 0)return e[t.toUpperCase()]};async function E(n,t,s={}){try{switch(n.toLowerCase()){case"type":{if(typeof t!="string")return"ERROR: Type action requires a valid string input";await w(),await g.setContent(t);let a=process.platform==="darwin"?e.LeftSuper:e.LeftControl;return await i.pressKey(a,e.V),await i.releaseKey(a,e.V),await w(),s.autoPressEnter?(await new Promise(o=>setTimeout(o,50)),await i.type(e.Enter),`Typed text input ("${t.length>20?t.substring(0,20)+"...":t}") and pressed Enter`):`Typed text input ("${t.length>20?t.substring(0,20)+"...":t}")`}case"key_press":{let r=p(t);return r===void 0?`ERROR: Unknown key name "${t}"`:(await i.type(r),`Pressed key ${t}`)}case"key_combination":{if(!Array.isArray(t))return'ERROR: key_combination requires an array of keys (e.g. ["ctrl", "c"])';let r=t.map(a=>p(a)).filter(a=>a!==void 0);return r.length===0?"ERROR: Invalid key combination":(await i.pressKey(...r),await i.releaseKey(...r),`Executed key combination [${t.join(" + ")}]`)}case"clear_input":return await i.pressKey(e.LeftControl,e.A),await i.releaseKey(e.LeftControl,e.A),await i.type(e.Backspace),"Cleared active text input (Select All + Backspace)";case"browser_back":{let r=process.platform==="darwin";return r?(await i.pressKey(e.LeftSuper,e.Left),await i.releaseKey(e.LeftSuper,e.Left)):(await i.pressKey(e.LeftAlt,e.Left),await i.releaseKey(e.LeftAlt,e.Left)),await w(),`Browser back navigation (${r?"Cmd+Left":"Alt+Left"})`}default:return`ERROR: Unsupported keyboard action "${n}"`}}catch(r){return`ERROR: Keyboard action failed: ${r.message}`}}export{h as a,E as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as u}from"./chunk-63V6P5DU.js";import{e as
|
|
1
|
+
import{n as u}from"./chunk-63V6P5DU.js";import{e as g,f as c}from"./chunk-L3W2X74K.js";import{b as s}from"./chunk-DSVLWYIT.js";import n from"fs-extra";import m from"path";var r={mode:"Flux",display:0,thinkingLevel:"Medium",aiProvider:"Google",activeModel:u("Google","Free")||"gemma-4-31b-it",showFullThinking:!0,apiTier:"Free",quotas:{agentLimit:999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerTiers:{Google:"Free",DeepSeek:"Free",NVIDIA:"Free",OpenRouter:"Free",InferX:"Free",SenseNova:"Free",Poolside:"Free",ExpLabs:"Free",TokenHarbor:"Free",Infron:"Free",APInex:"Free",c_openai:"Free"}},systemSettings:{customOpenAIBaseUrl:"",memory:!1,theme:"Dark",compression:0,autoExec:!0,allowExternalAccess:!1,advanceRollback:!1,autoDeleteHistory:"7d",useExternalData:!1,externalDataPath:"",preserveThinking:!0,loadingPhrases:!0,progressiveRendering:!0,showTPMEstimate:!0,subAgents:!1,CustomSubAgent:!1,SubAgentModel:"Default",SubAgentProvider:"",dynamicDirAwareness:!1,indentationTree:!0,ollamaEndpoint:"Cloud",compressToolResults:!1,autoTruncateResults:!0,imageHistoryCU:"Standard",contextLength:"256k",keepReasoningContext:!1,autoExcludeMetadata:!1,disableTodo:!1},profileData:{name:null,nickname:null,instructions:null},imageSettings:{keyType:"Default",quality:"Low-High",apiKey:""}},p=async()=>{let t={...r};try{if(await n.exists(s)){let e=g(s);if(e.imageSettings&&e.imageSettings.apiKey)try{let a=e.imageSettings.apiKey,{saveSecret:i}=await import("./secrets-UNXNDOLK.js");await i("POLLINATIONS_API_KEY",a),e.imageSettings.apiKey="",c(s,e)}catch{}t={...r,...e,quotas:{...r.quotas,...e.quotas,providerTiers:{...r.quotas.providerTiers,...e.quotas?.providerTiers||{}}},systemSettings:{...r.systemSettings,...e.systemSettings},profileData:{...r.profileData,...e.profileData},imageSettings:{...r.imageSettings,...e.imageSettings}}}}catch(e){console.error("Failed to load settings:",e)}try{let{getSecret:e}=await import("./secrets-UNXNDOLK.js"),a=await e("POLLINATIONS_API_KEY");a&&(t.imageSettings.apiKey=a)}catch{}if(t.showFullThinking===!1){t.showFullThinking=!0;try{c(s,t)}catch{}}return t},f=async t=>{let{FLUXFLOW_DIR:e}=await import("./paths-2EXHWUSL.js"),a=["logs","secret"];for(let i of a){let l=m.join(e,i),o=m.join(t,i);try{await n.exists(l)&&(await n.ensureDir(o),await n.copy(l,o,{overwrite:!0}))}catch(d){console.error(`Migration failed for ${i}:`,d)}}},F=async t=>{try{let e=await p();if(!e.systemSettings.useExternalData&&t.systemSettings?.useExternalData&&t.systemSettings?.externalDataPath&&await f(t.systemSettings.externalDataPath),t.imageSettings&&t.imageSettings.apiKey!==void 0){let{saveSecret:i,removeSecret:l}=await import("./secrets-UNXNDOLK.js"),o=t.imageSettings.apiKey;o?await i("POLLINATIONS_API_KEY",o):await l("POLLINATIONS_API_KEY")}let a={...e,...t};a.systemSettings&&(a.systemSettings.dynamicDirAwareness=!1),a.imageSettings&&(a.imageSettings={...a.imageSettings,apiKey:""}),await n.ensureDir(m.dirname(s)),c(s,a);try{let{invalidateCachedBaseUrl:i}=await import("./usage-OUCURLG4.js");i()}catch{}return!0}catch(e){return console.error("Failed to save settings:",e),!1}};export{p as a,F as b};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{a as W}from"./chunk-KZTDLEUL.js";import{a as dt,b as J}from"./chunk-L3W2X74K.js";import{d as G,h as K,i as v,j as C}from"./chunk-DSVLWYIT.js";import D from"fs-extra";import U from"path";import vt from"http";import F from"fs-extra";import tt from"path";import{spawn as Ct}from"child_process";import{fileURLToPath as Mt}from"url";var I=52991,xt=15e3,mt=tt.join(G,"usage","usage_error.txt"),ut=async(s,t)=>{let o=t?.stack||t?.message||String(t);console.error(`[Usage Daemon Error] [${s}]:`,t);try{await F.ensureDir(tt.dirname(mt));let e=`[${new Date().toISOString()}] [Daemon:${s}] ${o}
|
|
2
|
+
-------------------------------------
|
|
3
|
+
|
|
4
|
+
`;await F.appendFile(mt,e,"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:[]},Z=(s,t)=>{if(!s)return{};let o=Object.keys(s),n=new Date(new Date(t).getTime()-720*60*60*1e3),e={};for(let a of o)new Date(a)>=n&&(e[a]=s[a]);return e};async function Rt(){let s=new Date().toISOString().split("T")[0],t=null;try{if(await F.exists(v)){let o=(await F.readFile(v,"utf8")).trim();o.startsWith("{")||o.startsWith("[")?t=JSON.parse(o):t=JSON.parse(J(o))}}catch(o){await ut("loadUsageFromDisk",o)}if(t){let o={...j,...t.stats||{}};Array.isArray(o.imageCalls)||(o.imageCalls=[]);let n=t.history||{},e=Z(n,s);if(t.date===s)return{...t,stats:o,history:e};{let a=t.date,r={...e};return a&&(r[a]=o),{date:s,stats:{...j},history:Z(r,s)}}}return{date:s,stats:{...j},history:{}}}async function Ut(s=I){let t=await Rt(),o=!1,n=!1,e=Date.now(),a=null,r=async()=>{if(t)try{await F.ensureDir(tt.dirname(v));let c=new Date().toISOString().split("T")[0];t.history=Z(t.history||{},t.date||c),t.saveId=Math.random().toString(36).substring(2)+Date.now().toString(36);let i=dt(JSON.stringify(t,null,2));await F.writeFile(v,i,"utf8"),n=!1}catch(c){await ut("flushToDisk",c)}},l=async()=>{a&&clearInterval(a),await r(),f.close(()=>{process.exit(0)}),setTimeout(()=>process.exit(0),1e3).unref()};a=setInterval(async()=>{if(o)return;Date.now()-e>xt&&await l()},5e3),a.unref&&a.unref();let f=vt.createServer(async(c,i)=>{let m=c.url||"";if(c.method==="POST"&&m==="/heartbeat"){o||(e=Date.now()),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({ok:!0}));return}if((c.method==="GET"||c.method==="POST")&&m==="/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(()=>{f.close(()=>process.exit(0)),setTimeout(()=>process.exit(0),500).unref()},3e3);return}if(c.method==="POST"&&m==="/flush"){o||(e=Date.now(),await r()),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({success:!0}));return}if(c.method==="POST"&&m==="/write"){if(o){i.writeHead(403,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:"Daemon finalized. Writes locked."}));return}e=Date.now();let d="";c.on("data",g=>{d+=g}),c.on("end",async()=>{try{let g=JSON.parse(d||"{}"),w=new Date().toISOString().split("T")[0];if(t.date!==w){let k=t.date;k&&(t.history||(t.history={}),t.history[k]={...t.stats}),t.date=w,t.stats={...j}}t.stats||(t.stats={...j});let{key:h,amount:u=1,provider:y,model:T}=g;if(h&&t.stats[h]!==void 0&&typeof t.stats[h]=="number"&&(t.stats[h]+=Math.floor(u)),h==="agent"&&y&&(t.stats.providerRequests||(t.stats.providerRequests={}),t.stats.providerRequests[y]=(t.stats.providerRequests[y]||0)+Math.floor(u)),y&&T&&(h==="tokens"||h==="cachedTokens"||h==="candidateTokens"||h==="ttft")){t.stats.models||(t.stats.models={}),t.stats.models[y]||(t.stats.models[y]={}),t.stats.models[y][T]||(t.stats.models[y][T]={tokens:0,cachedTokens:0,candidateTokens:0,ttftSum:0,ttftCalls:0});let k=t.stats.models[y][T];h==="tokens"&&(k.tokens+=Math.floor(u)),h==="cachedTokens"&&(k.cachedTokens+=Math.floor(u)),h==="candidateTokens"&&(k.candidateTokens+=Math.floor(u)),h==="ttft"&&(k.ttftSum=(k.ttftSum||0)+Math.floor(u),k.ttftCalls=(k.ttftCalls||0)+1)}n=!0,await r(),i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify({success:!0}))}catch(g){i.writeHead(400,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:g.message}))}});return}i.writeHead(404,{"Content-Type":"text/plain"}),i.end("Not Found")});f.listen(s,"127.0.0.1",()=>{e=Date.now()}),f.on("error",c=>{c.code==="EADDRINUSE"&&process.exit(0)})}async function Ot(s=I){try{if((await fetch(`http://127.0.0.1:${s}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(300)})).ok)return!0}catch{}try{let t=Mt(import.meta.url);Ct(process.execPath,[t,"--usage-daemon-worker",`--port=${s}`],{detached:!0,stdio:"ignore",windowsHide:!0}).unref();for(let n=0;n<10;n++){await new Promise(e=>setTimeout(e,100));try{if((await fetch(`http://127.0.0.1:${s}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(300)})).ok)return!0}catch{}}}catch{}return!1}async function et(s,t=I){try{await Ot(t),await fetch(`http://127.0.0.1:${t}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:AbortSignal.timeout(1e3)})}catch{}}async function bt(s=I){try{await fetch(`http://127.0.0.1:${s}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(600)})}catch{}}async function At(s=I){try{await fetch(`http://127.0.0.1:${s}/finalize`,{method:"GET",signal:AbortSignal.timeout(1e3)})}catch{}}if(process.argv.includes("--usage-daemon-worker")){let s=process.argv.find(o=>o.startsWith("--port=")),t=s?parseInt(s.split("=")[1],10):I;Ut(t)}var ft=U.join(G,"usage","usage_error.txt"),z=null,Vt=()=>{z=null},ot=async s=>{if(s!=="c_openai")return s;if(z)return z;try{let o=(await W())?.systemSettings?.customOpenAIBaseUrl||"";if(o=o.trim().replace(/\/+$/,""),o){let n=o.indexOf("/v1");return n!==-1&&(o=o.substring(0,n+3)),z=o,o}}catch{}return"c_openai"},Q=async(s,t)=>{let o=t?.stack||t?.message||String(t);console.error(`[Usage Error] [${s}]:`,t);try{await D.ensureDir(U.dirname(ft));let e=`[${new Date().toISOString()}] [${s}] ${o}
|
|
5
|
+
-------------------------------------
|
|
6
|
+
|
|
7
|
+
`;await D.appendFile(ft,e,"utf8")}catch{}},p=null,M={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:[]},X=(s,t)=>{if(!s)return{};let o=Object.keys(s),n=new Date(new Date(t).getTime()-720*60*60*1e3),e={};for(let a of o)new Date(a)>=n&&(e[a]=s[a]);return e},B=async()=>{let s=new Date().toISOString().split("T")[0];try{!await D.exists(v)&&await D.exists(K)&&(await D.ensureDir(U.dirname(v)),await D.move(K,v))}catch{}let t=null;try{if(await D.exists(v)){let n=(await D.readFile(v,"utf8")).trim();n.startsWith("{")||n.startsWith("[")?t=JSON.parse(n):t=JSON.parse(J(n))}}catch(n){await Q("loadUsageFromFile",n)}let o=t;if(o){let n=o.stats||{...M},e={...M,...n};Array.isArray(e.imageCalls)||(e.imageCalls=[]);let a=o.history||{},r=X(a,s);if(o.date===s)return{...o,stats:e,history:r};{let l=o.date,f=e,c={...r};return l&&(c[l]=f),{date:s,stats:{...M},history:X(c,s)}}}return{date:s,stats:{...M},history:{}}},Ft=async()=>{},st=500,gt=0,It=()=>{let t=new Date().toISOString().split("T")[0];return U.join(C,`${t}.jsonl`)},Kt=async s=>{try{await D.ensureDir(C);let t=await ot(s.provider),o={time:new Date().toISOString(),provider:t||"unknown",model:s.model||"unknown",input:Number(s.prompt)||0,cached:Number(s.cached)||0,output:Number(s.output)||0,reasoning:Number(s.reasoning)||0,ttft:Number(s.ttft)||0};await D.appendFile(It(),JSON.stringify(o)+`
|
|
8
|
+
`,"utf8"),++gt>=10&&(gt=0,await ht())}catch{}},ht=async()=>{try{if(!await D.exists(C))return;let s=(await D.readdir(C)).filter(e=>e.endsWith(".jsonl")).sort(),t=[];for(let e of s)try{let a=await D.readFile(U.join(C,e),"utf8");for(let r of a.split(`
|
|
9
|
+
`))r.trim()&&t.push({file:e,line:r})}catch{}if(t.length<=st)return;let o=t.slice(-st),n=new Map;for(let e of o)n.has(e.file)||n.set(e.file,[]),n.get(e.file).push(e.line);for(let e of s){let a=n.get(e);!a||a.length===0?await D.remove(U.join(C,e)):await D.writeFile(U.join(C,e),a.join(`
|
|
10
|
+
`)+`
|
|
11
|
+
`,"utf8")}}catch{}},Zt=async(s=30)=>{let t=[];try{if(!await D.exists(C))return t;let n=(await D.readdir(C)).filter(e=>e.endsWith(".jsonl")).sort().slice(-Math.max(1,s));for(let e of n)try{let a=await D.readFile(U.join(C,e),"utf8");for(let r of a.split(`
|
|
12
|
+
`))if(r.trim())try{t.push(JSON.parse(r))}catch(l){await Q(`getTimedUsage:parseLine (${e})`,l)}}catch(a){await Q(`getTimedUsage:readFile (${e})`,a)}}catch(o){await Q("getTimedUsage",o)}return t.slice(-st)},te=async()=>{p=await B(),await ht()},x=async()=>{let s=new Date().toISOString().split("T")[0];if(!p)p=await B();else if(p.date!==s){let t=p.date,o=p.stats,n=p.history||{};o&&(n[t]=o),p={date:s,stats:{...M},history:X(n,s)},await Ft()}return p&&p.stats&&!Array.isArray(p.stats.imageCalls)&&(p.stats.imageCalls=[]),p.stats},pt=async()=>{let s=new Date().toISOString().split("T")[0];p||(p=await B()),p.date!==s&&await x();let t=p.history||{},o=X(t,s);p.history=o;let n=p.stats||{...M},e={...M};e.imageCalls=[],e.models={},e.providerRequests={};let a=(r,l)=>{for(let f in r)if(f==="imageCalls")r.imageCalls=[...r.imageCalls||[],...l.imageCalls||[]];else if(f==="providerRequests"){let c=l.providerRequests||{};for(let i in c)r.providerRequests[i]=(r.providerRequests[i]||0)+(c[i]||0)}else if(f==="models"){let c=l.models||{};for(let i in c){r.models[i]||(r.models[i]={});for(let m in c[i]){r.models[i][m]||(r.models[i][m]={tokens:0,cachedTokens:0,candidateTokens:0,ttftSum:0,ttftCalls:0});let d=r.models[i][m],g=c[i][m];d.tokens+=g.tokens||0,d.cachedTokens+=g.cachedTokens||0,d.candidateTokens+=g.candidateTokens||0,d.ttftSum=(d.ttftSum||0)+(g.ttftSum||0),d.ttftCalls=(d.ttftCalls||0)+(g.ttftCalls||0)}}}else typeof r[f]=="number"&&(r[f]+=l[f]||0)};a(e,n);for(let r in o)a(e,o[r]);return e},ee=async(s,t)=>{t=await ot(t),s==="toolSuccess"?E.toolSuccess++:s==="toolFailure"?E.toolFailure++:s==="toolDenied"&&E.toolDenied++;let o=await x();o[s]!==void 0&&o[s]++,t&&s==="agent"&&(o.providerRequests||(o.providerRequests={}),o.providerRequests[t]=(o.providerRequests[t]||0)+1),await et({key:s,amount:1,provider:t})},E={linesAdded:0,linesRemoved:0,toolSuccess:0,toolFailure:0,toolDenied:0},se=async(s,t,o,n)=>{o=await ot(o),s==="linesAdded"?E.linesAdded+=t:s==="linesRemoved"&&(E.linesRemoved+=t);let e=await x();if(e[s]!==void 0&&(e[s]+=Math.floor(t)),o&&n&&(s==="tokens"||s==="cachedTokens"||s==="candidateTokens"||s==="ttft")){e.models||(e.models={}),e.models[o]||(e.models[o]={}),e.models[o][n]||(e.models[o][n]={tokens:0,cachedTokens:0,candidateTokens:0,ttftSum:0,ttftCalls:0});let a=e.models[o][n];s==="tokens"&&(a.tokens+=Math.floor(t)),s==="cachedTokens"&&(a.cachedTokens+=Math.floor(t)),s==="candidateTokens"&&(a.candidateTokens+=Math.floor(t)),s==="ttft"&&(a.ttftSum=(a.ttftSum||0)+Math.floor(t),a.ttftCalls=(a.ttftCalls||0)+1)}await et({key:s,amount:t,provider:o,model:n})},yt=async(s=1)=>{let t=new Date,o=t.toISOString().split("T")[0];p||(p=await B()),p.date!==o&&await x();let n=t.getFullYear(),e=t.getMonth();t.getDate()<s&&(e-=1,e<0&&(e=11,n-=1));let l=new Date(n,e,s).toISOString().split("T")[0],f=p.history||{},c=p.stats||{...M},i={...M};i.imageCalls=[],i.models={},i.providerRequests={};let m=(d,g)=>{for(let w in d)if(w==="imageCalls")d.imageCalls=[...d.imageCalls||[],...g.imageCalls||[]];else if(w==="providerRequests"){let h=g.providerRequests||{};for(let u in h)d.providerRequests[u]=(d.providerRequests[u]||0)+(h[u]||0)}else if(w==="models"){let h=g.models||{};for(let u in h){d.models[u]||(d.models[u]={});for(let y in h[u]){d.models[u][y]||(d.models[u][y]={tokens:0,cachedTokens:0,candidateTokens:0,ttftSum:0,ttftCalls:0});let T=d.models[u][y],k=h[u][y];T.tokens+=k.tokens||0,T.cachedTokens+=k.cachedTokens||0,T.candidateTokens+=k.candidateTokens||0,T.ttftSum=(T.ttftSum||0)+(k.ttftSum||0),T.ttftCalls=(T.ttftCalls||0)+(k.ttftCalls||0)}}}else typeof d[w]=="number"&&(d[w]+=g[w]||0)};m(i,c);for(let d in f)d>=l&&d<o&&m(i,f[d]);return i},Et=async(s,t={})=>{let o=await W().catch(()=>({})),n=t.apiTier||o.apiTier||"Free",e=t.quotas||t.systemSettings?.quotas||o.quotas||{},a=e.providerBudgets||{},r=!!a.__useProvider,l=t.aiProvider||o.aiProvider||"Google",f=r&&!!a[l],c=()=>{if(f){let i=a[l];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:e.agentLimit||99999999,tokenLimit:e.tokenLimit||99999999999999,monthlyTokenLimit:e.monthlyTokenLimit||99999999999999}};if(s==="agent"){let{agentLimit:i,tokenLimit:m,monthlyTokenLimit:d}=c(),g=await x(),w;e.resetMode==="Custom"?w=await yt(e.resetDay||1):w=await pt();let h=0,u=0,y=0;if(f){h=g.providerRequests?.[l]||0;let T=g.models?.[l]||{};for(let q in T)u+=T[q]?.tokens||0;let k=w.models?.[l]||{};for(let q in k)y+=k[q]?.tokens||0}else h=g.agent||0,u=g.tokens||0,y=w.tokens||0;return n==="Free"&&g.agent+g.background>=999999?{allowed:!1,reason:"Free Tier Daily Usage Limit Exceeded"}:h>=i?{allowed:!1,reason:f?`Daily Request Limit Reached for ${l}`:"Daily Agent Request Limit Reached"}:u>=m?{allowed:!1,reason:f?`Daily Token Budget Exhausted for ${l}`:"Daily Token Budget Exhausted"}:y>=d?{allowed:!1,reason:f?`Monthly Token Budget Exhausted for ${l}`:"Monthly Token Budget Exhausted"}:{allowed:!0}}if(s==="background"){let i=await x();if(n==="Free"&&i.agent+i.background>=999999)return{allowed:!1,reason:"Free Tier Background Limit Exceeded"};let m=i.background<(e.backgroundLimit||999999);return{allowed:m,reason:m?void 0:"Background Request Limit Exceeded"}}if(s==="search"){let m=(await x()).search<(e.searchLimit||100);return{allowed:m,reason:m?void 0:"Search Quota Exceeded"}}return{allowed:!0}},oe=async(s,t={})=>(await Et(s,t)).allowed,nt=s=>{if(!s||s.length===0)return[];let o=[...s].sort((e,a)=>e.timestamp-a.timestamp),n=[];for(let e of o){if(n.length>0){let a=n[n.length-1];if(e.timestamp>=a.start&&e.timestamp<a.end){a.calls.push(e),a.spent+=e.cost;continue}}n.push({start:e.timestamp,end:e.timestamp+36e5,calls:[e],spent:e.cost})}return n},kt=(s,t)=>{if(!s||s.length===0)return .025;let n=nt(s);if(n.length===0)return .025;let e=[];for(let m of n){let d=.025;if(e.length>0){let w=e[e.length-1],h=!1;if(e.length>=2){let u=e[e.length-2];w.ratio>=.8&&u.ratio>=.8&&(h=!0)}if(h)d=.015;else{let u=w.limit,y=w.ratio;y>=.8?d=u===.015?.015:u:y<.4?d=Math.min(.025,u+.005):y>=.4&&y<.6?d=Math.min(.025,u+.004):d=Math.min(.025,u+.002)}}let g=d>0?m.spent/d:0;e.push({limit:d,spent:m.spent,ratio:g})}let a=n[n.length-1];if(t<a.end)return e[e.length-1].limit;let r=e[e.length-1].limit,l=r,f=e[e.length-1].ratio,c=a.end,i=0;for(let m=e.length-1;m>=0&&e[m].ratio>=.8;m--)i++;for(;c<=t;){let m=.025;i>=2?m=.015:f>=.8?m=l===.015?.015:l:f<.4?m=Math.min(.025,l+.005):f>=.4&&f<.6?m=Math.min(.025,l+.004):m=Math.min(.025,l+.002),l=m,f=0,i=0,c+=36e5,r=m}return r},ne=async s=>{let t=s.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,e=await x();e.imageCalls||(e.imageCalls=[]);let a=Date.now(),r=nt(e.imageCalls),l=0;if(r.length>0){let c=r[r.length-1];a>=c.start&&a<c.end&&(l=c.spent)}let f=kt(e.imageCalls,a);return l+n<=f},ae=async()=>{let s=await x();s.imageCalls||(s.imageCalls=[]);let t=Date.now(),o=nt(s.imageCalls),n=[],e=0,a=0;if(o.length>0){let c=o[o.length-1];t>=c.start&&t<c.end&&(n=c.calls,e=c.spent,a=Math.max(0,Math.ceil((c.end-t)/(60*1e3))))}let r=kt(s.imageCalls,t),l=Math.max(0,r-e),f=e;return{totalSpent:e,remaining:l,activeCallsCount:n.length,nextResetMin:a,reclaimCost:f,limit:r}},ie=async s=>{let t=s.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,e=await x();e.imageCalls||(e.imageCalls=[]),e.imageCalls.push({timestamp:Date.now(),cost:n}),queueFlush()},re=async()=>{let s=new Date().toISOString().split("T")[0];p||(p=await B()),p.date!==s&&await x();let t=p.stats||{...M},o=p.history||{},n=new Set(Object.keys(o));n.add(s);let a=Array.from(n).sort().map(L=>{let R=L===s?t:o[L]||{},S={...M,...R},P=S.tokens||0,_=S.cachedTokens||0,H=S.candidateTokens||0,$=Math.max(0,P-H),N=Math.max(0,$-_),O=S.agent||0,b=S.background||0,A=S.search||0,wt=O+b+A,Y=S.toolSuccess||0,at=S.toolFailure||0,it=S.toolDenied||0,V=Y+at+it,Tt=V>0?(Y/V*100).toFixed(1):"100.0",rt=S.linesAdded||0,lt=S.linesRemoved||0,ct=Array.isArray(S.imageCalls)?S.imageCalls:[],St=ct.reduce((Dt,Lt)=>Dt+(Lt.cost||0),0);return{date:L,tokens:P,cachedTokens:_,candidateTokens:H,promptTokens:$,uncachedPromptTokens:N,agent:O,background:b,search:A,totalRequests:wt,toolSuccess:Y,toolFailure:at,toolDenied:it,totalTools:V,toolSuccessRate:parseFloat(Tt),linesAdded:rt,linesRemoved:lt,netLines:rt-lt,duration:S.duration||0,imageCallsCount:ct.length,imageCost:St,models:S.models||{},providerRequests:S.providerRequests||{}}}),r=await W().catch(()=>({})),l=r.quotas||{},f=r.apiTier||"Free",c=await pt().catch(()=>({tokens:0,agent:0})),i=null;l.resetMode==="Custom"&&(i=await yt(l.resetDay||1).catch(()=>({tokens:0})));let m=l.tokenLimit||0,d=l.monthlyTokenLimit||0,g=l.agentLimit||0,w=l.resetMode||"Daily",h=l.resetDay||1,u=l.providerBudgets||{},y=!!u.__useProvider,T=["Google","Anthropic","OpenAI","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama","InferX","SenseNova","AIHubMix","Poolside"];Object.keys(u).forEach(L=>{L!=="__useProvider"&&!T.includes(L)&&T.push(L)});let k=[];for(let L of T){let R=u[L];if(R&&(R.agentLimit||R.tokenLimit||R.monthlyTokenLimit)){let S=0,P=t.models?.[L]||{};for(let A in P)S+=P[A]?.tokens||0;let _=0,H=(l.resetMode==="Custom"?i?.models:c?.models)?.[L]||{};for(let A in H)_+=H[A]?.tokens||0;let $=t.providerRequests?.[L]||0,N=R.tokenLimit||0,O=R.monthlyTokenLimit||0,b=R.agentLimit||0;k.push({provider:L,dailyTokens:S,dailyTokenLimit:N,isDailyUnlimited:N>=9999999999999||N===0,monthlyTokens:_,monthlyTokenLimit:O,isMonthlyUnlimited:O>=9999999999999||O===0,dailyRequests:$,dailyAgentLimit:b,isRequestsUnlimited:b>=9999999||b===0})}}let q={apiTier:f,resetMode:w,resetDay:h,quotas:l,usingProviderBudgets:y&&k.length>0||k.length>0,providerBudgetsList:k,daily:{tokensUsed:t.tokens||0,tokenLimit:m,agentRequests:t.agent||0,agentLimit:g,isUnlimitedTokens:m>=9999999999999||m===0,isUnlimitedRequests:g>=9999999||g===0},monthly:{tokensUsed:(l.resetMode==="Custom"?i?.tokens:c?.tokens)||0,tokenLimit:d,isUnlimitedTokens:d>=9999999999999||d===0},providerBudgets:u};return{currentDate:s,todayStats:t,history:o,timeline:a,budget:q,runtimeSession:{...E}}};export{bt as a,At as b,Vt as c,Ft as d,Kt as e,ht as f,Zt as g,te as h,x as i,pt as j,ee as k,E as l,se as m,yt as n,Et as o,oe as p,nt as q,kt as r,ne as s,ae as t,ie as u,re as v};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as mr}from"./chunk-JS5ZIGFR.js";import{a as Bt}from"./chunk-56EJGQU3.js";import{a as mo}from"./chunk-7SFAWGE2.js";import{a as gr,c as hr}from"./chunk-U2NRX2PX.js";import{a as bi,g as pr}from"./chunk-VYTQ6J56.js";import{a as yr}from"./chunk-RZTZPIC5.js";import{c as pi,g as yi,h as fr,i as ur,m as xi}from"./chunk-53AFLLUU.js";import{a as $o}from"./chunk-FQBBOFNP.js";import{a as G}from"./chunk-Y5JU726N.js";import{b as hi}from"./chunk-KHCAQOSP.js";import{
|
|
1
|
+
import{a as mr}from"./chunk-JS5ZIGFR.js";import{a as Bt}from"./chunk-56EJGQU3.js";import{a as mo}from"./chunk-7SFAWGE2.js";import{a as gr,c as hr}from"./chunk-U2NRX2PX.js";import{a as bi,g as pr}from"./chunk-VYTQ6J56.js";import{a as yr}from"./chunk-RZTZPIC5.js";import{c as pi,g as yi,h as fr,i as ur,m as xi}from"./chunk-53AFLLUU.js";import{a as $o}from"./chunk-FQBBOFNP.js";import{a as G}from"./chunk-Y5JU726N.js";import{b as hi}from"./chunk-KHCAQOSP.js";import{e as ho,k as kt,m as gt,o as mi,p as dr}from"./chunk-X6YW3TVC.js";import{a as go}from"./chunk-KZTDLEUL.js";import{k as it,l as Lo,o as Z}from"./chunk-63V6P5DU.js";import{c as Tt,d as zn,e as cr}from"./chunk-L3W2X74K.js";import{a as An,b as lr,d as En,e as Oo,k as Fn,l as Po,m as ui,r as gi,w as fo,x as uo}from"./chunk-DSVLWYIT.js";import{GoogleGenAI as Os,ThinkingLevel as Ge,HarmBlockThreshold as vn,HarmCategory as _n}from"@google/genai";var xr=(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 --
|
|
@@ -548,7 +548,7 @@ ${xr(n,t)}
|
|
|
548
548
|
=== END SYSTEM PROMPT ===${e?`
|
|
549
549
|
|
|
550
550
|
-- current saved user memories --
|
|
551
|
-
${e}`:""}`.trim();var ts=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),ns=()=>import("./web_scrape-BHSQTMX4.js").then(e=>e.web_scrape),os=()=>import("./memory-M7ASUB6J.js").then(e=>e.memory),is=()=>import("./chat-MELTWDZ3.js").then(e=>e.chat),rs=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),ss=()=>import("./write_file-LSRYHZN6.js").then(e=>e.write_file),as=()=>import("./update_file-WBHNB4AY.js").then(e=>e.update_file),ls=()=>import("./exec_command-AB4DNQYP.js").then(e=>e.exec_command),cs=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Oi=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),ds=()=>import("./write_pdf-N2Q4Z3YP.js").then(e=>e.write_pdf),fs=()=>import("./write_docx-4Y43QJUV.js").then(e=>e.write_docx),Go=()=>import("./search_keyword-ARDEFVCK.js").then(e=>e.search_keyword),us=()=>import("./generate_image-GMYCWQ4R.js").then(e=>e.generate_image),Ho=()=>import("./saveSummary-UGNDVNI5.js").then(e=>e.saveSummary),wo=()=>import("./addMemScore-BCPTSMKD.js").then(e=>e.addMemScore),gs=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),jo=()=>import("./todo-GFMPH2JV.js").then(e=>e.todo),hs=()=>import("./invokeSync-AKLDZ6WL.js").then(e=>e.invokeSync),ua=()=>import("./invoke-UECYKKCJ.js").then(e=>e.invoke),ms=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ga=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),ps=()=>import("./emergency_rollback-6X27LZE4.js").then(e=>e.emergency_rollback),So=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),To=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),Vo=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),Ko=()=>import("./computer_action-NNJOTL7H.js").then(e=>e.computer_action),ys=()=>import("./click-AHOXSDH6.js").then(e=>e.click),xs=()=>import("./drag-SOCUV5Z7.js").then(e=>e.drag),bs=()=>import("./scroll-JDGCDDUB.js").then(e=>e.scroll),Pi=()=>import("./keyboard_typing-OGUSR6BH.js").then(e=>e.keyboard_typing),Li=()=>import("./key_press-A5PRGC7E.js").then(e=>e.key_press),$i=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),Yo=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),ha={web_search:ts,web_scrape:ns,memory:os,chat:is,view_file:rs,write_file:ss,update_file:as,exec_command:ls,read_folder:cs,write_pdf:ds,write_docx:fs,search_keyword:Go,generate_image:us,saveSummary:Ho,addMemScore:wo,file_map:gs,todo:jo,Todo:jo,goal:jo,Goal:jo,invokeSync:hs,invoke:ua,getProgress:ms,cancel:ga,awaitSubagent:So,answerSubagent:To,steerSubagent:Vo,computer_action:Ko,computer_use:Ko,ComputerAction:Ko,ComputerUse:Ko,click:ys,Click:ys,drag:xs,Drag:xs,scroll:bs,Scroll:bs,keyboard_typing:Pi,KeyboardTyping:Pi,keyboardtyping:Pi,key_press:Li,KeyPress:Li,keypress:Li,recapture_screen:$i,RecaptureScreen:$i,recapturescreen:$i,invoke_sync:hs,get_progress:ms,await_subagent:So,answer_subagent:To,steer_subagent:Vo,steer:Vo,Steer:Vo,ask:Oi,Ask:Oi,AskUser:Oi,WebSearch:ts,WebScrape:ns,ReadFile:rs,ReadFolder:cs,WriteFile:ss,PatchFile:as,WritePDF:ds,WriteDoc:fs,Run:ls,SearchKeyword:Go,CodeSearch:Go,code_search:Go,Memory:os,Chat:is,GenerateImage:us,saveSumary:Ho,SaveSummary:Ho,SaveSumary:Ho,add_mem_score:wo,AddMemScore:wo,addMemoryScore:wo,AddMemoryScore:wo,FileMap:gs,answer:To,Answer:To,AnswerSubagent:To,await:So,Await:So,AwaitSubagent:So,EmergencyRollback:ps,emergency_rollback:ps,find_file:Yo,findFile:Yo,FindFile:Yo,findfile:Yo},ko=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(y=>o.includes(y))||o==="ask",g=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(y=>o.includes(y));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(!g)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=ha[e];if(!h){let y=["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"],u={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"},m=o.replace(/[^a-z0-9]/g,""),r=u[m]||null;if(!r){let w=0,pe=v=>{let ie=new Set;for(let ee=0;ee<v.length-1;ee++)ie.add(v.slice(ee,ee+2));return ie},b=pe(m);for(let v of y){let ie=v.toLowerCase().replace(/[^a-z0-9]/g,"");if(m===ie){r=v;break}let ee=0;(ie.includes(m)||m.includes(ie))&&(ee+=.6);let te=pe(ie),I=0;for(let _e of b)te.has(_e)&&I++;let $e=2*I/(b.size+te.size||1);ee=Math.max(ee,$e),ee>w&&ee>=.35&&(w=ee,r=v)}}let f=r?` Do you mean '${r}'?`:"";return`ERROR: Action [${e}] not found in registry.${f}`}try{return await(await h())(n,t)}catch(y){let u=y instanceof Error?y.message:String(y);return`ERROR: Execution failed for [${e}]: ${u}`}};import V from"path";import ve from"fs";import ma from"gradient-string";var Ni=["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 ws=[{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"]}],Ao={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 zo=null;var Ss=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(zo||(zo=ws[Math.floor(Math.random()*ws.length)]),n={...zo,id:"Mystery"}):(zo=null,Ao[e]?n=Ao[e]:e==="GitHub"?n=Ao["GitHub Dark"]:e==="Transparent"?n=Ao["Transparent Dark"]:n=Ao.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan";return{...n,codeText:t}};var pa=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",ic=(e=2)=>{let n=pa();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},rc=(e="...",n="Loading...",t="Dark")=>{let i=Ni[Math.floor(Math.random()*Ni.length)],o=Ss(t),s=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let w=cr(lr,{})?.systemSettings?.customOpenAIBaseUrl;w&&(s=w)}catch{}let c=o.logoTextAnsi,a=o.logoBodyAnsi,g=o.logoMutedAnsi,h="\x1B[0m",y=[" \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 "],u=o.logoGradient||["#0077ff","#ff00ff"],m=ma(u).multiline(y.join(`
|
|
551
|
+
${e}`:""}`.trim();var ts=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),ns=()=>import("./web_scrape-BHSQTMX4.js").then(e=>e.web_scrape),os=()=>import("./memory-M7ASUB6J.js").then(e=>e.memory),is=()=>import("./chat-MELTWDZ3.js").then(e=>e.chat),rs=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),ss=()=>import("./write_file-AMAYRCUC.js").then(e=>e.write_file),as=()=>import("./update_file-VIY6KSMT.js").then(e=>e.update_file),ls=()=>import("./exec_command-AB4DNQYP.js").then(e=>e.exec_command),cs=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Oi=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),ds=()=>import("./write_pdf-N2Q4Z3YP.js").then(e=>e.write_pdf),fs=()=>import("./write_docx-4Y43QJUV.js").then(e=>e.write_docx),Go=()=>import("./search_keyword-ARDEFVCK.js").then(e=>e.search_keyword),us=()=>import("./generate_image-ZNBMY2PT.js").then(e=>e.generate_image),Ho=()=>import("./saveSummary-UGNDVNI5.js").then(e=>e.saveSummary),wo=()=>import("./addMemScore-BCPTSMKD.js").then(e=>e.addMemScore),gs=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),jo=()=>import("./todo-GFMPH2JV.js").then(e=>e.todo),hs=()=>import("./invokeSync-4A2ELLCQ.js").then(e=>e.invokeSync),ua=()=>import("./invoke-UH2WOJRR.js").then(e=>e.invoke),ms=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ga=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),ps=()=>import("./emergency_rollback-6X27LZE4.js").then(e=>e.emergency_rollback),So=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),To=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),Vo=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),Ko=()=>import("./computer_action-VMC545YJ.js").then(e=>e.computer_action),ys=()=>import("./click-PN3BLFOY.js").then(e=>e.click),xs=()=>import("./drag-NMHO3BAW.js").then(e=>e.drag),bs=()=>import("./scroll-OMBQDZHP.js").then(e=>e.scroll),Pi=()=>import("./keyboard_typing-VXT53PRV.js").then(e=>e.keyboard_typing),Li=()=>import("./key_press-RJIPXDAB.js").then(e=>e.key_press),$i=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),Yo=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),ha={web_search:ts,web_scrape:ns,memory:os,chat:is,view_file:rs,write_file:ss,update_file:as,exec_command:ls,read_folder:cs,write_pdf:ds,write_docx:fs,search_keyword:Go,generate_image:us,saveSummary:Ho,addMemScore:wo,file_map:gs,todo:jo,Todo:jo,goal:jo,Goal:jo,invokeSync:hs,invoke:ua,getProgress:ms,cancel:ga,awaitSubagent:So,answerSubagent:To,steerSubagent:Vo,computer_action:Ko,computer_use:Ko,ComputerAction:Ko,ComputerUse:Ko,click:ys,Click:ys,drag:xs,Drag:xs,scroll:bs,Scroll:bs,keyboard_typing:Pi,KeyboardTyping:Pi,keyboardtyping:Pi,key_press:Li,KeyPress:Li,keypress:Li,recapture_screen:$i,RecaptureScreen:$i,recapturescreen:$i,invoke_sync:hs,get_progress:ms,await_subagent:So,answer_subagent:To,steer_subagent:Vo,steer:Vo,Steer:Vo,ask:Oi,Ask:Oi,AskUser:Oi,WebSearch:ts,WebScrape:ns,ReadFile:rs,ReadFolder:cs,WriteFile:ss,PatchFile:as,WritePDF:ds,WriteDoc:fs,Run:ls,SearchKeyword:Go,CodeSearch:Go,code_search:Go,Memory:os,Chat:is,GenerateImage:us,saveSumary:Ho,SaveSummary:Ho,SaveSumary:Ho,add_mem_score:wo,AddMemScore:wo,addMemoryScore:wo,AddMemoryScore:wo,FileMap:gs,answer:To,Answer:To,AnswerSubagent:To,await:So,Await:So,AwaitSubagent:So,EmergencyRollback:ps,emergency_rollback:ps,find_file:Yo,findFile:Yo,FindFile:Yo,findfile:Yo},ko=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(y=>o.includes(y))||o==="ask",g=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(y=>o.includes(y));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(!g)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=ha[e];if(!h){let y=["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"],u={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"},m=o.replace(/[^a-z0-9]/g,""),r=u[m]||null;if(!r){let w=0,pe=v=>{let ie=new Set;for(let ee=0;ee<v.length-1;ee++)ie.add(v.slice(ee,ee+2));return ie},b=pe(m);for(let v of y){let ie=v.toLowerCase().replace(/[^a-z0-9]/g,"");if(m===ie){r=v;break}let ee=0;(ie.includes(m)||m.includes(ie))&&(ee+=.6);let te=pe(ie),I=0;for(let _e of b)te.has(_e)&&I++;let $e=2*I/(b.size+te.size||1);ee=Math.max(ee,$e),ee>w&&ee>=.35&&(w=ee,r=v)}}let f=r?` Do you mean '${r}'?`:"";return`ERROR: Action [${e}] not found in registry.${f}`}try{return await(await h())(n,t)}catch(y){let u=y instanceof Error?y.message:String(y);return`ERROR: Execution failed for [${e}]: ${u}`}};import V from"path";import ve from"fs";import ma from"gradient-string";var Ni=["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 ws=[{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"]}],Ao={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 zo=null;var Ss=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(zo||(zo=ws[Math.floor(Math.random()*ws.length)]),n={...zo,id:"Mystery"}):(zo=null,Ao[e]?n=Ao[e]:e==="GitHub"?n=Ao["GitHub Dark"]:e==="Transparent"?n=Ao["Transparent Dark"]:n=Ao.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan";return{...n,codeText:t}};var pa=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",ic=(e=2)=>{let n=pa();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},rc=(e="...",n="Loading...",t="Dark")=>{let i=Ni[Math.floor(Math.random()*Ni.length)],o=Ss(t),s=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let w=cr(lr,{})?.systemSettings?.customOpenAIBaseUrl;w&&(s=w)}catch{}let c=o.logoTextAnsi,a=o.logoBodyAnsi,g=o.logoMutedAnsi,h="\x1B[0m",y=[" \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 "],u=o.logoGradient||["#0077ff","#ff00ff"],m=ma(u).multiline(y.join(`
|
|
552
552
|
`)).split(`
|
|
553
553
|
`),r=f=>`${g}${f}${h}`;return`${m[0]}
|
|
554
554
|
${m[1]} ${c}Selected Provider: ${s}${h}
|
|
@@ -685,7 +685,7 @@ WARNING: CWD Changed from previous: "${eo}" to current: "${process.cwd()}", writ
|
|
|
685
685
|
`:""}${ln}
|
|
686
686
|
Action format: [action:ActionName(...)]
|
|
687
687
|
[/Metadata]
|
|
688
|
-
${Hn}${er}${oi}${Zi}[user prompt] ${Qi.trim()} [/user prompt]`.trim();let nr={role:"user",text:vo};Co&&(nr.binaryPart=Co),x.forEach(M=>{M.text&&M.role==="agent"&&(M.text=Wt(M.text))}),x.push(nr),Hn&&n[n.length-1]?.id&&(yield{type:"summary_injected",content:{id:n[n.length-1].id,text:vo}});let zt=null,xn=a==="Flux"?50:15;xn=a.toLowerCase().includes("cu")?75:xn;let Gs=Math.floor(xn/2),or=0,en=16;yield{type:"status",content:"Connecting"},ht=!1;let ii=[],_o=!1,ir=!1;for(let M=0;M<=xn;M++){let Ue=Math.floor(xn*.95);if(M>=Ue&&or<Ue&&typeof t?.onAskUser=="function"){or=Ue;try{let oe="Agent has been running for a long time. Do you want to continue execution?",ae=[{id:"continue",label:"Continue",description:"Add few more steps"},{id:"cancel",label:"Cancel",description:"Stop extending and finish current turn limit"}],B=await t.onAskUser(oe,ae);B&&(B.toLowerCase().includes("continue")||B==="Continue")&&(xn+=Gs)}catch{}}let cn=await mi("agent",t);if(!cn.allowed)throw new Error(cn.reason||`Budget Exhausted for Provider (${r||"Agent"})`);let qe=[];if(_o=!1,a==="ICU"||a==="FluxCU")try{yield{type:"status",content:"Capturing Screen"},await new Promise(B=>setTimeout(B,1e3));let{captureGriddedScreenshot:oe}=await import("./screen_grid-
|
|
688
|
+
${Hn}${er}${oi}${Zi}[user prompt] ${Qi.trim()} [/user prompt]`.trim();let nr={role:"user",text:vo};Co&&(nr.binaryPart=Co),x.forEach(M=>{M.text&&M.role==="agent"&&(M.text=Wt(M.text))}),x.push(nr),Hn&&n[n.length-1]?.id&&(yield{type:"summary_injected",content:{id:n[n.length-1].id,text:vo}});let zt=null,xn=a==="Flux"?50:15;xn=a.toLowerCase().includes("cu")?75:xn;let Gs=Math.floor(xn/2),or=0,en=16;yield{type:"status",content:"Connecting"},ht=!1;let ii=[],_o=!1,ir=!1;for(let M=0;M<=xn;M++){let Ue=Math.floor(xn*.95);if(M>=Ue&&or<Ue&&typeof t?.onAskUser=="function"){or=Ue;try{let oe="Agent has been running for a long time. Do you want to continue execution?",ae=[{id:"continue",label:"Continue",description:"Add few more steps"},{id:"cancel",label:"Cancel",description:"Stop extending and finish current turn limit"}],B=await t.onAskUser(oe,ae);B&&(B.toLowerCase().includes("continue")||B==="Continue")&&(xn+=Gs)}catch{}}let cn=await mi("agent",t);if(!cn.allowed)throw new Error(cn.reason||`Budget Exhausted for Provider (${r||"Agent"})`);let qe=[];if(_o=!1,a==="ICU"||a==="FluxCU")try{yield{type:"status",content:"Capturing Screen"},await new Promise(B=>setTimeout(B,1e3));let{captureGriddedScreenshot:oe}=await import("./screen_grid-PMTAQA3B.js"),ae=await oe();if(ae&&ae.base64){let B="[system] Fresh Gridded Screen Feedback Captured. Use numeric coordinates. Old screenshots will be removed when new screenshot is captured, summarize in text if context is needed later [/system]",It={inlineData:{mimeType:ae.mimeType,data:ae.base64}},bt=u?.imageHistoryCU||"Standard",wt=bt==="Low"?3:bt==="Extended"?10:bt==="Max"?999:5,Vt=x.filter(Pe=>Array.isArray(Pe.parts)&&Pe.parts.some(Mt=>Mt.inlineData));if(Vt.length>=wt){let Pe=Vt.length-wt+1;for(let Mt=0;Mt<Pe;Mt++){let St=Vt[Mt];Array.isArray(St.parts)&&(St.parts=St.parts.filter(yt=>!yt.inlineData))}}if(x.length>0&&x[x.length-1].role==="user"){let Pe=x[x.length-1];typeof Pe.text=="string"&&(Pe.text+=`
|
|
689
689
|
|
|
690
690
|
${B}`,Array.isArray(Pe.parts)||(Pe.parts=[{text:Pe.text}]),Pe.parts.push(It))}else x.push({role:"user",text:B,parts:[{text:B},It]})}}catch(oe){console.error("Vision screenshot capture error:",oe)}if(u?.compression===0&&(m?.tokens||0)>Rt&&(x=pr(x,6)),M>0?yield{type:"status",content:"Working"}:yield{type:"status",content:"Connecting"},ht){try{let{clearPendingNudges:oe}=await import("./subagent_state-LZCOZSUJ.js");oe()}catch{}yield{type:"status",content:"Request Cancelled"},yield{type:"text",content:`
|
|
691
691
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as z}from"./chunk-
|
|
2
|
-
`)){let i=s.split(" ");if(i.length<12||parseInt(i[0])!==5)continue;let o=i[2],f=i[3],a=i[4],h=parseInt(i[6]),g=parseInt(i[7]),w=parseInt(i[8]),M=parseInt(i[9]),c=parseFloat(i[10]),p=i.slice(11).join(" ").trim();if(!p||c<0)continue;let x={x0:h,y0:g,x1:h+w,y1:g+M},y={text:p,confidence:c,bbox:x};n.push(y);let d=`${o}_${f}_${a}`;e.has(d)||e.set(d,{words:[],bbox:{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}});let u=e.get(d);u.words.push(y),u.bbox.x0=Math.min(u.bbox.x0,x.x0),u.bbox.y0=Math.min(u.bbox.y0,x.y0),u.bbox.x1=Math.max(u.bbox.x1,x.x1),u.bbox.y1=Math.max(u.bbox.y1,x.y1)}let r=[];for(let s of e.values())s.words.length>0&&r.push({text:s.words.map(i=>i.text).join(" "),bbox:s.bbox,words:s.words});return{words:n,lines:r}}function Z(t){if(!(t.words&&t.words.length>0)){if(t.blocks&&t.blocks.length>0){t.words=[],t.lines=[];for(let n of t.blocks)for(let e of n.paragraphs||[])for(let r of e.lines||[]){r.bbox&&t.lines.push(r);for(let s of r.words||[])s.bbox&&t.words.push(s)}if(t.words.length>0)return}if(t.tsv){let n=V(t.tsv);t.words=n.words,t.lines=n.lines}}}function A(t,n,e=0,r=0,s=1){Z(t);let i=o=>({x0:Math.round(o.x0/s)+e,y0:Math.round(o.y0/s)+r,x1:Math.round(o.x1/s)+e,y1:Math.round(o.y1/s)+r}),l=[];if(t.lines&&t.lines.length>0)for(let o of t.lines){let f=o.text?o.text.toLowerCase().trim():"";if(!f||!o.bbox||!(f===n||new RegExp(`\\b${J(n)}\\b`,"i").test(f)))continue;let h=o.words||(t.words?t.words.filter(c=>c.bbox&&c.bbox.x0>=o.bbox.x0-5&&c.bbox.x1<=o.bbox.x1+5&&c.bbox.y0>=o.bbox.y0-5&&c.bbox.y1<=o.bbox.y1+5):[]),g=n.split(/\s+/),w=g.map(c=>c.replace(/[^a-z0-9]/g,"")).join(" "),M=!1;if(h.length>0)for(let c=0;c<=h.length-g.length;c++){let p=h.slice(c,c+g.length),x=p.map(y=>(y.text||"").toLowerCase().trim().replace(/[^a-z0-9]/g,"")).join(" ");if(x===w||x.includes(w)){let y={x0:Math.min(...p.map(d=>d.bbox.x0)),y0:Math.min(...p.map(d=>d.bbox.y0)),x1:Math.max(...p.map(d=>d.bbox.x1)),y1:Math.max(...p.map(d=>d.bbox.y1))};l.push(i(y)),M=!0}}M||l.push(i(o.bbox))}if(l.length===0&&t.words&&t.words.length>0)for(let o of t.words){let f=o.text?o.text.toLowerCase().trim().replace(/[^a-z0-9]/g,""):"",a=n.replace(/[^a-z0-9]/g,"");f===a&&o.bbox&&l.push(i(o.bbox))}if(l.length===0&&t.words&&t.words.length>0){let o=Q(n.length);for(let f of t.words){let a=f.text?f.text.toLowerCase().trim():"";a.length>=3&&Math.abs(a.length-n.length)<=o&&K(a,n,o)<=o&&f.bbox&&l.push(i(f.bbox))}}return l}function E(t,n){let e=null,r=1/0;for(let s of t){let i=Math.round((s.x0+s.x1)/2),l=Math.round((s.y0+s.y1)/2),o=n.x>=s.x0&&n.x<=s.x1&&n.y>=s.y0&&n.y<=s.y1,f=Math.hypot(i-n.x,l-n.y),a=o?0:f;a<r&&(r=a,e={x:i,y:l,dist:f,containsPoint:o,bbox:s})}return e}function X(t,n,e,r){let l=Math.ceil(t/4),o=Math.ceil(n/2),f=[];for(let a=0;a<2;a++)for(let h=0;h<4;h++){let g=h*l,w=a*o,M=Math.min(l,t-g),c=Math.min(o,n-w),p=g+M/2,x=w+c/2,y=e>=g&&e<g+M&&r>=w&&r<w+c;f.push({x0:g,y0:w,w:M,h:c,cx:p,cy:x,containsTarget:y})}return f.sort((a,h)=>{if(a.containsTarget)return-1;if(h.containsTarget)return 1;let g=Math.hypot(a.cx-e,a.cy-r),w=Math.hypot(h.cx-e,h.cy-r);return g-w})}var W=null;async function Y(){return W||(W=(async()=>{let{createWorker:t}=await import("tesseract.js"),n=await import("fs-extra"),{CU_CACHE_DIR:e}=await import("./paths-2EXHWUSL.js");return n.ensureDirSync(e),t("eng",1,{cachePath:e,logger:()=>{}})})().catch(t=>{throw W=null,t})),W}var O=null,N=null;async function tt(){let{getActiveDisplay:t}=await import("./screen_grid-
|
|
1
|
+
import{a as z}from"./chunk-KHJAWDBM.js";import{f as U}from"./chunk-H4KXMWYP.js";import{a as j}from"./chunk-Y5JU726N.js";import F from"screenshot-desktop";import I from"sharp";import G from"fs-extra";import H from"path";import"@nut-tree-fork/nut-js";async function P(t,n,e){if(!(!process.env.SHOW_DEBUG_GRID&&!process.env.DEBUG_OCR))try{let r=H.resolve(process.cwd(),"screenshots",t);await G.ensureDir(r),await G.writeFile(H.join(r,n),e)}catch{}}function J(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(t,n,e=1/0){if(t===n)return 0;if(t.length===0)return n.length;if(n.length===0)return t.length;if(Math.abs(t.length-n.length)>e)return e+1;let r=Array.from({length:n.length+1},(s,i)=>i);for(let s=1;s<=t.length;s++){let i=[s],l=s;for(let o=1;o<=n.length;o++){let f=t[s-1]===n[o-1]?0:1,a=Math.min(i[o-1]+1,r[o]+1,r[o-1]+f);i.push(a),a<l&&(l=a)}if(r=i,l>e)return e+1}return r[n.length]}function Q(t){return t<=4?0:t<=8?1:2}async function B(t,n=3){let e=await I(t).metadata();return I(t).resize(Math.round(e.width*n),Math.round(e.height*n),{kernel:"lanczos3"}).greyscale().normalise().toBuffer()}function V(t){if(!t)return{words:[],lines:[]};let n=[],e=new Map;for(let s of t.split(`
|
|
2
|
+
`)){let i=s.split(" ");if(i.length<12||parseInt(i[0])!==5)continue;let o=i[2],f=i[3],a=i[4],h=parseInt(i[6]),g=parseInt(i[7]),w=parseInt(i[8]),M=parseInt(i[9]),c=parseFloat(i[10]),p=i.slice(11).join(" ").trim();if(!p||c<0)continue;let x={x0:h,y0:g,x1:h+w,y1:g+M},y={text:p,confidence:c,bbox:x};n.push(y);let d=`${o}_${f}_${a}`;e.has(d)||e.set(d,{words:[],bbox:{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}});let u=e.get(d);u.words.push(y),u.bbox.x0=Math.min(u.bbox.x0,x.x0),u.bbox.y0=Math.min(u.bbox.y0,x.y0),u.bbox.x1=Math.max(u.bbox.x1,x.x1),u.bbox.y1=Math.max(u.bbox.y1,x.y1)}let r=[];for(let s of e.values())s.words.length>0&&r.push({text:s.words.map(i=>i.text).join(" "),bbox:s.bbox,words:s.words});return{words:n,lines:r}}function Z(t){if(!(t.words&&t.words.length>0)){if(t.blocks&&t.blocks.length>0){t.words=[],t.lines=[];for(let n of t.blocks)for(let e of n.paragraphs||[])for(let r of e.lines||[]){r.bbox&&t.lines.push(r);for(let s of r.words||[])s.bbox&&t.words.push(s)}if(t.words.length>0)return}if(t.tsv){let n=V(t.tsv);t.words=n.words,t.lines=n.lines}}}function A(t,n,e=0,r=0,s=1){Z(t);let i=o=>({x0:Math.round(o.x0/s)+e,y0:Math.round(o.y0/s)+r,x1:Math.round(o.x1/s)+e,y1:Math.round(o.y1/s)+r}),l=[];if(t.lines&&t.lines.length>0)for(let o of t.lines){let f=o.text?o.text.toLowerCase().trim():"";if(!f||!o.bbox||!(f===n||new RegExp(`\\b${J(n)}\\b`,"i").test(f)))continue;let h=o.words||(t.words?t.words.filter(c=>c.bbox&&c.bbox.x0>=o.bbox.x0-5&&c.bbox.x1<=o.bbox.x1+5&&c.bbox.y0>=o.bbox.y0-5&&c.bbox.y1<=o.bbox.y1+5):[]),g=n.split(/\s+/),w=g.map(c=>c.replace(/[^a-z0-9]/g,"")).join(" "),M=!1;if(h.length>0)for(let c=0;c<=h.length-g.length;c++){let p=h.slice(c,c+g.length),x=p.map(y=>(y.text||"").toLowerCase().trim().replace(/[^a-z0-9]/g,"")).join(" ");if(x===w||x.includes(w)){let y={x0:Math.min(...p.map(d=>d.bbox.x0)),y0:Math.min(...p.map(d=>d.bbox.y0)),x1:Math.max(...p.map(d=>d.bbox.x1)),y1:Math.max(...p.map(d=>d.bbox.y1))};l.push(i(y)),M=!0}}M||l.push(i(o.bbox))}if(l.length===0&&t.words&&t.words.length>0)for(let o of t.words){let f=o.text?o.text.toLowerCase().trim().replace(/[^a-z0-9]/g,""):"",a=n.replace(/[^a-z0-9]/g,"");f===a&&o.bbox&&l.push(i(o.bbox))}if(l.length===0&&t.words&&t.words.length>0){let o=Q(n.length);for(let f of t.words){let a=f.text?f.text.toLowerCase().trim():"";a.length>=3&&Math.abs(a.length-n.length)<=o&&K(a,n,o)<=o&&f.bbox&&l.push(i(f.bbox))}}return l}function E(t,n){let e=null,r=1/0;for(let s of t){let i=Math.round((s.x0+s.x1)/2),l=Math.round((s.y0+s.y1)/2),o=n.x>=s.x0&&n.x<=s.x1&&n.y>=s.y0&&n.y<=s.y1,f=Math.hypot(i-n.x,l-n.y),a=o?0:f;a<r&&(r=a,e={x:i,y:l,dist:f,containsPoint:o,bbox:s})}return e}function X(t,n,e,r){let l=Math.ceil(t/4),o=Math.ceil(n/2),f=[];for(let a=0;a<2;a++)for(let h=0;h<4;h++){let g=h*l,w=a*o,M=Math.min(l,t-g),c=Math.min(o,n-w),p=g+M/2,x=w+c/2,y=e>=g&&e<g+M&&r>=w&&r<w+c;f.push({x0:g,y0:w,w:M,h:c,cx:p,cy:x,containsTarget:y})}return f.sort((a,h)=>{if(a.containsTarget)return-1;if(h.containsTarget)return 1;let g=Math.hypot(a.cx-e,a.cy-r),w=Math.hypot(h.cx-e,h.cy-r);return g-w})}var W=null;async function Y(){return W||(W=(async()=>{let{createWorker:t}=await import("tesseract.js"),n=await import("fs-extra"),{CU_CACHE_DIR:e}=await import("./paths-2EXHWUSL.js");return n.ensureDirSync(e),t("eng",1,{cachePath:e,logger:()=>{}})})().catch(t=>{throw W=null,t})),W}var O=null,N=null;async function tt(){let{getActiveDisplay:t}=await import("./screen_grid-PMTAQA3B.js"),n=await t();if(O&&N===n)return O;N=n,O={format:"png"};try{let e=await F.listDisplays();e&&e.length>0&&(O={format:"png",screen:(e[n]||e[0]).id})}catch{}return O}var ut=async(t,n={})=>{let e=j(t),r=e.gridId||e.grid||e.coordinate||e.target||e.id,s=(e.type||e.clickType||"single").toLowerCase(),i=(e.button||"left").toLowerCase(),l=e.intendedClickText||e.text||"",o=e.ocrCorrection!==void 0?e.ocrCorrection===!0||e.ocrCorrection==="true":e.useOCR!==void 0?e.useOCR===!0||e.useOCR==="true":!0;if(!r&&!l)return'ERROR: Missing required "gridId" parameter for Click tool.';let f=r;if(o&&l)try{let h=r?U(r):null,g=await tt(),w=await F(g),M=await I(w).metadata(),c=M.width||1920,p=M.height||1080,x=h?{x:Math.round(h.x*(c/1280)),y:Math.round(h.y*(p/720))}:{x:c/2,y:p/2},y=l.toLowerCase().trim(),d=await Y(),u=null,$="",q=h?320:500;if(h){let _=Math.min(Math.round(c/2),c),k=Math.min(Math.round(p/2),p),b=Math.max(0,Math.min(c-_,x.x-Math.floor(_/2))),m=Math.max(0,Math.min(p-k,x.y-Math.floor(k/2))),T=await I(w).extract({left:b,top:m,width:_,height:k}).toBuffer(),D=2,R=await B(T,D),v=y.replace(/[^a-z0-9]/g,"_");await P("cropped",`crop_${Date.now()}_${v}.png`,R),await d.setParameters({tessedit_pageseg_mode:"11"});let{data:C}=await d.recognize(R,{},{tsv:!0,blocks:!0});if(C&&C.text){let L=A(C,y,b,m,D);if(L.length>0){let S=E(L,x);S&&(S.containsPoint||S.dist<=q)&&(u=S,$="centered target crop OCR")}}}if(!u){let _=await B(w,2),k=y.replace(/[^a-z0-9]/g,"_");await P("fullscreen",`full_${Date.now()}_${k}.png`,_),await d.setParameters({tessedit_pageseg_mode:"3"});let{data:b}=await d.recognize(_,{},{tsv:!0,blocks:!0});if(b&&b.text){let m=A(b,y,0,0,2);if(m.length>0){let T=E(m,x);T&&(u=T,$="full-screen OCR")}}}if(!u){let _=X(c,p,x.x,x.y),k=y.replace(/[^a-z0-9]/g,"_");await d.setParameters({tessedit_pageseg_mode:"11"});for(let b=0;b<_.length;b++){let m=_[b],T=await I(w).extract({left:m.x0,top:m.y0,width:m.w,height:m.h}).toBuffer(),D=await B(T,3);await P("tiles",`tile_${b+1}_${Date.now()}_${k}.png`,D);let{data:R}=await d.recognize(D,{},{tsv:!0,blocks:!0});if(!R||!R.text)continue;let v=A(R,y,m.x0,m.y0,3);if(v.length>0){let C=E(v,x);if(C){u=C,$=`tile ${b+1} OCR (${m.containsTarget?"target tile":`offset ${m.x0},${m.y0}`})`;break}}}}if(u){let _={x:Math.round(u.x*(1280/c)),y:Math.round(u.y*(720/p))};return`${await z("click",_,{button:i,clickType:s})} (${$} for "${l}" at ${Math.round(u.dist)}px distance)`}}catch{}return await z("click",f,{button:i,clickType:s})};export{ut as click};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,b as s}from"./chunk-
|
|
1
|
+
import{a as i,b as s}from"./chunk-KHJAWDBM.js";import"./chunk-H4KXMWYP.js";import{a as c}from"./chunk-Y5JU726N.js";var d=async(a,p={})=>{let e=c(a),r=e.action||e.type||e.cmd,n=e.target||e.grid||e.gridCode||e.location||e.input;if(!r)return'ERROR: Missing required "action" argument for computer_action (e.g. move, click, drag, scroll, type, key_press, key_combination).';let t=r.toLowerCase();if(t.startsWith("mouse_")||["move","click","drag","scroll"].includes(t)){let o=t.replace("mouse_","");return await i(o,n,{button:e.button,clickType:e.clickType||e.type,from:e.from,to:e.to,direction:e.direction,amount:e.amount?parseInt(e.amount,10):void 0})}if(t.startsWith("key_")||t==="type"||t==="press"){let o=t;t==="press"&&(o="key_press");let u=e.autoPressEnter===!0||e.autoPressEnter==="true"||e.enter===!0||e.enter==="true";return await s(o,n||e.text||e.keys,{...e,autoPressEnter:u})}return`ERROR: Unrecognized action "${r}". Supported actions: move, click, drag, scroll, type, key_press, key_combination.`};export{d as computer_action};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-KHJAWDBM.js";import"./chunk-H4KXMWYP.js";import{a as d}from"./chunk-Y5JU726N.js";var m=async(a,i={})=>{let r=d(a),o=r.fromGridId||r.from||r.start,t=r.toGridId||r.to||r.end;return!o||!t?'ERROR: Drag requires both "fromGridId" and "toGridId" parameters.':await e("drag",o,{from:o,to:t})};export{m as drag};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-FQBBOFNP.js";import{a as b}from"./chunk-Y5JU726N.js";import{
|
|
1
|
+
import{a as k}from"./chunk-FQBBOFNP.js";import{a as b}from"./chunk-Y5JU726N.js";import{s as B,t as T,u as $}from"./chunk-X6YW3TVC.js";import{a as I}from"./chunk-KZTDLEUL.js";import"./chunk-63V6P5DU.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-
|
|
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-P2QF3HPK.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-
|
|
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-P2QF3HPK.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-
|
|
2
|
-
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-
|
|
1
|
+
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-P2QF3HPK.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-P2QF3HPK.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{b as e}from"./chunk-
|
|
1
|
+
import{b as e}from"./chunk-KHJAWDBM.js";import"./chunk-H4KXMWYP.js";import{a as i}from"./chunk-Y5JU726N.js";var k=async(s,c={})=>{let t=i(s),a=t.key||t.keys||t.input||t.shortcut;if(!a)return'ERROR: Missing required "key" parameter for KeyPress tool.';let r=String(a).trim().toLowerCase();if(r==="clearinput"||r==="clear_input"||r==="clear")return await e("clear_input");if(r==="back"||r==="browser_back"||r==="browserBack")return await e("browser_back");if(r.includes(";")||r.includes("+")){let o=r.split(/[;+]/).map(n=>n.trim()).filter(Boolean);return await e("key_combination",o)}return await e("key_press",r)};export{k as key_press};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-KHJAWDBM.js";import"./chunk-H4KXMWYP.js";import{a as r}from"./chunk-Y5JU726N.js";var p=async(o,u={})=>{let t=r(o),e=t.text||t.input||t.value||"",s=t.autoPressEnter===!0||t.autoPressEnter==="true"||t.enter===!0||t.enter==="true";return e==null?'ERROR: Missing required "text" parameter for KeyboardTyping tool.':await n("type",String(e),{autoPressEnter:s})};export{p as keyboard_typing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-H4KXMWYP.js";export{a as GRID_CONFIG,e as captureGriddedScreenshot,d as getActiveDisplay,g as gridToNativeCoordinates,f as parseGridCodeTo720p,c as rawModelOnly,b as useModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-KHJAWDBM.js";import"./chunk-H4KXMWYP.js";import{a as t}from"./chunk-Y5JU726N.js";var m=async(n,i={})=>{let o=t(n),e=(o.direction||"down").toLowerCase(),c=o.amount?parseInt(o.amount,10):6,s=o.gridId||o.grid||o.coordinate||o.target||o.id||null;return await r("scroll",s,{direction:e,amount:c})};export{m as scroll};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-KZTDLEUL.js";import"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as h,h as m,i as R}from"./chunk-53AFLLUU.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-
|
|
1
|
+
import{g as h,h as m,i as R}from"./chunk-53AFLLUU.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-KZTDLEUL.js";import"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import c from"fs";import P from"path";var j=async(w,y={})=>{let n=$(w),t=n.path;if(!t)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:o,allowMultiple:E,error:p}=h(n);if(p)return`ERROR: ${p}`;if(o.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let M=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":E,i=P.resolve(process.cwd(),t);try{if(!c.existsSync(i))return`ERROR: File [${t}] does not exist. Use WriteFile instead.`;let e=y.forcedContent||c.readFileSync(i,"utf8");e.startsWith("\uFEFF")&&(e=e.slice(1));let s=e.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`),{content:u,results:l}=m(s,o,{allowMultiple:M}),a=l.filter(r=>!r.success),f=l.filter(r=>r.success);if(f.length===0)return`ERROR: Patch Failed to apply to [${t}].
|
|
4
4
|
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-X6YW3TVC.js";import"./chunk-KZTDLEUL.js";import"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{m as addToUsage,s as checkImageQuota,p as checkQuota,o as checkQuotaDetailed,d as forceFlushUsage,v as getAllUsageData,n as getCustomPeriodUsage,i as getDailyUsage,q as getImageQuotaBuckets,r as getImageQuotaLimit,t as getImageQuotaStats,j as getMonthlyUsage,g as getTimedUsage,k as incrementUsage,h as initUsage,c as invalidateCachedBaseUrl,f as purgeTimedUsage,u as recordImageGeneration,e as recordTimedUsage,l as runtimeSession,b as sendUsageFinalize,a as sendUsageHeartbeat};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-5MFIJRT6.js";import"./chunk-X6YW3TVC.js";import"./chunk-KZTDLEUL.js";import"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as S}from"./chunk-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import{a as R}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import{a as R}from"./chunk-KZTDLEUL.js";import"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";import r from"fs";import F from"path";var B=async(v,E={})=>{let{path:s,content:o}=y(v);if(!s)return'ERROR: Missing "path" argument for WriteFile.';if(o===void 0)return'ERROR: Missing "content" argument for WriteFile.';o=o.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let t=F.resolve(process.cwd(),s),m=F.dirname(t);try{await S.recordFileChange(t);let n="";if(r.existsSync(t))try{n=`Old File contents:
|
|
4
4
|
${r.readFileSync(t,"utf8").split(/\r?\n/).map((g,j)=>`${j+1} | ${g}`).join(`
|