@voidwire/lore 1.0.1 → 1.0.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/lib/config.ts +5 -0
- package/lib/indexers/sessions.ts +16 -7
- package/package.json +1 -1
package/lib/config.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface LoreConfig {
|
|
|
24
24
|
projects: string;
|
|
25
25
|
personal: string;
|
|
26
26
|
session_events?: string;
|
|
27
|
+
sable_events?: string;
|
|
27
28
|
flux?: string;
|
|
28
29
|
flux_projects?: string;
|
|
29
30
|
};
|
|
@@ -118,6 +119,10 @@ export function getConfig(): LoreConfig {
|
|
|
118
119
|
typeof paths.session_events === "string"
|
|
119
120
|
? resolvePath(paths.session_events)
|
|
120
121
|
: undefined,
|
|
122
|
+
sable_events:
|
|
123
|
+
typeof paths.sable_events === "string"
|
|
124
|
+
? resolvePath(paths.sable_events)
|
|
125
|
+
: undefined,
|
|
121
126
|
flux:
|
|
122
127
|
typeof paths.flux === "string" ? resolvePath(paths.flux) : undefined,
|
|
123
128
|
flux_projects:
|
package/lib/indexers/sessions.ts
CHANGED
|
@@ -27,16 +27,25 @@ interface SessionData {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export async function indexSessions(ctx: IndexerContext): Promise<void> {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// Collect event files from all configured directories
|
|
31
|
+
const eventDirs = [
|
|
32
|
+
ctx.config.paths.session_events,
|
|
33
|
+
ctx.config.paths.sable_events,
|
|
34
|
+
].filter((d): d is string => !!d && existsSync(d));
|
|
35
|
+
|
|
36
|
+
if (eventDirs.length === 0) {
|
|
37
|
+
console.log("No session events directories found, skipping sessions");
|
|
33
38
|
return;
|
|
34
39
|
}
|
|
35
40
|
|
|
36
|
-
const eventFiles =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
const eventFiles: string[] = [];
|
|
42
|
+
for (const dir of eventDirs) {
|
|
43
|
+
const files = readdirSync(dir)
|
|
44
|
+
.filter((f) => f.endsWith(".jsonl"))
|
|
45
|
+
.map((f) => join(dir, f));
|
|
46
|
+
eventFiles.push(...files);
|
|
47
|
+
}
|
|
48
|
+
eventFiles.sort();
|
|
40
49
|
|
|
41
50
|
if (eventFiles.length === 0) {
|
|
42
51
|
console.log("No session event files found, skipping sessions");
|