openyida 0.1.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.
- package/.cache/.gitkeep +0 -0
- package/.eslintrc.json +25 -0
- package/.github/workflows/ci.yml +123 -0
- package/.github/workflows/publish.yml +105 -0
- package/.github/workflows/update-contributors.yml +151 -0
- package/.openclaw/skills/yida-issue/SKILL.md +27 -0
- package/.openclaw/skills/yida-issue/scripts/create-issue.js +317 -0
- package/CLAUDE.md +168 -0
- package/CONTRIBUTING.md +59 -0
- package/LICENSE +21 -0
- package/README.md +106 -0
- package/bin/yida.js +811 -0
- package/config.json +4 -0
- package/install-skills.ps1 +162 -0
- package/install-skills.sh +175 -0
- package/package.json +34 -0
- package/pages/dist/.gitkeep +0 -0
- package/pages/src/.gitkeep +0 -0
- package/prd/salary-calculator.md +15 -0
- package/tests/cli.test.js +930 -0
- package/tests/install.test.js +277 -0
- package/tests/yida-issue.test.js +314 -0
package/config.json
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# install-skills.ps1 - 安装 yida-skills(Windows PowerShell)
|
|
2
|
+
#
|
|
3
|
+
# 兼容:Windows PowerShell 5.1+ / PowerShell Core 7+
|
|
4
|
+
# Mac/Linux 用户请使用:install-skills.sh
|
|
5
|
+
#
|
|
6
|
+
# 用法:
|
|
7
|
+
# .\install-skills.ps1 # 自动检测网络,国内自动使用加速源
|
|
8
|
+
# .\install-skills.ps1 --cn # 强制使用国内加速源
|
|
9
|
+
# .\install-skills.ps1 --global # 强制使用原始 GitHub 地址
|
|
10
|
+
# PowerShell -ExecutionPolicy Bypass -File install-skills.ps1
|
|
11
|
+
|
|
12
|
+
param(
|
|
13
|
+
[string]$Mode = ""
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
$ErrorActionPreference = "Continue"
|
|
17
|
+
|
|
18
|
+
$SkillsDir = ".claude\skills"
|
|
19
|
+
$GithubUrl = "https://github.com/openyida/yida-skills.git"
|
|
20
|
+
# ghproxy.com 是社区维护的 GitHub 加速代理,国内访问 GitHub 时使用
|
|
21
|
+
$GhproxyUrl = "https://ghproxy.com/https://github.com/openyida/yida-skills.git"
|
|
22
|
+
$Branch = "main"
|
|
23
|
+
|
|
24
|
+
Write-Host "🔧 正在安装 yida-skills..." -ForegroundColor Cyan
|
|
25
|
+
|
|
26
|
+
# 检查是否在项目根目录(有 .git 或 config.json)
|
|
27
|
+
if (-not (Test-Path "config.json") -and -not (Test-Path ".git")) {
|
|
28
|
+
Write-Host "❌ 请在项目根目录下运行此脚本" -ForegroundColor Red
|
|
29
|
+
exit 1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# ── 环境依赖检查与自动安装 ────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
# 检查 git
|
|
35
|
+
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
|
36
|
+
Write-Host "❌ 未找到 git,请先安装 Git for Windows:https://git-scm.com/download/win" -ForegroundColor Red
|
|
37
|
+
exit 1
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# 检查并安装 Node.js
|
|
41
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
42
|
+
Write-Host "⚠️ 未找到 Node.js(yida-publish 等脚本需要 Node.js ≥ 16)" -ForegroundColor Yellow
|
|
43
|
+
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
|
44
|
+
Write-Host "📦 检测到 winget,正在自动安装 Node.js LTS..." -ForegroundColor Cyan
|
|
45
|
+
winget install OpenJS.NodeJS.LTS --accept-source-agreements --accept-package-agreements
|
|
46
|
+
# 刷新环境变量
|
|
47
|
+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
48
|
+
if (Get-Command node -ErrorAction SilentlyContinue) {
|
|
49
|
+
Write-Host "✅ Node.js 安装完成:$(node --version)" -ForegroundColor Green
|
|
50
|
+
Write-Host "📦 配置 npm 淘宝镜像源..." -ForegroundColor Cyan
|
|
51
|
+
npm config set registry https://registry.npmmirror.com
|
|
52
|
+
Write-Host "✅ npm 镜像源已设置为淘宝镜像(npmmirror.com)" -ForegroundColor Green
|
|
53
|
+
} else {
|
|
54
|
+
Write-Host "💡 Node.js 已安装,请重新打开终端后再运行此脚本" -ForegroundColor Yellow
|
|
55
|
+
exit 1
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
Write-Host "💡 请手动安装 Node.js(≥ 16):https://nodejs.org" -ForegroundColor Yellow
|
|
59
|
+
Write-Host " 安装完成后重新运行此脚本" -ForegroundColor Yellow
|
|
60
|
+
exit 1
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
$nodeVersionRaw = node --version
|
|
64
|
+
$nodeVersion = $nodeVersionRaw -replace "^v", ""
|
|
65
|
+
$nodeMajor = [int]($nodeVersion -split "\.")[0]
|
|
66
|
+
if ($nodeMajor -lt 16) {
|
|
67
|
+
Write-Host "⚠️ Node.js 版本过低(当前 $nodeVersionRaw,要求 ≥ 16)" -ForegroundColor Yellow
|
|
68
|
+
Write-Host "💡 请升级 Node.js:https://nodejs.org" -ForegroundColor Yellow
|
|
69
|
+
} else {
|
|
70
|
+
Write-Host "✅ Node.js $nodeVersionRaw" -ForegroundColor Green
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# 检查并安装 Python
|
|
75
|
+
if (-not (Get-Command python3 -ErrorAction SilentlyContinue) -and -not (Get-Command python -ErrorAction SilentlyContinue)) {
|
|
76
|
+
Write-Host "⚠️ 未找到 Python(yida-login / yida-logout 需要 Python ≥ 3.10)" -ForegroundColor Yellow
|
|
77
|
+
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
|
78
|
+
Write-Host "📦 检测到 winget,正在自动安装 Python..." -ForegroundColor Cyan
|
|
79
|
+
winget install Python.Python.3.12 --accept-source-agreements --accept-package-agreements
|
|
80
|
+
# 刷新环境变量
|
|
81
|
+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
82
|
+
if (Get-Command python -ErrorAction SilentlyContinue) {
|
|
83
|
+
Write-Host "✅ Python 安装完成:$(python --version)" -ForegroundColor Green
|
|
84
|
+
Write-Host "📦 配置 pip 阿里云镜像源..." -ForegroundColor Cyan
|
|
85
|
+
python -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
|
86
|
+
python -m pip config set global.trusted-host mirrors.aliyun.com
|
|
87
|
+
Write-Host "✅ pip 镜像源已设置为阿里云(mirrors.aliyun.com)" -ForegroundColor Green
|
|
88
|
+
} else {
|
|
89
|
+
Write-Host "💡 Python 已安装,请重新打开终端后再运行此脚本" -ForegroundColor Yellow
|
|
90
|
+
exit 1
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
Write-Host "💡 请手动安装 Python(≥ 3.10):https://www.python.org" -ForegroundColor Yellow
|
|
94
|
+
Write-Host " 安装完成后重新运行此脚本" -ForegroundColor Yellow
|
|
95
|
+
exit 1
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
$pythonCmd = if (Get-Command python3 -ErrorAction SilentlyContinue) { "python3" } else { "python" }
|
|
99
|
+
$pythonVersionRaw = & $pythonCmd --version 2>&1
|
|
100
|
+
$pythonVersion = ($pythonVersionRaw -replace "Python ", "").Trim()
|
|
101
|
+
$versionParts = $pythonVersion -split "\."
|
|
102
|
+
$pythonMajor = [int]$versionParts[0]
|
|
103
|
+
$pythonMinor = [int]$versionParts[1]
|
|
104
|
+
if ($pythonMajor -lt 3 -or ($pythonMajor -eq 3 -and $pythonMinor -lt 10)) {
|
|
105
|
+
Write-Host "⚠️ Python 版本过低(当前 $pythonVersion,要求 ≥ 3.10)" -ForegroundColor Yellow
|
|
106
|
+
Write-Host "💡 请升级 Python:https://www.python.org" -ForegroundColor Yellow
|
|
107
|
+
} else {
|
|
108
|
+
Write-Host "✅ Python $pythonVersion" -ForegroundColor Green
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
Write-Host ""
|
|
113
|
+
|
|
114
|
+
# ── 判断使用哪个源 ────────────────────────────────────────────────────
|
|
115
|
+
|
|
116
|
+
$UseProxy = $false
|
|
117
|
+
|
|
118
|
+
if ($Mode -eq "--cn") {
|
|
119
|
+
$UseProxy = $true
|
|
120
|
+
Write-Host "🇨🇳 已指定使用国内加速源" -ForegroundColor Cyan
|
|
121
|
+
} elseif ($Mode -eq "--global") {
|
|
122
|
+
$UseProxy = $false
|
|
123
|
+
Write-Host "🌐 已指定使用原始 GitHub 地址" -ForegroundColor Cyan
|
|
124
|
+
} else {
|
|
125
|
+
# 自动检测:尝试连接 GitHub,超时 3 秒
|
|
126
|
+
Write-Host "🔍 检测网络环境..." -ForegroundColor Cyan
|
|
127
|
+
try {
|
|
128
|
+
Invoke-WebRequest -Uri "https://github.com" -TimeoutSec 3 -UseBasicParsing -ErrorAction Stop | Out-Null
|
|
129
|
+
Write-Host "🌐 GitHub 可直连,使用原始地址" -ForegroundColor Green
|
|
130
|
+
$UseProxy = $false
|
|
131
|
+
} catch {
|
|
132
|
+
Write-Host "🇨🇳 GitHub 连接超时,自动切换到国内加速源(ghproxy.com)" -ForegroundColor Yellow
|
|
133
|
+
$UseProxy = $true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
$CloneUrl = if ($UseProxy) { $GhproxyUrl } else { $GithubUrl }
|
|
138
|
+
|
|
139
|
+
# ── 安装 Skills ───────────────────────────────────────────────────────
|
|
140
|
+
|
|
141
|
+
if (Test-Path $SkillsDir) {
|
|
142
|
+
Write-Host "📦 $SkillsDir 已存在,拉取最新代码(branch: $Branch)..." -ForegroundColor Yellow
|
|
143
|
+
git -C $SkillsDir fetch origin $Branch
|
|
144
|
+
git -C $SkillsDir checkout $Branch
|
|
145
|
+
git -C $SkillsDir pull origin $Branch
|
|
146
|
+
} else {
|
|
147
|
+
Write-Host "📦 克隆 yida-skills(branch: $Branch)到 $SkillsDir..." -ForegroundColor Yellow
|
|
148
|
+
git clone --branch $Branch --depth 1 $CloneUrl $SkillsDir
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
Write-Host "✅ Skills 安装完成:$SkillsDir\skills\" -ForegroundColor Green
|
|
152
|
+
Write-Host ""
|
|
153
|
+
Write-Host "已安装的 Skills:" -ForegroundColor Cyan
|
|
154
|
+
|
|
155
|
+
$SkillsSubDir = Join-Path $SkillsDir "skills"
|
|
156
|
+
if (Test-Path $SkillsSubDir) {
|
|
157
|
+
Get-ChildItem -Path $SkillsSubDir -Directory | ForEach-Object {
|
|
158
|
+
Write-Host " - $($_.Name)"
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
Write-Host " (未找到 skills 子目录)" -ForegroundColor Yellow
|
|
162
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# install-skills.sh - 安装 yida-skills
|
|
3
|
+
#
|
|
4
|
+
# 兼容:macOS / Linux(sh/bash/zsh)
|
|
5
|
+
# Windows 用户请使用:install-skills.ps1
|
|
6
|
+
#
|
|
7
|
+
# 用法:
|
|
8
|
+
# bash install-skills.sh # 自动检测网络,国内自动使用加速源
|
|
9
|
+
# bash install-skills.sh --cn # 强制使用国内加速源
|
|
10
|
+
# bash install-skills.sh --global # 强制使用原始 GitHub 地址
|
|
11
|
+
|
|
12
|
+
set -e
|
|
13
|
+
|
|
14
|
+
SKILLS_DIR=".claude/skills"
|
|
15
|
+
GITHUB_URL="https://github.com/openyida/yida-skills.git"
|
|
16
|
+
# ghproxy.com 是社区维护的 GitHub 加速代理,国内访问 GitHub 时使用
|
|
17
|
+
GHPROXY_URL="https://ghproxy.com/https://github.com/openyida/yida-skills.git"
|
|
18
|
+
BRANCH="main"
|
|
19
|
+
|
|
20
|
+
echo "🔧 正在安装 yida-skills..."
|
|
21
|
+
|
|
22
|
+
# 检查是否在项目根目录(有 .git 或 config.json)
|
|
23
|
+
if [ ! -f "config.json" ] && [ ! -d ".git" ]; then
|
|
24
|
+
echo "❌ 请在项目根目录下运行此脚本"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# ── 环境依赖检查与自动安装 ────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
# 检查 git
|
|
31
|
+
if ! command -v git > /dev/null 2>&1; then
|
|
32
|
+
echo "❌ 未找到 git,请先安装 Git:"
|
|
33
|
+
echo " macOS: brew install git 或访问 https://git-scm.com"
|
|
34
|
+
echo " Linux: sudo apt install git / sudo yum install git"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# 检查并安装 Node.js
|
|
39
|
+
if ! command -v node > /dev/null 2>&1; then
|
|
40
|
+
echo "⚠️ 未找到 Node.js(yida-publish 等脚本需要 Node.js ≥ 16)"
|
|
41
|
+
if command -v brew > /dev/null 2>&1; then
|
|
42
|
+
echo "📦 检测到 Homebrew,正在自动安装 Node.js..."
|
|
43
|
+
brew install node
|
|
44
|
+
echo "✅ Node.js 安装完成:$(node --version)"
|
|
45
|
+
echo "📦 配置 npm 淘宝镜像源..."
|
|
46
|
+
npm config set registry https://registry.npmmirror.com
|
|
47
|
+
echo "✅ npm 镜像源已设置为淘宝镜像(npmmirror.com)"
|
|
48
|
+
elif command -v apt-get > /dev/null 2>&1; then
|
|
49
|
+
echo "📦 检测到 apt,正在自动安装 Node.js(阿里云镜像)..."
|
|
50
|
+
curl -fsSL https://mirrors.aliyun.com/nodesource/setup_lts.x | sudo -E bash -
|
|
51
|
+
sudo apt-get install -y nodejs
|
|
52
|
+
echo "✅ Node.js 安装完成:$(node --version)"
|
|
53
|
+
echo "📦 配置 npm 淘宝镜像源..."
|
|
54
|
+
npm config set registry https://registry.npmmirror.com
|
|
55
|
+
echo "✅ npm 镜像源已设置为淘宝镜像(npmmirror.com)"
|
|
56
|
+
elif command -v yum > /dev/null 2>&1; then
|
|
57
|
+
echo "📦 检测到 yum,正在自动安装 Node.js(阿里云镜像)..."
|
|
58
|
+
curl -fsSL https://mirrors.aliyun.com/nodesource/setup_lts.x | sudo bash -
|
|
59
|
+
sudo yum install -y nodejs
|
|
60
|
+
echo "✅ Node.js 安装完成:$(node --version)"
|
|
61
|
+
echo "📦 配置 npm 淘宝镜像源..."
|
|
62
|
+
npm config set registry https://registry.npmmirror.com
|
|
63
|
+
echo "✅ npm 镜像源已设置为淘宝镜像(npmmirror.com)"
|
|
64
|
+
else
|
|
65
|
+
echo "💡 请手动安装 Node.js(≥ 16):https://nodejs.org"
|
|
66
|
+
echo " 或使用 nvm:https://github.com/nvm-sh/nvm"
|
|
67
|
+
echo " 安装完成后重新运行此脚本"
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
else
|
|
71
|
+
NODE_VERSION=$(node --version | sed 's/v//')
|
|
72
|
+
NODE_MAJOR=$(echo "$NODE_VERSION" | cut -d. -f1)
|
|
73
|
+
if [ "$NODE_MAJOR" -lt 16 ]; then
|
|
74
|
+
echo "⚠️ Node.js 版本过低(当前 v${NODE_VERSION},要求 ≥ 16)"
|
|
75
|
+
echo "💡 请升级 Node.js:https://nodejs.org 或使用 nvm 管理版本"
|
|
76
|
+
else
|
|
77
|
+
echo "✅ Node.js v${NODE_VERSION}"
|
|
78
|
+
fi
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# 检查并安装 Python
|
|
82
|
+
if ! command -v python3 > /dev/null 2>&1; then
|
|
83
|
+
echo "⚠️ 未找到 Python(yida-login / yida-logout 需要 Python ≥ 3.10)"
|
|
84
|
+
if command -v brew > /dev/null 2>&1; then
|
|
85
|
+
echo "📦 检测到 Homebrew,正在自动安装 Python..."
|
|
86
|
+
brew install python
|
|
87
|
+
echo "✅ Python 安装完成:$(python3 --version)"
|
|
88
|
+
echo "📦 配置 pip 阿里云镜像源..."
|
|
89
|
+
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
|
90
|
+
pip3 config set global.trusted-host mirrors.aliyun.com
|
|
91
|
+
echo "✅ pip 镜像源已设置为阿里云(mirrors.aliyun.com)"
|
|
92
|
+
elif command -v apt-get > /dev/null 2>&1; then
|
|
93
|
+
echo "📦 检测到 apt,正在自动安装 Python..."
|
|
94
|
+
sudo apt-get install -y python3 python3-pip
|
|
95
|
+
echo "✅ Python 安装完成:$(python3 --version)"
|
|
96
|
+
echo "📦 配置 pip 阿里云镜像源..."
|
|
97
|
+
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
|
98
|
+
pip3 config set global.trusted-host mirrors.aliyun.com
|
|
99
|
+
echo "✅ pip 镜像源已设置为阿里云(mirrors.aliyun.com)"
|
|
100
|
+
elif command -v yum > /dev/null 2>&1; then
|
|
101
|
+
echo "📦 检测到 yum,正在自动安装 Python..."
|
|
102
|
+
sudo yum install -y python3 python3-pip
|
|
103
|
+
echo "✅ Python 安装完成:$(python3 --version)"
|
|
104
|
+
echo "📦 配置 pip 阿里云镜像源..."
|
|
105
|
+
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
|
106
|
+
pip3 config set global.trusted-host mirrors.aliyun.com
|
|
107
|
+
echo "✅ pip 镜像源已设置为阿里云(mirrors.aliyun.com)"
|
|
108
|
+
else
|
|
109
|
+
echo "💡 请手动安装 Python(≥ 3.10):https://www.python.org"
|
|
110
|
+
echo " 安装完成后重新运行此脚本"
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
else
|
|
114
|
+
PYTHON_VERSION=$(python3 --version 2>&1 | sed 's/Python //')
|
|
115
|
+
PYTHON_MAJOR=$(echo "$PYTHON_VERSION" | cut -d. -f1)
|
|
116
|
+
PYTHON_MINOR=$(echo "$PYTHON_VERSION" | cut -d. -f2)
|
|
117
|
+
if [ "$PYTHON_MAJOR" -lt 3 ] || { [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 10 ]; }; then
|
|
118
|
+
echo "⚠️ Python 版本过低(当前 ${PYTHON_VERSION},要求 ≥ 3.10)"
|
|
119
|
+
echo "💡 请升级 Python:https://www.python.org"
|
|
120
|
+
else
|
|
121
|
+
echo "✅ Python ${PYTHON_VERSION}"
|
|
122
|
+
fi
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
echo ""
|
|
126
|
+
|
|
127
|
+
# ── 判断使用哪个源 ────────────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
USE_PROXY=0
|
|
130
|
+
|
|
131
|
+
if [ "$1" = "--cn" ]; then
|
|
132
|
+
USE_PROXY=1
|
|
133
|
+
echo "🇨🇳 已指定使用国内加速源"
|
|
134
|
+
elif [ "$1" = "--global" ]; then
|
|
135
|
+
USE_PROXY=0
|
|
136
|
+
echo "🌐 已指定使用原始 GitHub 地址"
|
|
137
|
+
else
|
|
138
|
+
# 自动检测:尝试连接 GitHub,超时 3 秒
|
|
139
|
+
echo "🔍 检测网络环境..."
|
|
140
|
+
if curl -s --connect-timeout 3 https://github.com > /dev/null 2>&1; then
|
|
141
|
+
echo "🌐 GitHub 可直连,使用原始地址"
|
|
142
|
+
USE_PROXY=0
|
|
143
|
+
else
|
|
144
|
+
echo "🇨🇳 GitHub 连接超时,自动切换到国内加速源(ghproxy.com)"
|
|
145
|
+
USE_PROXY=1
|
|
146
|
+
fi
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
if [ "$USE_PROXY" = "1" ]; then
|
|
150
|
+
CLONE_URL="${GHPROXY_URL}"
|
|
151
|
+
else
|
|
152
|
+
CLONE_URL="${GITHUB_URL}"
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
# ── 安装 Skills ───────────────────────────────────────────────────────
|
|
156
|
+
|
|
157
|
+
if [ -d "${SKILLS_DIR}" ]; then
|
|
158
|
+
echo "📦 ${SKILLS_DIR} 已存在,拉取最新代码(branch: ${BRANCH})..."
|
|
159
|
+
git -C "${SKILLS_DIR}" fetch origin "${BRANCH}" && git -C "${SKILLS_DIR}" checkout "${BRANCH}" && git -C "${SKILLS_DIR}" pull origin "${BRANCH}"
|
|
160
|
+
else
|
|
161
|
+
echo "📦 克隆 yida-skills(branch: ${BRANCH})到 ${SKILLS_DIR}..."
|
|
162
|
+
git clone --branch "${BRANCH}" --depth 1 "${CLONE_URL}" "${SKILLS_DIR}"
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
echo "✅ Skills 安装完成:${SKILLS_DIR}/skills/"
|
|
166
|
+
echo ""
|
|
167
|
+
echo "已安装的 Skills:"
|
|
168
|
+
if [ -d "${SKILLS_DIR}/skills" ]; then
|
|
169
|
+
for skill_dir in "${SKILLS_DIR}/skills"/*/; do
|
|
170
|
+
skill_name=$(basename "${skill_dir}")
|
|
171
|
+
echo " - ${skill_name}"
|
|
172
|
+
done
|
|
173
|
+
else
|
|
174
|
+
echo " (未找到 skills 子目录)"
|
|
175
|
+
fi
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openyida",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "OpenYida CLI - 宜搭命令行工具",
|
|
5
|
+
"bin": {
|
|
6
|
+
"yida": "./bin/yida.js",
|
|
7
|
+
"openyida": "./bin/yida.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"test:coverage": "jest --coverage"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["yida", "aliwork", "dingtalk", "cli", "openyida"],
|
|
14
|
+
"author": "OpenYida Contributors",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"commander": "^12.0.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"jest": "^29.0.0"
|
|
21
|
+
},
|
|
22
|
+
"jest": {
|
|
23
|
+
"testMatch": [
|
|
24
|
+
"**/tests/**/*.test.js"
|
|
25
|
+
],
|
|
26
|
+
"coverageReporters": [
|
|
27
|
+
"text",
|
|
28
|
+
"lcov"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=16"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 个人薪资计算器 需求文档
|
|
2
|
+
|
|
3
|
+
## 功能需求
|
|
4
|
+
|
|
5
|
+
专业级薪资结构分析工具,帮助职场人精准估算收入结构,包含:
|
|
6
|
+
- 智能输入区:月薪、城市、年终奖、社保公积金等参数
|
|
7
|
+
- 计算引擎:五险一金、个税累进税率、年终奖单独/合并计税
|
|
8
|
+
- 可视化结果:4宫格核心指标 + CSS 图表(环形图、柱状图、瀑布图)
|
|
9
|
+
- 结果操作:一键复制、保存方案、方案对比
|
|
10
|
+
|
|
11
|
+
## UI 设计
|
|
12
|
+
|
|
13
|
+
- 色彩:主绿#10B981、深绿#059669、浅绿#D1FAE5
|
|
14
|
+
- 布局:桌面左右分栏(输入40%+结果60%),移动端上下堆叠
|
|
15
|
+
- 字体:等宽数字、24-32px粗体绿色金额
|