Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

795 B
Raw Blame
export type DataSource = 'runtime';

export type WorkspaceFile = {
  path: string;
  name: string;
  language: 'markdown' | 'srt' | 'html' | 'text' | 'json' | 'unknown';
  content: string;
  saved: boolean;
  dirty: boolean;
  updatedAt: string;
  source: DataSource;
};

export type FileTreeNode = {
  type: 'folder' | 'file';
  name: string;
  path: string;
  depth: number;
  language?: WorkspaceFile['language'];
};

export function createUnavailableFileService() {
  return {
    async listTree(): Promise<FileTreeNode[]> {
      return [];
    },
    async openFile(): Promise<WorkspaceFile> {
      throw new Error('Workspace file runtime is unavailable');
    },
    async saveFile(): Promise<WorkspaceFile> {
      throw new Error('Workspace file runtime is unavailable');
    }
  };
}