@gmickel/gno 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmickel/gno",
3
- "version": "0.13.2",
3
+ "version": "0.14.0",
4
4
  "description": "Local semantic search for your documents. Index Markdown, PDF, and Office files with hybrid BM25 + vector search.",
5
5
  "keywords": [
6
6
  "embeddings",
@@ -19,6 +19,8 @@ import {
19
19
 
20
20
  import type { SkippedEntry, WalkConfig, WalkEntry, WalkerPort } from "./types";
21
21
 
22
+ import { SUPPORTED_EXTENSIONS } from "../converters/mime";
23
+
22
24
  /**
23
25
  * Regex to detect dangerous patterns with parent directory traversal.
24
26
  * Matches ".." at start, after "/", or after "\" (Windows).
@@ -108,18 +110,20 @@ function matchesExclude(relPath: string, excludes: string[]): boolean {
108
110
  /**
109
111
  * Check if a file extension matches the include list.
110
112
  * Include list contains extensions like ".md" or "md" (normalized).
113
+ * When include is empty, falls back to SUPPORTED_EXTENSIONS to avoid
114
+ * walking files that can't be converted.
111
115
  */
112
116
  function matchesInclude(relPath: string, include: string[]): boolean {
113
- if (include.length === 0) {
114
- return true;
115
- }
116
-
117
117
  const ext = extname(relPath).toLowerCase();
118
118
  if (!ext) {
119
119
  return false;
120
120
  }
121
121
 
122
- return include.some((inc) => {
122
+ // Fallback to supported extensions when no explicit include list
123
+ const effectiveInclude =
124
+ include.length === 0 ? SUPPORTED_EXTENSIONS : include;
125
+
126
+ return effectiveInclude.some((inc) => {
123
127
  const normalizedInc = inc.startsWith(".")
124
128
  ? inc.toLowerCase()
125
129
  : `.${inc.toLowerCase()}`;