From d2e1f9eb9c8a624bf07fbe2afab7c78ec1790075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=AA=E7=A8=8B=E4=BC=9F?= Date: Fri, 5 Jun 2026 12:45:20 +0800 Subject: [PATCH] feat(wiki): support multi-path and glob patterns for KB source directory Allow knowledge base source paths to be configured as a newline-separated list of absolute paths or glob patterns rather than a single directory. - Each non-blank, non-# line is treated as one path or glob pattern - Plain paths (no wildcards) retain the existing recursive-scan behaviour filtered by SUPPORTED_EXTENSIONS - Glob patterns (e.g. /data/ocr/**/*.txt) walk from the fixed-prefix base and apply Java's PathMatcher against each candidate's absolute path - Patterns whose filename segment explicitly specifies an extension (*.txt, *.{xlsx,csv}) skip the SUPPORTED_EXTENSIONS secondary filter, respecting the user's explicit choice (key for OCR pipelines that produce .txt output and should ignore the original PDF scans) - Candidates collected across multiple patterns are deduplicated by resolved absolute path so overlapping patterns don't double-count - Symlink-escape check uses each pattern's own validated scan root - parseSourcePatterns / extractBasePath moved into WikiSourcePathValidator to eliminate a static circular reference between the two services - Frontend watcher panel: single-line replaced with +

@@ -505,6 +510,7 @@ onMounted(() => { loaded.profile = true; loadProfile() }) .kv b { font-size: 14px; color: var(--mc-text-primary); } .dir-row { display: flex; gap: 8px; } .dir-row .form-input { flex: 1; } +.dir-editor { min-height: 100px; font-size: 12.5px; } .runs-box { border: 1px solid var(--mc-border-light); border-radius: 12px; padding: 12px; background: var(--mc-bg-muted); } .runs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }