Changelog, dev startup, README, AgentHub 0.4.0, model catalog, and landing site (#7)
Branch-length batch covering tooling, the model layer, the Web App and the public surfaces. Highlights: - Changelog: a per-release `changelog/<version>/` tree, grouped by the surface each change touches, with a root CHANGELOG.md holding one line per release. - Dev startup: `scripts/dev-prebuild.mjs` serializes the skills+core prebuild behind a lock and keeps `pnpm install` current; `pnpm dev` runs server+web together. - AgentHub 0.3.3 -> 0.4.0: OmniMessage complete payloads carry one opaque `fidelity` object in place of item-level `signature`/`phase`, threaded verbatim through Trace, replay and resume; malformed classification adapted to the new error types. - Model layer: a model is always referenced by an explicit `(provider, model_id)` pair. The provider is never inferred, guessed or defaulted -- both the catalog inference and the unique-match config resolution are gone, and CLI, SDK, server routes and run_subagent all require the complete pair. Catalog gains the Qwen Token Plan, Qwen Pay-As-You-Go and Fireworks AI gateways, plus an expanded OpenRouter group. - Web App: catalog preset sync and per-group speed test on the Models page, positional slash commands, a markdown renderer, skill-library update reminders, and a vertically centred draft page whose upward menus size themselves to the room available. - Public surfaces: restructured READMEs, the penguin.ooo landing site and blog, refreshed benchmark results for both suites, and the demo videos playing on the landing page. Includes the fixes from a full review of the branch: 23 confirmed findings, among them a provider-inference bug that could send one vendor's API key to another vendor's endpoint, and an Escape handler that destroyed the composer's contents unrecoverably. Verified on the branch head: pnpm test (1127 passing, 7 packages), pnpm typecheck and pnpm format:check clean, Playwright e2e 14/14.
This commit is contained in:
@@ -122,6 +122,7 @@ describe("files/stat route (batch existence check)", () => {
|
||||
let owner: ReturnType<typeof apiClient>;
|
||||
let outsider: ReturnType<typeof apiClient>;
|
||||
let sessionId: string;
|
||||
let workspace: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
t = await createTestApp();
|
||||
@@ -141,6 +142,7 @@ describe("files/stat route (batch existence check)", () => {
|
||||
await owner.post(`/api/projects/${projectId}/agents/default_agent/sessions`, {})
|
||||
).json()) as SessionCreateResponse;
|
||||
sessionId = sess.session.sessionId;
|
||||
workspace = sess.session.workspace;
|
||||
await fs.mkdir(path.join(sess.session.workspace, "sub"));
|
||||
await fs.writeFile(path.join(sess.session.workspace, "a.txt"), "A");
|
||||
await fs.writeFile(path.join(sess.session.workspace, "sub", "b.md"), "B");
|
||||
@@ -149,6 +151,35 @@ describe("files/stat route (batch existence check)", () => {
|
||||
await t.cleanup();
|
||||
});
|
||||
|
||||
it("files/content on html: inline stays text/plain; preview=1 keeps text/html under a CSP sandbox; download keeps the real type with no CSP", async () => {
|
||||
await fs.writeFile(path.join(workspace, "page.html"), "<!doctype html><script>1</script>");
|
||||
const url = `/api/sessions/${sessionId}/files/content?path=page.html`;
|
||||
|
||||
const inline = await owner.get(url);
|
||||
expect(inline.status).toBe(200);
|
||||
expect(inline.headers.get("content-type")).toContain("text/plain");
|
||||
expect(inline.headers.get("content-security-policy")).toBeNull();
|
||||
|
||||
const preview = await owner.get(`${url}&preview=1`);
|
||||
expect(preview.status).toBe(200);
|
||||
expect(preview.headers.get("content-type")).toContain("text/html");
|
||||
const csp = preview.headers.get("content-security-policy") ?? "";
|
||||
expect(csp).toContain("sandbox");
|
||||
expect(csp).not.toContain("allow-same-origin");
|
||||
expect(preview.headers.get("content-disposition")).toContain("inline");
|
||||
|
||||
// download wins over preview: attachment + real type, no CSP needed.
|
||||
const download = await owner.get(`${url}&download=1&preview=1`);
|
||||
expect(download.headers.get("content-type")).toContain("text/html");
|
||||
expect(download.headers.get("content-disposition")).toContain("attachment");
|
||||
expect(download.headers.get("content-security-policy")).toBeNull();
|
||||
|
||||
// Non-scriptable files are unaffected by preview.
|
||||
const txt = await owner.get(`/api/sessions/${sessionId}/files/content?path=a.txt&preview=1`);
|
||||
expect(txt.headers.get("content-type")).toContain("text/plain");
|
||||
expect(txt.headers.get("content-security-policy")).toBeNull();
|
||||
});
|
||||
|
||||
it("existing files return in order, deduplicated; missing / directory / out-of-bounds all count as nonexistent, always 200", async () => {
|
||||
const res = await owner.post(`/api/sessions/${sessionId}/files/stat`, {
|
||||
paths: ["sub/b.md", "a.txt", "sub/b.md", "nope.txt", "sub", "../escape.txt", "/etc/passwd"],
|
||||
|
||||
Reference in New Issue
Block a user