Enhance Beryl Agent detail and report views

This commit is contained in:
Beryl
2026-09-11 11:13:24 +08:00
parent 336bf88466
commit 15f067fff9
57 changed files with 1833 additions and 95 deletions
@@ -0,0 +1,9 @@
import {expect,it} from "vitest";
import {monitorView} from "../src/monitor-view.js";
it("bounds model context and exposes counts and pagination",()=>{
const state={fatigueRows:Array.from({length:60},(_,i)=>({id:i,state:"observe",account:{id:"a"}})),rows:[{id:"campaign"}],error:"stale"};
const first=monitorView(state,{kind:"fatigue"});expect(first.rows).toHaveLength(25);expect(first.total).toBe(60);expect(first.nextOffset).toBe(25);expect(first.error).toBe("stale");
expect(monitorView(state,{kind:"fatigue",offset:50}).rows).toHaveLength(10);
expect(monitorView(state,{kind:"campaign"}).rows).toHaveLength(1);
expect(monitorView(state,{accountId:"b"}).total).toBe(0);
});