Spaces:
Running
Running
| import { SpaceEntry } from "@huggingface/hub"; | |
| export interface User { | |
| fullname: string; | |
| avatarUrl: string; | |
| name: string; | |
| isLocalUse?: boolean; | |
| isPro: boolean; | |
| id: string; | |
| token?: string; | |
| } | |
| export interface HtmlHistory { | |
| pages: Page[]; | |
| createdAt: Date; | |
| prompt: string; | |
| } | |
| export interface Project { | |
| title: string; | |
| html: string; | |
| prompts: string[]; | |
| user_id: string; | |
| space_id: string; | |
| pages: Page[]; | |
| files: string[]; | |
| cardData?: any; | |
| name?: string; | |
| _id?: string; | |
| _updatedAt?: Date; | |
| _createdAt?: Date; | |
| } | |
| // expand SpaceEntry type | |
| export interface ProjectType extends SpaceEntry { | |
| cardData?: any; | |
| } | |
| export interface Page { | |
| path: string; | |
| html: string; | |
| } | |
| export interface Commit { | |
| title: string; | |
| oid: string; | |
| date: Date; | |
| } | |
| export interface EnhancedSettings { | |
| isActive: boolean; | |
| primaryColor: string | undefined; | |
| secondaryColor: string | undefined; | |
| theme: Theme; | |
| } | |
| export type Theme = "light" | "dark" | undefined; | |
| // OmniDev Augmentation types | |
| export type FileAction = "add" | "update" | "delete"; | |
| export interface FileUpdate { | |
| path: string; // e.g., /frontend/src/App.tsx or /backend/routes/auth.ts | |
| action: FileAction; | |
| content?: string; // required for add/update; omit for delete | |
| note?: string; // optional human-readable note | |
| } | |
| export interface AugmentRequest { | |
| context: string; // project structure + important file snippets | |
| instruction: string; // user instruction (e.g., add JWT auth) | |
| language?: string; // javascript, typescript, python | |
| framework?: string; // express-react, nextjs, nestjs, etc. | |
| response_type?: "file_updates" | "explanation"; | |
| model?: string; | |
| provider?: string; // 'google' to force Gemini | |
| } | |
| export interface AugmentResponse { | |
| ok: boolean; | |
| files?: FileUpdate[]; | |
| logs?: string[]; | |
| summary?: string; | |
| message?: string; | |
| } | |