merge: integrate upstream main with local Makelore changes
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
type CodingConversationV2,
|
||||
} from './conversation-store';
|
||||
import {
|
||||
acknowledgeLegacyConversationNotice,
|
||||
isCanonicalCodingProjectId,
|
||||
normalizeCodingProjectConfigV2,
|
||||
normalizeProjectIdentityChoice,
|
||||
@@ -16,10 +15,6 @@ import {
|
||||
writeCodingProjectConfigV2,
|
||||
type CodingProjectConfigV2,
|
||||
} from './project-config';
|
||||
import {
|
||||
migrateCodingProjectToV2,
|
||||
type CodingProjectMigrationDependencies,
|
||||
} from './migration';
|
||||
import {
|
||||
createLocalCodingProject,
|
||||
normalizeCodingProjectPath,
|
||||
@@ -79,7 +74,6 @@ export interface CodingProjectServiceOptions {
|
||||
): Promise<void> | void;
|
||||
createConversationStore?: typeof createCodingConversationStore;
|
||||
writeConfig?: typeof writeCodingProjectConfigV2;
|
||||
migration?: CodingProjectMigrationDependencies;
|
||||
}
|
||||
|
||||
function requiredAbsolutePath(value: string | undefined, label: string): string {
|
||||
@@ -147,7 +141,6 @@ export class CodingProjectService {
|
||||
ReturnType<typeof createCodingConversationStore>
|
||||
>();
|
||||
private activeTransitionTail = Promise.resolve();
|
||||
private readonly migrationFlights = new Map<string, Promise<CodingProjectConfigV2>>();
|
||||
private readonly identityTransitionTails = new Map<string, Promise<void>>();
|
||||
|
||||
constructor(
|
||||
@@ -508,16 +501,6 @@ export class CodingProjectService {
|
||||
return await this.listKnowledgeFiles(project.path);
|
||||
}
|
||||
|
||||
async acknowledgeLegacyConversationNotice(projectId: string): Promise<CodingProjectConfigSnapshot> {
|
||||
const project = await this.getProject(projectId);
|
||||
const config = await acknowledgeLegacyConversationNotice(project.path);
|
||||
return {
|
||||
project,
|
||||
config,
|
||||
knowledgeFiles: await this.listKnowledgeFiles(project.path),
|
||||
};
|
||||
}
|
||||
|
||||
conversationStore(projectPath: string): ReturnType<typeof createCodingConversationStore> {
|
||||
const existing = this.conversationStores.get(projectPath);
|
||||
if (existing) return existing;
|
||||
@@ -569,19 +552,7 @@ export class CodingProjectService {
|
||||
|
||||
private async readCurrentConfig(projectPath: string): Promise<CodingProjectConfigV2 | null> {
|
||||
const current = await readCodingProjectConfigV2(projectPath);
|
||||
if (current.status === 'valid') return current.config;
|
||||
if (current.status !== 'invalid' || !this.options.migration) return null;
|
||||
const existing = this.migrationFlights.get(projectPath);
|
||||
if (existing) return await existing;
|
||||
const flight = migrateCodingProjectToV2(projectPath, this.options.migration)
|
||||
.then((result) => result.config)
|
||||
.finally(() => {
|
||||
if (this.migrationFlights.get(projectPath) === flight) {
|
||||
this.migrationFlights.delete(projectPath);
|
||||
}
|
||||
});
|
||||
this.migrationFlights.set(projectPath, flight);
|
||||
return await flight;
|
||||
return current.status === 'valid' ? current.config : null;
|
||||
}
|
||||
|
||||
private transitionActiveProject<T>(operation: () => Promise<{
|
||||
|
||||
Reference in New Issue
Block a user