@voidwire/lore 1.1.1 → 1.2.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.
@@ -136,7 +136,7 @@ export async function indexBlogs(ctx: IndexerContext): Promise<void> {
136
136
 
137
137
  ctx.insert({
138
138
  source: "blogs",
139
- title: `[blog] ${title}`,
139
+ title,
140
140
  content,
141
141
  topic,
142
142
  timestamp,
@@ -68,7 +68,7 @@ export async function indexCaptures(ctx: IndexerContext): Promise<void> {
68
68
  }
69
69
  if (techTags.length > 0) content += `\n${techTags.join("\n")}`;
70
70
 
71
- title = `[completion] ${topic}: ${name}`;
71
+ title = `${topic}: ${name}`;
72
72
  type = "completion";
73
73
 
74
74
  if (event.data?.tags) metadata.tags = event.data.tags;
@@ -79,7 +79,7 @@ export async function indexCaptures(ctx: IndexerContext): Promise<void> {
79
79
  const tags = event.data?.tags || [];
80
80
  const tagsStr = tags.join(", ");
81
81
 
82
- title = tagsStr ? `[note] ${tagsStr}` : "[note] untagged";
82
+ title = tagsStr ? tagsStr : "untagged";
83
83
  type = "note";
84
84
 
85
85
  if (tags.length > 0) metadata.tags = tags;
@@ -88,7 +88,7 @@ export async function indexCaptures(ctx: IndexerContext): Promise<void> {
88
88
  content = event.data?.content || "";
89
89
  const subtype = event.data?.subtype || "insight";
90
90
 
91
- title = `[${subtype}] ${topic}`;
91
+ title = topic;
92
92
  type = subtype;
93
93
  }
94
94
 
@@ -68,7 +68,7 @@ export async function indexCommits(ctx: IndexerContext): Promise<void> {
68
68
 
69
69
  ctx.insert({
70
70
  source: "commits",
71
- title: `[commit] ${subject}`,
71
+ title: subject,
72
72
  content,
73
73
  topic: project,
74
74
  timestamp,
@@ -72,7 +72,7 @@ export async function indexExplorations(ctx: IndexerContext): Promise<void> {
72
72
 
73
73
  ctx.insert({
74
74
  source: "explorations",
75
- title: `[exploration] ${title}`,
75
+ title,
76
76
  content,
77
77
  topic: project,
78
78
  timestamp,
@@ -125,10 +125,7 @@ function parseFluxFile(
125
125
  const description = rest.trim();
126
126
  if (!description) continue;
127
127
 
128
- const title =
129
- topic !== "general"
130
- ? `[${topic}] [${type}] ${description.slice(0, 80)}`
131
- : `[${type}] ${description.slice(0, 80)}`;
128
+ const title = description.slice(0, 80);
132
129
 
133
130
  ctx.insert({
134
131
  source: "flux",
@@ -44,7 +44,7 @@ export async function indexInsights(ctx: IndexerContext): Promise<void> {
44
44
 
45
45
  ctx.insert({
46
46
  source: "insights",
47
- title: `[summary] ${topic}`,
47
+ title: topic,
48
48
  content,
49
49
  topic,
50
50
  type: "summary",
@@ -43,7 +43,7 @@ export async function indexLearnings(ctx: IndexerContext): Promise<void> {
43
43
 
44
44
  ctx.insert({
45
45
  source: "learnings",
46
- title: `[learning] ${topic}`,
46
+ title: topic,
47
47
  content,
48
48
  topic,
49
49
  timestamp: event.timestamp || "",
@@ -44,7 +44,7 @@ export async function indexObservations(ctx: IndexerContext): Promise<void> {
44
44
 
45
45
  ctx.insert({
46
46
  source: "observations",
47
- title: `[${subtype}] ${topic}`,
47
+ title: topic,
48
48
  content,
49
49
  topic,
50
50
  type: subtype,
@@ -25,30 +25,29 @@ function toISO(dateStr: string, fallback: string): string {
25
25
  return s.includes("T") ? s : `${s.slice(0, 10)}T00:00:00Z`;
26
26
  }
27
27
 
28
+ const ENRICH_SHARED = `Only expand from the information provided. Do not add names, dates, or facts not present in the input.
29
+ Include both singular and plural forms where applicable.
30
+ Keep under 80 words. Output only the description, no headers or formatting.`;
31
+
28
32
  const ENRICH_PROMPTS: Record<string, string> = {
29
33
  person: `You are enriching a personal contact entry for search indexing.
30
34
  The "relationship" field is the EXACT relationship — do NOT add other relationship types.
31
35
  Generate synonyms and alternative phrasings ONLY for the stated relationship.
32
36
  Example: relationship "uncle" → uncle, family member, relative, parent's brother, parent's sibling. NOT: cousin, nephew, aunt.
33
37
  Example: relationship "daughter" → daughter, child, kid, offspring, family member. NOT: son, niece, nephew.
34
- Include both singular and plural forms where applicable.
35
- Keep under 80 words. Output only the description, no headers or formatting.`,
38
+ ${ENRICH_SHARED}`,
36
39
  book: `You are enriching a book entry for search indexing.
37
- Generate: genre, themes, subject matter, and related topics.
38
- Include both singular and plural forms of key terms.
39
- Keep under 80 words. Output only the description, no headers or formatting.`,
40
+ Generate: genre, themes, and related topics based on the title.
41
+ ${ENRICH_SHARED}`,
40
42
  movie: `You are enriching a movie entry for search indexing.
41
- Generate: genre, themes, notable actors or director if well-known, and related topics.
42
- Include both singular and plural forms of key terms.
43
- Keep under 80 words. Output only the description, no headers or formatting.`,
43
+ Generate: genre, themes, and related topics based on the title.
44
+ ${ENRICH_SHARED}`,
44
45
  interest: `You are enriching a personal interest entry for search indexing.
45
46
  Generate: related activities, domains, synonyms, and common alternative phrasings.
46
- Include both singular and plural forms.
47
- Keep under 80 words. Output only the description, no headers or formatting.`,
47
+ ${ENRICH_SHARED}`,
48
48
  habit: `You are enriching a personal habit/routine entry for search indexing.
49
49
  Generate: related routines, synonyms, categories, and common alternative phrasings.
50
- Include both singular and plural forms.
51
- Keep under 80 words. Output only the description, no headers or formatting.`,
50
+ ${ENRICH_SHARED}`,
52
51
  };
53
52
 
54
53
  const ENRICH_TIMEOUT_MS = 30_000;
@@ -117,7 +116,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
117
116
 
118
117
  ctx.insert({
119
118
  source: "personal",
120
- title: `[book] ${book.title}`,
119
+ title: book.title,
121
120
  content,
122
121
  topic: "",
123
122
  type: "book",
@@ -150,7 +149,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
150
149
 
151
150
  ctx.insert({
152
151
  source: "personal",
153
- title: `[person] ${person.name}`,
152
+ title: person.name,
154
153
  content,
155
154
  topic: "",
156
155
  type: "person",
@@ -186,7 +185,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
186
185
 
187
186
  ctx.insert({
188
187
  source: "personal",
189
- title: `[movie] ${movie.title}`,
188
+ title: movie.title,
190
189
  content,
191
190
  topic: "",
192
191
  type: "movie",
@@ -212,7 +211,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
212
211
 
213
212
  ctx.insert({
214
213
  source: "personal",
215
- title: `[podcast] ${name}`,
214
+ title: name,
216
215
  content,
217
216
  topic: "",
218
217
  type: "podcast",
@@ -242,7 +241,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
242
241
 
243
242
  ctx.insert({
244
243
  source: "personal",
245
- title: `[interest] ${interest}`,
244
+ title: interest,
246
245
  content,
247
246
  topic: "",
248
247
  type: "interest",
@@ -274,7 +273,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
274
273
 
275
274
  ctx.insert({
276
275
  source: "personal",
277
- title: `[habit] ${habitName}`,
276
+ title: habitName,
278
277
  content,
279
278
  topic: "",
280
279
  type: "habit",
@@ -299,7 +298,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
299
298
 
300
299
  ctx.insert({
301
300
  source: "personal",
302
- title: `[profile] ${key}`,
301
+ title: key,
303
302
  content,
304
303
  topic: "",
305
304
  type: "profile",
@@ -327,7 +326,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
327
326
 
328
327
  ctx.insert({
329
328
  source: "personal",
330
- title: `[preference] ${category}/${key}`,
329
+ title: `${category}/${key}`,
331
330
  content,
332
331
  topic: "",
333
332
  type: "preference",
@@ -340,7 +339,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
340
339
 
341
340
  ctx.insert({
342
341
  source: "personal",
343
- title: `[preference] ${category}`,
342
+ title: category,
344
343
  content,
345
344
  topic: "",
346
345
  type: "preference",
@@ -122,7 +122,7 @@ export async function indexSessions(ctx: IndexerContext): Promise<void> {
122
122
 
123
123
  ctx.insert({
124
124
  source: "sessions",
125
- title: `[session] ${session.project} (${date})`,
125
+ title: `${session.project} (${date})`,
126
126
  content,
127
127
  topic: session.project,
128
128
  timestamp: session.firstTs,
@@ -43,7 +43,7 @@ export async function indexTeachings(ctx: IndexerContext): Promise<void> {
43
43
 
44
44
  ctx.insert({
45
45
  source: "teachings",
46
- title: `[teaching] ${topic}`,
46
+ title: topic,
47
47
  content,
48
48
  topic,
49
49
  type: "teaching",
package/lib/search.ts CHANGED
@@ -16,6 +16,7 @@ export interface SearchResult {
16
16
  content: string;
17
17
  metadata: string;
18
18
  topic: string;
19
+ type: string;
19
20
  rank: number;
20
21
  }
21
22
 
@@ -99,7 +100,7 @@ export function search(
99
100
  params.push(limit);
100
101
 
101
102
  const sql = `
102
- SELECT rowid, source, title, snippet(search, 2, '→', '←', '...', 32) as content, metadata, topic, rank
103
+ SELECT rowid, source, title, snippet(search, 2, '→', '←', '...', 32) as content, metadata, topic, type, rank
103
104
  FROM search
104
105
  WHERE ${conditions.join(" AND ")}
105
106
  ORDER BY rank
package/lib/semantic.ts CHANGED
@@ -20,6 +20,7 @@ export interface SemanticResult {
20
20
  content: string;
21
21
  metadata: string;
22
22
  topic: string;
23
+ type: string;
23
24
  distance: number;
24
25
  }
25
26
 
@@ -248,6 +249,7 @@ export async function semanticSearch(
248
249
  s.content,
249
250
  s.metadata,
250
251
  s.topic,
252
+ s.type,
251
253
  e.distance
252
254
  FROM embeddings e
253
255
  JOIN search s ON e.doc_id = s.rowid
@@ -276,6 +278,7 @@ export interface HybridResult {
276
278
  content: string;
277
279
  metadata: string;
278
280
  topic: string;
281
+ type: string;
279
282
  score: number;
280
283
  vectorScore: number;
281
284
  textScore: number;
@@ -364,6 +367,7 @@ export async function hybridSearch(
364
367
  content: r.content,
365
368
  metadata: r.metadata,
366
369
  topic: r.topic,
370
+ type: r.type,
367
371
  vectorScore,
368
372
  textScore: 0,
369
373
  score: vectorWeight * vectorScore,
@@ -391,6 +395,7 @@ export async function hybridSearch(
391
395
  content: r.content,
392
396
  metadata: r.metadata,
393
397
  topic: r.topic,
398
+ type: r.type,
394
399
  vectorScore: 0,
395
400
  textScore,
396
401
  score: textWeight * textScore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidwire/lore",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Unified knowledge CLI - Search, list, and capture your indexed knowledge",
5
5
  "type": "module",
6
6
  "main": "./index.ts",