@voidwire/lore 1.0.2 → 1.0.3

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/lib/indexer.ts CHANGED
@@ -150,8 +150,11 @@ export function createIndexerContext(
150
150
  // Chunk content if needed
151
151
  const chunks = chunkContent(entry.content);
152
152
 
153
- // Insert each chunk
153
+ // Insert each chunk (dedup at chunk level)
154
154
  for (const chunk of chunks) {
155
+ const chunkHash = createHash("sha256").update(chunk).digest("hex");
156
+ if (seenHashes.has(chunkHash)) continue;
157
+ seenHashes.add(chunkHash);
155
158
  insertStmt.run(
156
159
  entry.source,
157
160
  entry.title,
@@ -12,7 +12,7 @@
12
12
  * Timestamp: captured date if present, otherwise empty
13
13
  */
14
14
 
15
- import { readdirSync, readFileSync, existsSync } from "fs";
15
+ import { readdirSync, readFileSync, existsSync, statSync } from "fs";
16
16
  import { join, basename } from "path";
17
17
  import type { IndexerContext } from "../indexer";
18
18
 
@@ -82,6 +82,7 @@ function parseFluxFile(
82
82
  status: string,
83
83
  ): void {
84
84
  const raw = readFileSync(filePath, "utf-8");
85
+ const mtime = statSync(filePath).mtime;
85
86
  const lines = raw.split("\n");
86
87
 
87
88
  for (const line of lines) {
@@ -112,6 +113,11 @@ function parseFluxFile(
112
113
  );
113
114
  }
114
115
 
116
+ // Fall back to file mtime if no captured date
117
+ if (!timestamp) {
118
+ timestamp = mtime.toISOString();
119
+ }
120
+
115
121
  // Extract archived date if present (strip from description)
116
122
  rest = rest.replace(/\s*archived::\s*\S+/, "");
117
123
 
@@ -135,6 +135,8 @@ export async function indexObsidian(ctx: IndexerContext): Promise<void> {
135
135
 
136
136
  const title = basename(filePath, ".md");
137
137
 
138
+ if (!content.trim()) continue;
139
+
138
140
  ctx.insert({
139
141
  source: "obsidian",
140
142
  title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidwire/lore",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Unified knowledge CLI - Search, list, and capture your indexed knowledge",
5
5
  "type": "module",
6
6
  "main": "./index.ts",