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
release: v0.4.15
nash_su3c19470a135e
diff --git a/package-lock.json b/package-lock.jsonindex b92d1ab5..3d1586db 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "llm-wiki",- "version": "0.4.14",+ "version": "0.4.15","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "llm-wiki",- "version": "0.4.14",+ "version": "0.4.15","dependencies": {"@base-ui/react": "^1.3.0","@fontsource-variable/geist": "^5.2.8",diff --git a/package.json b/package.jsonindex d2e6ce1b..f214dbb8 100644--- a/package.json+++ b/package.json@@ -1,7 +1,7 @@{"name": "llm-wiki","private": true,- "version": "0.4.14",+ "version": "0.4.15","type": "module","scripts": {"dev": "vite",diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lockindex aa92f349..5a2252ba 100644--- a/src-tauri/Cargo.lock+++ b/src-tauri/Cargo.lock@@ -531,6 +531,16 @@ dependencies = ["debug_unsafe",]+[[package]]+name = "atoi_simd"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f3cdb3708a128e559a30fb830e8a77a5022ee6902806925c216658652b452a44"+dependencies = [+ "debug_unsafe",+ "rustversion",+]+[[package]]name = "atomic-waker"version = "1.1.2"@@ -811,7 +821,7 @@ version = "0.34.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "20ae05a4e39297eecf9a994210d27501318c37a9318201f8e11050add82bb6f0"dependencies = [- "atoi_simd",+ "atoi_simd 0.17.0","byteorder","codepage","encoding_rs",@@ -4420,7 +4430,7 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"[[package]]name = "llm-wiki"-version = "0.4.14"+version = "0.4.15"dependencies = ["arrow-array","arrow-schema",@@ -4433,6 +4443,7 @@ dependencies = ["lancedb","md-5","notify",+ "office_oxide","pdfium-render","reqwest 0.12.28","serde",@@ -5141,6 +5152,24 @@ dependencies = ["web-time",]+[[package]]+name = "office_oxide"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "866a8fa5e1a756f8cc9f9f614031ad7e33adc7f6972eab74a35b0c799fe08da5"+dependencies = [+ "atoi_simd 0.18.1",+ "encoding_rs",+ "fast-float2",+ "libc",+ "log",+ "quick-xml 0.40.1",+ "serde",+ "serde_json",+ "thiserror 2.0.18",+ "zip 8.6.0",+]+[[package]]name = "once_cell"version = "1.21.4"@@ -5732,6 +5761,16 @@ dependencies = ["memchr",]+[[package]]+name = "quick-xml"+version = "0.40.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2474bd2e5029e7ccb6abb2ba48cf2383a333851dedf495901544281590c7da7f"+dependencies = [+ "memchr",+ "serde",+]+[[package]]name = "quinn"version = "0.11.9"@@ -9414,6 +9453,20 @@ dependencies = ["zopfli",]+[[package]]+name = "zip"+version = "8.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b"+dependencies = [+ "crc32fast",+ "flate2",+ "indexmap 2.14.0",+ "memchr",+ "typed-path",+ "zopfli",+]+[[package]]name = "zlib-rs"version = "0.6.3"diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.tomlindex afa8a846..98d34fb6 100644--- a/src-tauri/Cargo.toml+++ b/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "llm-wiki"-version = "0.4.14"+version = "0.4.15"description = "LLM Wiki - A personal knowledge base for LLM concepts"authors = []edition = "2021"@@ -33,6 +33,7 @@ tiny_http = "0.12"zip = "2"calamine = "0.34.0"docx-rs = "0.4.20"+office_oxide = "=0.1.2"lancedb = "0.27.2"# tokio provided by tauri runtime for async commandsarrow-array = "57"diff --git a/src-tauri/src/commands/fs.rs b/src-tauri/src/commands/fs.rsindex d35aa1c6..e93fedab 100644--- a/src-tauri/src/commands/fs.rs+++ b/src-tauri/src/commands/fs.rs@@ -5,13 +5,14 @@ use std::thread;use std::time::Duration;use calamine::{open_workbook_auto, Data, Reader};+use office_oxide::Document;use crate::commands::file_sync;use crate::panic_guard::run_guarded;use crate::types::wiki::FileNode;/// Known binary formats that need special extraction-const OFFICE_EXTS: &[&str] = &["docx", "pptx", "xlsx", "odt", "ods", "odp"];+const OFFICE_EXTS: &[&str] = &["doc", "docx", "pptx", "xls", "xlsx", "odt", "ods", "odp"];const IMAGE_EXTS: &[&str] = &["png", "jpg", "jpeg", "gif", "webp", "bmp", "ico", "tiff", "tif", "avif", "heic", "heif", "svg",];@@ -19,7 +20,7 @@ const MEDIA_EXTS: &[&str] = &["mp4", "webm", "mov", "avi", "mkv", "flv", "wmv", "m4v", "mp3", "wav", "ogg", "flac", "aac","m4a", "wma",];-const LEGACY_DOC_EXTS: &[&str] = &["doc", "xls", "ppt", "pages", "numbers", "key", "epub"];+const LEGACY_DOC_EXTS: &[&str] = &["ppt", "pages", "numbers", "key", "epub"];#[tauri::command]pub async fn read_file(path: String) -> Result<String, String> {@@ -394,6 +395,11 @@ fn extract_office_text(path: &str, ext: &str) -> Result<String, String> {return extract_docx_with_library(path);}+ // DOC: use office_oxide for legacy Word binary documents.+ if ext == "doc" {+ return extract_doc_with_office_oxide(path);+ }+// PPTX and ODF: use ZIP-based parsinglet file = fs::File::open(path).map_err(|e| format!("Failed to open '{}': {}", path, e))?;let mut archive = zip::ZipArchive::new(file)@@ -406,6 +412,23 @@ fn extract_office_text(path: &str, ext: &str) -> Result<String, String> {}}+/// Extract legacy Word `.doc` text using office_oxide.+fn extract_doc_with_office_oxide(path: &str) -> Result<String, String> {+ let doc = Document::open(path).map_err(|e| format!("Failed to parse DOC '{}': {}", path, e))?;+ let markdown = doc.to_markdown();+ let text = if markdown.trim().is_empty() {+ doc.plain_text()+ } else {+ markdown+ };++ if text.trim().is_empty() {+ Ok("[Document: no extractable text found in .doc file]".to_string())+ } else {+ Ok(text)+ }+}+/// Extract DOCX using docx-rs library for proper structural parsing.fn extract_docx_with_library(path: &str) -> Result<String, String> {let bytes = fs::read(path).map_err(|e| format!("Failed to read DOCX '{}': {}", path, e))?;@@ -815,12 +838,6 @@ fn extract_pptx_markdown(archive: &mut zip::ZipArchive<fs::File>) -> Result<Stri}}-/// Extract XLSX/XLS/ODS to Markdown tables using calamine.-fn extract_xlsx_markdown(_archive: &mut zip::ZipArchive<fs::File>) -> Result<String, String> {- // calamine needs the file path, not the archive- Err("Use extract_spreadsheet instead".to_string())-}-/// Extract spreadsheet to Markdown using calamine (supports xlsx, xls, ods).fn extract_spreadsheet(path: &str) -> Result<String, String> {let mut workbook = open_workbook_auto(path)@@ -1570,6 +1587,13 @@ mod tests {assert!(result.is_err() || result.is_ok()); // must at least return}+ #[test]+ fn extract_doc_with_office_oxide_handles_missing_file() {+ let result = extract_doc_with_office_oxide("/nonexistent/path/that/does/not/exist.doc");+ assert!(result.is_err());+ assert!(result.unwrap_err().contains("Failed to parse DOC"));+ }+/// Ad-hoc probe: run the production PDF extraction path against every/// .pdf under a user-provided directory and print a per-file report of/// Ok / Err (library returned an error) / Panic (library panicked anddiff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex 8a896493..42735f03 100644--- a/src-tauri/tauri.conf.json+++ b/src-tauri/tauri.conf.json@@ -1,7 +1,7 @@{"$schema": "https://schema.tauri.app/config/2","productName": "LLM Wiki",- "version": "0.4.14",+ "version": "0.4.15","identifier": "com.llmwiki.app","build": {"beforeDevCommand": "npm run dev",diff --git a/src/components/editor/file-preview.tsx b/src/components/editor/file-preview.tsxindex da8e5296..4b7778f4 100644--- a/src/components/editor/file-preview.tsx+++ b/src/components/editor/file-preview.tsx@@ -13,7 +13,12 @@ import {FileSpreadsheet,FileQuestion,} from "lucide-react"-import { getFileCategory, getCodeLanguage } from "@/lib/file-types"+import {+ getFileCategory,+ getCodeLanguage,+ getFileExtension,+ isExtractedTextPreviewFile,+} from "@/lib/file-types"import type { FileCategory } from "@/lib/file-types"import { getFileName } from "@/lib/path-utils"import { resolveMarkdownImageSrc } from "@/lib/markdown-image-resolver"@@ -49,12 +54,35 @@ export function FilePreview({ filePath, textContent }: FilePreviewProps) {case "text":return <TextPreview filePath={filePath} content={textContent} label="Text" />case "document":+ if (isExtractedTextPreviewFile(filePath)) {+ return <TextPreview filePath={filePath} content={textContent} label={extractedTextLabel(filePath)} />+ }return <BinaryPlaceholder filePath={filePath} fileName={fileName} category={category} />default:return <BinaryPlaceholder filePath={filePath} fileName={fileName} category={category} />}}+function extractedTextLabel(filePath: string): string {+ switch (getFileExtension(filePath)) {+ case "doc":+ return "Word DOC (extracted text)"+ case "docx":+ return "Word DOCX (extracted text)"+ case "pptx":+ return "PowerPoint (extracted text)"+ case "xls":+ case "xlsx":+ return "Spreadsheet (extracted text)"+ case "odt":+ case "ods":+ case "odp":+ return "OpenDocument (extracted text)"+ default:+ return "Extracted text"+ }+}+function ImagePreview({ filePath, fileName }: { filePath: string; fileName: string }) {const src = convertFileSrc(filePath)return (diff --git a/src/components/layout/preview-panel.tsx b/src/components/layout/preview-panel.tsxindex ace2b928..1dd88581 100644--- a/src/components/layout/preview-panel.tsx+++ b/src/components/layout/preview-panel.tsx@@ -2,7 +2,7 @@ import { useEffect, useCallback, useRef } from "react"import { X } from "lucide-react"import { useWikiStore } from "@/stores/wiki-store"import { readFile, writeFile } from "@/commands/fs"-import { getFileCategory, isBinary } from "@/lib/file-types"+import { getFileCategory, isBinary, isExtractedTextPreviewFile } from "@/lib/file-types"import { WikiEditor } from "@/components/editor/wiki-editor"import { FilePreview } from "@/components/editor/file-preview"import { getFileName } from "@/lib/path-utils"@@ -34,7 +34,7 @@ export function PreviewPanel() {const category = getFileCategory(selectedFile)- if (isBinary(category)) {+ if (isBinary(category) && !isExtractedTextPreviewFile(selectedFile)) {setFileContent("")lastLoadedRef.current = ""returndiff --git a/src/lib/changelog.ts b/src/lib/changelog.tsindex 7f567b8b..4b881e76 100644--- a/src/lib/changelog.ts+++ b/src/lib/changelog.ts@@ -25,6 +25,24 @@ export interface ChangelogEntry {}export const CHANGELOG: ChangelogEntry[] = [+ {+ version: "0.4.15",+ date: "2026-05-28",+ highlights: {+ en: [+ "Added AnyTXT as an external information source for Chat and Deep Research, with source labels and snippet previews.",+ "Added legacy Word .doc support for source import, text extraction, ingest, and preview.",+ "Improved source import, monitoring, chat search controls, graph controls, wiki generation reliability, and Mermaid rendering stability.",+ "Fixed raw-source preview, scrolling, editing, embedding configuration, and lint persistence issues.",+ ],+ zh: [+ "新增 AnyTXT 作为 AI 对话和 Deep Research 的外部信息源,并支持来源标记和片段预览。",+ "新增旧版 Word .doc 支持,可用于资料导入、文本提取、摄取和预览。",+ "改进资料导入与监控、对话搜索开关、关系图控制、Wiki 生成可靠性和 Mermaid 渲染稳定性。",+ "修复原始资料预览、滚动、编辑保存、Embedding 配置和检查结果持久化相关问题。",+ ],+ },+ },{version: "0.4.14",date: "2026-05-26",diff --git a/src/lib/extract-source-images.ts b/src/lib/extract-source-images.tsindex 67af8d2b..c715ce6a 100644--- a/src/lib/extract-source-images.ts+++ b/src/lib/extract-source-images.ts@@ -37,10 +37,9 @@ export interface SavedImage {* are XML-rendered shapes, not embedded raster). Adding them later is* a one-line change here. */const SUPPORTED_PDF_EXTS = ["pdf"] as const-const SUPPORTED_OFFICE_EXTS = ["pptx", "docx", "ppt", "doc"] as const-// Note: ppt / doc (legacy binary formats) won't actually work — they-// aren't ZIP. Listed for completeness; Rust side will return Err which-// the caller treats as "no images" gracefully.+const SUPPORTED_OFFICE_EXTS = ["pptx", "docx"] as const+// Legacy binary .doc/.ppt text extraction is handled separately; image+// extraction here is ZIP-based and only supports OOXML files.const MARKDOWN_IMAGE_EXTS = new Set(["png","jpg",diff --git a/src/lib/file-types.test.ts b/src/lib/file-types.test.tsnew file mode 100644index 00000000..191bce79--- /dev/null+++ b/src/lib/file-types.test.ts@@ -0,0 +1,21 @@+import { describe, expect, it } from "vitest"+import {+ getFileExtension,+ isExtractedTextPreviewFile,+} from "@/lib/file-types"++describe("file types", () => {+ it("recognizes backend-extracted document previews", () => {+ expect(isExtractedTextPreviewFile("/project/raw/sources/report.doc")).toBe(true)+ expect(isExtractedTextPreviewFile("/project/raw/sources/report.docx")).toBe(true)+ expect(isExtractedTextPreviewFile("/project/raw/sources/slides.pptx")).toBe(true)+ expect(isExtractedTextPreviewFile("/project/raw/sources/sheet.xlsx")).toBe(true)+ expect(isExtractedTextPreviewFile("/project/raw/sources/archive.zip")).toBe(false)+ })++ it("extracts extensions from windows and unix paths", () => {+ expect(getFileExtension("C:\\Users\\me\\report.DOC")).toBe("doc")+ expect(getFileExtension("/Users/me/report.docx")).toBe("docx")+ expect(getFileExtension("/Users/me/README")).toBe("")+ })+})diff --git a/src/lib/file-types.ts b/src/lib/file-types.tsindex f1abf555..65689295 100644--- a/src/lib/file-types.ts+++ b/src/lib/file-types.ts@@ -96,7 +96,7 @@ const EXT_MAP: Record<string, FileCategory> = {pdf: "pdf",- // Documents (binary, not directly previewable)+ // Documents. Some are previewable through backend text extraction.doc: "document",docx: "document",xls: "document",@@ -130,6 +130,27 @@ export function isTextReadable(category: FileCategory): boolean {return ["markdown", "text", "code", "data"].includes(category)}+export const EXTRACTED_TEXT_PREVIEW_EXTENSIONS = new Set([+ "pdf",+ "doc",+ "docx",+ "pptx",+ "xls",+ "xlsx",+ "odt",+ "ods",+ "odp",+])++export function getFileExtension(filePath: string): string {+ const fileName = filePath.split(/[\\/]/).pop() ?? ""+ return fileName.includes(".") ? fileName.split(".").pop()?.toLowerCase() ?? "" : ""+}++export function isExtractedTextPreviewFile(filePath: string): boolean {+ return EXTRACTED_TEXT_PREVIEW_EXTENSIONS.has(getFileExtension(filePath))+}+export function isBinary(category: FileCategory): boolean {return ["image", "video", "audio", "document", "unknown"].includes(category)}diff --git a/src/lib/source-lifecycle.ts b/src/lib/source-lifecycle.tsindex e13c5337..2a82894d 100644--- a/src/lib/source-lifecycle.ts+++ b/src/lib/source-lifecycle.ts@@ -41,6 +41,7 @@ export const INGESTABLE_SOURCE_EXTENSIONS = new Set(["mdx","txt","pdf",+ "doc","docx","pptx","xlsx",diff --git a/src/lib/source-watch-config.test.ts b/src/lib/source-watch-config.test.tsindex 7987194d..22d12084 100644--- a/src/lib/source-watch-config.test.ts+++ b/src/lib/source-watch-config.test.ts@@ -14,7 +14,7 @@ describe("source watch config", () => {it("allows document types by default and rejects config/media/binaries", () => {expect(isPathAllowedBySourceWatch("raw/sources/report.pdf", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(true)expect(isPathAllowedBySourceWatch("raw/sources/notes.md", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(true)- expect(isPathAllowedBySourceWatch("raw/sources/report.doc", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(false)+ expect(isPathAllowedBySourceWatch("raw/sources/report.doc", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(true)expect(isPathAllowedBySourceWatch("raw/sources/secrets.json", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(false)expect(isPathAllowedBySourceWatch("raw/sources/video.mp4", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(false)expect(isPathAllowedBySourceWatch("raw/sources/tool.exe", DEFAULT_SOURCE_WATCH_CONFIG)).toBe(false)diff --git a/src/lib/source-watch-config.ts b/src/lib/source-watch-config.tsindex 95489f13..8ad3cd6d 100644--- a/src/lib/source-watch-config.ts+++ b/src/lib/source-watch-config.ts@@ -7,7 +7,7 @@ export const DEFAULT_SOURCE_WATCH_CONFIG: SourceWatchConfig = sourceWatchDefaultexport const SOURCE_WATCH_FILE_TYPE_GROUPS = [{id: "documents",- extensions: ["md", "mdx", "txt", "pdf", "docx", "odt", "rtf"],+ extensions: ["md", "mdx", "txt", "pdf", "doc", "docx", "odt", "rtf"],},{id: "presentations",diff --git a/src/lib/source-watch-defaults.json b/src/lib/source-watch-defaults.jsonindex bcf72c73..d7c7f2a4 100644--- a/src/lib/source-watch-defaults.json+++ b/src/lib/source-watch-defaults.json@@ -6,6 +6,7 @@"mdx","txt","pdf",+ "doc","docx","pptx","xls",