mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Force FS types into a shared RuntimeFS type
This commit is contained in:
9 files changed
+226
-95
No files matched your search
@@ -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}>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user