feat: Add persistent chat sessions for iterative phase/task refinement
Introduces a chat loop where users send instructions to an agent that applies changes (create/update/delete phases, tasks, pages) and stays alive for follow-up messages. Includes schema + migration, repository layer, chat prompt, file-io action field extension, output handler chat mode, revert support for deletes, tRPC procedures, events, frontend slide-over UI with inline changeset display and revert, and docs.
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
DrizzleChangeSetRepository,
|
||||
DrizzleLogChunkRepository,
|
||||
DrizzleConversationRepository,
|
||||
DrizzleChatSessionRepository,
|
||||
} from './db/index.js';
|
||||
import type { InitiativeRepository } from './db/repositories/initiative-repository.js';
|
||||
import type { PhaseRepository } from './db/repositories/phase-repository.js';
|
||||
@@ -32,6 +33,7 @@ import type { AccountRepository } from './db/repositories/account-repository.js'
|
||||
import type { ChangeSetRepository } from './db/repositories/change-set-repository.js';
|
||||
import type { LogChunkRepository } from './db/repositories/log-chunk-repository.js';
|
||||
import type { ConversationRepository } from './db/repositories/conversation-repository.js';
|
||||
import type { ChatSessionRepository } from './db/repositories/chat-session-repository.js';
|
||||
import type { EventBus } from './events/index.js';
|
||||
import { createEventBus } from './events/index.js';
|
||||
import { ProcessManager, ProcessRegistry } from './process/index.js';
|
||||
@@ -56,7 +58,7 @@ import type { ServerContextDeps } from './server/index.js';
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* All 11 repository ports.
|
||||
* All 12 repository ports.
|
||||
*/
|
||||
export interface Repositories {
|
||||
initiativeRepository: InitiativeRepository;
|
||||
@@ -70,10 +72,11 @@ export interface Repositories {
|
||||
changeSetRepository: ChangeSetRepository;
|
||||
logChunkRepository: LogChunkRepository;
|
||||
conversationRepository: ConversationRepository;
|
||||
chatSessionRepository: ChatSessionRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create all 11 Drizzle repository adapters from a database instance.
|
||||
* Create all 12 Drizzle repository adapters from a database instance.
|
||||
* Reusable by both the production server and the test harness.
|
||||
*/
|
||||
export function createRepositories(db: DrizzleDatabase): Repositories {
|
||||
@@ -89,6 +92,7 @@ export function createRepositories(db: DrizzleDatabase): Repositories {
|
||||
changeSetRepository: new DrizzleChangeSetRepository(db),
|
||||
logChunkRepository: new DrizzleLogChunkRepository(db),
|
||||
conversationRepository: new DrizzleConversationRepository(db),
|
||||
chatSessionRepository: new DrizzleChatSessionRepository(db),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -171,6 +175,8 @@ export async function createContainer(options?: ContainerOptions): Promise<Conta
|
||||
repos.pageRepository,
|
||||
repos.logChunkRepository,
|
||||
options?.debug ?? false,
|
||||
undefined, // processManagerOverride
|
||||
repos.chatSessionRepository,
|
||||
);
|
||||
log.info('agent manager created');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user