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,16 @@
import { afterEach, expect, it } from "vitest";
import { modelStorageKey, readSavedModel, saveModel } from "../src/model-storage.js";
import type { ModelConnectionInput } from "@agent-studio/shared";
afterEach(() => localStorage.clear());
const config = { providerId: "test", modelId: "test", apiKey: "test-secret" } as ModelConnectionInput;
it("never persists the API key", () => {
saveModel(config);
expect(localStorage.getItem(modelStorageKey)).not.toContain("test-secret");
expect(readSavedModel()?.apiKey).toBeUndefined();
expect(config.apiKey).toBe("test-secret");
});
it("removes keys from legacy saved configurations", () => {
localStorage.setItem(modelStorageKey, JSON.stringify(config));
expect(readSavedModel()?.apiKey).toBeUndefined();
expect(localStorage.getItem(modelStorageKey)).not.toContain("test-secret");
});