my harness for niri
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

more noise removal

+10 -4
+10 -4
src/memory.ts
··· 531 531 } 532 532 533 533 function conciseDiscordMemoryQuery(raw: string): MemoryQueryParts | null { 534 - const withoutWakeEnvelope = raw.replace(/^\[(wake|incoming|harness restarted)[^\n]*\]\s*/gi, "").trim() 534 + const withoutWakeEnvelope = stripWakeEnvelope(raw) 535 535 if (!/\[discord\/(?:dm|channel)\]/i.test(withoutWakeEnvelope)) return null 536 536 537 537 const blocks = withoutWakeEnvelope ··· 574 574 } 575 575 576 576 function conciseDiscordBatchMemoryQuery(raw: string): MemoryQueryParts | null { 577 - const withoutWakeEnvelope = raw.replace(/^\[(wake|incoming|harness restarted)[^\n]*\]\s*/gi, "").trim() 577 + const withoutWakeEnvelope = stripWakeEnvelope(raw) 578 578 if (!/\[discord batch\]/i.test(withoutWakeEnvelope)) return null 579 579 580 580 const pending = extractBulletSection(withoutWakeEnvelope, "pending preview") ··· 605 605 return { sender: lastSender, source: lastSource, body } 606 606 } 607 607 608 + const WAKE_ENVELOPE_PATTERN = /^\[(wake|incoming|harness restarted)[^\n]*\]\s*/gi 609 + 610 + function stripWakeEnvelope(raw: string): string { 611 + return raw.replace(WAKE_ENVELOPE_PATTERN, "").trim() 612 + } 613 + 608 614 function memoryQueryForUserMessage(raw: string): MemoryQueryParts { 609 615 return ( 610 616 conciseDiscordMemoryQuery(raw) ?? 611 617 conciseDiscordBatchMemoryQuery(raw) ?? 612 - { sender: null, source: null, body: raw } 618 + { sender: null, source: null, body: stripWakeEnvelope(raw) } 613 619 ) 614 620 } 615 621 ··· 755 761 /\bname\b/.test(normalized) || 756 762 /\bfriend\b/.test(normalized), 757 763 eventQuery: 758 - /\b(what happened|when|yesterday|today|tonight|earlier|before|after|restart|restarted|session|wake)\b/.test( 764 + /\b(what happened|when|yesterday|today|tonight|earlier|before|after|session|wake)\b/.test( 759 765 normalized, 760 766 ) || 761 767 /\b\d{4}-\d{2}-\d{2}\b/.test(normalized) ||