fluxflow-cli 4.25.5 → 4.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -4
- package/dist/chunks/9router-J5GHSSMY.js +2 -0
- package/dist/chunks/ai-26X3QUNA.js +1 -0
- package/dist/chunks/aihubmix-ZANBMI5F.js +2 -0
- package/dist/chunks/apinex-MSG2QNBL.js +2 -0
- package/dist/chunks/{app-EIBVHMQV.js → app-HB46OKKI.js} +133 -133
- package/dist/chunks/{chunk-2AUIP6N5.js → chunk-37QHXCGM.js} +1 -1
- package/dist/chunks/chunk-HM3CMNOJ.js +1 -0
- package/dist/chunks/chunk-JS5ZIGFR.js +1 -0
- package/dist/chunks/chunk-NL4MAQSB.js +1 -0
- package/dist/chunks/chunk-PSAFKMCL.js +12 -0
- package/dist/chunks/{chunk-AF7LASZ3.js → chunk-QJBRY74K.js} +1 -1
- package/dist/chunks/{chunk-BM3FXMTK.js → chunk-QNUIT5G4.js} +1 -1
- package/dist/chunks/chunk-QWTKV7Q4.js +1 -0
- package/dist/chunks/chunk-QXN5B2BR.js +33 -0
- package/dist/chunks/chunk-Y5H7A7H3.js +882 -0
- package/dist/chunks/chunk-ZLWYMCCW.js +1 -0
- package/dist/chunks/{click-5I5YOSNC.js → click-BIP2KIKK.js} +2 -2
- package/dist/chunks/{computer_action-RTEC7VUX.js → computer_action-W532LBFE.js} +1 -1
- package/dist/chunks/deepseek-Y4NFGKGV.js +2 -0
- package/dist/chunks/{drag-6TRBT2C3.js → drag-XXDYAMBU.js} +1 -1
- package/dist/chunks/{exec_command-J23EG77W.js → exec_command-AB4DNQYP.js} +1 -1
- package/dist/chunks/explabs-4D3EJOBE.js +2 -0
- package/dist/chunks/{generate_image-4LIDEIYO.js → generate_image-DJ5N72HD.js} +1 -1
- package/dist/chunks/inferx-R7LOBSCS.js +3 -0
- package/dist/chunks/infron-6QUT2E5V.js +2 -0
- package/dist/chunks/{invoke-R75DZFQB.js → invoke-7BVHSLMJ.js} +2 -2
- package/dist/chunks/{invokeSync-JS3JUZLM.js → invokeSync-CJLYOYER.js} +2 -2
- package/dist/chunks/{key_press-Z3OXF74E.js → key_press-EJFHIVWP.js} +1 -1
- package/dist/chunks/{keyboard_typing-F2SAZLI2.js → keyboard_typing-4M63JGZ4.js} +1 -1
- package/dist/chunks/mistral-7PATNJTO.js +2 -0
- package/dist/chunks/{model_config-M24OEKJE.js → model_config-YD5AWI33.js} +1 -1
- package/dist/chunks/nvidia-FORTI2DZ.js +2 -0
- package/dist/chunks/ollama-ZPTZJK7V.js +2 -0
- package/dist/chunks/openrouter-M3ZZMDXU.js +2 -0
- package/dist/chunks/poolside-IS5XCHAE.js +2 -0
- package/dist/chunks/{screen_grid-RAKJUJQA.js → screen_grid-BK5KF7MP.js} +1 -1
- package/dist/chunks/{scroll-7JYRU34H.js → scroll-5V7P3DXY.js} +1 -1
- package/dist/chunks/search_keyword-7WJ4M737.js +6 -0
- package/dist/chunks/{secrets-LPVNWDTB.js → secrets-4GLUJF7A.js} +1 -1
- package/dist/chunks/sensenova-AJZGPQZ5.js +2 -0
- package/dist/chunks/{settings-KKYNW25D.js → settings-RB45GKVI.js} +1 -1
- package/dist/chunks/tokenharbor-3ZMTIJ2M.js +2 -0
- package/dist/chunks/{update_file-KNEQRJAG.js → update_file-FUWOJ4JN.js} +1 -1
- package/dist/chunks/{usage-VLICZGBC.js → usage-73HUG5FC.js} +1 -1
- package/dist/chunks/usageServer-NUJCWWP3.js +1 -0
- package/dist/chunks/{write_file-7X2GQFWK.js → write_file-HH7WRRDJ.js} +1 -1
- package/dist/cli.js +5 -5
- package/dist/model_config.json +7 -6
- package/dist/package.json +2 -2
- package/model_config.json +7 -6
- package/package.json +2 -2
- package/surprise.js +15 -1
- package/dist/chunks/ai-ZBSCEHTS.js +0 -1
- package/dist/chunks/chunk-3CZWTXIR.js +0 -1
- package/dist/chunks/chunk-4XXLWMY6.js +0 -9
- package/dist/chunks/chunk-GRQ7JZZP.js +0 -1
- package/dist/chunks/chunk-KA7IQD5D.js +0 -892
- package/dist/chunks/chunk-OSDQRSY6.js +0 -1
- package/dist/chunks/chunk-RTT7P5KS.js +0 -33
- package/dist/chunks/search_keyword-CSRQFPHQ.js +0 -6
- package/dist/chunks/usageServer-HY4ME2BW.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-DSVLWYIT.js";import d from"fs";import p from"path";import{fileURLToPath as M}from"url";var u={version:0,release:20260913,fallbacks:{janitor_default:"gemini-3.1-flash-lite",janitor_attempts_fallback:"gemma-4-26b-a4b-it",janitor_open_router:"google/gemma-4-26b-a4b-it:free",general_fallback:"gemini-3.1-flash-lite",deepseek_fast_fallback:"deepseek-v4-flash",deepseek_level_1:"deepseek-v4-flash",deepseek_level_2:"deepseek-v4-pro",mistral_janitor_fallback:"",mistral_level_1:"",nvidia_janitor_fallback:"mistralai/mistral-nemotron",nvidia_chat_summarizer_fallback:"nvidia/nemotron-3-super-120b-a12b",google_level_1:"gemini-3-flash-preview",google_level_2:"gemini-3.7-flash",gemma_emergency:"gemma-4-31b-it",gemma_janitor_fallback_google_openrouter:"google/gemma-4-26b-a4b-it:free",gemma_janitor_fallback_google:"gemma-4-26b-a4b-it",inferx_fallback:"",sensenova_fallback:"",crofai_fallback:"",aihubmix_fallback:"",poolside_fallback:"","9router_fallback":"",explabs_fallback:"",tokenharbor_fallback:""},providers:{}};var S=M(import.meta.url),y=p.dirname(S),g="",I=[p.join(y,"../../model_config.json"),p.join(y,"../model_config.json")];for(let e of I)try{if(d.existsSync(e)){g=e;break}}catch{}var _=p.join(m,"model_config.json"),a=null,v=()=>{if(g)try{let e=d.readFileSync(g,"utf-8"),s=JSON.parse(e);if(s&&typeof s=="object")return s}catch{}return u&&typeof u=="object"?JSON.parse(JSON.stringify(u)):{version:0,release:20260913,fallbacks:{},providers:{}}};if(d.existsSync(_))try{let e=d.readFileSync(_,"utf-8"),s=JSON.parse(e);if(s&&typeof s=="object"){let t=v();s.fallbacks={...t.fallbacks||{},...s.fallbacks||{}},s.providers||(s.providers={}),s.release||(s.release=t.release||20260913),a=s}}catch{}a||(a=v());var F=new Set,k=new Set,f=()=>{let e=new Set,s=new Set;if(a.providers)for(let t of Object.keys(a.providers)){let r=a.providers[t];if(r&&r.models){let o=["Free","Paid"];for(let l of o){let i=r.models[l];if(Array.isArray(i)){for(let n of i)if(n&&n.cmd){let b=n.cmd.trim().toLowerCase();n.multimodal===!0&&e.add(b),n.hasReasoning===!0&&s.add(b)}}}}}if(Array.isArray(a.multimodal_models))for(let t of a.multimodal_models)t&&typeof t=="string"&&e.add(t.trim().toLowerCase());F=e,k=s};f();var L=()=>a,c=()=>{try{return d.existsSync(m)||d.mkdirSync(m,{recursive:!0}),d.writeFileSync(_,JSON.stringify(a,null,2),"utf-8"),!0}catch{return!1}},$=(e,s,t=!1)=>{if(!e||!s)return{success:!1,reason:"Invalid provider or model ID"};let r=s.trim();if(!r)return{success:!1,reason:"Model ID cannot be empty"};a.providers||(a.providers={}),a.providers[e]||(a.providers[e]={default_free:"",default_paid:"",models:{Free:[],Paid:[]}});let o=a.providers[e];o.models||(o.models={Free:[],Paid:[]}),Array.isArray(o.models.Free)||(o.models.Free=[]);let l=o.models.Free.find(i=>(typeof i=="string"?i:i?.cmd)===r);if(!l)o.models.Free.push({cmd:r,multimodal:!!t,desc:r});else if(typeof l=="string"){let i=o.models.Free.indexOf(l);o.models.Free[i]={cmd:r,multimodal:!!t,desc:r}}else l.multimodal=!!t;return f(),c(),{success:!0}},N=(e,s,t=!0)=>{if(!e||!s)return{success:!1,reason:"Invalid provider or model ID"};let r=s.trim();if(!r)return{success:!1,reason:"Model ID cannot be empty"};let o=a.providers?.[e];if(!o||!o.models||!Array.isArray(o.models.Free))return{success:!1,reason:`Provider ${e} has no models configured`};let l=o.models.Free.find(i=>(typeof i=="string"?i:i?.cmd)===r);if(!l)return{success:!1,reason:`Model "${r}" not found in ${e} model list`};if(typeof l=="string"){let i=o.models.Free.indexOf(l);o.models.Free[i]={cmd:r,multimodal:!!t,desc:r}}else l.multimodal=!!t;return f(),c(),{success:!0}},J=(e,s,t=!1)=>{if(!e||!s)return{success:!1,reason:"Invalid provider or model ID"};let r=s.trim();if(!r)return{success:!1,reason:"Model ID cannot be empty"};a.providers||(a.providers={}),a.providers[e]||(a.providers[e]={default_free:"",default_paid:"",models:{Free:[],Paid:[]}});let o=a.providers[e];o.models||(o.models={Free:[],Paid:[]}),Array.isArray(o.models.Free)||(o.models.Free=[]);let l=o.models.Free.find(i=>(typeof i=="string"?i:i?.cmd)===r);if(!l)o.models.Free.push({cmd:r,multimodal:!!t,desc:r});else if(t)if(typeof l=="string"){let i=o.models.Free.indexOf(l);o.models.Free[i]={cmd:r,multimodal:!0,desc:r}}else l.multimodal=!0;return o.default_free=r,f(),c(),{success:!0}},R=(e,s)=>{if(!e||!s)return{success:!1,reason:"Invalid provider or model ID"};let t=s.trim();if(!t)return{success:!1,reason:"Model ID cannot be empty"};let r=a.providers?.[e];if(!r||!r.models||!Array.isArray(r.models.Free))return{success:!1,reason:`Provider ${e} has no models configured`};let o=r.models.Free.findIndex(l=>(typeof l=="string"?l:l?.cmd)===t);return o===-1?{success:!1,reason:`Model "${t}" not found in ${e} model list`}:(r.models.Free.splice(o,1),r.default_free===t&&(r.default_free=""),r.default_paid===t&&(r.default_paid=""),f(),c(),{success:!0})},T=(e,s,t)=>{if(!e||!s||!t)return{success:!1,reason:"Invalid provider or model IDs"};let r=s.trim(),o=t.trim();if(!r||!o)return{success:!1,reason:"Model IDs cannot be empty"};let l=a.providers?.[e];if(!l||!l.models||!Array.isArray(l.models.Free))return{success:!1,reason:`Provider ${e} has no models configured`};let i=l.models.Free.find(n=>(typeof n=="string"?n:n?.cmd)===r);if(!i)return{success:!1,reason:`Model "${r}" not found in ${e} model list`};if(typeof i=="string"){let n=l.models.Free.indexOf(i);l.models.Free[n]={cmd:o,multimodal:!1,desc:o}}else i.cmd=o,(i.desc===r||!i.desc)&&(i.desc=o);return f(),c(),{success:!0}},x=!1,P=e=>{x=!!e},E=P,U=e=>{if(!e)return!1;let s=e.trim().toLowerCase();return!!(x||F.has(s)||s.startsWith("gemini-")||s.startsWith("gemma-"))},W=e=>{if(!e)return!1;let s=e.trim().toLowerCase();return k.has(s)},z=(e,s)=>{let t=a.providers[e];return t?t.models[s==="Free"?"Free":"Paid"]||[]:[]},G=(e,s)=>{let t=a.providers[e];return t?s==="Free"?t.default_free:t.default_paid:""},K=e=>a.fallbacks[e];export{u as a,L as b,c,$ as d,N as e,J as f,R as g,T as h,P as i,E as j,U as k,W as l,z as m,G as n,K as o};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a as b,b as L}from"./chunk-U2NRX2PX.js";import{a as C}from"./chunk-Y5JU726N.js";import{spawn as A}from"child_process";var P=null;try{let f=await import("node-pty");P=f.default||f}catch{}var D=!!P,y=f=>typeof f!="string"?f:f.replace(/(?:\u001b][\s\S]*?(?:\u0007|\u001b\\))|(?:[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])/g,""),E=f=>{if(!f)return"";let p=[[]],n=0,o=0,w=/\x1b\[([0-9;]*?)([a-zA-Z])/g,g=0,h,d=a=>{for(let e=0;e<a.length;e++){let s=a[e];if(s===`
|
|
2
|
-
`)for(n++,o=0;n>=p.length;)p.push([]);else if(s==="\r")o=0;else{for(;n>=p.length;)p.push([]);let t=p[n];for(;o>t.length;)t.push(" ");t[o]=s,o++}}};for(;(h=w.exec(f))!==null;){d(f.substring(g,h.index));let a=h[1],e=h[2],s=a?a.split(";").map(Number):[];if(e==="A"){let t=s[0]||1;n=Math.max(0,n-t)}else if(e==="B"){let t=s[0]||1;for(n=n+t;n>=p.length;)p.push([])}else if(e==="C"){let t=s[0]||1;o=o+t}else if(e==="D"){let t=s[0]||1;o=Math.max(0,o-t)}else if(e==="G"){let t=(s[0]||1)-1;o=Math.max(0,t)}else if(e==="H"||e==="f"){let t=(s[0]||1)-1,r=(s[1]||1)-1;for(n=Math.max(0,t),o=Math.max(0,r);n>=p.length;)p.push([])}else if(e==="K"){let t=s[0]||0;if(n<p.length){let r=p[n];if(t===0)r.length=o;else if(t===1)for(let c=0;c<o&&c<r.length;c++)r[c]=" ";else t===2&&(r.length=0)}}else if(e==="J"){let t=s[0]||0;(t===2||t===3)&&(p.length=0,p.push([]),n=0,o=0)}g=w.lastIndex}d(f.substring(g));let O=p.map(a=>a.join(""));for(;O.length>0&&O[O.length-1]==="";)O.pop();return O.join(`
|
|
3
|
-
`)},x=null,k=!1,_=f=>{try{x&&(k&&typeof x.write=="function"?x.write(f):x.stdin&&x.stdin.writable&&x.stdin.write(f))}catch{}},F=()=>{if(x){try{k&&typeof x.destroy=="function"?x.destroy():typeof x.kill=="function"&&(process.platform==="win32"?A("taskkill",["/pid",x.pid,"/f","/t"]):x.kill("SIGKILL"))}catch{}x=null,k=!1}},T=(f,p=!1)=>{if(process.platform!=="win32")return f;let n=[],o="",w=null,g=!1;for(let e=0;e<f.length;e++){let s=f[e];if(g){o+=s,g=!1;continue}if(s==="\\"){if(f[e+1]===" "){o+=" ",e++;continue}o+=s,g=!0;continue}w?(s===w&&(w=null),o+=s):s==='"'||s==="'"?(w=s,o+=s):s===";"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push(p?";":"&")):s==="&"&&!o.includes("://")?f[e+1]==="&"?(o.length>0&&(n.push(o),o=""),n.push("&&"),e++):o.endsWith("2>")&&f[e+1]==="1"?(n.push("2>&1"),o="",e++):(o.length>0&&(n.push(o),o=""),n.push("&")):s==="|"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push("|")):/\s/.test(s)?o.length>0&&(n.push(o),o=""):o+=s}o.length>0&&n.push(o);let h=e=>!(!e.includes("/")||/^(https?|file|ftp):\/\//i.test(e)||e.startsWith("@")||e.startsWith("/")&&(e.match(/\//g)||[]).length===1||/\s\/|\/\s/.test(e)||/[\(\)\{\}\;\<\>\=\'\"]/.test(e)),d=[];for(let e=0;e<n.length;e++){let s=n[e];if(s==="mkdir"&&p&&b()){let t=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;c!=="-p"&&c!=="--parents"&&c!=="-v"&&c!=="--verbose"&&t.push(c),r++}if(t.length>0){let c=t.map(i=>{let u=i.replace(/^['"]|['"]$/g,""),l=i;return h(u)&&(l=i.replace(/\//g,"\\")),l});d.push("New-Item","-ItemType","Directory","-Force","-Path",c.join(","))}else d.push("New-Item","-ItemType","Directory","-Force");e=r-1;continue}if(s==="rm"&&p&&b()){let t=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-rf"||l==="-fr"?(r=!0,c=!0):l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:t.push(l),i++}let u=["Remove-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),t.length>0){let l=t.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});u.push("-Path",l.join(","))}d.push(...u),e=i-1;continue}if(s==="cp"&&p&&b()){let t=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:t.push(l),i++}let u=["Copy-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),t.length>0){let l=t.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});if(l.length>1){let m=l.pop();u.push("-Path",l.join(","),"-Destination",m)}else u.push("-Path",l[0])}d.push(...u),e=i-1;continue}if(s==="touch"&&p&&b()){let t=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;t.push(c),r++}if(t.length>0){let i=`(${t.map(u=>{let l=u.replace(/^['"]|['"]$/g,""),m=u;return h(l)&&(m=u.replace(/\//g,"\\")),m}).join(", ")}) | ForEach-Object { if (Test-Path $_) { (Get-Item $_).LastWriteTime = [System.DateTime]::Now } else { $null | Out-File -FilePath $_ } }`;d.push(i)}e=r-1;continue}if(s==="|"&&n[e+1]==="tee"){n[e+2]==="-a"?(d.push(">>"),e+=2):(d.push(">"),e+=1);continue}if(s==="|"&&n[e+1]==="cat"&&n[e+2]===">"){d.push(">"),e+=2;continue}if(s==="|"){let t=n[e+1];if(t){let r=t.replace(/^['"]|['"]$/g,""),c=/\.(txt|md|json|log|csv|html|css|py|js|xml|yaml|yml|pdf|docx|pptx|xlsx)$/i.test(r);if(h(r)&&c){d.push(">");continue}}}d.push(s)}let O=!1,a=d.map(e=>{if(e==="echo")return O=!0,e;[">",">>","<","&","&&","|","||",";"].includes(e)&&(O=!1);let t=/^['"]|['"]$/.test(e),r=e;O&&t&&(r=e.replace(/^['"]|['"]$/g,""));let c=/^['"]|['"]$/.test(r),i=r.replace(/^['"]|['"]$/g,"");h(i)&&(r=r.replace(/\//g,"\\"));let u=r.replace(/^['"]|['"]$/g,"");return u.includes(" ")&&!c&&(r=`"${u}"`),r});if(p){let e="",s=0;for(let t=0;t<a.length;t++){let r=a[t];r==="&&"?(e+="; if ($?) {",s++):r===";"?(e+=" }".repeat(s)+";",s=0):(e&&!e.endsWith(" ")&&!e.endsWith("{")&&(e+=" "),e+=r)}return e+=" }".repeat(s),e}return a.join(" ")},W=async(f,p={})=>{let{command:n}=C(f),{onChunk:o}=p;if(!n)return'ERROR: Missing "command" argument for Run.';let w=process.platform==="win32",g=p.systemSettings||{},h={};return g.networkAccess===!1&&(h.HTTP_PROXY="http://127.0.0.1:9999",h.HTTPS_PROXY="http://127.0.0.1:9999",h.ALL_PROXY="socks5://127.0.0.1:9999",h.http_proxy="http://127.0.0.1:9999",h.https_proxy="http://127.0.0.1:9999",h.all_proxy="socks5://127.0.0.1:9999",h.NO_PROXY="localhost,127.0.0.1"),new Promise(d=>{let O=a=>{let e=a==="pwsh"||a==="powershell",s=T(n,e),t;w?a==="pwsh"?t="pwsh.exe":a==="powershell"?t="powershell.exe":t="cmd.exe":t=process.env.SHELL||"bash";let r=w?e?["-NoProfile","-Command",s]:["/c",s]:["-c",s];if(g.networkAccess===!1&&!w){let c=t,i=[...r];if(process.platform==="linux")t="unshare",r=["-n","-r",c,...i];else if(process.platform==="darwin"){let u=`(version 1)
|
|
4
|
-
(allow default)
|
|
5
|
-
(deny network-outbound)
|
|
6
|
-
(allow network-outbound (remote ip "localhost:*"))
|
|
7
|
-
(allow network-outbound (remote ip "127.0.0.1:*"))
|
|
8
|
-
`;t="sandbox-exec",r=["-p",u,c,...i]}}if(P)try{let c=P.spawn(t,r,{name:"xterm-256color",cols:p.cols||120,rows:p.rows||30,cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...h}});x=c,k=!0;let i="",u=!1;return c.onData(l=>{if(!u){i+=l,o&&o(l);let m=y(i);/(?:Network:\s+use\s+--host\s+to|Network:\s+Type\s+--host\s+to|Local:\s+http:\/\/localhost:\d+|ready in \d+\s*ms|Compiled successfully|Development server is running|Listening on:)/i.test(m)&&(u=!0,setTimeout(()=>d(`Dev server started successfully in background.
|
|
9
|
-
|
|
10
|
-
${m}`),500))}}),c.onExit(({exitCode:l})=>{if(u)return;x=null;let m=E(i||""),R=y(m).replace(/\n{3,}/g,`
|
|
11
|
-
|
|
12
|
-
`)||"Command executed with no output.";d(l!==0?`ERROR: Command [${n}] failed with exit code [${l}].
|
|
13
|
-
|
|
14
|
-
${R}`:`Command [${n}] completed.
|
|
15
|
-
|
|
16
|
-
${R}`)}),!0}catch(c){return w&&(a==="pwsh"||a==="powershell")&&c.code==="ENOENT"?!1:(v(d,s,n,h,o,a,g),!0)}else return v(d,s,n,h,o,a,g),!0};if(w){let a=L();O(a)||(a==="pwsh"&&!O("powershell")||a==="powershell")&&O("cmd")}else O("bash")})},v=(f,p,n,o,w,g="powershell",h={})=>{let d=process.platform==="win32",O=g==="pwsh"||g==="powershell",a;d?g==="pwsh"?a="pwsh.exe":g==="powershell"?a="powershell.exe":a="cmd.exe":a=process.env.SHELL||"bash";let e=d?O?["-NoProfile","-Command",p]:["/c",p]:["-c",p];if(h.networkAccess===!1&&!d){let i=a,u=[...e];if(process.platform==="linux")a="unshare",e=["-n","-r",i,...u];else if(process.platform==="darwin"){let l=`(version 1)
|
|
17
|
-
(allow default)
|
|
18
|
-
(deny network-outbound)
|
|
19
|
-
(allow network-outbound (remote ip "localhost:*"))
|
|
20
|
-
(allow network-outbound (remote ip "127.0.0.1:*"))
|
|
21
|
-
`;a="sandbox-exec",e=["-p",l,i,...u]}}let s=d?A(a,e,{cwd:process.cwd(),env:{...process.env,...o}}):A(a,e,{cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...o}});x=s,k=!1,s.stdin&&s.stdin.on("error",()=>{x=null});let t="",r="",c=!1;s.stdout.on("data",i=>{if(!c){let u=i.toString();t+=u,w&&w(u);let l=y(t);/(?:Network:\s+use\s+--host\s+to|Network:\s+Type\s+--host\s+to|Local:\s+http:\/\/localhost:\d+|ready in \d+\s*ms|Compiled successfully|Development server is running|Listening on:)/i.test(l)&&(c=!0,setTimeout(()=>f(`Dev server started successfully in background.
|
|
22
|
-
|
|
23
|
-
${l}`),500))}}),s.stderr.on("data",i=>{if(!c){let u=i.toString();r+=u,w&&w(u)}}),s.on("close",i=>{if(c)return;x=null;let u=[],l=E(t),m=E(r);l&&u.push(`STDOUT:
|
|
24
|
-
${l}`),m&&u.push(`STDERR:
|
|
25
|
-
${m}`),i!==0&&u.push(`EXIT CODE: ${i}`);let R=u.join(`
|
|
26
|
-
|
|
27
|
-
`)||"Command executed with no output.",$=y(R).replace(/\n{3,}/g,`
|
|
28
|
-
|
|
29
|
-
`);f(i!==0?`ERROR: Command [${n}] failed with exit code [${i}].
|
|
30
|
-
|
|
31
|
-
${$}`:`Command [${n}] completed.
|
|
32
|
-
|
|
33
|
-
${$}`)}),s.on("error",i=>{if(d&&i.code==="ENOENT"){if(g==="pwsh"){let l=T(n,!0);return v(f,l,n,o,w,"powershell",h)}else if(g==="powershell"){let l=T(n,!1);return v(f,l,n,o,w,"cmd",h)}}x=null;let u=i instanceof Error?i.message:String(i);f(`ERROR: Failed to start command [${n}]: ${u}`)})};export{D as a,y as b,E as c,x as d,k as e,_ as f,F as g,T as h,W as i};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as V}from"./chunk-Y5JU726N.js";import{w as j,x as H}from"./chunk-DSVLWYIT.js";import K from"fs/promises";import z from"path";import Z from"fast-glob";import{Minimatch as q}from"minimatch";async function O(a,s,e=a,g=1){if(g>12)return[];let c=[],r;try{r=await K.readdir(a,{withFileTypes:!0})}catch{return[]}for(let t of r){let i=z.join(a,t.name),m=z.relative(e,i),F=m.split(z.sep).map($=>$.toLowerCase()),M=t.name.toLowerCase();if(!s.some($=>{let L=$.toLowerCase();return L.startsWith(".")&&M.endsWith(L)?!0:F.some(W=>W===L||W.startsWith(".pnpm"))}))if(t.isDirectory()){let $=await O(i,s,e,g+1);c=c.concat($)}else t.isFile()&&c.push({fullPath:i,relativePath:m})}return c}function Y(a,s,e=1/0){if(a===s)return 0;if(a.length===0)return s.length;if(s.length===0)return a.length;if(Math.abs(a.length-s.length)>e)return e+1;let g=Array.from({length:s.length+1},(c,r)=>r);for(let c=1;c<=a.length;c++){let r=[c],t=c;for(let i=1;i<=s.length;i++){let m=a[c-1]===s[i-1]?0:1,F=Math.min(r[i-1]+1,g[i]+1,g[i-1]+m);r.push(F),F<t&&(t=F)}if(g=r,t>e)return e+1}return g[s.length]}function tt(a,s){if(!a||!s)return!1;let e=a.toLowerCase(),g=s.toLowerCase();if(e.includes(g))return!0;let c=e.split(/[^a-z0-9]+/).filter(t=>t.length>0),r=g.split(/[^a-z0-9]+/).filter(t=>t.length>1||g.length===1&&t.length>0);return r.length===0?!1:r.every(t=>{let i=t.length<=2?0:t.length<=5?1:2;for(let m of c)if(m.includes(t)||t.length>=3&&m.length>=3&&Math.abs(m.length-t.length)<=i&&Y(t,m,i)<=i)return!0;return!1})}var at=async a=>{let{keyword:s,path:e,fuzzy:g,subString:c,regex:r}=V(a);if(s==null)return'ERROR: Missing "keyword" argument.';let t=String(s);if(e&&(e.trim().toLowerCase()==="#docs"||e.trim().toLowerCase()==="#doc"||e.trim().toLowerCase()==="#documentation"||e.trim().toLowerCase().includes("#skill/global/fluxflow"))||e.trim().toLowerCase().startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills.";let i=l=>l===!0||l==="true"||l===1||l==="1"||l==="yes",m=r===!1||r==="false"||r===0||r==="0"||r==="no",F=r===!0||r==="true"||r===1||r==="1"||r==="yes",M=i(g)||i(c),A=null,$=null;if(m)M||($=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{A=new RegExp(t,"i")}catch(l){if(F)return`ERROR: Invalid regex pattern "${t}": ${l.message}`}$=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let L=Array.from(new Set([...j,...H(process.cwd())])),W=150;try{let l=[],x=process.cwd(),h=null;if(e){let n=e.split(";").map(o=>o.trim()).filter(Boolean),w=n.some(o=>o.startsWith("!"));if(n.some(o=>Z.isDynamicPattern(o)||/[*?{}[\]()|+]/.test(o))){h="glob";let o=e.replace(/\\/g,"/"),E=n.map(u=>u.replace(/\\/g,"/")),f=L.map(u=>u.startsWith(".")?`**/*${u}`:`**/${u}/**`);if(w&&!n.some(u=>!u.startsWith("!"))){let u=await O(x,L,x),y=p=>p.endsWith("/")?p+"**":p,d=E.filter(p=>p.startsWith("!")).map(p=>y(p.slice(1))),C=E.filter(p=>!p.startsWith("!")).map(y);l=u.filter(p=>{let R=p.relativePath.replace(/\\/g,"/"),_=C.length===0||C.some(b=>{try{return new q(b).match(R)}catch{return!1}}),k=d.some(b=>{try{return new q(b).match(R)}catch{return!1}});return _&&!k})}else{let u=E.some(d=>/[\(\)\|]|\.\*/.test(d)),y=[];if(!u)try{y=await Z(E,{cwd:x,ignore:f,dot:!0,onlyFiles:!0,absolute:!1})}catch{y=[]}if(y.length===0&&(u||Z.isDynamicPattern(o))){let d=o.match(/^([^\*\?\(\)\|\[\]\s]+)\//),C=d&&!/[\*\?\(\)\|\[\]]/.test(d[1])?z.resolve(x,d[1]):x,p=await O(C,L,x);try{let R=o.replace(/^\.\//,"");R=R.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!R.startsWith("^")&&!R.startsWith(".*")&&(R=`.*${R}`);let _=new RegExp(R.endsWith("$")?R:`${R}$`,"i");l=p.filter(k=>{let b=k.relativePath.replace(/\\/g,"/");return _.test(b)})}catch{l=[]}}else l=y.map(d=>({fullPath:z.resolve(x,d),relativePath:d}))}}else{let o=[],E=!1,f=!1;for(let S of n){let u=S.replace(/[\/\\]+$/,""),y=z.resolve(x,u);try{let d=await K.stat(y);if(d.isDirectory()){f=!0;let C=await O(y,L,x);o.push(...C)}else if(d.isFile())E=!0,o.push({fullPath:y,relativePath:z.relative(x,y)});else return`ERROR: Path is neither a file nor a directory: ${S}`}catch{return`ERROR: Path not found: ${S}`}}l=o,E&&!f?h="file":h="dir"}}else l=await O(x,L);let J=l.map(async n=>{try{let w=await K.readFile(n.fullPath,"utf-8");if(w.includes("\0"))return[];let P=w.split(/\r?\n/),o=[];for(let f=0;f<P.length;f++)(M?P[f].toLowerCase().includes(t.toLowerCase())||tt(P[f],t):m?$&&$.test(P[f]):A&&A.test(P[f])||$&&$.test(P[f]))&&o.push({line:f+1,content:P[f].trim()});return o.length===0?null:{path:n.relativePath.replace(/\\/g,"/"),matches:o}}catch{return[]}}),Q=await Promise.all(J),v=[],D=0;for(let n of Q){if(!n||!n.matches)continue;if(D>=W)break;let w=W-D,P=n.matches.slice(0,w);v.push({path:n.path,matches:P}),D+=P.length}typeof global.gc=="function"&&global.gc();let G=M?"(fuzzy mode)":F?"(regex mode)":m?"(keyword mode)":"(standard mode)";if(v.length===0){let n=h==="file"?` in '${e}'`:h==="dir"||h==="glob"?` in '${e}'`:". Try to specify files",w=h==="dir"?"[DIR]":h==="glob"?"[GLOB]":"";return`${w}${w?" ":""}Found 0 matches of '${t}'${n}${G?` ${G}`:""}`}let N=G?` ${G}`:"",T=`${v.length} file${v.length===1?"":"s"}`,U=`${D} match${D===1?"":"es"}`,I;h==="file"?I=`Found ${U} of '${t}' in '${e}'${N}:`:h==="dir"||h==="glob"?I=`Found ${U} of '${t}' in '${e}' across ${T}${N}:`:I=`Found ${U} of '${t}' across ${T}${N}:`;let X=h==="dir"?"[DIR]":h==="glob"?"[GLOB]":"",B=`${X}${X?" ":""}${I}
|
|
2
|
-
|
|
3
|
-
`;for(let n of v){B+=`${n.path}
|
|
4
|
-
`;for(let w of n.matches)B+=` ${w.line}: ${w.content}
|
|
5
|
-
`;B+=`
|
|
6
|
-
`}return B.trimEnd()}catch(l){return`ERROR: ${l.message}`}};export{at as search_keyword};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-AF7LASZ3.js";import"./chunk-4XXLWMY6.js";import"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{b as openUsageDashboard,a as startUsageServer};
|