refactor: 删除 config.json + 内置工具抽离 + 统一接口

删除:
  - config.rs / config.json(AppConfig/LmStudioConfig)
  - LM Studio 残留(lmstudio.rs 已在之前删除)
  - main.rs 中散落的内置工具 match arms

新增:
  - src/tools/builtin.rs — BuiltinRegistry 统一切入
    get_current_datetime、manage_memos 为核心内置工具
    统一参数校验、风险等级、错误返回

改动:
  - 模型名直接从 DEEPSEEK_MODEL 环境变量读取
  - builtin 工具与 skills 工具统一经过 SkillRegistry 审批
  - query_capabilities 合并内置 + 外部技能列表
This commit is contained in:
2026-06-02 15:07:33 +08:00
parent a32593bc25
commit 079150b1d0
9 changed files with 106 additions and 404 deletions
+2 -20
View File
@@ -1,26 +1,8 @@
# get_current_datetime
获取当前日期时间(北京时间 UTC+8)。
获取当前日期时间(UTC+8)。内置 Rust 实现,无脚本依赖。
## Risk Level
Low
## Parameters
```json
{
"type": "object",
"properties": {
"format": {
"type": "string",
"description": "时间格式: full | date | time",
"enum": ["full", "date", "time"],
"default": "full"
}
}
}
```
## Execute
```bash
scripts/datetime.sh
# Builtin: Rust
```
@@ -1,16 +0,0 @@
#!/bin/bash
# 读取 stdin JSON 参数
read -r input
format=$(echo "$input" | python3 -c "
import sys, json
try:
d = json.load(sys.stdin)
print(d.get('format', 'full'))
except: print('full')
" 2>/dev/null || echo "full")
case "$format" in
date) TZ='Asia/Shanghai' date '+{"datetime": "%Y-%m-%d"}' ;;
time) TZ='Asia/Shanghai' date '+{"datetime": "%H:%M:%S"}' ;;
*) TZ='Asia/Shanghai' date '+{"datetime": "%Y-%m-%d %H:%M:%S"}' ;;
esac