@kmlckj/licos-ai-cli 0.0.7 → 0.0.8
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/lib/__templates__/agent/scripts/setup.sh +14 -40
- package/lib/__templates__/expo/_npmrc +2 -1
- package/lib/__templates__/expo/_pnpmrc +2 -0
- package/lib/__templates__/nextjs/_npmrc +2 -1
- package/lib/__templates__/nextjs/_pnpmrc +2 -0
- package/lib/__templates__/nuxt-vue/_npmrc +2 -1
- package/lib/__templates__/nuxt-vue/_pnpmrc +2 -0
- package/lib/__templates__/taro/_npmrc +2 -1
- package/lib/__templates__/taro/_pnpmrc +2 -0
- package/lib/__templates__/vite/_npmrc +2 -1
- package/lib/__templates__/vite/_pnpmrc +2 -0
- package/lib/cli.js +3 -3
- package/package.json +1 -1
|
@@ -4,52 +4,26 @@ set -eo pipefail
|
|
|
4
4
|
PROJECT_DIR="${LICOS_PROJECT_PATH:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
|
|
5
5
|
cd "$PROJECT_DIR"
|
|
6
6
|
|
|
7
|
+
ensure_pip_config() {
|
|
8
|
+
mkdir -p "${HOME:-/root}/.pip"
|
|
9
|
+
cat > "${HOME:-/root}/.pip/pip.conf" <<'EOF'
|
|
10
|
+
[global]
|
|
11
|
+
index-url = https://mirrors.aliyun.com/pypi/simple/
|
|
12
|
+
extra-index-url = https://pypi.org/simple/
|
|
13
|
+
trusted-host = mirrors.aliyun.com
|
|
14
|
+
EOF
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
ensure_pip_config
|
|
18
|
+
|
|
7
19
|
PIP_ARGS=(--no-cache-dir)
|
|
8
|
-
if python -m pip --help 2>/dev/null | grep -q -- "--break-system-packages"; then
|
|
20
|
+
if python -m pip install --help 2>/dev/null | grep -q -- "--break-system-packages"; then
|
|
9
21
|
PIP_ARGS+=(--break-system-packages)
|
|
10
22
|
fi
|
|
11
23
|
if [ -n "${PIP_TARGET:-}" ]; then
|
|
12
24
|
PIP_ARGS+=(--target "$PIP_TARGET")
|
|
13
25
|
fi
|
|
14
26
|
|
|
15
|
-
runtime_available() {
|
|
16
|
-
python - <<'PY' >/dev/null 2>&1
|
|
17
|
-
import licos_agent_runtime
|
|
18
|
-
PY
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
has_extra_requirements() {
|
|
22
|
-
[ -f "requirements.txt" ] && grep -Ev '^[[:space:]]*(#|$|licos-agent-runtime([<>=!~ ].*)?)[[:space:]]*$' requirements.txt >/dev/null 2>&1
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
install_filtered_requirements() {
|
|
26
|
-
local tmp_req
|
|
27
|
-
tmp_req="$(mktemp)"
|
|
28
|
-
grep -Ev '^[[:space:]]*(#|$|licos-agent-runtime([<>=!~ ].*)?)[[:space:]]*$' requirements.txt > "$tmp_req" || true
|
|
29
|
-
if [ -s "$tmp_req" ]; then
|
|
30
|
-
python -m pip install "${PIP_ARGS[@]}" -r "$tmp_req"
|
|
31
|
-
fi
|
|
32
|
-
rm -f "$tmp_req"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
RUNTIME_SOURCE="${LICOS_AGENT_RUNTIME_SOURCE:-/opt/licos-agent-runtime}"
|
|
36
|
-
if [ -d "$RUNTIME_SOURCE" ]; then
|
|
37
|
-
echo "[setup] Installing licos-agent-runtime from $RUNTIME_SOURCE"
|
|
38
|
-
python -m pip install "${PIP_ARGS[@]}" "$RUNTIME_SOURCE"
|
|
39
|
-
install_filtered_requirements
|
|
40
|
-
exit 0
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
if runtime_available; then
|
|
44
|
-
if has_extra_requirements; then
|
|
45
|
-
echo "[setup] licos-agent-runtime already available, installing extra requirements"
|
|
46
|
-
install_filtered_requirements
|
|
47
|
-
else
|
|
48
|
-
echo "[setup] licos-agent-runtime already available, no extra requirements"
|
|
49
|
-
fi
|
|
50
|
-
exit 0
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
27
|
if command -v uv >/dev/null 2>&1 && [ -f "pyproject.toml" ]; then
|
|
54
28
|
if [ -n "${PIP_TARGET:-}" ]; then
|
|
55
29
|
echo "[setup] Deploy mode (uv): installing to PIP_TARGET=$PIP_TARGET"
|
|
@@ -64,7 +38,7 @@ if command -v uv >/dev/null 2>&1 && [ -f "pyproject.toml" ]; then
|
|
|
64
38
|
fi
|
|
65
39
|
elif [ -f "requirements.txt" ]; then
|
|
66
40
|
echo "[setup] Fallback mode (pip): installing from requirements.txt"
|
|
67
|
-
pip install -r requirements.txt
|
|
41
|
+
python -m pip install "${PIP_ARGS[@]}" -r requirements.txt
|
|
68
42
|
else
|
|
69
43
|
echo "[setup] no pyproject.toml or requirements.txt found, skipping install"
|
|
70
44
|
fi
|
package/lib/cli.js
CHANGED
|
@@ -2107,8 +2107,8 @@ const EventBuilder = {
|
|
|
2107
2107
|
};
|
|
2108
2108
|
|
|
2109
2109
|
var name = "@kmlckj/licos-ai-cli";
|
|
2110
|
-
var version = "0.0.
|
|
2111
|
-
var description = "
|
|
2110
|
+
var version = "0.0.8";
|
|
2111
|
+
var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
|
|
2112
2112
|
var license = "MIT";
|
|
2113
2113
|
var author = "kmlckj";
|
|
2114
2114
|
var maintainers = [
|
|
@@ -8214,7 +8214,7 @@ const ensureDir = async (dir) => {
|
|
|
8214
8214
|
*/
|
|
8215
8215
|
const convertDotfileName = (filePath) => {
|
|
8216
8216
|
// 白名单:需要从 _ 开头转换为 . 开头的文件
|
|
8217
|
-
const dotfileWhitelist = ['_gitignore', '_npmrc'];
|
|
8217
|
+
const dotfileWhitelist = ['_gitignore', '_npmrc', '_pnpmrc'];
|
|
8218
8218
|
|
|
8219
8219
|
const fileName = path.basename(filePath);
|
|
8220
8220
|
|