mirror of
https://github.com/samvallad33/vestige.git
synced 2026-04-25 00:36:22 +02:00
Hygiene release + two UI gap closures. Full CHANGELOG in CHANGELOG.md. Version bumps: - vestige-core: 2.0.6 -> 2.0.7 - vestige-mcp: 2.0.6 -> 2.0.7 - @vestige/dashboard: 2.0.6 -> 2.0.7 - @vestige/init: 2.0.6 -> 2.0.7 - vestige-mcp-server: 2.0.6 -> 2.0.7 Rebuild: pnpm --dir apps/dashboard run build regenerates apps/dashboard/build/** with the v2.0.7 asset hashes. Pre-release validation green: - cargo check --workspace: clean - cargo test -p vestige-core --lib: 366 passed - cargo test -p vestige-mcp --lib: 425 passed - pnpm run check (svelte-check): 580 files, 0 errors - cargo clippy on touched crates: -D warnings clean - 4-parallel-agent pre-merge audit passed (security, code quality, end-to-end flow, external verification). Two MEDIUM fixes landed in-branch before tag. The 12 feature/fix commits on chore/v2.0.7-clean are preserved via fast-forward merge so each logical change stays independently revertible on main.
1 line
1.9 KiB
JavaScript
1 line
1.9 KiB
JavaScript
import{d as c,w as v}from"./DAj0p1rI.js";const $=200;function S(){const{subscribe:t,set:o,update:e}=v({connected:!1,events:[],lastHeartbeat:null,error:null});let n=null,a=null,d=0;function m(i){const u=i||(window.location.port==="5173"?`ws://${window.location.hostname}:3927/ws`:`ws://${window.location.host}/ws`);if((n==null?void 0:n.readyState)!==WebSocket.OPEN)try{n=new WebSocket(u),n.onopen=()=>{d=0,e(r=>({...r,connected:!0,error:null}))},n.onmessage=r=>{try{const s=JSON.parse(r.data);e(f=>{if(s.type==="Heartbeat")return{...f,lastHeartbeat:s};const w=[s,...f.events].slice(0,$);return{...f,events:w}})}catch(s){console.warn("[vestige] Failed to parse WebSocket message:",s)}},n.onclose=()=>{e(r=>({...r,connected:!1})),b(u)},n.onerror=()=>{e(r=>({...r,error:"WebSocket connection failed"}))}}catch(r){e(s=>({...s,error:String(r)}))}}function b(i){a&&clearTimeout(a);const u=Math.min(1e3*2**d,3e4);d++,a=setTimeout(()=>m(i),u)}function p(){a&&clearTimeout(a),n==null||n.close(),n=null,o({connected:!1,events:[],lastHeartbeat:null,error:null})}function h(){e(i=>({...i,events:[]}))}return{subscribe:t,connect:m,disconnect:p,clearEvents:h}}const l=S(),y=c(l,t=>t.connected),g=c(l,t=>t.events);c(l,t=>t.lastHeartbeat);const k=c(l,t=>{var o,e;return((e=(o=t.lastHeartbeat)==null?void 0:o.data)==null?void 0:e.memory_count)??0}),M=c(l,t=>{var o,e;return((e=(o=t.lastHeartbeat)==null?void 0:o.data)==null?void 0:e.avg_retention)??0}),T=c(l,t=>{var o,e;return((e=(o=t.lastHeartbeat)==null?void 0:o.data)==null?void 0:e.suppressed_count)??0}),W=c(l,t=>{var o,e;return((e=(o=t.lastHeartbeat)==null?void 0:o.data)==null?void 0:e.uptime_secs)??0});function _(t){if(!Number.isFinite(t)||t<0)return"—";const o=Math.floor(t/86400),e=Math.floor(t%86400/3600),n=Math.floor(t%3600/60),a=Math.floor(t%60);return o>0?e>0?`${o}d ${e}h`:`${o}d`:e>0?n>0?`${e}h ${n}m`:`${e}h`:n>0?a>0?`${n}m ${a}s`:`${n}m`:`${a}s`}export{M as a,g as e,_ as f,y as i,k as m,T as s,W as u,l as w};
|