[claude] Context injection — pass conversation history to work model (#39) (#78)

This commit was merged in pull request #78.
This commit is contained in:
2026-03-23 01:51:22 +00:00
parent ef3e27d595
commit 4ea59f7198
6 changed files with 104 additions and 5 deletions

View File

@@ -13,3 +13,4 @@ export * from "./nostr-trust-vouches";
export * from "./relay-accounts";
export * from "./relay-event-queue";
export * from "./job-debates";
export * from "./session-messages";

View File

@@ -0,0 +1,18 @@
import { pgTable, text, timestamp, integer, serial } from "drizzle-orm/pg-core";
import { sessions } from "./sessions";
// ── session_messages ────────────────────────────────────────────────────────
// Stores conversation history for context injection into the work model.
export const sessionMessages = pgTable("session_messages", {
id: serial("id").primaryKey(),
sessionId: text("session_id")
.notNull()
.references(() => sessions.id),
role: text("role").$type<"user" | "assistant">().notNull(),
content: text("content").notNull(),
tokenCount: integer("token_count"),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
});
export type SessionMessage = typeof sessionMessages.$inferSelect;