Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ Environment:
OLLAMA_BASE_URL Ollama server URL (default: http://localhost:11434/v1)
LMSTUDIO_BASE_URL LM Studio server URL (default: http://localhost:1234/v1)
SPACEMOLT_URL Override game server URL
FILTER_NOTIFICATIONS Comma-separated notification categories to hide from the LLM
(default: none). Valid: chat, dm, broadcast, combat, trade, info, system.
Example: FILTER_NOTIFICATIONS=chat,trade. Filtered notifications still appear in terminal output.
```

## Supported Models
Expand Down
14 changes: 14 additions & 0 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ const RESET = "\x1b[0m";
const BOLD = "\x1b[1m";
const DIM = "\x1b[2m";

/**
* Notification categories to filter from the LLM context (still logged to stdout).
* Set via FILTER_NOTIFICATIONS env var as a comma-separated list of categories.
* Valid categories: chat, dm, broadcast, combat, trade, info, system
* Default: none (all notifications forwarded to the LLM)
*/
const FILTERED_CATEGORIES: Set<string> = new Set(
(process.env.FILTER_NOTIFICATIONS ?? "")
.split(",")
.map(s => s.trim())
.filter(Boolean)
);

let debugEnabled = false;

export function setDebug(enabled: boolean): void {
Expand Down Expand Up @@ -362,6 +375,7 @@ export function formatNotifications(notifications: unknown[]): string {
for (const n of notifications) {
const parsed = parseNotification(n);
if (!parsed) continue;
if (FILTERED_CATEGORIES.has(parsed.category)) continue;
lines.push(` > [${parsed.tag}] ${parsed.text}`);
}
return lines.join("\n");
Expand Down