Phase 1 MVP - Complete implementation

- Login with JWT and refresh token rotation
- Dashboard with projects cards
- ProjectView with TreeView navigation
- DocumentView with markdown editor and auto-save
- Tag management (create, assign, remove)
- Dark mode CSS variables
- Security fixes applied (logout to backend, createDocument endpoint)
This commit is contained in:
Motoko
2026-03-30 15:17:29 +00:00
commit c9cb07dbfc
1341 changed files with 1084068 additions and 0 deletions

119
src/types/index.ts Normal file
View File

@@ -0,0 +1,119 @@
// User / Auth types
export interface Agent {
id: string
username: string
role: 'agent' | 'admin'
created_at: string
updated_at: string
}
export interface AuthResponse {
access_token: string
token_type: string
}
// Project types
export interface Project {
id: string
name: string
description: string | null
agent_id: string
created_at: string
updated_at: string
}
// Folder types
export interface Folder {
id: string
name: string
project_id: string
parent_id: string | null
path: string
created_at: string
updated_at: string
}
// Document types
export interface Tag {
id: string
name: string
color: string
}
export interface DocumentReasoning {
reasoning_type: 'chain' | 'idea' | 'context' | 'reflection'
confidence: number | null
reasoning_steps: Array<{
step: number
thought: string
conclusion: string | null
}>
model_source: string | null
}
export interface Document {
id: string
title: string
content: string
project_id: string
folder_id: string | null
path: string
tags: Tag[]
reasoning: DocumentReasoning | null
created_at: string
updated_at: string
}
// Tree view node
export interface TreeNode {
id: string
name: string
type: 'folder' | 'document'
children?: TreeNode[]
parent_id: string | null
}
// API responses
export interface ProjectsResponse {
projects: Project[]
}
export interface FoldersResponse {
folders: Folder[]
}
export interface DocumentsResponse {
documents: Document[]
}
// Form inputs
export interface LoginForm {
username: string
password: string
}
export interface RegisterForm {
username: string
password: string
}
export interface ProjectForm {
name: string
description: string
}
export interface FolderForm {
name: string
parent_id: string | null
}
export interface DocumentForm {
title: string
content: string
folder_id: string | null
}
export interface TagForm {
name: string
color: string
}