Files
javis_bot/src/voice_worker/log.py
javis-bot 3ef4281180 feat(app): features screen with tool switches and MCP servers; v2 drops host file and screen tools
- Settings `features` (weather, webSearch, meals) and `mcpServers` (name, command, args, env names,
  enabled), edited on the new 기능 screen. The tools of a feature that is off go into the brain's
  `disabled_tools`; only enabled MCP servers go into its `mcps`.
- MCP environment values (API keys) live only in the encrypted secrets (`mcp:<server>:<NAME>`),
  shown as stored or not, masked in logs, removed with their server, and reach the worker only in
  `JARVIS_MCP_ENV`, which the brain takes out of its environment before giving each server its own.
- `enabled_builtin_tools(cfg)` is the one list the router, toolSearchTool and the executor use, so
  a turned-off tool is neither offered nor run, also when the model names it.
- The v2 brain never offers v1's `localFiles` (home folder read/write/delete) and `screenshot`:
  anyone in the voice or chat channels could ask for them. Screen viewing comes in M7.
- The brain connects MCP servers on its own thread and logs each outcome without debug logging.
- Stored secrets are masked in the log hub as soon as the data folder is found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:56:17 +09:00

27 lines
874 B
Python

"""The worker's own debug log. It writes to the process's original stderr, so it still shows while
the brain's output is muted (``brain.Muted``); otherwise it is ``jarvis.debug.debug_log``."""
from __future__ import annotations
import sys
from jarvis import debug as _jarvis_debug
def debug_log(message: str, category: str = "debug") -> None:
if not _jarvis_debug._is_debug_enabled():
return
try:
print(f"[{category:^10}] {message}", file=sys.__stderr__, flush=True)
except Exception:
pass
def notice(message: str, category: str = "debug") -> None:
"""A line the user needs also without debug logging (the app's log screen shows every worker
line; a ``Warning`` in it marks it as a warning there)."""
try:
print(f"[{category:^10}] {message}", file=sys.__stderr__, flush=True)
except Exception:
pass