@voidwire/lore 0.5.0 → 0.5.2
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 +3 -0
- package/lib/capture.ts +71 -1
- package/lib/list.ts +4 -1
- package/package.json +3 -2
package/index.ts
CHANGED
|
@@ -66,12 +66,15 @@ export {
|
|
|
66
66
|
captureTask,
|
|
67
67
|
captureNote,
|
|
68
68
|
captureTeaching,
|
|
69
|
+
captureInsight,
|
|
69
70
|
type CaptureResult,
|
|
70
71
|
type KnowledgeInput,
|
|
71
72
|
type KnowledgeCaptureType,
|
|
72
73
|
type TaskInput,
|
|
73
74
|
type NoteInput,
|
|
74
75
|
type TeachingInput,
|
|
76
|
+
type InsightInput,
|
|
77
|
+
type InsightType,
|
|
75
78
|
type CaptureEvent,
|
|
76
79
|
} from "./lib/capture";
|
|
77
80
|
|
package/lib/capture.ts
CHANGED
|
@@ -57,6 +57,22 @@ export interface TeachingInput {
|
|
|
57
57
|
source?: string;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
export type InsightType =
|
|
61
|
+
| "decision"
|
|
62
|
+
| "pattern"
|
|
63
|
+
| "preference"
|
|
64
|
+
| "problem"
|
|
65
|
+
| "tool"
|
|
66
|
+
| "summary";
|
|
67
|
+
|
|
68
|
+
export interface InsightInput {
|
|
69
|
+
session_id: string;
|
|
70
|
+
project: string;
|
|
71
|
+
insight_type: InsightType;
|
|
72
|
+
text: string;
|
|
73
|
+
source: "auto";
|
|
74
|
+
}
|
|
75
|
+
|
|
60
76
|
interface TaskEvent {
|
|
61
77
|
event: "captured";
|
|
62
78
|
type: "task";
|
|
@@ -110,7 +126,25 @@ interface TeachingEvent {
|
|
|
110
126
|
};
|
|
111
127
|
}
|
|
112
128
|
|
|
113
|
-
|
|
129
|
+
interface InsightEvent {
|
|
130
|
+
event: "captured";
|
|
131
|
+
type: "insight";
|
|
132
|
+
timestamp: string;
|
|
133
|
+
data: {
|
|
134
|
+
session_id: string;
|
|
135
|
+
project: string;
|
|
136
|
+
insight_type: InsightType;
|
|
137
|
+
text: string;
|
|
138
|
+
source: "auto";
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
type CaptureEvent =
|
|
143
|
+
| TaskEvent
|
|
144
|
+
| KnowledgeEvent
|
|
145
|
+
| NoteEvent
|
|
146
|
+
| TeachingEvent
|
|
147
|
+
| InsightEvent;
|
|
114
148
|
|
|
115
149
|
function getLogPath(): string {
|
|
116
150
|
const dataHome =
|
|
@@ -247,4 +281,40 @@ export function captureTeaching(input: TeachingInput): CaptureResult {
|
|
|
247
281
|
return writeEvent(event);
|
|
248
282
|
}
|
|
249
283
|
|
|
284
|
+
const VALID_INSIGHT_TYPES: InsightType[] = [
|
|
285
|
+
"decision",
|
|
286
|
+
"pattern",
|
|
287
|
+
"preference",
|
|
288
|
+
"problem",
|
|
289
|
+
"tool",
|
|
290
|
+
"summary",
|
|
291
|
+
];
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Capture an auto-extracted insight from llm-summarize
|
|
295
|
+
*/
|
|
296
|
+
export function captureInsight(input: InsightInput): CaptureResult {
|
|
297
|
+
if (!VALID_INSIGHT_TYPES.includes(input.insight_type)) {
|
|
298
|
+
return {
|
|
299
|
+
success: false,
|
|
300
|
+
error: `Invalid insight_type: ${input.insight_type}. Must be one of: ${VALID_INSIGHT_TYPES.join(", ")}`,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const event: InsightEvent = {
|
|
305
|
+
event: "captured",
|
|
306
|
+
type: "insight",
|
|
307
|
+
timestamp: "",
|
|
308
|
+
data: {
|
|
309
|
+
session_id: input.session_id,
|
|
310
|
+
project: input.project,
|
|
311
|
+
insight_type: input.insight_type,
|
|
312
|
+
text: input.text,
|
|
313
|
+
source: input.source,
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
return writeEvent(event);
|
|
318
|
+
}
|
|
319
|
+
|
|
250
320
|
export type { CaptureEvent };
|
package/lib/list.ts
CHANGED
|
@@ -27,7 +27,8 @@ export type Source =
|
|
|
27
27
|
| "people"
|
|
28
28
|
| "habits"
|
|
29
29
|
| "teachings"
|
|
30
|
-
| "sessions"
|
|
30
|
+
| "sessions"
|
|
31
|
+
| "insights";
|
|
31
32
|
|
|
32
33
|
export const SOURCES: Source[] = [
|
|
33
34
|
"development",
|
|
@@ -47,6 +48,7 @@ export const SOURCES: Source[] = [
|
|
|
47
48
|
"habits",
|
|
48
49
|
"teachings",
|
|
49
50
|
"sessions",
|
|
51
|
+
"insights",
|
|
50
52
|
];
|
|
51
53
|
|
|
52
54
|
// Sources that query the 'personal' source with type filter
|
|
@@ -66,6 +68,7 @@ const PROJECT_FIELD: Record<string, string> = {
|
|
|
66
68
|
tasks: "project",
|
|
67
69
|
captures: "context",
|
|
68
70
|
teachings: "source",
|
|
71
|
+
insights: "project",
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
export interface ListOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidwire/lore",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Unified knowledge CLI - Search, list, and capture your indexed knowledge",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./index.ts",
|
|
12
|
-
"./cli": "./cli.ts"
|
|
12
|
+
"./cli": "./cli.ts",
|
|
13
|
+
"./capture": "./lib/capture.ts"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"index.ts",
|