@voidwire/lore 1.7.2 → 1.7.4

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/about.ts CHANGED
@@ -24,7 +24,7 @@ export interface AboutResult {
24
24
  /**
25
25
  * Sources to query for project knowledge
26
26
  * Each source has a different field for project mapping (handled by list.ts)
27
- * Note: "insights" will be added when task 2.1 is complete
27
+ * Covers commits, captures, flux, teachings, and sessions
28
28
  */
29
29
  const ABOUT_SOURCES: Source[] = [
30
30
  "commits",
@@ -6,12 +6,10 @@
6
6
  */
7
7
 
8
8
  import type { IndexerFunction } from "../indexer";
9
- import { indexEvents } from "./events";
10
9
  import { indexReadmes } from "./readmes";
11
10
  import { indexDevelopment } from "./development";
12
11
  import { indexCaptures } from "./captures";
13
12
  import { indexTeachings } from "./teachings";
14
- import { indexInsights } from "./insights";
15
13
  import { indexObservations } from "./observations";
16
14
  import { indexExplorations } from "./explorations";
17
15
  import { indexSessions } from "./sessions";
@@ -22,12 +20,10 @@ import { indexBlogs } from "./blogs";
22
20
  import { indexPersonal } from "./personal";
23
21
 
24
22
  export const indexers: Record<string, IndexerFunction> = {
25
- events: indexEvents,
26
23
  readmes: indexReadmes,
27
24
  development: indexDevelopment,
28
25
  captures: indexCaptures,
29
26
  teachings: indexTeachings,
30
- insights: indexInsights,
31
27
  observations: indexObservations,
32
28
  explorations: indexExplorations,
33
29
  sessions: indexSessions,
package/lib/list.ts CHANGED
@@ -13,7 +13,6 @@ import { getDatabasePath } from "./db.js";
13
13
  export type Source =
14
14
  | "development"
15
15
  | "flux"
16
- | "events"
17
16
  | "blogs"
18
17
  | "commits"
19
18
  | "explorations"
@@ -28,13 +27,11 @@ export type Source =
28
27
  | "habits"
29
28
  | "teachings"
30
29
  | "sessions"
31
- | "insights"
32
30
  | "observations";
33
31
 
34
32
  export const SOURCES: Source[] = [
35
33
  "development",
36
34
  "flux",
37
- "events",
38
35
  "blogs",
39
36
  "commits",
40
37
  "explorations",
@@ -49,7 +46,6 @@ export const SOURCES: Source[] = [
49
46
  "habits",
50
47
  "teachings",
51
48
  "sessions",
52
- "insights",
53
49
  "observations",
54
50
  ];
55
51
 
package/lib/projects.ts CHANGED
@@ -13,7 +13,6 @@ const PROJECT_SOURCES = [
13
13
  "commits",
14
14
  "sessions",
15
15
  "flux",
16
- "insights",
17
16
  "captures",
18
17
  "teachings",
19
18
  "observations",
package/lib/realtime.ts CHANGED
@@ -303,18 +303,20 @@ export function extractType(event: CaptureEvent): string {
303
303
 
304
304
  switch (event.type) {
305
305
  case "knowledge":
306
- return String(data.subtype || "general");
306
+ return String(data.subtype);
307
307
  case "teaching":
308
308
  return "teaching";
309
309
  case "observation":
310
- return String(data.subtype || "pattern");
310
+ return String(data.subtype);
311
311
  case "insight":
312
- return String(data.subtype || "insight");
312
+ return String(data.subtype);
313
313
  case "task":
314
314
  return "task";
315
315
  case "note":
316
316
  return "note";
317
317
  default:
318
- return "general";
318
+ throw new Error(
319
+ `extractType: unhandled event type "${(event as any).type}"`,
320
+ );
319
321
  }
320
322
  }
package/lib/source-map.ts CHANGED
@@ -19,7 +19,9 @@ export function getSourceForEvent(event: CaptureEvent): string {
19
19
  case "observation":
20
20
  return "observations";
21
21
  case "insight":
22
- return "insights";
22
+ throw new Error(
23
+ "getSourceForEvent: insight events should not be indexed — they go to log.jsonl only",
24
+ );
23
25
  case "task":
24
26
  return "flux";
25
27
  case "note":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidwire/lore",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "description": "Unified knowledge CLI - Search, list, and capture your indexed knowledge",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -1,65 +0,0 @@
1
- /**
2
- * lib/indexers/events.ts - Events indexer
3
- *
4
- * Aggregates development events from log.jsonl by project.
5
- * Each project gets one entry with all event lines.
6
- *
7
- * Source: events
8
- * Topic: project name
9
- * Type: (empty)
10
- * Timestamp: last event timestamp per project
11
- */
12
-
13
- import { readFileSync } from "fs";
14
- import { checkPath, type IndexerContext } from "../indexer";
15
-
16
- export async function indexEvents(ctx: IndexerContext): Promise<void> {
17
- const logPath = `${ctx.config.paths.data}/log.jsonl`;
18
- if (
19
- !checkPath(
20
- "events",
21
- "log.jsonl",
22
- logPath,
23
- "populated by Sable session hooks",
24
- )
25
- )
26
- return;
27
-
28
- const lines = readFileSync(logPath, "utf-8").split("\n").filter(Boolean);
29
- const projectData = new Map<
30
- string,
31
- { lines: string[]; lastTimestamp: string }
32
- >();
33
-
34
- for (const line of lines) {
35
- try {
36
- const event = JSON.parse(line);
37
- const project = event.data?.topic || "general";
38
- if (!projectData.has(project)) {
39
- projectData.set(project, { lines: [], lastTimestamp: "" });
40
- }
41
- const data = projectData.get(project)!;
42
- data.lines.push(
43
- `[${event.timestamp}] ${event.event}: ${event.type || ""}`,
44
- );
45
- if (event.timestamp) {
46
- data.lastTimestamp = event.timestamp;
47
- }
48
- } catch {
49
- // Skip malformed JSON
50
- continue;
51
- }
52
- }
53
-
54
- for (const [project, data] of projectData) {
55
- const content = data.lines.join("\n");
56
-
57
- ctx.insert({
58
- source: "events",
59
- title: `Development events: ${project}`,
60
- content,
61
- topic: project,
62
- timestamp: data.lastTimestamp,
63
- });
64
- }
65
- }
@@ -1,58 +0,0 @@
1
- /**
2
- * lib/indexers/insights.ts - Insights indexer
3
- *
4
- * Reads log.jsonl and indexes insight summary captures.
5
- * Filters for event=captured AND type=insight AND data.subtype=summary.
6
- *
7
- * Source: insights
8
- * Topic: data.topic or "assistant"
9
- * Type: summary (fixed)
10
- * Timestamp: event timestamp
11
- */
12
-
13
- import { readFileSync } from "fs";
14
- import { checkPath, type IndexerContext } from "../indexer";
15
-
16
- export async function indexInsights(ctx: IndexerContext): Promise<void> {
17
- const logPath = `${ctx.config.paths.data}/log.jsonl`;
18
- if (
19
- !checkPath(
20
- "insights",
21
- "log.jsonl",
22
- logPath,
23
- "populated by Sable session hooks",
24
- )
25
- )
26
- return;
27
-
28
- const lines = readFileSync(logPath, "utf-8").split("\n").filter(Boolean);
29
-
30
- for (const line of lines) {
31
- try {
32
- const event = JSON.parse(line);
33
- if (event.event !== "captured" || event.type !== "insight") continue;
34
- if (event.data?.subtype !== "summary") continue;
35
-
36
- const topic = event.data?.topic || "assistant";
37
- const content = event.data?.content || "";
38
- const sessionId = event.data?.session_id;
39
-
40
- if (!content) continue;
41
-
42
- const metadata: Record<string, unknown> = {};
43
- if (sessionId) metadata.session_id = sessionId;
44
-
45
- ctx.insert({
46
- source: "insights",
47
- title: topic,
48
- content,
49
- topic,
50
- type: "summary",
51
- timestamp: event.timestamp,
52
- metadata: Object.keys(metadata).length > 0 ? metadata : undefined,
53
- });
54
- } catch (e) {
55
- continue;
56
- }
57
- }
58
- }