chore(integration): snapshot local main worktree

This commit is contained in:
inman
2026-08-31 10:23:21 +08:00
parent 48a9189939
commit 33fb31fb28
116 changed files with 8108 additions and 3026 deletions

View File

@@ -6,16 +6,11 @@ import {
type CodingConversationV2,
} from './conversation-store';
import {
acknowledgeLegacyConversationNotice,
normalizeCodingProjectConfigV2,
readCodingProjectConfigV2,
writeCodingProjectConfigV2,
type CodingProjectConfigV2,
} from './project-config';
import {
migrateCodingProjectToV2,
type CodingProjectMigrationDependencies,
} from './migration';
import {
createLocalCodingProject,
type CodingProject,
@@ -66,7 +61,6 @@ export interface CodingProjectServiceOptions {
): Promise<void> | void;
createConversationStore?: typeof createCodingConversationStore;
writeConfig?: typeof writeCodingProjectConfigV2;
migration?: CodingProjectMigrationDependencies;
}
function requiredAbsolutePath(value: string | undefined, label: string): string {
@@ -106,7 +100,6 @@ export class CodingProjectService {
ReturnType<typeof createCodingConversationStore>
>();
private activeTransitionTail = Promise.resolve();
private readonly migrationFlights = new Map<string, Promise<CodingProjectConfigV2>>();
constructor(
private readonly store: CodingProjectStore,
@@ -309,16 +302,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;
@@ -355,19 +338,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<{