✨ upload attachments and custom feedback
This commit is contained in:
@@ -5,10 +5,20 @@ export interface FileNode {
|
||||
children?: FileNode[]
|
||||
}
|
||||
|
||||
export interface AttachmentMeta {
|
||||
name: string
|
||||
mimeType: string
|
||||
}
|
||||
|
||||
export interface Attachment extends AttachmentMeta {
|
||||
data: string // base64 for images, extracted text for text/PDF
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id: string
|
||||
role: 'user' | 'assistant'
|
||||
content: string
|
||||
attachments?: AttachmentMeta[] // metadata only — stored in history for display
|
||||
}
|
||||
|
||||
export type AnnotationType = 'passive_voice' | 'consistency' | 'style' | 'critique'
|
||||
@@ -33,6 +43,7 @@ export interface AIPayload {
|
||||
documentPath: string
|
||||
conversationHistory: Array<{ role: 'user' | 'assistant'; content: string }>
|
||||
userMessage: string
|
||||
attachments?: Attachment[] // full data for current API call only
|
||||
}
|
||||
|
||||
export interface RevisionMeta {
|
||||
|
||||
3
src/renderer/types/global.d.ts
vendored
3
src/renderer/types/global.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import type { FileNode, AIPayload, RevisionMeta } from './editor'
|
||||
import type { FileNode, AIPayload, RevisionMeta, Attachment } from './editor'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -13,6 +13,7 @@ declare global {
|
||||
removeAIListener: () => void
|
||||
getProjectWordCount: () => Promise<number>
|
||||
saveOrder: (order: Record<string, string[]>) => Promise<void>
|
||||
pickAttachments: () => Promise<Attachment[]>
|
||||
saveRevision: (filePath: string, content: string) => Promise<void>
|
||||
listRevisions: (filePath: string) => Promise<RevisionMeta[]>
|
||||
loadRevision: (filePath: string, revisionId: string) => Promise<string>
|
||||
|
||||
Reference in New Issue
Block a user