@voidwire/lore 1.1.2 → 1.3.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 +9 -9
- package/lib/indexers/sessions.ts +1 -1
- package/lib/indexers/teachings.ts +1 -1
- package/lib/realtime.ts +8 -8
- 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
|
@@ -116,7 +116,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
116
116
|
|
|
117
117
|
ctx.insert({
|
|
118
118
|
source: "personal",
|
|
119
|
-
title:
|
|
119
|
+
title: book.title,
|
|
120
120
|
content,
|
|
121
121
|
topic: "",
|
|
122
122
|
type: "book",
|
|
@@ -149,7 +149,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
149
149
|
|
|
150
150
|
ctx.insert({
|
|
151
151
|
source: "personal",
|
|
152
|
-
title:
|
|
152
|
+
title: person.name,
|
|
153
153
|
content,
|
|
154
154
|
topic: "",
|
|
155
155
|
type: "person",
|
|
@@ -185,7 +185,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
185
185
|
|
|
186
186
|
ctx.insert({
|
|
187
187
|
source: "personal",
|
|
188
|
-
title:
|
|
188
|
+
title: movie.title,
|
|
189
189
|
content,
|
|
190
190
|
topic: "",
|
|
191
191
|
type: "movie",
|
|
@@ -211,7 +211,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
211
211
|
|
|
212
212
|
ctx.insert({
|
|
213
213
|
source: "personal",
|
|
214
|
-
title:
|
|
214
|
+
title: name,
|
|
215
215
|
content,
|
|
216
216
|
topic: "",
|
|
217
217
|
type: "podcast",
|
|
@@ -241,7 +241,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
241
241
|
|
|
242
242
|
ctx.insert({
|
|
243
243
|
source: "personal",
|
|
244
|
-
title:
|
|
244
|
+
title: interest,
|
|
245
245
|
content,
|
|
246
246
|
topic: "",
|
|
247
247
|
type: "interest",
|
|
@@ -273,7 +273,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
273
273
|
|
|
274
274
|
ctx.insert({
|
|
275
275
|
source: "personal",
|
|
276
|
-
title:
|
|
276
|
+
title: habitName,
|
|
277
277
|
content,
|
|
278
278
|
topic: "",
|
|
279
279
|
type: "habit",
|
|
@@ -298,7 +298,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
298
298
|
|
|
299
299
|
ctx.insert({
|
|
300
300
|
source: "personal",
|
|
301
|
-
title:
|
|
301
|
+
title: key,
|
|
302
302
|
content,
|
|
303
303
|
topic: "",
|
|
304
304
|
type: "profile",
|
|
@@ -326,7 +326,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
326
326
|
|
|
327
327
|
ctx.insert({
|
|
328
328
|
source: "personal",
|
|
329
|
-
title:
|
|
329
|
+
title: `${category}/${key}`,
|
|
330
330
|
content,
|
|
331
331
|
topic: "",
|
|
332
332
|
type: "preference",
|
|
@@ -339,7 +339,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
339
339
|
|
|
340
340
|
ctx.insert({
|
|
341
341
|
source: "personal",
|
|
342
|
-
title:
|
|
342
|
+
title: category,
|
|
343
343
|
content,
|
|
344
344
|
topic: "",
|
|
345
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/realtime.ts
CHANGED
|
@@ -129,26 +129,26 @@ function getSourceForEvent(event: CaptureEvent): string {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
* Build title for FTS5 entry,
|
|
132
|
+
* Build title for FTS5 entry (type is a first-class column, not a title prefix)
|
|
133
133
|
*/
|
|
134
134
|
function buildTitle(event: CaptureEvent): string {
|
|
135
135
|
const data = event.data as Record<string, unknown>;
|
|
136
136
|
|
|
137
137
|
switch (event.type) {
|
|
138
138
|
case "knowledge":
|
|
139
|
-
return
|
|
139
|
+
return `${data.topic || "general"}`;
|
|
140
140
|
case "teaching":
|
|
141
|
-
return
|
|
141
|
+
return `${data.topic || "general"} (${data.confidence || "medium"})`;
|
|
142
142
|
case "observation":
|
|
143
|
-
return
|
|
143
|
+
return `${data.topic || "general"}`;
|
|
144
144
|
case "insight":
|
|
145
|
-
return
|
|
145
|
+
return `${data.topic || "general"}`;
|
|
146
146
|
case "learning":
|
|
147
|
-
return
|
|
147
|
+
return `${data.topic || "general"}`;
|
|
148
148
|
case "task":
|
|
149
|
-
return
|
|
149
|
+
return `${data.topic || "general"}: ${data.name || "untitled"}`;
|
|
150
150
|
case "note":
|
|
151
|
-
return
|
|
151
|
+
return `${data.topic || "general"}`;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
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,
|