feat: implement PI core chat timeline

This commit is contained in:
2026-08-24 00:34:03 +08:00
parent 54d8bb2e4a
commit 612135f911
40 changed files with 3881 additions and 119 deletions

View File

@@ -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');