Use Nut API development server instead of webcontainers (#50)

This commit is contained in:
Brian Hackett
2025-03-13 07:59:10 -07:00
committed by GitHub
parent 58f2cb0f58
commit 9e58d6bb64
40 changed files with 297 additions and 2356 deletions

View File

@@ -7,7 +7,6 @@ import { BaseChat } from '~/components/chat/BaseChat';
import { Chat } from '~/components/chat/Chat.client';
import { useGit } from '~/lib/hooks/useGit';
import { useChatHistory } from '~/lib/persistence';
import { createCommandsMessage, detectProjectCommands } from '~/utils/projectCommands';
import { LoadingOverlay } from '~/components/ui/LoadingOverlay';
import { toast } from 'react-toastify';
@@ -59,18 +58,14 @@ export function GitUrlImport() {
const fileContents = filePaths
.map((filePath) => {
const { data: content, encoding } = data[filePath];
const file = data[filePath];
return {
path: filePath,
content:
encoding === 'utf8' ? content : content instanceof Uint8Array ? textDecoder.decode(content) : '',
content: file?.content,
};
})
.filter((f) => f.content);
const commands = await detectProjectCommands(fileContents);
const commandsMessage = createCommandsMessage(commands);
const filesMessage: Message = {
role: 'assistant',
content: `Cloning the repo ${repoUrl} into ${workdir}
@@ -90,10 +85,6 @@ ${file.content}
const messages = [filesMessage];
if (commandsMessage) {
messages.push(commandsMessage);
}
await importChat(`Git Project:${repoUrl.split('/').slice(-1)[0]}`, messages);
}
} catch (error) {