claude-cac 1.1.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cac +14 -8
- package/package.json +1 -1
package/cac
CHANGED
|
@@ -10,7 +10,7 @@ VERSIONS_DIR="$CAC_DIR/versions"
|
|
|
10
10
|
# ━━━ utils.sh ━━━
|
|
11
11
|
# ── utils: 颜色、读写、UUID、proxy 解析 ───────────────────────
|
|
12
12
|
|
|
13
|
-
CAC_VERSION="1.
|
|
13
|
+
CAC_VERSION="1.2.0"
|
|
14
14
|
|
|
15
15
|
_read() { [[ -f "$1" ]] && tr -d '[:space:]' < "$1" || echo "${2:-}"; }
|
|
16
16
|
_die() { printf '%b\n' "$(_red "error:") $*" >&2; exit 1; }
|
|
@@ -1727,6 +1727,14 @@ cmd_check() {
|
|
|
1727
1727
|
local problems=()
|
|
1728
1728
|
local summary_parts=()
|
|
1729
1729
|
|
|
1730
|
+
# ── wrapper 检查 ──
|
|
1731
|
+
local claude_path; claude_path="$(command -v claude 2>/dev/null || true)"
|
|
1732
|
+
if [[ -z "$claude_path" ]] || [[ "$(readlink -f "$claude_path" 2>/dev/null || echo "$claude_path")" != *"/.cac/bin/claude"* ]]; then
|
|
1733
|
+
if [[ "$claude_path" != *"/.cac/bin/claude" ]]; then
|
|
1734
|
+
problems+=("claude 未指向 wrapper — 运行 source ~/.zshrc 或重开终端")
|
|
1735
|
+
fi
|
|
1736
|
+
fi
|
|
1737
|
+
|
|
1730
1738
|
# ── 网络检查 ──
|
|
1731
1739
|
local proxy_ip=""
|
|
1732
1740
|
if [[ -n "$proxy" ]]; then
|
|
@@ -1741,8 +1749,8 @@ cmd_check() {
|
|
|
1741
1749
|
fi
|
|
1742
1750
|
fi
|
|
1743
1751
|
|
|
1744
|
-
#
|
|
1745
|
-
|
|
1752
|
+
# 冲突检测(仅代理连通时才有意义)
|
|
1753
|
+
if [[ -n "$proxy_ip" ]]; then
|
|
1746
1754
|
local os; os=$(_detect_os)
|
|
1747
1755
|
local has_conflict=false
|
|
1748
1756
|
local tun_procs="clash|mihomo|sing-box|surge|shadowrocket|v2ray|xray|hysteria|tuic|nekoray"
|
|
@@ -1778,13 +1786,14 @@ cmd_check() {
|
|
|
1778
1786
|
fi
|
|
1779
1787
|
|
|
1780
1788
|
if [[ "$relay_ok" == "true" ]]; then
|
|
1781
|
-
summary_parts+=("
|
|
1789
|
+
summary_parts+=("TUN 冲突已绕过")
|
|
1782
1790
|
else
|
|
1783
1791
|
local proxy_hp; proxy_hp=$(_proxy_host_port "$proxy")
|
|
1784
1792
|
local proxy_host="${proxy_hp%%:*}"
|
|
1785
1793
|
problems+=("代理冲突:需在代理软件中为 $proxy_host 添加 DIRECT 规则")
|
|
1786
1794
|
fi
|
|
1787
1795
|
fi
|
|
1796
|
+
fi
|
|
1788
1797
|
else
|
|
1789
1798
|
summary_parts+=("API Key 模式")
|
|
1790
1799
|
fi
|
|
@@ -1805,7 +1814,7 @@ cmd_check() {
|
|
|
1805
1814
|
done
|
|
1806
1815
|
|
|
1807
1816
|
if [[ "$env_ok" -eq "$env_total" ]]; then
|
|
1808
|
-
summary_parts+=("
|
|
1817
|
+
summary_parts+=("遥测屏蔽 ${env_ok}/${env_total}")
|
|
1809
1818
|
else
|
|
1810
1819
|
problems+=("遥测屏蔽 ${env_ok}/${env_total}")
|
|
1811
1820
|
fi
|
|
@@ -1819,9 +1828,6 @@ cmd_check() {
|
|
|
1819
1828
|
for p in "${problems[@]}"; do
|
|
1820
1829
|
echo " $(_red "✗") $p"
|
|
1821
1830
|
done
|
|
1822
|
-
if [[ ${#summary_parts[@]} -gt 0 ]]; then
|
|
1823
|
-
echo " $(IFS=' | '; echo "${summary_parts[*]}")"
|
|
1824
|
-
fi
|
|
1825
1831
|
fi
|
|
1826
1832
|
|
|
1827
1833
|
# ── 详细模式 ──
|