fluxflow-cli 4.41.0 → 4.42.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-BN2T224B.js +1 -0
- package/dist/chunks/app-H54JNKMS.js +332 -0
- package/dist/chunks/{auto_completion-KOKDZVBJ.js → auto_completion-D6AQ4ZA3.js} +1 -1
- package/dist/chunks/{chat-E7KU2LZM.js → chat-BA72I6O3.js} +1 -1
- package/dist/chunks/{chunk-NEOXX2J6.js → chunk-NG2US66I.js} +200 -199
- package/dist/chunks/chunk-Z5D4VQSG.js +1 -0
- package/dist/chunks/{chunk-M46I73DX.js → chunk-ZYLACK6T.js} +26 -26
- package/dist/chunks/{invoke-44R4K62P.js → invoke-3KPWF6KF.js} +2 -2
- package/dist/chunks/{invokeSync-ZKNYPA5T.js → invokeSync-CTBUY6WD.js} +2 -2
- package/dist/chunks/{update_file-DG3QLIHE.js → update_file-JXUYSH2G.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/ai-BZA7TWT3.js +0 -1
- package/dist/chunks/app-TTT2UBEU.js +0 -331
- package/dist/chunks/chunk-WTMVNZDA.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O}from"./chunk-6EYQQ7GQ.js";import{c as u,d as p}from"./chunk-P5HBJA23.js";import{f as m,g as h,l as C,m as M,s as f}from"./chunk-26BQ45XP.js";import d from"fs-extra";import j from"path";import{nanoid as F}from"nanoid";var S=Promise.resolve(),T=t=>{let r=S.then(async()=>{try{return await t()}catch(e){throw console.error("Lock Operation Failed:",e),e}});return S=r.catch(()=>{}),r},B=(t,r="")=>{let e=n=>(n||"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();return t?.name&&!t.name.startsWith("Session")?e(t.name):t?.prompt?e(t.prompt):e(t?.name)||r},I=async()=>{await d.ensureDir(h);let t={};if(await d.pathExists(m))try{t=u(m,{})}catch{t={}}for(let r in t){let e=j.join(h,`${r}.json`);Object.defineProperty(t[r],"messages",{get:()=>{if(d.existsSync(e))try{return u(e,[])}catch{return[]}return[]},set:n=>{try{p(e,n)}catch{}},enumerable:!1,configurable:!0})}return t},G=async(t,r,e)=>T(async()=>{await d.ensureDir(h);let n=await I(),s=n[t],i=(e||[]).filter(a=>!a.isUpdateNotification&&(!a.isMeta||a.text&&a.text.includes("Request Cancelled"))),o=a=>{if(!a)return;let A=typeof a=="string"?a:a.text||a.content||"";if(!A||typeof A!="string")return;let g=A.replace(/\s*\n+\s*\[Prompted on:.*?\]/g,"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();if(!g)return;let N=g.split(/\s+/),E;return N.length>7?E=N.slice(0,7).join(" ")+"...":g.length>45?E=g.substring(0,45).trimEnd()+"...":E=g,E},c,y=i.filter(a=>a.role==="user"),l=y[0],w=y[y.length-1],x=o(w),D=o(l);s&&s.prompt?Math.random()<.3&&x?c=x:c=s.prompt:c=D||x;let H=r||(s?s.name:`Session ${t.slice(-6)}`),b=j.join(h,`${t}.json`);p(b,i),n[t]={name:H,prompt:c||void 0,updatedAt:Date.now()};let k={};for(let a in n)k[a]={name:n[a].name,prompt:n[a].prompt||void 0,updatedAt:n[a].updatedAt};p(m,k)}),J=async(t,r)=>T(async()=>{let e=await I();e[t]?(e[t].name=r,e[t].updatedAt=Date.now()):e[t]={name:r,updatedAt:Date.now()};let n={};for(let s in e)n[s]={name:e[s].name,prompt:e[s].prompt||void 0,updatedAt:e[s].updatedAt};p(m,n)}),L=async t=>T(async()=>{let r=await I();delete r[t];let e={};for(let o in r)e[o]={name:r[o].name,prompt:r[o].prompt||void 0,updatedAt:r[o].updatedAt};if(p(m,e),await d.pathExists(f))try{let o=u(f,[]);if(Array.isArray(o)){let c=o.filter(y=>Object.keys(y)[0]!==String(t));p(f,c)}}catch{}let n=u(C,{});n[t]&&(delete n[t],p(C,n));let s=u(M,{});s[t]&&(delete s[t],p(M,s)),await O.deleteChatBackups(t);let i=j.join(h,`${t}.json`);if(await d.pathExists(i))try{await d.remove(i)}catch{}return r}),Q=()=>`flow-${F(6)}`,W=async t=>{if(!t||t==="Never")return;let r=parseInt(t);if(isNaN(r))return;let e=await I(),n=Date.now(),s=r*24*60*60*1e3,i=0;for(let o in e){let c=e[o];c.updatedAt&&n-c.updatedAt>s&&(await L(o),i++)}return i},Y=(t,r=4)=>{if(t.length<=1)return t;let e=t[0],n=t.slice(1),s=r*2,i=n.slice(s);return[e,...i]};var q=async(t,r,e)=>T(async()=>{let n=u(f,[]);Array.isArray(n)||(n=[]);let s=r||0,i=e||0,o={total:s,context:i},c=n.findIndex(l=>Object.keys(l)[0]===String(t));s===0&&i===0?c!==-1&&n.splice(c,1):c!==-1?n[c]={[String(t)]:o}:n.push({[String(t)]:o});let y=n.filter(l=>{if(!l||typeof l!="object")return!1;let w=Object.keys(l)[0];if(!w)return!1;let x=l[w];return x&&((x.total||0)>0||(x.context||0)>0)});p(f,y)}),K=async t=>{try{if(!await d.pathExists(f))return{total:0,context:0};let r=u(f,[]);if(!Array.isArray(r))return{total:0,context:0};let e=r.find(n=>Object.keys(n)[0]===String(t));return e?{total:0,context:0,...e[String(t)]}:{total:0,context:0}}catch{return{total:0,context:0}}};export{B as a,I as b,G as c,J as d,L as e,Q as f,W as g,Y as h,q as i,K as j};
|