🎉 initial commit

This commit is contained in:
2026-02-20 14:17:34 +10:00
commit e21d1c7b58
33 changed files with 8207 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
export interface FileNode {
name: string
path: string
type: 'file' | 'directory'
children?: FileNode[]
}
export interface ChatMessage {
id: string
role: 'user' | 'assistant'
content: string
}
export type AnnotationType = 'passive_voice' | 'consistency' | 'style'
export interface TextAnnotation {
id: string
type: AnnotationType
from: number
to: number
matchedText: string
message: string
suggestion?: string
}
export type AnalysisMode = 'none' | 'passive_voice' | 'consistency' | 'style'
export type AIMode = 'chat' | 'passive_voice' | 'consistency' | 'style'
export interface AIPayload {
mode: AIMode
documentContent: string
documentPath: string
conversationHistory: Array<{ role: 'user' | 'assistant'; content: string }>
userMessage: string
}

16
src/renderer/types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
import type { FileNode, AIPayload } from './editor'
declare global {
interface Window {
api: {
listFiles: () => Promise<FileNode[]>
readFile: (filePath: string) => Promise<string>
writeFile: (filePath: string, content: string) => Promise<void>
streamAIMessage: (
payload: AIPayload,
onChunk: (chunk: string) => void
) => Promise<void>
removeAIListener: () => void
}
}
}