@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
19 lines • 898 B
JavaScript
/** Per-monitor attribution of one wake: what it carried inline plus what overflowed. */
export function monitorDetails(events, ids, overflowBook) {
return [...ids].map((id) => {
const own = events.filter((event) => event.id === id);
const overflow = overflowBook.get(id);
const kinds = new Set(own.map((event) => event.type));
for (const kind of overflow?.kinds ?? [])
kinds.add(kind);
const humanInput = own.some((event) => event.type === "line" && event.humanInput === true) || overflow?.humanInput === true;
return {
id,
description: own[0]?.description ?? overflow?.description ?? id,
eventCount: own.length + (overflow?.count ?? 0),
kinds: [...kinds],
...(humanInput ? { humanInput: true } : {}),
};
});
}
//# sourceMappingURL=monitor-notify-details.js.map