aico-cli 0.4.9 → 2.0.24

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 (70) hide show
  1. package/bin/cli/README.md +43 -0
  2. package/bin/cli/cli.js +3780 -0
  3. package/bin/cli/package.json +32 -0
  4. package/bin/cli/sdk-tools.d.ts +275 -0
  5. package/bin/cli/sdk.d.ts +446 -0
  6. package/bin/cli/sdk.mjs +14840 -0
  7. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/annotations-23.0.0.jar +0 -0
  8. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta-searchableOptions.jar +0 -0
  9. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta.jar +0 -0
  10. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/config-1.4.3.jar +0 -0
  11. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/jansi-2.4.1.jar +0 -0
  12. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-logging-jvm-7.0.0.jar +0 -0
  13. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-reflect-2.0.21.jar +0 -0
  14. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-sdk-jvm-0.4.0.jar +0 -0
  15. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-stdlib-2.1.20.jar +0 -0
  16. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-core-jvm-1.9.0.jar +0 -0
  17. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-slf4j-1.9.0.jar +0 -0
  18. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-bytestring-jvm-0.5.4.jar +0 -0
  19. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-core-jvm-0.5.4.jar +0 -0
  20. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-core-jvm-1.8.1.jar +0 -0
  21. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-json-jvm-1.8.1.jar +0 -0
  22. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-client-cio-jvm-3.0.2.jar +0 -0
  23. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-client-core-jvm-3.0.2.jar +0 -0
  24. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-events-jvm-3.0.2.jar +0 -0
  25. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-http-cio-jvm-3.0.2.jar +0 -0
  26. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-http-jvm-3.0.2.jar +0 -0
  27. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-io-jvm-3.0.2.jar +0 -0
  28. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-network-jvm-3.0.2.jar +0 -0
  29. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-network-tls-jvm-3.0.2.jar +0 -0
  30. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-serialization-jvm-3.0.2.jar +0 -0
  31. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-cio-jvm-3.0.2.jar +0 -0
  32. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-core-jvm-3.0.2.jar +0 -0
  33. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-sse-jvm-3.0.2.jar +0 -0
  34. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-websockets-jvm-3.0.2.jar +0 -0
  35. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-sse-jvm-3.0.2.jar +0 -0
  36. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-utils-jvm-3.0.2.jar +0 -0
  37. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-websocket-serialization-jvm-3.0.2.jar +0 -0
  38. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-websockets-jvm-3.0.2.jar +0 -0
  39. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/slf4j-api-2.0.16.jar +0 -0
  40. package/bin/cli/vendor/ripgrep/COPYING +3 -0
  41. package/bin/cli/vendor/ripgrep/arm64-darwin/rg +0 -0
  42. package/bin/cli/vendor/ripgrep/arm64-darwin/ripgrep.node +0 -0
  43. package/bin/cli/vendor/ripgrep/arm64-linux/rg +0 -0
  44. package/bin/cli/vendor/ripgrep/arm64-linux/ripgrep.node +0 -0
  45. package/bin/cli/vendor/ripgrep/x64-darwin/rg +0 -0
  46. package/bin/cli/vendor/ripgrep/x64-darwin/ripgrep.node +0 -0
  47. package/bin/cli/vendor/ripgrep/x64-linux/rg +0 -0
  48. package/bin/cli/vendor/ripgrep/x64-linux/ripgrep.node +0 -0
  49. package/bin/cli/vendor/ripgrep/x64-win32/rg.exe +0 -0
  50. package/bin/cli/vendor/ripgrep/x64-win32/ripgrep.node +0 -0
  51. package/bin/cli/yoga.wasm +0 -0
  52. package/dist/chunks/run-command.mjs +1 -0
  53. package/dist/chunks/simple-config.mjs +56 -10
  54. package/dist/cli.mjs +81 -32
  55. package/dist/index.mjs +3 -52
  56. package/package.json +2 -1
  57. package/templates/agents/base/panel-experts.md +244 -0
  58. package/templates/agents/code/python/345/274/200/345/217/221/344/270/223/345/256/266.md +49 -0
  59. package/templates/agents/code//345/256/211/345/205/250/346/274/217/346/264/236/350/257/206/345/210/253/344/270/223/345/256/266.md +51 -0
  60. package/templates/agents/code//346/200/247/350/203/275/345/210/206/346/236/220/344/270/223/345/256/266.md +49 -0
  61. package/templates/agents/code//346/212/200/346/234/257/346/226/207/346/241/243/345/267/245/347/250/213/345/270/210.md +49 -0
  62. package/templates/agents/code//346/240/271/346/234/254/345/216/237/345/233/240/345/210/206/346/236/220/345/270/210.md +49 -0
  63. package/templates/agents/code//347/263/273/347/273/237/346/236/266/346/236/204/345/270/210.md +232 -0
  64. package/templates/agents/code//350/264/250/351/207/217/350/257/204/344/274/260/345/267/245/347/250/213/345/270/210.md +49 -0
  65. package/templates/commands/base//344/270/223/345/256/266/347/273/204/345/210/206/346/236/220/346/231/272/350/203/275/344/275/223.md +82 -0
  66. package/templates/cursor.md +87 -0
  67. package/templates/hooks/notify.ps1 +110 -24
  68. package/templates/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1 +123 -34
  69. package/templates/personality.md +1 -1
  70. package/templates/settings.json +3 -15
@@ -1,13 +1,59 @@
1
1
  # UserPromptSubmit Hook - 输入通知器
2
2
  # 当用户提交输入时发送通知
3
3
 
4
- # 加载跨平台工具模块
5
- . "$PSScriptRoot\..\..\..\utils\crossplatform-detector.ps1"
4
+ # 设置错误处理策略
5
+ $ErrorActionPreference = "Continue"
6
6
 
7
- # 获取操作系统类型
8
- $osType = Get-OperatingSystem
9
- $message = "Claude Code 等待您的输入"
10
- $title = "Claude Code"
7
+ # 尝试加载跨平台工具模块
8
+ $utilsPath = Join-Path $PSScriptRoot "../../utils/crossplatform-detector.ps1"
9
+ if (Test-Path $utilsPath) {
10
+ try {
11
+ . $utilsPath
12
+ Write-Host "[INFO] 成功加载跨平台工具模块"
13
+ } catch {
14
+ Write-Host "[WARN] 加载跨平台工具模块失败: $($_.Exception.Message)"
15
+ }
16
+ } else {
17
+ Write-Host "[WARN] 跨平台工具模块不存在: $utilsPath"
18
+ }
19
+
20
+ # 如果模块加载失败,提供备用函数
21
+ if (-not (Get-Command "Write-HookLog" -ErrorAction SilentlyContinue)) {
22
+ function Write-HookLog {
23
+ param(
24
+ [string]$Level,
25
+ [string]$Message
26
+ )
27
+ $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
28
+ Write-Host "[$timestamp] [$Level] $Message"
29
+ }
30
+ }
31
+
32
+ if (-not (Get-Command "Test-CommandExists" -ErrorAction SilentlyContinue)) {
33
+ function Test-CommandExists {
34
+ param([string]$Command)
35
+ try {
36
+ Get-Command $Command -ErrorAction Stop > $null
37
+ return $true
38
+ } catch {
39
+ return $false
40
+ }
41
+ }
42
+ }
43
+
44
+ if (-not (Get-Command "Get-OperatingSystem" -ErrorAction SilentlyContinue)) {
45
+ function Get-OperatingSystem {
46
+ if ($env:OS -eq "Windows_NT") {
47
+ return "windows"
48
+ } elseif ($IsLinux) {
49
+ return "linux"
50
+ } elseif ($IsMacOS) {
51
+ return "macos"
52
+ } else {
53
+ return "unknown"
54
+ }
55
+ }
56
+ }
11
57
 
12
58
  # 发送通知的函数
13
59
  function Send-Notification {
@@ -16,42 +62,85 @@ function Send-Notification {
16
62
  [string]$Message
17
63
  )
18
64
 
19
- switch ($osType) {
20
- "windows" {
21
- # Windows 使用系统通知
22
- try {
23
- Add-Type -AssemblyName System.Windows.Forms
24
- $result = [System.Windows.Forms.MessageBox]::Show($Message, $Title, [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)
25
-
26
- # 播放提醒声音
27
- $soundFile = [System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::Windows) + "\Media\notify.wav"
28
- if (Test-Path $soundFile) {
29
- $player = New-Object Media.SoundPlayer $soundFile
30
- $player.Play()
65
+ $osType = Get-OperatingSystem
66
+ Write-HookLog "INFO" "检测到操作系统: $osType"
67
+
68
+ try {
69
+ # 简化通知逻辑 - 使用控制台输出作为主要方式
70
+ switch ($osType) {
71
+ "windows" {
72
+ # Windows 简化通知 - 只使用控制台输出
73
+ Write-Host "=== $Title ===" -ForegroundColor Yellow
74
+ Write-Host $Message -ForegroundColor White
75
+
76
+ # 播放简单的系统声音
77
+ try {
78
+ [System.Media.SystemSounds]::Beep.Play()
79
+ Write-HookLog "INFO" "播放系统蜂鸣声成功"
80
+ } catch {
81
+ Write-HookLog "WARN" "系统声音播放失败: $($_.Exception.Message)"
31
82
  }
32
- } catch {
33
- Write-Host "通知发送失败: $_"
34
83
  }
35
- }
36
- default {
37
- # Unix/Linux/macOS 系统通知
38
- if (Test-CommandExists "notify-send") {
39
- notify-send $Title $Message
84
+ "linux" {
85
+ # Linux 简化通知
86
+ Write-Host "=== $Title ===" -ForegroundColor Yellow
87
+ Write-Host $Message -ForegroundColor White
88
+
89
+ # 如果可用,使用系统通知
90
+ if (Test-CommandExists "notify-send") {
91
+ try {
92
+ Start-Process -FilePath "notify-send" -ArgumentList $Title, $Message -NoNewWindow -Wait
93
+ Write-HookLog "INFO" "发送 Linux 桌面通知"
94
+ } catch {
95
+ Write-HookLog "WARN" "notify-send 失败,使用控制台输出"
96
+ }
97
+ }
40
98
  }
99
+ "macos" {
100
+ # macOS 简化通知
101
+ Write-Host "=== $Title ===" -ForegroundColor Yellow
102
+ Write-Host $Message -ForegroundColor White
41
103
 
42
- # 播放提醒声音
43
- if (Test-CommandExists "paplay") {
44
- paplay /usr/share/sounds/freedesktop/stereo/bell.oga 2>$null
104
+ # 如果可用,使用系统通知
105
+ if (Test-CommandExists "osascript") {
106
+ try {
107
+ $script = "display notification \"$Message\" with title \"$Title\""
108
+ Start-Process -FilePath "osascript" -ArgumentList "-e", $script -NoNewWindow -Wait
109
+ Write-HookLog "INFO" "发送 macOS 桌面通知"
110
+ } catch {
111
+ Write-HookLog "WARN" "osascript 失败,使用控制台输出"
112
+ }
113
+ }
114
+ }
115
+ default {
116
+ Write-HookLog "WARN" "未知操作系统,使用控制台输出"
117
+ Write-Host "=== $Title ===" -ForegroundColor Yellow
118
+ Write-Host $Message -ForegroundColor White
45
119
  }
46
120
  }
121
+ } catch {
122
+ Write-HookLog "ERROR" "通知发送过程中发生错误: $($_.Exception.Message)"
123
+ # 确保总是有某种形式的输出
124
+ Write-Host "[$Title] $Message" -ForegroundColor Cyan
47
125
  }
48
126
 
49
- # 记录通知事件
50
- Write-HookLog "INFO" "发送输入通知: $Message"
127
+ Write-HookLog "INFO" "通知发送完成: $Message"
51
128
  }
52
129
 
53
- # 发送通知
54
- Send-Notification -Title $title -Message $message
130
+ # 主执行逻辑
131
+ try {
132
+ Write-HookLog "INFO" "开始执行 UserPromptSubmit hook"
133
+
134
+ $message = "Claude Code 等待您的输入"
135
+ $title = "Claude Code"
136
+
137
+ # 发送通知
138
+ Send-Notification -Title $title -Message $message
55
139
 
56
- # 继续执行
57
- exit 0
140
+ Write-HookLog "INFO" "UserPromptSubmit hook 执行成功"
141
+ exit 0
142
+ } catch {
143
+ Write-HookLog "ERROR" "UserPromptSubmit hook 执行失败: $($_.Exception.Message)"
144
+ # 即使失败也返回成功状态码,避免影响主流程
145
+ exit 0
146
+ }
@@ -84,7 +84,7 @@ description: 架构师级软件工程师,以工程卓越为信仰,为追求
84
84
 
85
85
  3. **方案设计**
86
86
  - 方案设计优先复用现有方案,组件,工具方法等,能复用的尽可能复用
87
- - 扫描项目中使用的测试框架和脚本,生成本次需求的测试脚本,如果不存在测试脚本,则编写测试用例
87
+ - 扫描项目中使用的测试框架和脚本,生成本次需求的测试脚本,如果不存在测试脚本,则编写测试脚本到.aico/tests下面
88
88
 
89
89
  4. **执行验证**
90
90
  - 按方案设计的结果输出代码
@@ -26,7 +26,6 @@
26
26
  "NotebookEdit",
27
27
  "mcp__intention-coding",
28
28
  "mcp__context7",
29
- "mcp__mcp-deepwiki",
30
29
  "mcp__open-websearch",
31
30
  "mcp__chrome-devtools"
32
31
  ],
@@ -39,18 +38,7 @@
39
38
  "hooks": [
40
39
  {
41
40
  "type": "command",
42
- "command": "if [ \"$OS\" = \"Windows_NT\" ]; then $env:USERPROFILE/.claude/hooks/notify.ps1 input; else ~/.claude/hooks/notify.sh input; fi",
43
- "timeout": 10
44
- }
45
- ]
46
- }
47
- ],
48
- "UserPromptSubmit": [
49
- {
50
- "hooks": [
51
- {
52
- "type": "command",
53
- "command": "if [ \"$OS\" = \"Windows_NT\" ]; then $env:USERPROFILE/.claude/hooks/notify.ps1 input; else ~/.claude/hooks/notify.sh input; fi",
41
+ "command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/notify.ps1\" input; else ~/.claude/hooks/notify.sh input; fi",
54
42
  "timeout": 10
55
43
  }
56
44
  ]
@@ -61,7 +49,7 @@
61
49
  "hooks": [
62
50
  {
63
51
  "type": "command",
64
- "command": "if [ \"$OS\" = \"Windows_NT\" ]; then $env:USERPROFILE/.claude/hooks/notify.ps1 complete; else ~/.claude/hooks/notify.sh complete; fi",
52
+ "command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/notify.ps1\" complete; else ~/.claude/hooks/notify.sh complete; fi",
65
53
  "timeout": 10
66
54
  }
67
55
  ]
@@ -72,7 +60,7 @@
72
60
  "hooks": [
73
61
  {
74
62
  "type": "command",
75
- "command": "if [ \"$OS\" = \"Windows_NT\" ]; then $env:USERPROFILE/.claude/hooks/notify.ps1 complete; else ~/.claude/hooks/notify.sh complete; fi",
63
+ "command": "if [ \"$OS\" = \"Windows_NT\" ]; then powershell -File \"$env:USERPROFILE/.claude/hooks/notify.ps1\" complete; else ~/.claude/hooks/notify.sh complete; fi",
76
64
  "timeout": 10
77
65
  }
78
66
  ]