aico-cli 0.4.0 → 0.4.2

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.
Files changed (55) hide show
  1. package/dist/chunks/simple-config.mjs +41 -15
  2. package/dist/cli.mjs +35 -31
  3. package/package.json +4 -1
  4. package/templates/agents/aico/plan/function-point-analyzer.md +219 -0
  5. package/templates/agents/aico/requirement/test-crossplatform.ps1 +0 -0
  6. package/templates/agents/aico/requirement/test-crossplatform.sh +456 -0
  7. package/templates/commands/base//344/273/243/347/240/201/345/256/241/346/237/245/346/231/272/350/203/275/344/275/223.md +2 -5
  8. package/templates/commands/base//345/212/237/350/203/275/347/202/271/346/265/213/347/256/227.md +469 -19
  9. package/templates/skills/slack-gif-creator/LICENSE.txt +202 -0
  10. package/templates/skills/slack-gif-creator/SKILL.md +646 -0
  11. package/templates/skills/slack-gif-creator/core/color_palettes.py +302 -0
  12. package/templates/skills/slack-gif-creator/core/easing.py +230 -0
  13. package/templates/skills/slack-gif-creator/core/frame_composer.py +469 -0
  14. package/templates/skills/slack-gif-creator/core/gif_builder.py +246 -0
  15. package/templates/skills/slack-gif-creator/core/typography.py +357 -0
  16. package/templates/skills/slack-gif-creator/core/validators.py +264 -0
  17. package/templates/skills/slack-gif-creator/core/visual_effects.py +494 -0
  18. package/templates/skills/slack-gif-creator/requirements.txt +4 -0
  19. package/templates/skills/slack-gif-creator/templates/bounce.py +106 -0
  20. package/templates/skills/slack-gif-creator/templates/explode.py +331 -0
  21. package/templates/skills/slack-gif-creator/templates/fade.py +329 -0
  22. package/templates/skills/slack-gif-creator/templates/flip.py +291 -0
  23. package/templates/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
  24. package/templates/skills/slack-gif-creator/templates/morph.py +329 -0
  25. package/templates/skills/slack-gif-creator/templates/move.py +293 -0
  26. package/templates/skills/slack-gif-creator/templates/pulse.py +268 -0
  27. package/templates/skills/slack-gif-creator/templates/shake.py +127 -0
  28. package/templates/skills/slack-gif-creator/templates/slide.py +291 -0
  29. package/templates/skills/slack-gif-creator/templates/spin.py +269 -0
  30. package/templates/skills/slack-gif-creator/templates/wiggle.py +300 -0
  31. package/templates/skills/slack-gif-creator/templates/zoom.py +312 -0
  32. package/templates/skills/swimlane-diagram/README.md +373 -0
  33. package/templates/skills/swimlane-diagram/SKILL.md +242 -0
  34. package/templates/skills/swimlane-diagram/examples.md +405 -0
  35. package/templates/skills/swimlane-diagram/generators.mjs +258 -0
  36. package/templates/skills/swimlane-diagram/package.json +126 -0
  37. package/templates/skills/swimlane-diagram/reference.md +368 -0
  38. package/templates/skills/swimlane-diagram/swimlane-diagram.mjs +215 -0
  39. package/templates/skills/swimlane-diagram/swimlane-diagram.test.mjs +358 -0
  40. package/templates/skills/swimlane-diagram/validators.mjs +291 -0
  41. package/templates/skills/theme-factory/LICENSE.txt +202 -0
  42. package/templates/skills/theme-factory/SKILL.md +59 -0
  43. package/templates/skills/theme-factory/theme-showcase.pdf +0 -0
  44. package/templates/skills/theme-factory/themes/arctic-frost.md +19 -0
  45. package/templates/skills/theme-factory/themes/botanical-garden.md +19 -0
  46. package/templates/skills/theme-factory/themes/desert-rose.md +19 -0
  47. package/templates/skills/theme-factory/themes/forest-canopy.md +19 -0
  48. package/templates/skills/theme-factory/themes/golden-hour.md +19 -0
  49. package/templates/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  50. package/templates/skills/theme-factory/themes/modern-minimalist.md +19 -0
  51. package/templates/skills/theme-factory/themes/ocean-depths.md +19 -0
  52. package/templates/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  53. package/templates/skills/theme-factory/themes/tech-innovation.md +19 -0
  54. package/templates/code.md +0 -70
  55. package/templates/windows-bootstrap.ps1 +0 -390
@@ -1,390 +0,0 @@
1
- # AICO CLI Windows PowerShell 启动引导脚本
2
- # 提供 .sh 脚本的完整 PowerShell 兼容实现
3
-
4
- param(
5
- [Parameter(Mandatory=$true, Position=0)]
6
- [string]$Command,
7
-
8
- [Parameter(Position=1, ValueFromRemainingArguments=$true)]
9
- [string[]]$Arguments = @()
10
- )
11
-
12
- # 全局路径配置
13
- $AICO_ROOT = Split-Path -Parent $PSScriptRoot
14
- $AICO_TEMPLATES = Join-Path $AICO_ROOT "templates"
15
- $AICO_UTILS = Join-Path $AICO_TEMPLATES "utils"
16
- $AICO_HOOKS = Join-Path $AICO_TEMPLATES "hooks"
17
- $AICO_AGENTS = Join-Path $AICO_TEMPLATES "agents"
18
-
19
- # 版本信息
20
- $SCRIPT_VERSION = "1.0.0"
21
- $SCRIPT_BUILD = "2025-01-16"
22
-
23
- # 控制台输出美化
24
- function Write-AicoBanner {
25
- Write-Host @"
26
- ╔═══════════════════════════════════════════════════════════════════════════════════════╗
27
- ║ ║
28
- ║ 🚀 AICO CLI - PowerShell 跨平台兼容层 ║
29
- ║ 版本: $SCRIPT_VERSION | 构建: $SCRIPT_BUILD ║
30
- ║ Windows PowerShell 环境专用 ║
31
- ║ ║
32
- ╚═══════════════════════════════════════════════════════════════════════════════════════╝
33
- "@ -ForegroundColor Cyan
34
- }
35
-
36
- # 日志函数
37
- function Write-AicoLog {
38
- param(
39
- [string]$Message,
40
- [ValidateSet("INFO", "WARN", "ERROR", "DEBUG")]
41
- [string]$Level = "INFO",
42
- [string]$Source = "windows-bootstrap"
43
- )
44
-
45
- $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
46
- $entry = "[$Level] [$Source] $timestamp - $Message"
47
-
48
- switch ($Level) {
49
- "WARN" { Write-Host $entry -ForegroundColor Yellow }
50
- "ERROR" { Write-Host $entry -ForegroundColor Red }
51
- "DEBUG" { Write-Host $entry -ForegroundColor Gray }
52
- default { Write-Host $entry -ForegroundColor White }
53
- }
54
-
55
- # 文件日志
56
- $logFile = Join-Path $env:USERPROFILE ".claude\aico-windows.log"
57
- $logDir = Split-Path -Parent $logFile
58
- if (!(Test-Path $logDir)) {
59
- New-Item -ItemType Directory -Path $logDir -Force | Out-Null
60
- }
61
- Add-Content -Path $logFile -Value $entry -Force
62
- }
63
-
64
- # 平台检测与兼容性检查
65
- function Test-PlatformCompatibility {
66
- $os = [System.Environment]::OSVersion
67
- $isWindows = $os.Platform -eq "Win32NT"
68
- $hasWSL = Test-Path "C:\Windows\System32\wsl.exe"
69
- $hasGitBash = Test-Path "C:\Program Files\Git\bin\bash.exe"
70
-
71
- $compat = @{
72
- IsWindows = $isWindows
73
- HasWSL = $hasWSL
74
- HasGitBash = $hasGitBash
75
- PowerShellVersion = $PSVersionTable.PSVersion.ToString()
76
- IsAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
77
- }
78
-
79
- return $compat
80
- }
81
-
82
- # 路径转换工具
83
- function Convert-ToWindowsPath {
84
- param([string]$UnixPath)
85
-
86
- # Git Bash/Cygwin 路径转换
87
- if ($UnixPath -match '^/([a-zA-Z])/(.*)') {
88
- $drive = $Matches[1].ToUpper()
89
- $path = $Matches[2] -replace '/', '\'
90
- return "${drive}:\${path}"
91
- }
92
-
93
- # 已经是 Windows 路径
94
- if ($UnixPath -match '^[a-zA-Z]:\') {
95
- return $UnixPath
96
- }
97
-
98
- # 相对路径
99
- return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($UnixPath)
100
- }
101
-
102
- # .sh 脚本 PowerShell 适配器
103
- function Invoke-BashScriptAdapter {
104
- param(
105
- [string]$ScriptPath,
106
- [string[]]$ScriptArgs = @()
107
- )
108
-
109
- if (!(Test-Path $ScriptPath)) {
110
- Write-AicoLog -Level "ERROR" -Message "脚本文件不存在: $ScriptPath"
111
- return $false
112
- }
113
-
114
- # 查找对应的 PowerShell 版本
115
- $psScript = $ScriptPath -replace '\.sh$', '.ps1'
116
- if (Test-Path $psScript) {
117
- Write-AicoLog -Level "INFO" -Message "发现 PowerShell 版本: $psScript"
118
- try {
119
- & $psScript @ScriptArgs
120
- return $LASTEXITCODE -eq 0
121
- }
122
- catch {
123
- Write-AicoLog -Level "ERROR" -Message "PowerShell 脚本执行失败: $($_.Exception.Message)"
124
- return $false
125
- }
126
- }
127
-
128
- # 如果没有 PS 版本,使用通用适配器
129
- Write-AicoLog -Level "WARN" -Message "未找到 PowerShell 版本,使用通用适配器"
130
- return Invoke-GenericBashAdapter -ScriptPath $ScriptPath -Args $ScriptArgs
131
- }
132
-
133
- # 通用 Bash 适配器
134
- function Invoke-GenericBashAdapter {
135
- param([string]$ScriptPath, [string[]]$Args)
136
-
137
- try {
138
- # 读取脚本内容分析
139
- $content = Get-Content $ScriptPath -Raw
140
-
141
- # 基本模式识别
142
- if ($content -match 'notify\.sh') {
143
-
144
- return Invoke-NotifyAdapter -Content $content -Args $Args
145
- }
146
- elseif ($content -match 'task-manager') {
147
- return Invoke-TaskManagerAdapter -Content $content -Args $Args
148
- }
149
- elseif ($content -match 'requirement') {
150
- return Invoke-RequirementAdapter -Content $content -Args $Args
151
- }
152
- else {
153
- Write-AicoLog -Level "WARN" -Message "未知脚本类型,尝试调用 PowerShell 通用启动器"
154
- $launcher = Join-Path $AICO_UTILS "platform-launcher.ps1"
155
- if (Test-Path $launcher) {
156
- & $launcher -ScriptType "generic" -Arguments @($ScriptPath) + $Args
157
- return $LASTEXITCODE -eq 0
158
- }
159
- return $false
160
- }
161
- }
162
- catch {
163
- Write-AicoLog -Level "ERROR" -Message "通用适配失败: $($_.Exception.Message)"
164
- return $false
165
- }
166
- }
167
-
168
- # 通知系统适配器
169
- function Invoke-NotifyAdapter {
170
- param([string]$Content, [string[]]$Args)
171
-
172
- Write-AicoLog -Level "INFO" -Message "调用通知系统适配器"
173
-
174
- if ($Args.Count -gt 0) {
175
- $eventType = $Args[0]
176
- $notifyScript = Join-Path $AICO_HOOKS "notify.ps1"
177
-
178
- if (Test-Path $notifyScript) {
179
- & $notifyScript -EventType $eventType
180
- return $LASTEXITCODE -eq 0
181
- } else {
182
- # 备用方案:使用系统提示
183
- switch ($eventType) {
184
- "input" {
185
- [System.Console]::Beep(1000, 200)
186
- Write-Host "🎯 Claude Code: 需要您的输入" -ForegroundColor Yellow
187
- }
188
- "complete" {
189
- [System.Console]::Beep(2000, 100)
190
- Write-Host "✅ Claude Code: 任务完成" -ForegroundColor Green
191
- }
192
- }
193
- return $true
194
- }
195
- }
196
-
197
- return $false
198
- }
199
-
200
- # 任务管理适配器
201
- function Invoke-TaskManagerAdapter {
202
- param([string]$Content, [string[]]$Args)
203
-
204
- Write-AicoLog -Level "INFO" -Message "调用任务管理适配器"
205
-
206
- if ($Args.Count -ge 2) {
207
- $command = $Args[0]
208
- $taskListPath = Convert-ToWindowsPath $Args[1]
209
- $taskId = if ($Args.Count -ge 3) { $Args[2] } else { "" }
210
-
211
- $taskManager = Join-Path $AICO_UTILS "task-manager.ps1"
212
- if (Test-Path $taskManager) {
213
- & $taskManager $command $taskListPath $taskId
214
- return $LASTEXITCODE -eq 0
215
- } else {
216
- Write-AicoLog -Level "ERROR" -Message "任务管理器 PowerShell 版本未找到"
217
- return $false
218
- }
219
- }
220
-
221
- return $false
222
- }
223
-
224
- # 需求管理适配器
225
- function Invoke-RequirementAdapter {
226
- param([string]$Content, [string[]]$Args)
227
-
228
- Write-AicoLog -Level "INFO" -Message "调用需求管理适配器"
229
-
230
- # 需求管理相关脚本的统一处理
231
- if ($Content -match 'requirement.*processor') {
232
- # 需求处理器
233
- if ($Args.Count -gt 0) {
234
- $userInput = $Args -join " "
235
- Write-AicoLog -Level "INFO" -Message "处理需求: $userInput"
236
- Write-Host "🎯 需求识别完成,等待技术方案生成..." -ForegroundColor Green
237
- return $true
238
- }
239
- }
240
-
241
- return $true # 大多数需求管理脚本是信息收集,返回成功
242
- }
243
-
244
- # 命令分发
245
- function Invoke-AicoCommand {
246
- param([string]$Cmd, [string[]]$Args)
247
-
248
- Write-AicoLog -Level "DEBUG" -Message "执行命令: $Cmd 参数: $($Args -join ' ')"
249
-
250
- switch ($Cmd.ToLower()) {
251
- "notify" {
252
- return Invoke-NotifyAdapter -Content "" -Args $Args
253
- }
254
-
255
- "task-manager" {
256
- return Invoke-TaskManagerAdapter -Content "" -Args $Args
257
- }
258
-
259
- { $_ -in @("requirement", "hooks", "pre-requirement", "post-requirement") } {
260
- return Invoke-RequirementAdapter -Content $Cmd -Args $Args
261
- }
262
-
263
- "platform-info" {
264
- $compat = Test-PlatformCompatibility
265
- Write-Host "平台兼容性信息:"
266
- $compat | ConvertTo-Json -Depth 3 | Write-Host
267
- return $true
268
- }
269
-
270
- "test-connection" {
271
- Write-AicoLog -Level "INFO" -Message "测试与 PowerShell 环境的连接..."
272
-
273
- # 测试音频
274
- try {
275
- [Console]::Beep(1000, 100)
276
- Write-Host "🔊 音频测试通过" -ForegroundColor Green
277
- } catch {
278
- Write-Host "⚠️ 音频测试失败" -ForegroundColor Yellow
279
- }
280
-
281
- # 测试路径访问
282
- try {
283
- Test-Path $AICO_HOOKS
284
- Test-Path $AICO_UTILS
285
- Write-Host "📁 路径访问测试通过" -ForegroundColor Green
286
- } catch {
287
- Write-Host "❌ 路径访问测试失败" -ForegroundColor Red
288
- }
289
-
290
- return $true
291
- }
292
-
293
- "help" {
294
- Show-Usage
295
- return $true
296
- }
297
-
298
- default {
299
- # 尝试作为脚本文件执行
300
- $scriptPath = Join-Path $AICO_HOOKS "$Cmd.ps1"
301
- if (Test-Path $scriptPath) {
302
- try {
303
- & $scriptPath @Args
304
- return $LASTEXITCODE -eq 0
305
- }
306
- catch {
307
- Write-AicoLog -Level "ERROR" -Message "直接脚本执行失败: $($_.Exception.Message)"
308
- return $false
309
- }
310
- }
311
-
312
- # 最后尝试 Bash 适配器
313
- $bashScript = Join-Path $AICO_HOOKS "$Cmd.sh"
314
- if (Test-Path $bashScript) {
315
- return Invoke-BashScriptAdapter -ScriptPath $bashScript -ScriptArgs $Args
316
- }
317
-
318
- Write-AicoLog -Level "ERROR" -Message "未知命令或脚本: $Cmd"
319
- return $false
320
- }
321
- }
322
- }
323
-
324
- function Show-Usage {
325
- Write-Host @"
326
- 🚀 AICO CLI Windows PowerShell 启动器
327
-
328
- 📋 可用命令:
329
- notify [input|complete] - 触发通知系统
330
- task-manager <command> - 任务管理操作
331
- requirement <user-input> - 处理用户需求
332
- platform-info - 显示平台兼容性信息
333
- test-connection - 连接性测试
334
- <script-name> [args...] - 执行特定脚本
335
-
336
- 🔧 PowerShell 脚本兼容性:
337
- ✓ 原生 PowerShell 脚本
338
- ✓ 增强的Bash脚本适配器
339
- ✓ 跨平台路径转换
340
- ✓ Windows音频系统集成
341
-
342
- 💡 使用示例:
343
- .\windows-bootstrap.ps1 notify input
344
- .\windows-bootstrap.ps1 requirement "开发用户登录功能"
345
- .\windows-bootstrap.ps1 platform-info
346
- .\windows-bootstrap.ps1 notify complete
347
-
348
- 🎯 文件位置:
349
- 日志文件: $env:USERPROFILE\.claude\aico-windows.log
350
- 临时数据: $env:TEMP\aico-hooks\
351
- "@ -ForegroundColor Cyan
352
- }
353
-
354
- # 主函数
355
- function Main {
356
- Write-AicoBanner
357
- Write-AicoLog -Level "INFO" -Message "AICO Windows Bootstrap 启动"
358
-
359
- # 平台兼容性检查
360
- $compat = Test-PlatformCompatibility
361
- Write-AicoLog -Level "DEBUG" -Message "平台信息: $($compat | ConvertTo-Json -Compress)"
362
-
363
- if (!$compat.IsWindows) {
364
- Write-AicoLog -Level "ERROR" -Message "非 Windows 环境,此脚本专用于 Windows"
365
- return 1
366
- }
367
-
368
- Write-AicoLog -Level "INFO" -Message "执行命令: $Command 参数: $($Arguments -join ' ')"
369
-
370
- # 执行命令
371
- $result = Invoke-AicoCommand -Cmd $Command -Args $Arguments
372
-
373
- if ($result) {
374
- Write-AicoLog -Level "SUCCESS" -Message "命令执行成功: $Command"
375
- return 0
376
- } else {
377
- Write-AicoLog -Level "ERROR" -Message "命令执行失败: $Command"
378
- return 1
379
- }
380
- }
381
-
382
- # 入口点
383
- try {
384
- exit (Main)
385
- }
386
- catch {
387
- Write-AicoLog -Level "ERROR" -Message "引导程序异常: $($_.Exception.Message)"
388
- Write-Host "❌ 引导程序异常,查看日志获取详情: $env:USERPROFILE\.claude\aico-windows.log" -ForegroundColor Red
389
- exit 1
390
- }