@mingxy/cerebro 1.5.5 → 1.5.6
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/package.json +1 -1
- package/src/hooks.ts +6 -0
- package/src/index.ts +1 -1
package/package.json
CHANGED
package/src/hooks.ts
CHANGED
|
@@ -353,6 +353,7 @@ export function sessionIdleHook(
|
|
|
353
353
|
tui: any,
|
|
354
354
|
sdkClient: any,
|
|
355
355
|
_ingestMode: "smart" | "raw" = "smart",
|
|
356
|
+
getMainSessionId?: () => string | undefined,
|
|
356
357
|
) {
|
|
357
358
|
let idleTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
358
359
|
let isCapturing = false;
|
|
@@ -363,6 +364,11 @@ export function sessionIdleHook(
|
|
|
363
364
|
const sessionID = input.event.properties?.sessionID;
|
|
364
365
|
if (!sessionID) return;
|
|
365
366
|
|
|
367
|
+
if (getMainSessionId) {
|
|
368
|
+
const mainId = getMainSessionId();
|
|
369
|
+
if (mainId && sessionID !== mainId) return;
|
|
370
|
+
}
|
|
371
|
+
|
|
366
372
|
if (idleTimeout) clearTimeout(idleTimeout);
|
|
367
373
|
|
|
368
374
|
idleTimeout = setTimeout(async () => {
|
package/src/index.ts
CHANGED
|
@@ -96,7 +96,7 @@ const OmemPlugin: Plugin = async (input) => {
|
|
|
96
96
|
"chat.message": keywordDetectionHook(omemClient, containerTags, config.autoCaptureThreshold, tui, config.ingestMode),
|
|
97
97
|
"experimental.session.compacting": compactingHook(omemClient, containerTags, tui, config.ingestMode),
|
|
98
98
|
tool: buildTools(omemClient, containerTags, { agentId, getSessionId: () => currentSessionId }),
|
|
99
|
-
event: sessionIdleHook(omemClient, containerTags, tui, client, config.ingestMode),
|
|
99
|
+
event: sessionIdleHook(omemClient, containerTags, tui, client, config.ingestMode, () => currentSessionId),
|
|
100
100
|
"shell.env": async (_input: any, output: any) => {
|
|
101
101
|
if (directory) {
|
|
102
102
|
output.env.OMEM_PROJECT_DIR = directory;
|