eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 858 B
JavaScript
import{sliceVisible,visibleLength}from"./terminal-text.js";function buildStatusLine(t){let{theme:n,width:r}=t,i=n.colors,a=t.logLevel===void 0?void 0:i.cyan(`logs: ${t.logLevel}`),o=t.model===void 0?void 0:i.dim(t.model),s=t.tokens===void 0?void 0:i.dim(t.tokens),c=t.vercel?.pendingDeploy?i.yellow(`/deploy pending`):void 0,l=t.vercel?.identity?.projectName,u=t.endpoint===void 0?void 0:t.endpoint.kind===`external`?i.dim(`External endpoint`):t.endpoint.connected?i.dim(l===void 0?`AI Gateway`:`AI Gateway (${l})`):i.yellow(`${n.glyph.warning} AI Gateway`),d=` ${i.dim(n.glyph.dot)} `,compose=e=>e.filter(e=>e!==void 0).join(d),f=[compose([a,o,s,u,c]),compose([a,o,s,c]),compose([a,s,c]),compose([a])];if(f[0].length!==0){for(let e of f)if(e.length>0&&visibleLength(e)<=r)return e;return sliceVisible(f.findLast(e=>e.length>0),r)}}export{buildStatusLine};