LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。
TypeScript
import { invoke } from "@tauri-apps/api/core"
import type { SourceWatchConfig } from "@/stores/wiki-store"
import { normalizeSourceWatchConfig } from "@/lib/source-watch-config"
export type FileChangeKind = "created" | "modified" | "deleted"
export type FileChangeStatus = "pending" | "processing" | "done" | "failed" | "superseded"
export interface FileChangeTask {
id: string
projectId: string
path: string
kind: FileChangeKind
status: FileChangeStatus
hashBefore?: string | null
hashAfter?: string | null
size?: number | null
mtimeMs?: number | null
createdAt: number
updatedAt: number
retryCount: number
error?: string | null
needsRerun: boolean
}
export interface FileChangeQueue {
version: number
tasks: FileChangeTask[]
}
export interface FileChangeRescanResult {
queue: FileChangeQueue
changedTasks: FileChangeTask[]
}
export interface FileSyncPayload {
projectId: string
tasks: FileChangeTask[]
}
export function startProjectFileWatcher(
projectId: string,
projectPath: string,
sourceWatchConfig?: SourceWatchConfig,
): Promise<FileChangeRescanResult> {
return invoke<FileChangeRescanResult>("start_project_file_watcher", {
projectId,
projectPath,
sourceWatchConfig: normalizeSourceWatchConfig(sourceWatchConfig),
})
}
export function stopProjectFileWatcher(): Promise<void> {
return invoke<void>("stop_project_file_watcher")
}
export function rescanProjectFiles(
projectId: string,
projectPath: string,
sourceWatchConfig?: SourceWatchConfig,
watchRootsOnly = false,
): Promise<FileChangeRescanResult> {
return invoke<FileChangeRescanResult>("rescan_project_files", {
projectId,
projectPath,
sourceWatchConfig: normalizeSourceWatchConfig(sourceWatchConfig),
watchRootsOnly,
})
}
export function invalidateProjectFileSnapshotPaths(
projectPath: string,
paths: string[],
): Promise<void> {
return invoke<void>("invalidate_project_file_snapshot_paths", { projectPath, paths })
}
export function getFileChangeQueue(projectPath: string): Promise<FileChangeQueue> {
return invoke<FileChangeQueue>("get_file_change_queue", { projectPath })
}
export function retryFileChangeTask(
projectId: string,
projectPath: string,
taskId: string,
): Promise<FileChangeQueue> {
return invoke<FileChangeQueue>("retry_file_change_task", { projectId, projectPath, taskId })
}
export function ignoreFileChangeTask(
projectId: string,
projectPath: string,
taskId: string,
): Promise<FileChangeQueue> {
return invoke<FileChangeQueue>("ignore_file_change_task", { projectId, projectPath, taskId })
}