168 lines
5.7 KiB
YAML
168 lines
5.7 KiB
YAML
# ════════════════════════════════════════════════════════════════
|
||
# config/config.yaml — Agent 系统全局配置文件
|
||
# ════════════════════════════════════════════════════════════════
|
||
|
||
# ── LLM 模型配置 ───────────────────────────────────────────────
|
||
llm:
|
||
provider: "openai"
|
||
model_name: "gpt-4o"
|
||
api_key: "sk-AUmOuFI731Ty5Nob38jY26d8lydfDT-QkE2giqb0sCuPCAE2JH6zjLM4lZLpvL5WMYPOocaMe2FwVDmqM_9KimmKACjR" # 优先读取环境变量 LLM_API_KEY
|
||
api_base_url: "https://openapi.monica.im/v1" # 自定义代理地址,留空使用官方
|
||
max_tokens: 4096
|
||
temperature: 0.7
|
||
timeout: 60
|
||
max_retries: 3
|
||
function_calling: true
|
||
stream: false
|
||
model_path: ""
|
||
ollama_host: "http://localhost:11434"
|
||
skills_directory: "C:\\Users\\sonto\\Workspace\\base_agent\\skills\\OpenCLI\\skills" # 新增:SKILL.md 文件所在目录
|
||
# ── 本地 MCP Server 配置 ───────────────────────────────────────
|
||
mcp:
|
||
server_name: "DemoMCPServer"
|
||
transport: "stdio"
|
||
host: "localhost"
|
||
port: 3000
|
||
# 本地注册的工具列表
|
||
enabled_tools:
|
||
- calculator
|
||
- web_search
|
||
- file_reader
|
||
- code_executor
|
||
|
||
# ── 在线 MCP Skill 配置 ────────────────────────────────────────
|
||
# 每一项代表一个远端 MCP Server,其暴露的所有工具将作为 skill 注册到 Agent
|
||
mcp_skills:
|
||
|
||
# 示例一:SSE 传输(最常见的在线 MCP Server 形式)
|
||
# - name: "everything" # skill 组名称(用于日志/调试)
|
||
# enabled: true
|
||
# transport: "sse" # sse | http | stdio
|
||
# url: "http://localhost:3001/sse"
|
||
# # 请求头(可用于 API Key 认证)
|
||
# headers:
|
||
# Authorization: "" # 优先读取环境变量 MCP_EVERYTHING_TOKEN
|
||
# timeout: 30 # 连接超时(秒)
|
||
# retry: 2 # 失败重试次数
|
||
# # 只暴露指定工具(空列表=全部暴露)
|
||
# include_tools: []
|
||
# # 排除指定工具
|
||
# exclude_tools: []
|
||
|
||
# 示例二:Streamable HTTP 传输
|
||
# - name: "remote-tools"
|
||
# enabled: false
|
||
# transport: "http"
|
||
# url: "http://api.example.com/mcp"
|
||
# headers:
|
||
# Authorization: "Bearer your_token_here"
|
||
# X-Client-ID: "agent-demo"
|
||
# timeout: 30
|
||
# retry: 2
|
||
# include_tools: []
|
||
# exclude_tools: []
|
||
|
||
# 示例三:stdio 子进程(本地可执行文件作为 MCP Server)
|
||
# - name: "filesystem"
|
||
# enabled: false
|
||
# transport: "stdio"
|
||
# # stdio 模式使用 command 启动子进程,不需要 url
|
||
# command: "npx"
|
||
# args:
|
||
# - "-y"
|
||
# - "@modelcontextprotocol/server-filesystem"
|
||
# - "/tmp"
|
||
# env:
|
||
# NODE_ENV: "production"
|
||
# timeout: 30
|
||
# retry: 1
|
||
# include_tools: []
|
||
# exclude_tools: []
|
||
- name: "hexstrike-ai"
|
||
enabled: true
|
||
transport: "stdio"
|
||
command: "python3"
|
||
args:
|
||
- "/Users/sontolau/Applications/hexstrike-ai/hexstrike_mcp.py"
|
||
- "--server"
|
||
- "http://localhost:8999"
|
||
description: "HexStrike AI v6.0 - Advanced Cybersecurity Automation Platform"
|
||
timeout: 300
|
||
# 示例四:带鉴权的在线 MCP SaaS 服务
|
||
# - name: "brave-search"
|
||
# enabled: false
|
||
# transport: "sse"
|
||
# url: "https://mcp.brave.com/sse"
|
||
# headers:
|
||
# Authorization: "" # 优先读取环境变量 MCP_BRAVE_SEARCH_TOKEN
|
||
# timeout: 20
|
||
# retry: 2
|
||
# include_tools:
|
||
# - "brave_web_search"
|
||
# - "brave_local_search"
|
||
# exclude_tools: []
|
||
|
||
# ── 工具配置 ───────────────────────────────────────────────────
|
||
tools:
|
||
calculator:
|
||
precision: 10
|
||
|
||
web_search:
|
||
max_results: 5
|
||
timeout: 10
|
||
api_key: ""
|
||
engine: "mock"
|
||
|
||
file_reader:
|
||
allowed_root: "./workspace"
|
||
max_file_size_kb: 512
|
||
|
||
code_executor:
|
||
timeout: 5
|
||
sandbox: true
|
||
|
||
static_analyzer:
|
||
default_tool: "cppcheck"
|
||
default_std: "c++17"
|
||
timeout: 120
|
||
jobs: 4
|
||
output_format: "summary"
|
||
max_issues: 500
|
||
allowed_roots: []
|
||
tool_extra_args:
|
||
cppcheck: "--suppress=missingIncludeSystem --suppress=unmatchedSuppression"
|
||
clang-tidy: "--checks=*,-fuchsia-*,-google-*,-zircon-*"
|
||
infer: ""
|
||
|
||
ssh_docker:
|
||
default_ssh_port: 22
|
||
default_username: "root"
|
||
connect_timeout: 30
|
||
cmd_timeout: 120
|
||
deploy_timeout: 300
|
||
default_restart_policy: "unless-stopped"
|
||
default_tail_lines: 100
|
||
allowed_hosts: []
|
||
blocked_images: []
|
||
allow_privileged: false
|
||
servers: {}
|
||
|
||
# ── 记忆配置 ───────────────────────────────────────────────────
|
||
memory:
|
||
max_history: 20
|
||
enable_long_term: false
|
||
vector_db_url: ""
|
||
|
||
# ── 日志配置 ───────────────────────────────────────────────────
|
||
logging:
|
||
level: "DEBUG"
|
||
enable_file: true
|
||
log_dir: "./logs"
|
||
log_file: "agent.log"
|
||
|
||
# ── Agent 行为配置 ─────────────────────────────────────────────
|
||
agent:
|
||
max_chain_steps: 10
|
||
enable_multi_step: true
|
||
session_timeout: 3600
|
||
fallback_to_rules: true |