@ia-ccun/code-agent-cli 0.0.59-beta.3 → 0.0.59-beta.5
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/config/agent/mcp.json +5 -0
- package/package.json +3 -1
- package/scripts/postinstall.js +19 -0
- package/config/agent/extensions/aicode-safety-guard.ts +0 -924
- package/config/agent/extensions/transformers-mirror.ts +0 -155
- package/scripts/regression/README.md +0 -224
- package/scripts/regression/cases/01-version-and-deps.sh +0 -94
- package/scripts/regression/cases/02-extension-loading.sh +0 -130
- package/scripts/regression/cases/03-rpc-protocol.sh +0 -315
- package/scripts/regression/cases/04-prompt-stream.sh +0 -164
- package/scripts/regression/cases/05-slash-commands-and-skills.sh +0 -119
- package/scripts/regression/cases/06-tool-execution.sh +0 -115
- package/scripts/regression/cases/07-pi-new-features.sh +0 -153
- package/scripts/regression/lib/common.sh +0 -364
- package/scripts/regression/results/.last_pid +0 -1
- package/scripts/regression/results/.last_workdir +0 -1
- package/scripts/regression/results/02-extension-loading.err.log +0 -0
- package/scripts/regression/results/02-extension-loading.log +0 -20
- package/scripts/regression/results/03-rpc-protocol.err.log +0 -0
- package/scripts/regression/results/03-rpc-protocol.log +0 -93
- package/scripts/regression/results/04-prompt-stream.err.log +0 -0
- package/scripts/regression/results/04-prompt-stream.log +0 -56
- package/scripts/regression/results/05-slash-commands-and-skills.err.log +0 -1
- package/scripts/regression/results/05-slash-commands-and-skills.log +0 -9
- package/scripts/regression/results/06-tool-execution.err.log +0 -0
- package/scripts/regression/results/06-tool-execution.log +0 -8
- package/scripts/regression/results/07-pi-new-features.err.log +0 -0
- package/scripts/regression/results/07-pi-new-features.log +0 -28
- package/scripts/regression/results/repro.log +0 -4
- package/scripts/regression/run-all.sh +0 -181
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
Warning: No models match pattern "minimax-cn/router-auto"
|
|
2
|
-
{"id":"ready_probe","type":"response","command":"get_state","success":true,"data":{"model":{"id":"MiniMax-M3","name":"MiniMax-M3","api":"anthropic-messages","provider":"minimax-cn","baseUrl":"https://api.minimaxi.com/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":0.3137,"output":1.2549,"cacheRead":0.0627,"cacheWrite":0,"tiers":[{"inputTokensAbove":512000,"input":0.6275,"output":2.5098,"cacheRead":0.1255,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":524288,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"thinkingLevel":"minimal","isStreaming":false,"isCompacting":false,"steeringMode":"one-at-a-time","followUpMode":"all","sessionId":"01a175ce-fc90-71d1-8765-ad0418caa200","autoCompactionEnabled":true,"messageCount":0,"pendingMessageCount":0}}
|
|
3
|
-
{"id":"rpc1","type":"response","command":"get_state","success":true,"data":{"model":{"id":"MiniMax-M3","name":"MiniMax-M3","api":"anthropic-messages","provider":"minimax-cn","baseUrl":"https://api.minimaxi.com/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":0.3137,"output":1.2549,"cacheRead":0.0627,"cacheWrite":0,"tiers":[{"inputTokensAbove":512000,"input":0.6275,"output":2.5098,"cacheRead":0.1255,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":524288,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"thinkingLevel":"minimal","isStreaming":false,"isCompacting":false,"steeringMode":"one-at-a-time","followUpMode":"all","sessionId":"01a175ce-fc90-71d1-8765-ad0418caa200","autoCompactionEnabled":true,"messageCount":0,"pendingMessageCount":0}}
|
|
4
|
-
{"id":"rpc2","type":"response","command":"get_state","success":true,"data":{"model":{"id":"MiniMax-M3","name":"MiniMax-M3","api":"anthropic-messages","provider":"minimax-cn","baseUrl":"https://api.minimaxi.com/anthropic","reasoning":true,"input":["text","image"],"cost":{"input":0.3137,"output":1.2549,"cacheRead":0.0627,"cacheWrite":0,"tiers":[{"inputTokensAbove":512000,"input":0.6275,"output":2.5098,"cacheRead":0.1255,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":524288,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"thinkingLevel":"minimal","isStreaming":false,"isCompacting":false,"steeringMode":"one-at-a-time","followUpMode":"all","sessionId":"01a175ce-fc90-71d1-8765-ad0418caa200","autoCompactionEnabled":true,"messageCount":0,"pendingMessageCount":0}}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# run-all.sh — 串联所有回归测试用例,输出汇总报告
|
|
3
|
-
# 用法:
|
|
4
|
-
# ./run-all.sh # 跑全部 6 个 case
|
|
5
|
-
# ./run-all.sh --only 01,03,05 # 只跑指定 case
|
|
6
|
-
# ./run-all.sh --quiet # 减少输出
|
|
7
|
-
# ./run-all.sh --aicode /path/to/aicode # 指定二进制路径
|
|
8
|
-
# AICODE_BIN=/path/to/aicode ./run-all.sh
|
|
9
|
-
#
|
|
10
|
-
# 退出码:0 全部通过 / 1 有失败 / 2 环境问题(缺 jq 等)
|
|
11
|
-
|
|
12
|
-
set -uo pipefail
|
|
13
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
-
|
|
15
|
-
# 参数解析
|
|
16
|
-
ONLY_CASES=""
|
|
17
|
-
QUIET=0
|
|
18
|
-
while [[ $# -gt 0 ]]; do
|
|
19
|
-
case "$1" in
|
|
20
|
-
--only)
|
|
21
|
-
ONLY_CASES="$2"
|
|
22
|
-
shift 2
|
|
23
|
-
;;
|
|
24
|
-
--quiet | -q)
|
|
25
|
-
QUIET=1
|
|
26
|
-
shift
|
|
27
|
-
;;
|
|
28
|
-
--aicode)
|
|
29
|
-
export AICODE_BIN="$2"
|
|
30
|
-
shift 2
|
|
31
|
-
;;
|
|
32
|
-
--help | -h)
|
|
33
|
-
cat <<EOF
|
|
34
|
-
Usage: $0 [--only CASES] [--quiet] [--aicode PATH]
|
|
35
|
-
|
|
36
|
-
Options:
|
|
37
|
-
--only CASES 只跑指定 case(逗号分隔,如 01,03,05)
|
|
38
|
-
--quiet, -q 减少输出
|
|
39
|
-
--aicode PATH 指定 aicode 二进制路径(默认:PATH 中的 aicode)
|
|
40
|
-
--help, -h 显示帮助
|
|
41
|
-
|
|
42
|
-
Environment:
|
|
43
|
-
AICODE_BIN aicode 二进制路径(同 --aicode)
|
|
44
|
-
AICODE_CONFIG 配置目录(同 --config)
|
|
45
|
-
EOF
|
|
46
|
-
exit 0
|
|
47
|
-
;;
|
|
48
|
-
*)
|
|
49
|
-
echo "Unknown arg: $1"
|
|
50
|
-
exit 2
|
|
51
|
-
;;
|
|
52
|
-
esac
|
|
53
|
-
done
|
|
54
|
-
|
|
55
|
-
[[ $QUIET -eq 1 ]] && export REGRESSION_QUIET=1
|
|
56
|
-
|
|
57
|
-
# 前置依赖检查
|
|
58
|
-
echo "═══ aicode-cli 回归测试 ═══"
|
|
59
|
-
echo ""
|
|
60
|
-
echo "AICODE_BIN: ${AICODE_BIN:-aicode}"
|
|
61
|
-
echo "AICODE_CONFIG: ${AICODE_CONFIG:-$HOME/.aicode-cli}"
|
|
62
|
-
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
|
63
|
-
|
|
64
|
-
# jq 必须
|
|
65
|
-
if ! command -v jq >/dev/null 2>&1; then
|
|
66
|
-
echo ""
|
|
67
|
-
echo "ERROR: jq 未安装。请:brew install jq"
|
|
68
|
-
exit 2
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
# aicode 必须
|
|
72
|
-
if ! command -v "${AICODE_BIN:-aicode}" >/dev/null 2>&1; then
|
|
73
|
-
echo ""
|
|
74
|
-
echo "ERROR: ${AICODE_BIN:-aicode} 未找到。设 AICODE_BIN=/path/to/aicode 或 --aicode PATH"
|
|
75
|
-
exit 2
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
echo ""
|
|
79
|
-
echo "─── 预检 ───"
|
|
80
|
-
"$AICODE_BIN" -v 2>&1 | head -1 | sed 's/^/ version: /'
|
|
81
|
-
echo ""
|
|
82
|
-
|
|
83
|
-
# 收集 case
|
|
84
|
-
ALL_CASES=($(ls "$SCRIPT_DIR/cases/"*.sh 2>/dev/null | sort | xargs -n1 basename))
|
|
85
|
-
if [[ -n "$ONLY_CASES" ]]; then
|
|
86
|
-
IFS=',' read -ra WANTED <<<"$ONLY_CASES"
|
|
87
|
-
FILTERED=()
|
|
88
|
-
for c in "${ALL_CASES[@]}"; do
|
|
89
|
-
for w in "${WANTED[@]}"; do
|
|
90
|
-
# 支持短前缀匹配:"03" 匹配 "03-rpc-protocol.sh"
|
|
91
|
-
if [[ "$c" == "${w}.sh" || "$c" == "${w}-"* ]]; then
|
|
92
|
-
FILTERED+=("$c")
|
|
93
|
-
break
|
|
94
|
-
fi
|
|
95
|
-
done
|
|
96
|
-
done
|
|
97
|
-
if [[ ${#FILTERED[@]} -gt 0 ]]; then
|
|
98
|
-
CASES_TO_RUN=("${FILTERED[@]}")
|
|
99
|
-
else
|
|
100
|
-
CASES_TO_RUN=()
|
|
101
|
-
fi
|
|
102
|
-
else
|
|
103
|
-
CASES_TO_RUN=("${ALL_CASES[@]}")
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
if [[ ${#CASES_TO_RUN[@]} -eq 0 ]]; then
|
|
107
|
-
echo "ERROR: 没有匹配的 case (--only=$ONLY_CASES)"
|
|
108
|
-
exit 2
|
|
109
|
-
fi
|
|
110
|
-
|
|
111
|
-
echo "将运行 ${#CASES_TO_RUN[@]} 个 case: ${CASES_TO_RUN[*]}"
|
|
112
|
-
echo ""
|
|
113
|
-
|
|
114
|
-
# 跑每个 case
|
|
115
|
-
TOTAL_PASS=0
|
|
116
|
-
TOTAL_FAIL=0
|
|
117
|
-
TOTAL_SKIP=0
|
|
118
|
-
FAILED_CASES=()
|
|
119
|
-
|
|
120
|
-
for case_file in "${CASES_TO_RUN[@]}"; do
|
|
121
|
-
echo "━━━ $case_file ━━━"
|
|
122
|
-
chmod +x "$SCRIPT_DIR/cases/$case_file" 2>/dev/null
|
|
123
|
-
|
|
124
|
-
if "$SCRIPT_DIR/cases/$case_file"; then
|
|
125
|
-
:
|
|
126
|
-
else
|
|
127
|
-
FAILED_CASES+=("$case_file")
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
# 统计本 case 的 pass/fail/skip
|
|
131
|
-
last_log="$SCRIPT_DIR/results/${case_file%.sh}.log"
|
|
132
|
-
if [[ -f "$last_log" ]]; then
|
|
133
|
-
# 失败标记
|
|
134
|
-
if grep -q "✗" "$last_log" 2>/dev/null; then
|
|
135
|
-
:
|
|
136
|
-
fi
|
|
137
|
-
fi
|
|
138
|
-
done
|
|
139
|
-
|
|
140
|
-
# 解析每个 case 的日志
|
|
141
|
-
echo ""
|
|
142
|
-
echo "═══ 汇总 ═══"
|
|
143
|
-
|
|
144
|
-
for case_file in "${CASES_TO_RUN[@]}"; do
|
|
145
|
-
case_name="${case_file%.sh}"
|
|
146
|
-
pass_n=0
|
|
147
|
-
fail_n=0
|
|
148
|
-
skip_n=0
|
|
149
|
-
|
|
150
|
-
# 用实际退出码判定(case 脚本内部 summary() 返回非 0 即失败)
|
|
151
|
-
if [[ " ${FAILED_CASES[*]:-} " == *" $case_file "* ]]; then
|
|
152
|
-
fail_n=1
|
|
153
|
-
else
|
|
154
|
-
pass_n=1
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
TOTAL_PASS=$((TOTAL_PASS + pass_n))
|
|
158
|
-
TOTAL_FAIL=$((TOTAL_FAIL + fail_n))
|
|
159
|
-
TOTAL_SKIP=$((TOTAL_SKIP + skip_n))
|
|
160
|
-
|
|
161
|
-
if [[ $fail_n -gt 0 ]]; then
|
|
162
|
-
printf " %-40s ✗ %d fails\n" "$case_name" "$fail_n"
|
|
163
|
-
else
|
|
164
|
-
printf " %-40s ✓ pass\n" "$case_name"
|
|
165
|
-
fi
|
|
166
|
-
done
|
|
167
|
-
|
|
168
|
-
echo ""
|
|
169
|
-
echo "─── 总计 ───"
|
|
170
|
-
echo " PASS: $TOTAL_PASS"
|
|
171
|
-
echo " FAIL: $TOTAL_FAIL"
|
|
172
|
-
echo " SKIP: $TOTAL_SKIP"
|
|
173
|
-
echo ""
|
|
174
|
-
|
|
175
|
-
if [[ $TOTAL_FAIL -eq 0 ]]; then
|
|
176
|
-
echo "✓ ALL CASES PASSED"
|
|
177
|
-
exit 0
|
|
178
|
-
else
|
|
179
|
-
echo "✗ $TOTAL_FAIL FAILURES — 详见 results/*.log"
|
|
180
|
-
exit 1
|
|
181
|
-
fi
|