feat(sessions): add daemon notification inbox protocol

This commit is contained in:
Federico Jaramillo Martinez
2026-07-19 01:28:45 +02:00
parent d77ca66f28
commit 6e09df8329
21 changed files with 2290 additions and 59 deletions
@@ -26,6 +26,16 @@ afterEach(() => {
});
describe("federated route contract", () => {
it("allowlists notification HTTP routes without adding a notification WebSocket", () => {
expect(FEDERATED_HTTP_ROUTES.filter((route) => route.path.includes("notifications"))).toEqual([
{ method: "GET", path: "/sessions/notifications" },
{ method: "GET", path: "/sessions/:sessionId/notifications" },
{ method: "POST", path: "/sessions/:sessionId/notifications/dismiss" },
{ method: "POST", path: "/sessions/:sessionId/notifications/dismiss-all" },
]);
expect(FEDERATED_WEBSOCKET_ROUTES.some((path) => path.includes("notifications"))).toBe(false);
});
it("covers machine-scoped client HTTP calls with remote proxy routes", async () => {
const fetchMock = vi.fn<FetchLike>(() => Promise.resolve(jsonResponse({})));
vi.stubGlobal("fetch", fetchMock);
@@ -104,7 +104,7 @@ export class SessionController {
if (event.type === "status.update") this.queueStatusUpdate(event.status);
else if (event.type === "activity.update") this.queueActivityUpdate(event.activity);
else if (event.type === "session.created") this.applyCreatedSession(event.session);
else this.applySessionName(event.sessionId, event.name);
else if (event.type === "session.name") this.applySessionName(event.sessionId, event.name);
}
dispose() {