refactor: 将客服后端重构为宿主可嵌入模块
- 注入数据库、运行时配置、统一响应、文件存储和平台 AI 能力,补充业务读写工具与客户快捷操作契约。 - 移除模块内重复的组织、客户、工单、标签、技能、旧工作流、MCP 和迁移实现,将身份权限与业务主体交由宿主管理。 - 使用 libSQL 重构向量存储,并完善图片消息、访客身份、排队调度、企业微信和支持聊天页面。 - 统一 HTTP、DTO 与 WebSocket 的 snake_case 协议,补齐模块初始化、业务动作和公共载荷等回归测试。
This commit is contained in:
@@ -12,14 +12,9 @@ server:
|
||||
- http://localhost:3000
|
||||
|
||||
db:
|
||||
# Database driver. Supported values: sqlite, mysql, postgres (postgresql is also accepted).
|
||||
type: sqlite
|
||||
# Database connection string.
|
||||
# SQLite example: file:./data/app.db?_busy_timeout=5000
|
||||
# MySQL example: user:password@tcp(127.0.0.1:3306)/cs_ai_agent_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
|
||||
# For MySQL, keep parseTime=True so datetime fields are scanned into Go time values correctly.
|
||||
# PostgreSQL example: host=127.0.0.1 user=cs_ai_agent password=change-me dbname=cs_ai_agent port=5432 sslmode=disable TimeZone=Asia/Shanghai
|
||||
dsn: file:./data/app.db?_busy_timeout=5000
|
||||
# PostgreSQL is the only supported business database.
|
||||
type: postgres
|
||||
dsn: host=127.0.0.1 user=kefu password=change-me dbname=kefu port=5432 sslmode=disable TimeZone=Asia/Shanghai
|
||||
# Maximum number of idle connections kept in the pool. Values <= 0 use the database/sql default.
|
||||
maxIdleConns: 5
|
||||
# Maximum number of open connections. Values <= 0 mean no explicit limit.
|
||||
@@ -63,31 +58,8 @@ storage:
|
||||
signedUrlExpireSeconds: 600
|
||||
|
||||
vectorDB:
|
||||
type: qdrant # qdrant, lancedb
|
||||
qdrant:
|
||||
host: 127.0.0.1
|
||||
grpcPort: 6334
|
||||
apiKey: ""
|
||||
useTls: false
|
||||
# LanceDB requires building the backend with -tags lancedb and LanceDB native libraries.
|
||||
lancedb:
|
||||
path: data/lancedb
|
||||
|
||||
mcp:
|
||||
# Global switch for MCP tool integration.
|
||||
# When false, MCP tool catalog, debug endpoints, and runtime tool calls are disabled.
|
||||
enabled: true
|
||||
# MCP server registry. Each map key is the serverCode used by toolCode values like "system/tool_name".
|
||||
servers:
|
||||
system:
|
||||
# Whether this MCP server is available for catalog listing, debug calls, and agent runtime calls.
|
||||
enabled: true
|
||||
# Streamable HTTP MCP endpoint. The built-in system server is exposed by this backend at /api/mcp.
|
||||
endpoint: "http://127.0.0.1:8083/api/mcp"
|
||||
# Connection and request timeout in milliseconds. Values <= 0 fall back to 15000.
|
||||
timeoutMs: 15000
|
||||
# Extra HTTP headers sent to this MCP server on every request, for example Authorization or tenant headers.
|
||||
headers: {}
|
||||
# Local libSQL file used only for RAG embeddings and knowledge text chunks.
|
||||
path: data/agent/vectors.db
|
||||
|
||||
wxWork:
|
||||
# Whether to enable WeCom features.
|
||||
|
||||
Reference in New Issue
Block a user