feat: add Tower Log narrative event feed (Fixes #7)
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
Adds the tower_log DB table, a narrateEvent method on AgentService (Haiku-powered, stub-safe), a tower-log service that persists and broadcasts entries, a GET /api/tower-log REST endpoint, WebSocket bootstrap and real-time push, and a bottom-sheet Tower Log panel in the-matrix UI with fade-in animations and auto-scroll. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
lib/db/migrations/0010_tower_log.sql
Normal file
15
lib/db/migrations/0010_tower_log.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Migration: Tower Log narrative event feed (#7)
|
||||
-- Adds the tower_log table that stores prose narrative entries about
|
||||
-- Workshop activity, generated by Haiku on key events.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tower_log (
|
||||
id TEXT PRIMARY KEY,
|
||||
narrative TEXT NOT NULL,
|
||||
event_type TEXT NOT NULL,
|
||||
agent_id TEXT,
|
||||
job_id TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_tower_log_created_at
|
||||
ON tower_log(created_at DESC);
|
||||
@@ -14,3 +14,4 @@ export * from "./relay-accounts";
|
||||
export * from "./relay-event-queue";
|
||||
export * from "./job-debates";
|
||||
export * from "./session-messages";
|
||||
export * from "./tower-log";
|
||||
|
||||
10
lib/db/src/schema/tower-log.ts
Normal file
10
lib/db/src/schema/tower-log.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
||||
|
||||
export const towerLog = pgTable("tower_log", {
|
||||
id: text("id").primaryKey(),
|
||||
narrative: text("narrative").notNull(),
|
||||
eventType: text("event_type").notNull(),
|
||||
agentId: text("agent_id"),
|
||||
jobId: text("job_id"),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
});
|
||||
Reference in New Issue
Block a user