feat(bot/extension/watcher): Discord 아티팩트 알림 개선 — 파일 첨부 전송, truncation 확대, 동적 .md 감시

This commit is contained in:
Variet Worker
2026-03-13 09:46:56 +09:00
parent 9036f1cefc
commit e5a05e3ac4
10 changed files with 266 additions and 57 deletions

View File

@@ -110,8 +110,14 @@ class BrainEventHandler(FileSystemEventHandler):
return True
def _is_watched_file(self, file_name: str) -> bool:
"""Strict filter: only watch primary artifact files."""
return file_name in Config.WATCHED_FILES
"""Filter: watch primary artifact files + any file matching watched extensions."""
if file_name in Config.WATCHED_FILES:
return True
# Extension-based matching (e.g., any .md file in conversation dir)
ext = Path(file_name).suffix
if ext and ext in Config.WATCHED_EXTENSIONS:
return True
return False
def _emit(self, event: BrainEvent):
self.loop.call_soon_threadsafe(self.event_queue.put_nowait, event)
@@ -142,9 +148,17 @@ class BrainEventHandler(FileSystemEventHandler):
if not conv_id:
return
# Exclude files in .system_generated subdirectory (AG internal logs)
try:
relative = path.relative_to(Config.BRAIN_PATH / conv_id)
if '.system_generated' in relative.parts:
return
except ValueError:
pass
file_name = path.name
# STRICT filter: only primary artifacts
# Filter: watched files by name or extension
if not self._is_watched_file(file_name):
return