Force FS types into a shared RuntimeFS type

This commit is contained in:
Alex Gleason committed 2025-07-20 16:45:04 -05:00
1 parent 93a57b2560
commit 9dc856d46e
9 files changed
+226 -95

No files matched your search

+4 -1
View File
@@ -1,6 +1,7 @@
import { ReactNode } from 'react';
import type LightningFS from '@isomorphic-git/lightning-fs';
import { FSContext, type FSContextType } from '@/contexts/FSContext';
import { LightningFSAdapter } from '@/lib/LightningFSAdapter';
interface FSProviderProps {
children: ReactNode;
@@ -8,7 +9,9 @@ interface FSProviderProps {
}
export function FSProvider({ children, fs }: FSProviderProps) {
const contextValue: FSContextType = { fs };
const contextValue: FSContextType = {
fs: new LightningFSAdapter(fs)
};
return (
<FSContext.Provider value={contextValue}>
+2 -2
View File
@@ -11,7 +11,7 @@ import { useAISettings } from '@/hooks/useAISettings';
import { FsToolSet } from '@/lib/FsToolSet';
import { useFS } from '@/hooks/useFS';
import { useJSRuntime } from '@/hooks/useJSRuntime';
import { copyDirectory, copyToRuntime } from '@/lib/copyFiles';
import { copyDirectory } from '@/lib/copyFiles';
interface ChatPaneProps {
projectId: string;
@@ -48,7 +48,7 @@ export function ChatPane({ projectId, projectName }: ChatPaneProps) {
// Copy project files to runtime filesystem
const projectPath = `/projects/${projectId}`;
try {
await copyToRuntime(fs, runtime.fs, projectPath, '.');
await copyDirectory(fs, runtime.fs, projectPath, '.');
console.log('Successfully copied project to runtime');
} catch (error) {
console.error('Failed to copy project to runtime:', error);