feat(coding): add core host api composition
This commit is contained in:
@@ -68,6 +68,16 @@ export function createCodingProjectStorageFromStore(
|
||||
};
|
||||
}
|
||||
|
||||
export async function createElectronCodingProjectStorage(): Promise<CodingProjectStorage> {
|
||||
const Store = (await import('electron-store')).default;
|
||||
const store = new Store<{ projects?: CodingProjectStoreData }>({
|
||||
// Preserve the installed-user storage identity while replacing the
|
||||
// OpenCode-owned service and types with the product-owned store.
|
||||
name: 'opencode-projects',
|
||||
});
|
||||
return createCodingProjectStorageFromStore(store, 'projects');
|
||||
}
|
||||
|
||||
function emptyStoreData(): CodingProjectStoreData {
|
||||
return { projects: {}, activeProjectId: null };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user