同步完整源码至远程:扁平化重构现状 + 未入库源文件

- 补入库:server/internal/db/dump.go、redis 分页/扫描预算测试、opsxdb-mcp main_test、
  packages/opsxdb-mcp package-lock、docs 审计与对比文档等 37 个新文件
- 含结构扁平化进行中的 80 处修改与 155 处旧结构删除(server/ src/ src-tauri/ 为当前有效源)
- 构建产物(bin/target/dist)与签名私钥仍按规则排除
This commit is contained in:
logan committed 2026-10-16 03:47:33 +08:00
1 parent 5c0be49217
commit 2c0bfafd8d
269 files changed
+10372 -16435

No files matched your search

+8 -14
View File
@@ -1,6 +1,7 @@
package aitools
import (
"context"
"encoding/json"
"net/http"
"os"
@@ -101,7 +102,9 @@ func findToolVersion(name string, versionArg string) (bin, version string) {
if bin == "" {
return "", ""
}
out, err := exec.Command(bin, versionArg).CombinedOutput()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
out, err := exec.CommandContext(ctx, bin, versionArg).CombinedOutput()
if err != nil {
return bin, ""
}
@@ -130,14 +133,7 @@ func lookPathAugmented(name string) string {
"/usr/local/bin",
)
}
pathEnv := os.Getenv("PATH")
aug := strings.Join(extras, string(os.PathListSeparator))
if pathEnv != "" {
aug = aug + string(os.PathListSeparator) + pathEnv
}
cmd := exec.Command(name, "--version")
cmd.Env = append(os.Environ(), "PATH="+aug)
// Prefer LookPath with augmented PATH
// 检查常见安装路径,不执行探测命令。
for _, dir := range extras {
cand := filepath.Join(dir, name)
if runtime.GOOS == "windows" {
@@ -147,15 +143,13 @@ func lookPathAugmented(name string) string {
return cand
}
}
if p, err := exec.LookPath(name); err == nil {
return p
}
_ = cmd
return ""
}
func npmGlobalPackageVersion(npmBin, pkg string) string {
out, err := exec.Command(npmBin, "list", "-g", pkg, "--depth=0", "--json").CombinedOutput()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
out, err := exec.CommandContext(ctx, npmBin, "list", "-g", pkg, "--depth=0", "--json").CombinedOutput()
if err != nil && len(out) == 0 {
return ""
}