@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.
- package/lib/indexers/blogs.ts +1 -1
- package/lib/indexers/captures.ts +3 -3
- package/lib/indexers/commits.ts +1 -1
- package/lib/indexers/explorations.ts +1 -1
- package/lib/indexers/flux.ts +1 -4
- package/lib/indexers/insights.ts +1 -1
- package/lib/indexers/learnings.ts +1 -1
- package/lib/indexers/observations.ts +1 -1
- package/lib/indexers/personal.ts +20 -21
- package/lib/indexers/sessions.ts +1 -1
- package/lib/indexers/teachings.ts +1 -1
- package/lib/search.ts +2 -1
- package/lib/semantic.ts +5 -0
- package/package.json +1 -1
package/lib/indexers/blogs.ts
CHANGED
package/lib/indexers/captures.ts
CHANGED
|
@@ -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 =
|
|
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 ?
|
|
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 =
|
|
91
|
+
title = topic;
|
|
92
92
|
type = subtype;
|
|
93
93
|
}
|
|
94
94
|
|
package/lib/indexers/commits.ts
CHANGED
package/lib/indexers/flux.ts
CHANGED
|
@@ -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",
|
package/lib/indexers/insights.ts
CHANGED
package/lib/indexers/personal.ts
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
38
|
-
|
|
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,
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
342
|
+
title: category,
|
|
344
343
|
content,
|
|
345
344
|
topic: "",
|
|
346
345
|
type: "preference",
|
package/lib/indexers/sessions.ts
CHANGED
|
@@ -122,7 +122,7 @@ export async function indexSessions(ctx: IndexerContext): Promise<void> {
|
|
|
122
122
|
|
|
123
123
|
ctx.insert({
|
|
124
124
|
source: "sessions",
|
|
125
|
-
title:
|
|
125
|
+
title: `${session.project} (${date})`,
|
|
126
126
|
content,
|
|
127
127
|
topic: session.project,
|
|
128
128
|
timestamp: session.firstTs,
|
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,
|