feat: implement PI core chat timeline
This commit is contained in:
@@ -60,6 +60,7 @@ export class PiSessionRegistry {
|
||||
private readonly createConversationStore: typeof createCodingConversationStore;
|
||||
private readonly records = new Map<string, RegistryRecord>();
|
||||
private readonly prepareFlights = new Map<string, Promise<RegistryRecord>>();
|
||||
private readonly stores = new Map<string, ReturnType<typeof createCodingConversationStore>>();
|
||||
|
||||
constructor(options: PiSessionRegistryOptions) {
|
||||
this.projectStore = options.projectStore;
|
||||
@@ -126,7 +127,11 @@ export class PiSessionRegistry {
|
||||
candidate.id === input.agentId && candidate.enabled && !candidate.archivedAt
|
||||
));
|
||||
if (!agent) throw new Error('Coding Agent does not exist');
|
||||
const store = this.createConversationStore(project.path);
|
||||
let store = this.stores.get(project.path);
|
||||
if (!store) {
|
||||
store = this.createConversationStore(project.path);
|
||||
this.stores.set(project.path, store);
|
||||
}
|
||||
const conversation = await store.get(input.conversationId);
|
||||
if (!conversation || conversation.agentId !== input.agentId) {
|
||||
throw new Error('Coding Conversation does not exist for the selected Agent');
|
||||
|
||||
Reference in New Issue
Block a user