@voidwire/lore 0.5.3 → 0.5.5
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/index.ts +2 -0
- package/lib/capture.ts +47 -1
- package/lib/list.ts +8 -4
- package/lib/projects.ts +5 -2
- package/lib/semantic.ts +6 -4
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -67,6 +67,7 @@ export {
|
|
|
67
67
|
captureNote,
|
|
68
68
|
captureTeaching,
|
|
69
69
|
captureInsight,
|
|
70
|
+
captureLearning,
|
|
70
71
|
type CaptureResult,
|
|
71
72
|
type KnowledgeInput,
|
|
72
73
|
type KnowledgeCaptureType,
|
|
@@ -75,6 +76,7 @@ export {
|
|
|
75
76
|
type TeachingInput,
|
|
76
77
|
type InsightInput,
|
|
77
78
|
type InsightType,
|
|
79
|
+
type LearningInput,
|
|
78
80
|
type CaptureEvent,
|
|
79
81
|
} from "./lib/capture";
|
|
80
82
|
|
package/lib/capture.ts
CHANGED
|
@@ -73,6 +73,13 @@ export interface InsightInput {
|
|
|
73
73
|
source: "auto";
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
export interface LearningInput {
|
|
77
|
+
topic: string; // "spanish", "guitar", "kubernetes" - the learning topic
|
|
78
|
+
persona: string; // "marcus", "elena", etc.
|
|
79
|
+
progress: string; // "Covered verb conjugations, struggles with subjunctive"
|
|
80
|
+
session_summary?: string; // Longer form session notes
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
interface TaskEvent {
|
|
77
84
|
event: "captured";
|
|
78
85
|
type: "task";
|
|
@@ -139,12 +146,25 @@ interface InsightEvent {
|
|
|
139
146
|
};
|
|
140
147
|
}
|
|
141
148
|
|
|
149
|
+
interface LearningEvent {
|
|
150
|
+
event: "captured";
|
|
151
|
+
type: "learning";
|
|
152
|
+
timestamp: string;
|
|
153
|
+
data: {
|
|
154
|
+
topic: string; // Learning topic (spanish, guitar, etc.)
|
|
155
|
+
persona: string;
|
|
156
|
+
progress: string;
|
|
157
|
+
session_summary?: string;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
142
161
|
type CaptureEvent =
|
|
143
162
|
| TaskEvent
|
|
144
163
|
| KnowledgeEvent
|
|
145
164
|
| NoteEvent
|
|
146
165
|
| TeachingEvent
|
|
147
|
-
| InsightEvent
|
|
166
|
+
| InsightEvent
|
|
167
|
+
| LearningEvent;
|
|
148
168
|
|
|
149
169
|
function getLogPath(): string {
|
|
150
170
|
const dataHome =
|
|
@@ -317,4 +337,30 @@ export function captureInsight(input: InsightInput): CaptureResult {
|
|
|
317
337
|
return writeEvent(event);
|
|
318
338
|
}
|
|
319
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Capture a learning session progress
|
|
342
|
+
*/
|
|
343
|
+
export function captureLearning(input: LearningInput): CaptureResult {
|
|
344
|
+
if (!input.topic || !input.persona || !input.progress) {
|
|
345
|
+
return {
|
|
346
|
+
success: false,
|
|
347
|
+
error: "Missing required fields: topic, persona, progress",
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const event: LearningEvent = {
|
|
352
|
+
event: "captured",
|
|
353
|
+
type: "learning",
|
|
354
|
+
timestamp: "",
|
|
355
|
+
data: {
|
|
356
|
+
topic: input.topic,
|
|
357
|
+
persona: input.persona,
|
|
358
|
+
progress: input.progress,
|
|
359
|
+
session_summary: input.session_summary,
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
return writeEvent(event);
|
|
364
|
+
}
|
|
365
|
+
|
|
320
366
|
export type { CaptureEvent };
|
package/lib/list.ts
CHANGED
|
@@ -28,7 +28,8 @@ export type Source =
|
|
|
28
28
|
| "habits"
|
|
29
29
|
| "teachings"
|
|
30
30
|
| "sessions"
|
|
31
|
-
| "insights"
|
|
31
|
+
| "insights"
|
|
32
|
+
| "learnings";
|
|
32
33
|
|
|
33
34
|
export const SOURCES: Source[] = [
|
|
34
35
|
"development",
|
|
@@ -49,6 +50,7 @@ export const SOURCES: Source[] = [
|
|
|
49
50
|
"teachings",
|
|
50
51
|
"sessions",
|
|
51
52
|
"insights",
|
|
53
|
+
"learnings",
|
|
52
54
|
];
|
|
53
55
|
|
|
54
56
|
// Sources that query the 'personal' source with type filter
|
|
@@ -61,14 +63,16 @@ const PERSONAL_SUBTYPES: Partial<Record<Source, string>> = {
|
|
|
61
63
|
habits: "habit",
|
|
62
64
|
};
|
|
63
65
|
|
|
64
|
-
// Maps source to metadata field
|
|
66
|
+
// Maps source to metadata field for --project filter
|
|
67
|
+
// Project-based domains use "project", topic-based domains use "topic"
|
|
65
68
|
const PROJECT_FIELD: Record<string, string> = {
|
|
66
69
|
commits: "project",
|
|
67
70
|
sessions: "project",
|
|
68
71
|
tasks: "project",
|
|
69
|
-
captures: "context",
|
|
70
|
-
teachings: "source",
|
|
71
72
|
insights: "project",
|
|
73
|
+
captures: "topic",
|
|
74
|
+
teachings: "topic",
|
|
75
|
+
learnings: "topic",
|
|
72
76
|
};
|
|
73
77
|
|
|
74
78
|
export interface ListOptions {
|
package/lib/projects.ts
CHANGED
|
@@ -9,12 +9,15 @@ import { Database } from "bun:sqlite";
|
|
|
9
9
|
import { homedir } from "os";
|
|
10
10
|
import { existsSync } from "fs";
|
|
11
11
|
|
|
12
|
+
// Project-based domains use "project", topic-based domains use "topic"
|
|
12
13
|
const PROJECT_FIELD: Record<string, string> = {
|
|
13
14
|
commits: "project",
|
|
14
15
|
sessions: "project",
|
|
15
16
|
tasks: "project",
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
insights: "project",
|
|
18
|
+
captures: "topic",
|
|
19
|
+
teachings: "topic",
|
|
20
|
+
learnings: "topic",
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
function getDatabasePath(): string {
|
package/lib/semantic.ts
CHANGED
|
@@ -36,15 +36,17 @@ export interface SemanticSearchOptions {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Maps source types to their project field name in metadata JSON.
|
|
40
|
-
*
|
|
39
|
+
* Maps source types to their project/topic field name in metadata JSON.
|
|
40
|
+
* Project-based domains use "project", topic-based domains use "topic".
|
|
41
41
|
*/
|
|
42
42
|
const PROJECT_FIELD: Record<string, string> = {
|
|
43
43
|
commits: "project",
|
|
44
44
|
sessions: "project",
|
|
45
45
|
tasks: "project",
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
insights: "project",
|
|
47
|
+
captures: "topic",
|
|
48
|
+
teachings: "topic",
|
|
49
|
+
learnings: "topic",
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
const MODEL_NAME = "nomic-ai/nomic-embed-text-v1.5";
|