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>
This commit is contained in:
@@ -3,7 +3,7 @@ import sys
|
||||
import json
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
@@ -272,6 +272,9 @@ class Settings:
|
||||
# MCP Integration
|
||||
mcps: Dict[str, Any]
|
||||
|
||||
# Built-in tools that are neither offered nor run (v2 feature switches).
|
||||
disabled_tools: Tuple[str, ...] = ()
|
||||
|
||||
|
||||
|
||||
def default_config_path() -> Path:
|
||||
@@ -563,6 +566,8 @@ def get_default_config() -> Dict[str, Any]:
|
||||
|
||||
# MCP Integration (external servers Jarvis can use). No defaults.
|
||||
"mcps": {},
|
||||
# Built-in tools that are neither offered nor run.
|
||||
"disabled_tools": [],
|
||||
}
|
||||
|
||||
|
||||
@@ -766,6 +771,8 @@ def load_settings() -> Settings:
|
||||
raw_dict = merged.get("dictation_custom_dictionary", [])
|
||||
dictation_custom_dictionary = list(raw_dict) if isinstance(raw_dict, list) else []
|
||||
mcps = _ensure_dict(merged.get("mcps"))
|
||||
_disabled_raw = merged.get("disabled_tools") or []
|
||||
disabled_tools = tuple(str(t) for t in _disabled_raw) if isinstance(_disabled_raw, list) else ()
|
||||
whisper_min_confidence = float(merged.get("whisper_min_confidence", 0.4))
|
||||
whisper_no_speech_threshold = float(merged.get("whisper_no_speech_threshold", 0.5))
|
||||
whisper_min_audio_duration = float(merged.get("whisper_min_audio_duration", 0.3))
|
||||
@@ -913,4 +920,5 @@ def load_settings() -> Settings:
|
||||
|
||||
# MCP Integration
|
||||
mcps=mcps,
|
||||
disabled_tools=disabled_tools,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user