feat(plugin): integrate team-mode into session events and synthetic idles

This commit is contained in:
YeonGyu-Kim
2026-04-28 10:47:36 +09:00
parent f882f04bb0
commit dabd35f266
5 changed files with 949 additions and 45 deletions
+8 -1
View File
@@ -1,10 +1,11 @@
export function pruneRecentSyntheticIdles(args: {
recentSyntheticIdles: Map<string, number>
recentRealIdles: Map<string, number>
recentAnyIdles: Map<string, number>
now: number
dedupWindowMs: number
}): void {
const { recentSyntheticIdles, recentRealIdles, now, dedupWindowMs } = args
const { recentSyntheticIdles, recentRealIdles, recentAnyIdles, now, dedupWindowMs } = args
for (const [sessionID, emittedAt] of recentSyntheticIdles) {
if (now - emittedAt >= dedupWindowMs) {
@@ -17,4 +18,10 @@ export function pruneRecentSyntheticIdles(args: {
recentRealIdles.delete(sessionID)
}
}
for (const [sessionID, emittedAt] of recentAnyIdles) {
if (now - emittedAt >= dedupWindowMs) {
recentAnyIdles.delete(sessionID)
}
}
}