fluxflow-cli 4.36.5 → 4.37.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/cat.txt +3 -3
- package/dist/chunks/{9router-4EJCHCIO.js → 9router-CKETGMBB.js} +1 -1
- package/dist/chunks/{addMemScore-BCPTSMKD.js → addMemScore-76XLEW3K.js} +1 -1
- package/dist/chunks/{ai-ZW5X4EZL.js → ai-OQIVTNU2.js} +1 -1
- package/dist/chunks/{aihubmix-ZANBMI5F.js → aihubmix-YSGVPUM4.js} +1 -1
- package/dist/chunks/{apinex-MSG2QNBL.js → apinex-VI576FVJ.js} +1 -1
- package/dist/chunks/{app-KNIDIMIZ.js → app-SOKCZSBF.js} +152 -152
- package/dist/chunks/{chat-MELTWDZ3.js → chat-RLEHK3MX.js} +1 -1
- package/dist/chunks/{chunk-4MDSKJGX.js → chunk-2VV5ZE53.js} +1 -1
- package/dist/chunks/{chunk-FQBBOFNP.js → chunk-3JI2CRXK.js} +1 -1
- package/dist/chunks/chunk-5UEMARJ5.js +919 -0
- package/dist/chunks/{chunk-SZYN3VHU.js → chunk-BTMPM5BT.js} +1 -1
- package/dist/chunks/{chunk-QYNGDXPT.js → chunk-CBFC5KUU.js} +1 -1
- package/dist/chunks/{chunk-KHCAQOSP.js → chunk-ET66XVIM.js} +1 -1
- package/dist/chunks/{chunk-JS5ZIGFR.js → chunk-FAEB3V5R.js} +1 -1
- package/dist/chunks/chunk-FSE4BZZZ.js +1 -0
- package/dist/chunks/{chunk-VYTQ6J56.js → chunk-HOZQBBAO.js} +1 -1
- package/dist/chunks/{chunk-MTPBPPXV.js → chunk-JTTVSAKS.js} +1 -1
- package/dist/chunks/{chunk-OA7SWSBR.js → chunk-K4AZXTU6.js} +1 -1
- package/dist/chunks/{chunk-KAL5XSAQ.js → chunk-LTX2IUDV.js} +9 -10
- package/dist/chunks/chunk-M2ULCOL3.js +2 -0
- package/dist/chunks/chunk-MJL6DHQM.js +5 -0
- package/dist/chunks/{chunk-BGIZLZQF.js → chunk-PRTGV2R4.js} +1 -1
- package/dist/chunks/{chunk-7SFAWGE2.js → chunk-QOT4BYHM.js} +1 -1
- package/dist/chunks/{chunk-RZTZPIC5.js → chunk-T4ZG2WCV.js} +1 -1
- package/dist/chunks/click-B4ZRHV4Z.js +2 -0
- package/dist/chunks/{computer_action-WORDXIQY.js → computer_action-2RYMIFAM.js} +1 -1
- package/dist/chunks/{custom_openai-VP2CSZUQ.js → custom_openai-TLPPKENJ.js} +1 -1
- package/dist/chunks/{deepseek-Y4NFGKGV.js → deepseek-2GJCWFSR.js} +1 -1
- package/dist/chunks/{drag-LC3MFJZ7.js → drag-RNGTIO2V.js} +1 -1
- package/dist/chunks/{emergency_rollback-6X27LZE4.js → emergency_rollback-NXD2JKBG.js} +1 -1
- package/dist/chunks/{exec_command-ZPCKBWBK.js → exec_command-KLASTN6U.js} +1 -1
- package/dist/chunks/{explabs-4D3EJOBE.js → explabs-YICY4AMR.js} +1 -1
- package/dist/chunks/{export-QFE76VEG.js → export-C6VVIYP5.js} +1 -1
- package/dist/chunks/{file_map-KS6Y7BP3.js → file_map-T5FHB3F6.js} +1 -1
- package/dist/chunks/{find_file-A6NYLQJS.js → find_file-LZR7NET3.js} +1 -1
- package/dist/chunks/{generate_image-EKX5PUUR.js → generate_image-75IV5P3L.js} +1 -1
- package/dist/chunks/{inferx-R7LOBSCS.js → inferx-YMU7LMOQ.js} +1 -1
- package/dist/chunks/{infron-DMF34OSO.js → infron-A4BOV2AA.js} +1 -1
- package/dist/chunks/{invoke-M6VUQ6GW.js → invoke-IVSN6GNM.js} +2 -2
- package/dist/chunks/{invokeSync-MW7SR3Z4.js → invokeSync-LLGAN4ZS.js} +2 -2
- package/dist/chunks/{key_press-PDKXVENN.js → key_press-3VU6SHNQ.js} +1 -1
- package/dist/chunks/{keyboard_typing-UTFSDB4P.js → keyboard_typing-PCW3ISET.js} +1 -1
- package/dist/chunks/{memory-M7ASUB6J.js → memory-4DXO4K5C.js} +1 -1
- package/dist/chunks/{mistral-LNEFQAV5.js → mistral-2CZKHKDT.js} +1 -1
- package/dist/chunks/{model_config-55WPIUYV.js → model_config-VYWFV55M.js} +1 -1
- package/dist/chunks/{nvidia-GMX2ROSD.js → nvidia-EOLGFGFZ.js} +1 -1
- package/dist/chunks/{ollama-ZPTZJK7V.js → ollama-OHD5BFI7.js} +1 -1
- package/dist/chunks/{openrouter-T22AQJY6.js → openrouter-SK7LO52I.js} +1 -1
- package/dist/chunks/paths-EQFOJDZC.js +1 -0
- package/dist/chunks/{poolside-IS5XCHAE.js → poolside-SAAXTNGR.js} +1 -1
- package/dist/chunks/{saveSummary-UGNDVNI5.js → saveSummary-ZSJ2UKLG.js} +1 -1
- package/dist/chunks/screen_grid-Z2S4GMN5.js +1 -0
- package/dist/chunks/{scroll-UPGZCBPD.js → scroll-YSFTTROP.js} +1 -1
- package/dist/chunks/search_keyword-G3PCZR3C.js +8 -0
- package/dist/chunks/{secrets-UNXNDOLK.js → secrets-GHW6AWRR.js} +1 -1
- package/dist/chunks/{sensenova-AJZGPQZ5.js → sensenova-MQKZ7TNO.js} +1 -1
- package/dist/chunks/settings-5R5ADGXX.js +1 -0
- package/dist/chunks/{todo-GFMPH2JV.js → todo-KQCKHQBJ.js} +1 -1
- package/dist/chunks/{tokenharbor-3ZMTIJ2M.js → tokenharbor-A46BJ445.js} +1 -1
- package/dist/chunks/{ui_detector_onnx-YGGFMOK5.js → ui_detector_onnx-XRKXFWLG.js} +1 -1
- package/dist/chunks/{update_file-NBLTUYHL.js → update_file-OQMKLO6R.js} +1 -1
- package/dist/chunks/{usage-CAY5LYRU.js → usage-2WRVNL44.js} +1 -1
- package/dist/chunks/{usageServer-PJOHIWJT.js → usageServer-6XH36WK3.js} +1 -1
- package/dist/chunks/view_file-TZD6DAER.js +1 -0
- package/dist/chunks/{web_scrape-JO4DDXKB.js → web_scrape-KBKSNVBI.js} +1 -1
- package/dist/chunks/{web_search-2PFIJKIL.js → web_search-HACFAHXR.js} +1 -1
- package/dist/chunks/{write_docx-4Y43QJUV.js → write_docx-M5RMUI4W.js} +1 -1
- package/dist/chunks/{write_file-FZZRCU3L.js → write_file-2ZFCDYSW.js} +1 -1
- package/dist/chunks/{write_pdf-N2Q4Z3YP.js → write_pdf-E5HQYOTR.js} +1 -1
- package/dist/cli.js +8 -8
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-DSVLWYIT.js +0 -2
- package/dist/chunks/chunk-IS6NOF47.js +0 -5
- package/dist/chunks/chunk-LFDC5AM7.js +0 -916
- package/dist/chunks/chunk-QWEEC3PP.js +0 -1
- package/dist/chunks/click-PNIGPARB.js +0 -2
- package/dist/chunks/paths-2EXHWUSL.js +0 -1
- package/dist/chunks/screen_grid-PVVRYV5G.js +0 -1
- package/dist/chunks/search_keyword-ARDEFVCK.js +0 -6
- package/dist/chunks/settings-GLFTNEAT.js +0 -1
- package/dist/chunks/view_file-2THVIMD6.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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:"",activeModel:"",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:!1,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:""}},d=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},p=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(u){console.error(`Migration failed for ${i}:`,u)}}},D=async t=>{try{let e=await d();if(!e.systemSettings.useExternalData&&t.systemSettings?.useExternalData&&t.systemSettings?.externalDataPath&&await p(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-CAY5LYRU.js");i()}catch{}return!0}catch(e){return console.error("Failed to save settings:",e),!1}};export{d as a,D as b};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as z}from"./chunk-QYNGDXPT.js";import{f as U}from"./chunk-IS6NOF47.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-PVVRYV5G.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 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"./chunk-DSVLWYIT.js";export{q as ACTIVE_TX_FILE,n as BACKUPS_DIR,s as CONTEXT_FILE,u as CU_CACHE_DIR,c as DATA_DIR,w as DEFAULT_EXCLUDES,a as FLUXFLOW_DIR,g as HISTORY_DIR,f as HISTORY_FILE,p as LEDGER_ADVANCE_FILE,o as LEDGER_FILE,d as LOGS_DIR,k as MEMORIES_FILE,t as PARSER_DIR,r as PATHS_FILE,e as SECRET_DIR,b as SETTINGS_FILE,m as TEMP_MEM_CHAT_FILE,l as TEMP_MEM_FILE,v as THINKING_CONFIG_FILE,i as USAGE_FILE,h as USAGE_FILE_OLD,j as USAGE_FILE_TIMED,x as getGitignoreExcludes};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-IS6NOF47.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,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 k from"fast-glob";import{Minimatch as q}from"minimatch";async function b(a,n,s=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 l=z.join(a,t.name),d=z.relative(s,l),L=d.split(z.sep).map($=>$.toLowerCase()),O=t.name.toLowerCase();if(!n.some($=>{let E=$.toLowerCase();return E.startsWith(".")&&O.endsWith(E)?!0:L.some(W=>W===E||W.startsWith(".pnpm"))}))if(t.isDirectory()){let $=await b(l,n,s,g+1);c=c.concat($)}else t.isFile()&&c.push({fullPath:l,relativePath:d})}return c}function Y(a,n,s=1/0){if(a===n)return 0;if(a.length===0)return n.length;if(n.length===0)return a.length;if(Math.abs(a.length-n.length)>s)return s+1;let g=Array.from({length:n.length+1},(c,r)=>r);for(let c=1;c<=a.length;c++){let r=[c],t=c;for(let l=1;l<=n.length;l++){let d=a[c-1]===n[l-1]?0:1,L=Math.min(r[l-1]+1,g[l]+1,g[l-1]+d);r.push(L),L<t&&(t=L)}if(g=r,t>s)return s+1}return g[n.length]}function tt(a,n){if(!a||!n)return!1;let s=a.toLowerCase(),g=n.toLowerCase();if(s.includes(g))return!0;let c=s.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 l=t.length<=2?0:t.length<=5?1:2;for(let d of c)if(d.includes(t)||t.length>=3&&d.length>=3&&Math.abs(d.length-t.length)<=l&&Y(t,d,l)<=l)return!0;return!1})}var at=async a=>{let{keyword:n,path:s,fuzzy:g,subString:c,regex:r}=V(a);if(n==null)return'ERROR: Missing "keyword" argument.';let t=String(n);if(s){let e=s.trim().toLowerCase();if(e==="#docs"||e==="#doc"||e==="#documentation"||e.includes("#skill/global/fluxflow")||e.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let l=e=>e===!0||e==="true"||e===1||e==="1"||e==="yes",d=r===!1||r==="false"||r===0||r==="0"||r==="no",L=r===!0||r==="true"||r===1||r==="1"||r==="yes",O=l(g)||l(c),A=null,$=null;if(d)O||($=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{A=new RegExp(t,"i")}catch(e){if(L)return`ERROR: Invalid regex pattern "${t}": ${e.message}`}$=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let E=Array.from(new Set([...j,...H(process.cwd())])),W=150;try{let e=[],x=process.cwd(),h=null;if(s){let i=s.split(";").map(o=>o.trim()).filter(Boolean),w=i.some(o=>o.startsWith("!"));if(i.some(o=>k.isDynamicPattern(o)||/[*?{}[\]()|+]/.test(o))){h="glob";let o=s.replace(/\\/g,"/"),F=i.map(u=>u.replace(/\\/g,"/")),f=E.map(u=>u.startsWith(".")?`**/*${u}`:`**/${u}/**`);if(w&&!i.some(u=>!u.startsWith("!"))){let u=await b(x,E,x),y=p=>p.endsWith("/")?p+"**":p,m=F.filter(p=>p.startsWith("!")).map(p=>y(p.slice(1))),M=F.filter(p=>!p.startsWith("!")).map(y);e=u.filter(p=>{let R=p.relativePath.replace(/\\/g,"/"),_=M.length===0||M.some(S=>{try{return new q(S).match(R)}catch{return!1}}),Z=m.some(S=>{try{return new q(S).match(R)}catch{return!1}});return _&&!Z})}else{let u=F.some(m=>/[\(\)\|]|\.\*/.test(m)),y=[];if(!u)try{y=await k(F,{cwd:x,ignore:f,dot:!0,onlyFiles:!0,absolute:!1})}catch{y=[]}if(y.length===0&&(u||k.isDynamicPattern(o))){let m=o.match(/^([^\*\?\(\)\|\[\]\s]+)\//),M=m&&!/[\*\?\(\)\|\[\]]/.test(m[1])?z.resolve(x,m[1]):x,p=await b(M,E,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");e=p.filter(Z=>{let S=Z.relativePath.replace(/\\/g,"/");return _.test(S)})}catch{e=[]}}else e=y.map(m=>({fullPath:z.resolve(x,m),relativePath:m}))}}else{let o=[],F=!1,f=!1;for(let C of i){let u=C.replace(/[\/\\]+$/,""),y=z.resolve(x,u);try{let m=await K.stat(y);if(m.isDirectory()){f=!0;let M=await b(y,E,x);o.push(...M)}else if(m.isFile())F=!0,o.push({fullPath:y,relativePath:z.relative(x,y)});else return`ERROR: Path is neither a file nor a directory: ${C}`}catch{return`ERROR: Path not found: ${C}`}}e=o,F&&!f?h="file":h="dir"}}else e=await b(x,E);let J=e.map(async i=>{try{let w=await K.readFile(i.fullPath,"utf-8");if(w.includes("\0"))return[];let P=w.split(/\r?\n/),o=[];for(let f=0;f<P.length;f++)(O?P[f].toLowerCase().includes(t.toLowerCase())||tt(P[f],t):d?$&&$.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:i.relativePath.replace(/\\/g,"/"),matches:o}}catch{return[]}}),Q=await Promise.all(J),v=[],D=0;for(let i of Q){if(!i||!i.matches)continue;if(D>=W)break;let w=W-D,P=i.matches.slice(0,w);v.push({path:i.path,matches:P}),D+=P.length}typeof global.gc=="function"&&global.gc();let G=null;if(v.length===0){let i=h==="file"?` in '${s}'`:h==="dir"||h==="glob"?` in '${s}'`:". Try to specify files",w=h==="dir"?"[DIR]":h==="glob"?"[GLOB]":"";return`${w}${w?" ":""}Found 0 matches of '${t}'${i}${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 '${s}'${N}:`:h==="dir"||h==="glob"?I=`Found ${U} of '${t}' in '${s}' 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 i of v){B+=`${i.path}
|
|
4
|
-
`;for(let w of i.matches)B+=` ${w.line}: ${w.content}
|
|
5
|
-
`;B+=`
|
|
6
|
-
`}return B.trimEnd()}catch(e){return`ERROR: ${e.message}`}};export{at as search_keyword};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-QWEEC3PP.js";import"./chunk-BGIZLZQF.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-RZTZPIC5.js";import"./chunk-Y5JU726N.js";import"./chunk-DSVLWYIT.js";export{a as view_file};
|