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.
- package/bin/cli/README.md +43 -0
- package/bin/cli/cli.js +3780 -0
- package/bin/cli/package.json +32 -0
- package/bin/cli/sdk-tools.d.ts +275 -0
- package/bin/cli/sdk.d.ts +446 -0
- package/bin/cli/sdk.mjs +14840 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/annotations-23.0.0.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta-searchableOptions.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/config-1.4.3.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/jansi-2.4.1.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-logging-jvm-7.0.0.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-reflect-2.0.21.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-sdk-jvm-0.4.0.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-stdlib-2.1.20.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-core-jvm-1.9.0.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-slf4j-1.9.0.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-bytestring-jvm-0.5.4.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-core-jvm-0.5.4.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-core-jvm-1.8.1.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-json-jvm-1.8.1.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-client-cio-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-client-core-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-events-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-http-cio-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-http-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-io-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-network-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-network-tls-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-serialization-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-cio-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-core-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-sse-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-websockets-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-sse-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-utils-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-websocket-serialization-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-websockets-jvm-3.0.2.jar +0 -0
- package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/slf4j-api-2.0.16.jar +0 -0
- package/bin/cli/vendor/ripgrep/COPYING +3 -0
- package/bin/cli/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/bin/cli/vendor/ripgrep/arm64-darwin/ripgrep.node +0 -0
- package/bin/cli/vendor/ripgrep/arm64-linux/rg +0 -0
- package/bin/cli/vendor/ripgrep/arm64-linux/ripgrep.node +0 -0
- package/bin/cli/vendor/ripgrep/x64-darwin/rg +0 -0
- package/bin/cli/vendor/ripgrep/x64-darwin/ripgrep.node +0 -0
- package/bin/cli/vendor/ripgrep/x64-linux/rg +0 -0
- package/bin/cli/vendor/ripgrep/x64-linux/ripgrep.node +0 -0
- package/bin/cli/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/bin/cli/vendor/ripgrep/x64-win32/ripgrep.node +0 -0
- package/bin/cli/yoga.wasm +0 -0
- package/dist/chunks/run-command.mjs +1 -0
- package/dist/chunks/simple-config.mjs +56 -10
- package/dist/cli.mjs +81 -32
- package/dist/index.mjs +3 -52
- package/package.json +2 -1
- package/templates/agents/base/panel-experts.md +244 -0
- package/templates/agents/code/python/345/274/200/345/217/221/344/270/223/345/256/266.md +49 -0
- 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
- 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
- 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
- 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
- package/templates/agents/code//347/263/273/347/273/237/346/236/266/346/236/204/345/270/210.md +232 -0
- 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
- 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
- package/templates/cursor.md +87 -0
- package/templates/hooks/notify.ps1 +110 -24
- package/templates/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1 +123 -34
- package/templates/personality.md +1 -1
- package/templates/settings.json +3 -15
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
# UserPromptSubmit Hook - 输入通知器
|
|
2
2
|
# 当用户提交输入时发送通知
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
|
|
4
|
+
# 设置错误处理策略
|
|
5
|
+
$ErrorActionPreference = "Continue"
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
$
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
$
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
+
}
|
package/templates/personality.md
CHANGED
package/templates/settings.json
CHANGED
|
@@ -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
|
]
|