| # Claude Agent 配置文件 |
| |
| # Agent核心配置 (V2.2 - 使用 claude-agent-sdk) |
| [agent] |
| # 思考模式: interactive 或 yolo |
| default_mode = "interactive" |
| # 对话历史保留数量 (本地缓存,SDK 自动管理服务端上下文) |
| max_conversation_history = 100 |
| # Claude模型配置 |
| model = "claude-sonnet-4-5-20250929" |
| # API配置 |
| api_timeout = 60 |
| # 最大对话轮数 (SDK 会自动 compact,可以设置较大值) |
| max_turns = 100 |
| # 权限模式: default, acceptEdits, plan, bypassPermissions |
| permission_mode = "bypassPermissions" |
| |
| # Session 持久化配置 (V2.2 新增) |
| [agent.session] |
| # 是否启用 session 持久化 |
| enabled = true |
| # Session 过期时间 (秒),0 表示永不过期 |
| expire_seconds = 86400 |
| |
| # CLI界面配置 |
| [cli] |
| # 命令历史保留数量 |
| max_command_history = 1000 |
| # 提示符样式 |
| prompt_style = "cyan" |
| # 是否启用进度条 |
| show_progress = true |
| |
| # SSHOUT聊天室配置 |
| [sshout] |
| # 连接模式: ssh 或 api |
| connection_mode = "api" |
| # @Claude检测配置 |
| mention_patterns = [ |
| "@Claude", |
| "@claude", |
| "@CLAUDE", |
| "Claude:", |
| "claude:", |
| "Claude,", |
| "claude,", |
| "Claude,", |
| "claude," |
| ] |
| |
| # 服务器连接信息 |
| [sshout.server] |
| hostname = "example.com" |
| port = 22 |
| username = "sshout" |
| |
| # SSH密钥配置 (相对于项目根目录) |
| [sshout.ssh_key] |
| # 私钥文件路径 |
| private_key_path = "assets/ssh-keys/id_ecdsa_sshout_test" |
| # 连接超时时间(秒) |
| timeout = 10 |
| |
| # 消息处理配置 |
| [sshout.message] |
| # 消息历史保留数量 |
| max_history = 100 |
| # 上下文消息收集数量 |
| context_count = 5 |
| # 回复消息最大长度 (0表示无限制) |
| max_reply_length = 0 |
| |
| # MCP工具配置 |
| [mcp] |
| # 是否启用MCP工具 |
| enabled = true |
| # 工具服务器配置 |
| servers = [] |
| # 工具调用超时时间 |
| tool_timeout = 30 |
| |
| # Telegram Bot配置 |
| [telegram] |
| # Bot Token (从配置文件中读取,不要提交到git) |
| bot_token = "YOUR_BOT_TOKEN_HERE" |
| # 允许的用户Chat ID列表 |
| allowed_users = [] |
| # 允许的群组Chat ID列表 |
| allowed_groups = [] |
| |
| # 消息处理配置 |
| [telegram.message] |
| # 流式消息更新间隔(秒) |
| stream_update_interval = 1.0 |
| # 最大消息长度 |
| max_message_length = 4096 |
| # 是否启用Markdown解析 |
| enable_markdown = true |
| # 上下文历史保留数量 |
| context_history_limit = 50 |
| |
| # 群聊智能参与配置 |
| [telegram.group_participation] |
| # Bot可能被提及的名字列表 (用于检测用户是否在呼叫Bot) |
| bot_names = [ |
| "claude", "Claude", "CLAUDE", |
| "克劳德", "AI", "ai", "bot", "Bot", "BOT", |
| "助手", "机器人" |
| ] |
| # 随机参与的消息数量范围 [min, max] |
| random_participation_range = [5, 12] |
| |
| # Bot交互配置 |
| [telegram.bot_interaction] |
| # 是否启用Bot间交互功能 |
| enabled = true |
| # 是否响应来自Bot的@提及 |
| respond_to_bot_mentions = true |
| # 是否响应来自Bot的关键字触发 |
| respond_to_bot_keywords = true |
| # Bot关键字触发列表 |
| bot_trigger_keywords = [ |
| "claude", "Claude", "CLAUDE", |
| "AI", "ai", "助手", "机器人", |
| "帮助", "help", "问题", "question" |
| ] |
| # Bot交互的回复频率限制(秒,0表示无限制) |
| bot_interaction_cooldown = 2 |
| |
| # 文件处理配置 |
| [telegram.files] |
| # 支持的图片格式 |
| supported_image_formats = ["jpg", "jpeg", "png", "gif", "webp"] |
| # 支持的文档格式 |
| supported_document_formats = ["pdf", "doc", "docx", "txt", "md"] |
| # 最大文件大小(MB) |
| max_file_size_mb = 20 |
| # 临时文件存储目录 |
| temp_dir = "temp/telegram" |
| |
| # 日志配置 |
| [logging] |
| # 日志级别: DEBUG, INFO, WARNING, ERROR |
| level = "INFO" |
| # 是否启用彩色输出 |
| colored = true |
| # 日志格式 |
| format = "[%(asctime)s] %(levelname)s %(message)s" |
| |
| # Webhook配置(Bot间消息广播) |
| [webhook] |
| # 是否启用Webhook功能 |
| enabled = false |
| # Webhook服务器地址(多节点部署时改为实际服务器IP) |
| server_url = "http://localhost:8080" |
| # 认证Token(请修改为你自己的安全Token,所有Bot必须使用相同Token) |
| auth_token = "your-webhook-auth-token-here" |
| |
| # 服务器配置(如果作为Webhook服务器运行) |
| [webhook.server] |
| # 服务器绑定地址(0.0.0.0允许外部访问,127.0.0.1仅本地) |
| host = "0.0.0.0" |
| # 服务器端口 |
| port = 8080 |
| |
| # 客户端配置(Bot连接到Webhook服务器) |
| [webhook.client] |
| # 订阅的群组ID列表(Bot会接收这些群组中其他Bot的消息) |
| # 示例: [-1001234567890, -1001987654321] |
| subscribed_groups = [] |
| # 回调服务器端口(用于接收来自Webhook服务器的消息) |
| # 多个Bot运行时,每个Bot需要使用不同的端口 |
| callback_port = 8081 |
| # 连接超时时间(秒) |
| connection_timeout = 10.0 |
| # 请求超时时间(秒) |
| request_timeout = 5.0 |
| # 重试次数 |
| max_retries = 3 |
| # 重试延迟(秒) |
| retry_delay = 1.0 |