@voidwire/lore 0.5.2 → 0.5.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/index.ts +2 -0
- package/lib/capture.ts +50 -1
- package/lib/list.ts +7 -1
- 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,14 @@ export interface InsightInput {
|
|
|
73
73
|
source: "auto";
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
export interface LearningInput {
|
|
77
|
+
topic: string; // "spanish", "guitar", "kubernetes"
|
|
78
|
+
persona: string; // "marcus", "elena", etc.
|
|
79
|
+
progress: string; // "Covered verb conjugations, struggles with subjunctive"
|
|
80
|
+
goal?: string; // "conversational in 3 months"
|
|
81
|
+
session_summary?: string; // Longer form session notes
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
interface TaskEvent {
|
|
77
85
|
event: "captured";
|
|
78
86
|
type: "task";
|
|
@@ -139,12 +147,26 @@ interface InsightEvent {
|
|
|
139
147
|
};
|
|
140
148
|
}
|
|
141
149
|
|
|
150
|
+
interface LearningEvent {
|
|
151
|
+
event: "captured";
|
|
152
|
+
type: "learning";
|
|
153
|
+
timestamp: string;
|
|
154
|
+
data: {
|
|
155
|
+
topic: string;
|
|
156
|
+
persona: string;
|
|
157
|
+
progress: string;
|
|
158
|
+
goal?: string;
|
|
159
|
+
session_summary?: string;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
142
163
|
type CaptureEvent =
|
|
143
164
|
| TaskEvent
|
|
144
165
|
| KnowledgeEvent
|
|
145
166
|
| NoteEvent
|
|
146
167
|
| TeachingEvent
|
|
147
|
-
| InsightEvent
|
|
168
|
+
| InsightEvent
|
|
169
|
+
| LearningEvent;
|
|
148
170
|
|
|
149
171
|
function getLogPath(): string {
|
|
150
172
|
const dataHome =
|
|
@@ -317,4 +339,31 @@ export function captureInsight(input: InsightInput): CaptureResult {
|
|
|
317
339
|
return writeEvent(event);
|
|
318
340
|
}
|
|
319
341
|
|
|
342
|
+
/**
|
|
343
|
+
* Capture a learning session progress
|
|
344
|
+
*/
|
|
345
|
+
export function captureLearning(input: LearningInput): CaptureResult {
|
|
346
|
+
if (!input.topic || !input.persona || !input.progress) {
|
|
347
|
+
return {
|
|
348
|
+
success: false,
|
|
349
|
+
error: "Missing required fields: topic, persona, progress",
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const event: LearningEvent = {
|
|
354
|
+
event: "captured",
|
|
355
|
+
type: "learning",
|
|
356
|
+
timestamp: "",
|
|
357
|
+
data: {
|
|
358
|
+
topic: input.topic,
|
|
359
|
+
persona: input.persona,
|
|
360
|
+
progress: input.progress,
|
|
361
|
+
goal: input.goal,
|
|
362
|
+
session_summary: input.session_summary,
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
return writeEvent(event);
|
|
367
|
+
}
|
|
368
|
+
|
|
320
369
|
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
|
|
@@ -69,6 +71,7 @@ const PROJECT_FIELD: Record<string, string> = {
|
|
|
69
71
|
captures: "context",
|
|
70
72
|
teachings: "source",
|
|
71
73
|
insights: "project",
|
|
74
|
+
learnings: "topic",
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
export interface ListOptions {
|
|
@@ -128,6 +131,9 @@ function queryBySource(
|
|
|
128
131
|
params.push(type);
|
|
129
132
|
}
|
|
130
133
|
|
|
134
|
+
// Order by timestamp descending (most recent first)
|
|
135
|
+
sql += " ORDER BY json_extract(metadata, '$.timestamp') DESC";
|
|
136
|
+
|
|
131
137
|
if (limit) {
|
|
132
138
|
sql += " LIMIT ?";
|
|
133
139
|
params.push(limit);
|