aico-cli 2.0.27 → 2.0.28
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/bin/cli/cli.js +1345 -1336
- package/bin/cli/package.json +2 -2
- package/bin/cli/sdk-tools.d.ts +9 -1
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.12-beta-searchableOptions.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/{claude-code-jetbrains-plugin-0.1.11-beta.jar → claude-code-jetbrains-plugin-0.1.12-beta.jar} +0 -0
- package/dist/chunks/simple-config.mjs +1 -1
- package/package.json +3 -3
- package/templates/agents/aico/requirement/requirement-aligner.md +0 -47
- package/templates/agents/aico/requirement/requirement-identifier.md +0 -45
- package/templates/agents/aico/requirement/task-executor-validator.md +24 -67
- package/templates/agents/aico/requirement/task-executor.md +13 -58
- package/templates/agents/aico/requirement/task-splitter-validator.md +32 -75
- package/templates/personality.md +6 -3
- package/templates/settings.json +2 -2
- package/bin/cli/sdk.d.ts +0 -446
- package/bin/cli/sdk.mjs +0 -14840
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta-searchableOptions.jar +0 -0
- package/templates/agents/aico/requirement/WINDOWS_USAGE.md +0 -478
- package/templates/agents/aico/requirement/crossplatform-utils.ps1 +0 -465
- package/templates/agents/aico/requirement/crossplatform-utils.sh +0 -307
- package/templates/agents/aico/requirement/requirement-functions-crossplatform.ps1 +0 -458
- package/templates/agents/aico/requirement/requirement-functions-crossplatform.sh +0 -472
- package/templates/agents/aico/requirement/requirement-launcher.ps1 +0 -223
- package/templates/agents/aico/requirement/requirement-launcher.sh +0 -146
- package/templates/agents/aico/requirement/test-crossplatform.ps1 +0 -506
- package/templates/agents/aico/requirement/test-crossplatform.sh +0 -456
- package/templates/hooks/README.md +0 -291
- package/templates/hooks/pre-requirement-identifier.ps1 +0 -160
- package/templates/hooks/requirement-processor.sh +0 -180
- package/templates/hooks/subagent-context-injector.sh +0 -65
- package/templates/hooks/utils/crossplatform-detector.ps1 +0 -117
- package/templates/hooks/utils/crossplatform-detector.sh +0 -111
- package/templates/utils/platform-launcher.ps1 +0 -333
- package/templates/utils/task-manager.sh +0 -401
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 跨平台工具库 - 支持 Windows/Linux/macOS
|
|
3
|
-
# 为所有智能体脚本提供统一的跨平台功能
|
|
4
|
-
|
|
5
|
-
# 平台检测函数
|
|
6
|
-
detect_platform() {
|
|
7
|
-
case "$(uname -s)" in
|
|
8
|
-
Darwin)
|
|
9
|
-
PLATFORM="macos"
|
|
10
|
-
;;
|
|
11
|
-
Linux)
|
|
12
|
-
PLATFORM="linux"
|
|
13
|
-
;;
|
|
14
|
-
CYGWIN*|MINGW*|MSYS*)
|
|
15
|
-
PLATFORM="windows"
|
|
16
|
-
;;
|
|
17
|
-
*)
|
|
18
|
-
PLATFORM="unknown"
|
|
19
|
-
;;
|
|
20
|
-
esac
|
|
21
|
-
echo "🌐 检测到平台: $PLATFORM"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
# 跨平台临时目录
|
|
25
|
-
get_temp_dir() {
|
|
26
|
-
case "$PLATFORM" in
|
|
27
|
-
windows)
|
|
28
|
-
# Windows: 使用用户临时目录
|
|
29
|
-
if [ -n "$TEMP" ]; then
|
|
30
|
-
echo "$TEMP"
|
|
31
|
-
elif [ -n "$TMP" ]; then
|
|
32
|
-
echo "$TMP"
|
|
33
|
-
else
|
|
34
|
-
echo "/tmp"
|
|
35
|
-
fi
|
|
36
|
-
;;
|
|
37
|
-
*)
|
|
38
|
-
# Linux/macOS: 使用标准临时目录
|
|
39
|
-
echo "/tmp"
|
|
40
|
-
;;
|
|
41
|
-
esac
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
# 跨平台文件路径处理
|
|
45
|
-
normalize_path() {
|
|
46
|
-
local path="$1"
|
|
47
|
-
case "$PLATFORM" in
|
|
48
|
-
windows)
|
|
49
|
-
# 将路径转换为 Windows 兼容格式
|
|
50
|
-
echo "$path" | sed 's|/|\\|g'
|
|
51
|
-
;;
|
|
52
|
-
*)
|
|
53
|
-
echo "$path"
|
|
54
|
-
;;
|
|
55
|
-
esac
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
# 跨平台家目录
|
|
59
|
-
get_home_dir() {
|
|
60
|
-
case "$PLATFORM" in
|
|
61
|
-
windows)
|
|
62
|
-
echo "$USERPROFILE"
|
|
63
|
-
;;
|
|
64
|
-
*)
|
|
65
|
-
echo "$HOME"
|
|
66
|
-
;;
|
|
67
|
-
esac
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
# 跨平台命令检查
|
|
71
|
-
command_exists() {
|
|
72
|
-
command -v "$1" >/dev/null 2>&1
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
# 跨平台文件查找
|
|
76
|
-
find_files() {
|
|
77
|
-
local pattern="$1"
|
|
78
|
-
local max_results="${2:-10}"
|
|
79
|
-
|
|
80
|
-
# 使用兼容的 find 命令
|
|
81
|
-
if command_exists "find"; then
|
|
82
|
-
find . -name "$pattern" 2>/dev/null | head -n "$max_results"
|
|
83
|
-
else
|
|
84
|
-
# Windows 回退方案
|
|
85
|
-
ls -la "$pattern" 2>/dev/null | head -n "$max_results"
|
|
86
|
-
fi
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
# 跨平台文件读取
|
|
90
|
-
safe_read_file() {
|
|
91
|
-
local file_path="$1"
|
|
92
|
-
local max_lines="${2:-50}"
|
|
93
|
-
|
|
94
|
-
if [ -f "$file_path" ]; then
|
|
95
|
-
# 使用兼容的读取方式
|
|
96
|
-
if command_exists "head"; then
|
|
97
|
-
head -n "$max_lines" "$file_path" 2>/dev/null
|
|
98
|
-
else
|
|
99
|
-
# Windows 回退方案
|
|
100
|
-
sed -n "1,${max_lines}p" "$file_path" 2>/dev/null
|
|
101
|
-
fi
|
|
102
|
-
else
|
|
103
|
-
echo "文件不存在: $file_path"
|
|
104
|
-
fi
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
# 跨平台包管理器检测
|
|
108
|
-
detect_package_manager() {
|
|
109
|
-
if command_exists "npm"; then
|
|
110
|
-
echo "npm"
|
|
111
|
-
elif command_exists "yarn"; then
|
|
112
|
-
echo "yarn"
|
|
113
|
-
elif command_exists "pnpm"; then
|
|
114
|
-
echo "pnpm"
|
|
115
|
-
elif command_exists "pip"; then
|
|
116
|
-
echo "pip"
|
|
117
|
-
elif command_exists "cargo"; then
|
|
118
|
-
echo "cargo"
|
|
119
|
-
else
|
|
120
|
-
echo "unknown"
|
|
121
|
-
fi
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
# 跨平台 Git 命令
|
|
125
|
-
git_safe() {
|
|
126
|
-
if command_exists "git"; then
|
|
127
|
-
git "$@" 2>/dev/null
|
|
128
|
-
else
|
|
129
|
-
echo "Git 未安装"
|
|
130
|
-
fi
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
# 跨平台目录创建
|
|
134
|
-
safe_mkdir() {
|
|
135
|
-
local dir_path="$1"
|
|
136
|
-
|
|
137
|
-
if command_exists "mkdir"; then
|
|
138
|
-
mkdir -p "$dir_path" 2>/dev/null
|
|
139
|
-
else
|
|
140
|
-
# Windows 回退方案
|
|
141
|
-
md "$dir_path" 2>/dev/null
|
|
142
|
-
fi
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
# 跨平台文件复制
|
|
146
|
-
safe_cp() {
|
|
147
|
-
local source="$1"
|
|
148
|
-
local destination="$2"
|
|
149
|
-
|
|
150
|
-
if command_exists "cp"; then
|
|
151
|
-
cp "$source" "$destination" 2>/dev/null
|
|
152
|
-
else
|
|
153
|
-
# Windows 回退方案
|
|
154
|
-
copy "$source" "$destination" 2>/dev/null
|
|
155
|
-
fi
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
# 跨平台文件移动
|
|
159
|
-
safe_mv() {
|
|
160
|
-
local source="$1"
|
|
161
|
-
local destination="$2"
|
|
162
|
-
|
|
163
|
-
if command_exists "mv"; then
|
|
164
|
-
mv "$source" "$destination" 2>/dev/null
|
|
165
|
-
else
|
|
166
|
-
# Windows 回退方案
|
|
167
|
-
move "$source" "$destination" 2>/dev/null
|
|
168
|
-
fi
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
# 跨平台文件删除
|
|
172
|
-
safe_rm() {
|
|
173
|
-
local file_path="$1"
|
|
174
|
-
|
|
175
|
-
if command_exists "rm"; then
|
|
176
|
-
rm -f "$file_path" 2>/dev/null
|
|
177
|
-
else
|
|
178
|
-
# Windows 回退方案
|
|
179
|
-
del "$file_path" 2>/dev/null
|
|
180
|
-
fi
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
# 跨平台目录删除
|
|
184
|
-
safe_rmdir() {
|
|
185
|
-
local dir_path="$1"
|
|
186
|
-
|
|
187
|
-
if command_exists "rm"; then
|
|
188
|
-
rm -rf "$dir_path" 2>/dev/null
|
|
189
|
-
else
|
|
190
|
-
# Windows 回退方案
|
|
191
|
-
rmdir /s /q "$dir_path" 2>/dev/null
|
|
192
|
-
fi
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
# 跨平台环境变量设置
|
|
196
|
-
set_env() {
|
|
197
|
-
local var_name="$1"
|
|
198
|
-
local var_value="$2"
|
|
199
|
-
|
|
200
|
-
case "$PLATFORM" in
|
|
201
|
-
windows)
|
|
202
|
-
set "$var_name=$var_value"
|
|
203
|
-
;;
|
|
204
|
-
*)
|
|
205
|
-
export "$var_name=$var_value"
|
|
206
|
-
;;
|
|
207
|
-
esac
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
# 跨平台脚本执行
|
|
211
|
-
execute_script() {
|
|
212
|
-
local script_path="$1"
|
|
213
|
-
|
|
214
|
-
if [ -f "$script_path" ]; then
|
|
215
|
-
if command_exists "bash"; then
|
|
216
|
-
bash "$script_path"
|
|
217
|
-
else
|
|
218
|
-
# Windows 回退方案
|
|
219
|
-
cmd /c "$script_path"
|
|
220
|
-
fi
|
|
221
|
-
else
|
|
222
|
-
echo "脚本文件不存在: $script_path"
|
|
223
|
-
fi
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
# 跨平台进程检查
|
|
227
|
-
check_process() {
|
|
228
|
-
local process_name="$1"
|
|
229
|
-
|
|
230
|
-
case "$PLATFORM" in
|
|
231
|
-
windows)
|
|
232
|
-
tasklist | grep -i "$process_name" >/dev/null 2>&1
|
|
233
|
-
;;
|
|
234
|
-
*)
|
|
235
|
-
ps aux | grep -v "grep" | grep -i "$process_name" >/dev/null 2>&1
|
|
236
|
-
;;
|
|
237
|
-
esac
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
# 跨平台端口检查
|
|
241
|
-
check_port() {
|
|
242
|
-
local port="$1"
|
|
243
|
-
|
|
244
|
-
case "$PLATFORM" in
|
|
245
|
-
windows)
|
|
246
|
-
netstat -ano | grep ":$port " >/dev/null 2>&1
|
|
247
|
-
;;
|
|
248
|
-
*)
|
|
249
|
-
lsof -i ":$port" >/dev/null 2>&1
|
|
250
|
-
;;
|
|
251
|
-
esac
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
# 跨平台网络请求
|
|
255
|
-
safe_curl() {
|
|
256
|
-
if command_exists "curl"; then
|
|
257
|
-
curl "$@" 2>/dev/null
|
|
258
|
-
elif command_exists "wget"; then
|
|
259
|
-
wget -q -O - "$@" 2>/dev/null
|
|
260
|
-
else
|
|
261
|
-
echo "网络工具未安装"
|
|
262
|
-
fi
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
# 跨平台日期时间
|
|
266
|
-
get_timestamp() {
|
|
267
|
-
case "$PLATFORM" in
|
|
268
|
-
windows)
|
|
269
|
-
date "+%Y-%m-%d %H:%M:%S" 2>/dev/null || echo "$(date +'%Y-%m-%d %H:%M:%S')"
|
|
270
|
-
;;
|
|
271
|
-
*)
|
|
272
|
-
date '+%Y-%m-%d %H:%M:%S'
|
|
273
|
-
;;
|
|
274
|
-
esac
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
# 跨平台文件权限设置
|
|
278
|
-
set_executable() {
|
|
279
|
-
local file_path="$1"
|
|
280
|
-
|
|
281
|
-
case "$PLATFORM" in
|
|
282
|
-
windows)
|
|
283
|
-
# Windows 不需要设置执行权限
|
|
284
|
-
:
|
|
285
|
-
;;
|
|
286
|
-
*)
|
|
287
|
-
chmod +x "$file_path" 2>/dev/null
|
|
288
|
-
;;
|
|
289
|
-
esac
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
# 跨平台路径分隔符
|
|
293
|
-
get_path_separator() {
|
|
294
|
-
case "$PLATFORM" in
|
|
295
|
-
windows)
|
|
296
|
-
echo ";"
|
|
297
|
-
;;
|
|
298
|
-
*)
|
|
299
|
-
echo ":"
|
|
300
|
-
;;
|
|
301
|
-
esac
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
# 初始化平台检测
|
|
305
|
-
detect_platform
|
|
306
|
-
|
|
307
|
-
echo "✅ 跨平台工具库已加载 (支持 Windows/Linux/macOS)"
|