Add DotAI class

This commit is contained in:
Alex Gleason committed 2025-08-23 01:24:13 -05:00
1 parent 9a4c2a8cb5
commit 4df17bc17e
4 files changed
+412 -25

No files matched your search

+5 -7
View File
@@ -2,6 +2,7 @@ import git from 'isomorphic-git';
import http from 'isomorphic-git/http/web';
import { Buffer } from 'buffer';
import type { JSRuntimeFS } from '@/lib/JSRuntime';
import { DotAI } from './DotAI';
// Polyfill Buffer for browser
if (typeof window !== 'undefined') {
@@ -36,7 +37,10 @@ export class ProjectsManager {
}
async createProject(name: string): Promise<Project> {
return this.cloneProject(name, GIT_TEMPLATE_URL);
const project = await this.cloneProject(name, GIT_TEMPLATE_URL);
const dotAI = new DotAI(this.fs, project.path);
await dotAI.setupAiHistoryDir();
return project;
}
async cloneProject(name: string, repoUrl: string): Promise<Project> {
@@ -74,8 +78,6 @@ export class ProjectsManager {
};
}
async getProjects(): Promise<Project[]> {
try {
const projectDirs = await this.fs.readdir(this.dir);
@@ -259,10 +261,6 @@ export class ProjectsManager {
return naddr !== null;
}
private formatProjectName(dirName: string): string {
// Return the original directory name without formatting
return dirName;