@voidwire/lore 1.0.0 → 1.0.2

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/config.ts CHANGED
@@ -24,6 +24,7 @@ export interface LoreConfig {
24
24
  projects: string;
25
25
  personal: string;
26
26
  session_events?: string;
27
+ sable_events?: string;
27
28
  flux?: string;
28
29
  flux_projects?: string;
29
30
  };
@@ -118,6 +119,10 @@ export function getConfig(): LoreConfig {
118
119
  typeof paths.session_events === "string"
119
120
  ? resolvePath(paths.session_events)
120
121
  : undefined,
122
+ sable_events:
123
+ typeof paths.sable_events === "string"
124
+ ? resolvePath(paths.sable_events)
125
+ : undefined,
121
126
  flux:
122
127
  typeof paths.flux === "string" ? resolvePath(paths.flux) : undefined,
123
128
  flux_projects:
package/lib/db.ts CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { Database } from "bun:sqlite";
9
9
  import { existsSync } from "fs";
10
- import { homedir } from "os";
10
+ import { getConfig } from "./config";
11
11
 
12
12
  // Use Homebrew SQLite on macOS to enable extension loading
13
13
  // Must be called before any Database instances are created
@@ -20,7 +20,7 @@ if (existsSync(HOMEBREW_SQLITE)) {
20
20
  * Get the path to the lore database
21
21
  */
22
22
  export function getDatabasePath(): string {
23
- return `${homedir()}/.local/share/lore/lore.db`;
23
+ return getConfig().database.sqlite;
24
24
  }
25
25
 
26
26
  /**
@@ -27,16 +27,25 @@ interface SessionData {
27
27
  }
28
28
 
29
29
  export async function indexSessions(ctx: IndexerContext): Promise<void> {
30
- const eventsDir = ctx.config.paths.session_events;
31
- if (!eventsDir || !existsSync(eventsDir)) {
32
- console.log("No session events directory found, skipping sessions");
30
+ // Collect event files from all configured directories
31
+ const eventDirs = [
32
+ ctx.config.paths.session_events,
33
+ ctx.config.paths.sable_events,
34
+ ].filter((d): d is string => !!d && existsSync(d));
35
+
36
+ if (eventDirs.length === 0) {
37
+ console.log("No session events directories found, skipping sessions");
33
38
  return;
34
39
  }
35
40
 
36
- const eventFiles = readdirSync(eventsDir)
37
- .filter((f) => f.endsWith(".jsonl"))
38
- .sort()
39
- .map((f) => join(eventsDir, f));
41
+ const eventFiles: string[] = [];
42
+ for (const dir of eventDirs) {
43
+ const files = readdirSync(dir)
44
+ .filter((f) => f.endsWith(".jsonl"))
45
+ .map((f) => join(dir, f));
46
+ eventFiles.push(...files);
47
+ }
48
+ eventFiles.sort();
40
49
 
41
50
  if (eventFiles.length === 0) {
42
51
  console.log("No session event files found, skipping sessions");
package/lib/info.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  import { Database } from "bun:sqlite";
9
- import { homedir } from "os";
10
9
  import { existsSync } from "fs";
10
+ import { getDatabasePath } from "./db.js";
11
11
  import { projects as getProjects } from "./projects.js";
12
12
 
13
13
  export interface SourceInfo {
@@ -22,10 +22,6 @@ export interface InfoOutput {
22
22
  total_entries: number;
23
23
  }
24
24
 
25
- function getDatabasePath(): string {
26
- return `${homedir()}/.local/share/lore/lore.db`;
27
- }
28
-
29
25
  /**
30
26
  * Get info about indexed sources
31
27
  *
package/lib/list.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  import { Database } from "bun:sqlite";
9
- import { homedir } from "os";
10
9
  import { existsSync } from "fs";
10
+ import { getDatabasePath } from "./db.js";
11
11
 
12
12
  // Source types - data sources that can be listed
13
13
  export type Source =
@@ -85,11 +85,6 @@ export interface ListResult {
85
85
  count: number;
86
86
  }
87
87
 
88
- // Database path following XDG spec
89
- function getDatabasePath(): string {
90
- return `${homedir()}/.local/share/lore/lore.db`;
91
- }
92
-
93
88
  interface RawRow {
94
89
  title: string;
95
90
  content: string;
@@ -196,7 +191,7 @@ export function list(source: Source, options: ListOptions = {}): ListResult {
196
191
  const dbPath = getDatabasePath();
197
192
 
198
193
  if (!existsSync(dbPath)) {
199
- throw new Error(`Database not found: ${dbPath}. Run lore-index-all first.`);
194
+ throw new Error(`Database not found: ${dbPath}. Run lore-db-init first.`);
200
195
  }
201
196
 
202
197
  const db = new Database(dbPath, { readonly: true });
package/lib/projects.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  import { Database } from "bun:sqlite";
9
- import { homedir } from "os";
10
9
  import { existsSync } from "fs";
10
+ import { getDatabasePath } from "./db.js";
11
11
 
12
12
  const PROJECT_SOURCES = [
13
13
  "commits",
@@ -20,10 +20,6 @@ const PROJECT_SOURCES = [
20
20
  "observations",
21
21
  ];
22
22
 
23
- function getDatabasePath(): string {
24
- return `${homedir()}/.local/share/lore/lore.db`;
25
- }
26
-
27
23
  /**
28
24
  * Get all unique project names across sources
29
25
  *
package/lib/realtime.ts CHANGED
@@ -23,12 +23,7 @@ import {
23
23
  EMBEDDING_DIM,
24
24
  serializeEmbedding,
25
25
  } from "./semantic.js";
26
- import {
27
- hashContent,
28
- getCachedEmbedding,
29
- cacheEmbedding,
30
- getMissingHashes,
31
- } from "./cache.js";
26
+ import { hashContent, getCachedEmbedding, cacheEmbedding } from "./cache.js";
32
27
  import type { CaptureEvent } from "./capture.js";
33
28
 
34
29
  /**
@@ -182,12 +177,10 @@ function buildMetadata(event: CaptureEvent): string {
182
177
  break;
183
178
  case "teaching":
184
179
  metadata.confidence = data.confidence;
185
- metadata.capture_source = data.source || "manual";
186
180
  break;
187
181
  case "observation":
188
182
  metadata.subtype = data.subtype;
189
183
  metadata.confidence = data.confidence;
190
- metadata.capture_source = data.source || "auto";
191
184
  break;
192
185
  case "insight":
193
186
  metadata.subtype = data.subtype;
package/lib/search.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  import { Database } from "bun:sqlite";
9
- import { homedir } from "os";
10
9
  import { existsSync } from "fs";
10
+ import { getDatabasePath } from "./db.js";
11
11
 
12
12
  export interface SearchResult {
13
13
  rowid: number;
@@ -26,10 +26,6 @@ export interface SearchOptions {
26
26
  type?: string | string[];
27
27
  }
28
28
 
29
- function getDatabasePath(): string {
30
- return `${homedir()}/.local/share/lore/lore.db`;
31
- }
32
-
33
29
  /**
34
30
  * Escape a query for safe FTS5 MATCH
35
31
  * Wraps terms in double quotes to prevent FTS5 syntax interpretation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidwire/lore",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Unified knowledge CLI - Search, list, and capture your indexed knowledge",
5
5
  "type": "module",
6
6
  "main": "./index.ts",