create-windy 0.6.5 → 0.6.6

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/dist/cli.js CHANGED
@@ -2991,6 +2991,8 @@ ${starterServerBuild}
2991
2991
  build:
2992
2992
  context: .
2993
2993
  dockerfile: apps/agent-server/Dockerfile
2994
+ args:
2995
+ WINDY_PYPI_INDEX_URL: \${WINDY_PYPI_INDEX_URL:-http://mirrors.cloud.tencent.com/pypi/simple}
2994
2996
  environment:
2995
2997
  AGENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
2996
2998
  AGENT_RUN_STORE_PATH: /app/data/agent/runs.sqlite3
@@ -7777,6 +7779,11 @@ var recipes = [
7777
7779
  id: "starter-0.6.4-to-0.6.5",
7778
7780
  from: "0.6.4",
7779
7781
  to: "0.6.5"
7782
+ },
7783
+ {
7784
+ id: "starter-0.6.5-to-0.6.6",
7785
+ from: "0.6.5",
7786
+ to: "0.6.6"
7780
7787
  }
7781
7788
  ];
7782
7789
  function resolveRecipeChain(sourceVersion, targetVersion) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "464b1ea58e7c3a582cde26308d5e802bfe1eec1b",
4
- "generatorVersion": "0.6.5",
3
+ "templateCommit": "aebc81cd3a97d7bc3f13c600afb7dc13bbf9c3d0",
4
+ "generatorVersion": "0.6.6",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -3,13 +3,19 @@
3
3
  FROM python:3.12-slim AS runtime
4
4
  WORKDIR /app/apps/agent-server
5
5
 
6
- RUN pip install --no-cache-dir uv==0.9.27 \
6
+ ARG WINDY_PYPI_INDEX_URL=http://mirrors.cloud.tencent.com/pypi/simple
7
+ ARG WINDY_PYPI_TOTAL_TIMEOUT_SECONDS=180
8
+
9
+ COPY apps/agent-server/install-python-dependencies.sh /usr/local/bin/windy-agent-python-install
10
+ RUN chmod 0755 /usr/local/bin/windy-agent-python-install \
11
+ && windy-agent-python-install install-uv \
7
12
  && useradd --create-home --uid 10001 windy
8
13
  COPY apps/agent-server/pyproject.toml apps/agent-server/uv.lock ./
9
- RUN uv sync --frozen --no-dev --no-install-project
14
+ RUN windy-agent-python-install lock
15
+ RUN windy-agent-python-install sync --frozen --no-dev --no-install-project
10
16
  COPY apps/agent-server/src ./src
11
17
  COPY apps/agent-server/adk_web_agents ./adk_web_agents
12
- RUN uv sync --frozen --no-dev
18
+ RUN windy-agent-python-install sync --frozen --no-dev
13
19
 
14
20
  ENV PATH="/app/apps/agent-server/.venv/bin:${PATH}"
15
21
  ENV PYTHONUNBUFFERED=1
@@ -0,0 +1,92 @@
1
+ #!/bin/sh
2
+ set -eu
3
+
4
+ index_url="${WINDY_PYPI_INDEX_URL:-}"
5
+ total_timeout_seconds="${WINDY_PYPI_TOTAL_TIMEOUT_SECONDS:-}"
6
+
7
+ case "$index_url" in
8
+ http://* | https://*) ;;
9
+ *)
10
+ echo "Agent Server Python index 必须是 credential-free HTTP(S) URL" >&2
11
+ exit 64
12
+ ;;
13
+ esac
14
+ case "$index_url" in
15
+ *"@"* | *"?"* | *"#"*)
16
+ echo "Agent Server Python index 不得内嵌 credential、query 或 fragment" >&2
17
+ exit 64
18
+ ;;
19
+ esac
20
+
21
+ index_address="${index_url#*://}"
22
+ index_host="${index_address%%/*}"
23
+ case "$index_address" in
24
+ "" | *[!A-Za-z0-9._~:/%-]*)
25
+ echo "Agent Server Python index 含有不安全字符" >&2
26
+ exit 64
27
+ ;;
28
+ esac
29
+ case "$index_host" in
30
+ "" | *[!A-Za-z0-9.:-]*)
31
+ echo "Agent Server Python index host 无效" >&2
32
+ exit 64
33
+ ;;
34
+ esac
35
+ case "$total_timeout_seconds" in
36
+ "" | *[!0-9]*)
37
+ echo "WINDY_PYPI_TOTAL_TIMEOUT_SECONDS 必须是 1 到 600 的整数" >&2
38
+ exit 64
39
+ ;;
40
+ esac
41
+ if [ "$total_timeout_seconds" -lt 1 ] || [ "$total_timeout_seconds" -gt 600 ]; then
42
+ echo "WINDY_PYPI_TOTAL_TIMEOUT_SECONDS 必须是 1 到 600 的整数" >&2
43
+ exit 64
44
+ fi
45
+
46
+ trusted_host=""
47
+ insecure_host=""
48
+ case "$index_url" in
49
+ http://*)
50
+ trusted_host="$index_host"
51
+ insecure_host="$index_host"
52
+ ;;
53
+ esac
54
+
55
+ run_uv_network() {
56
+ operation="$1"
57
+ shift
58
+ if ! timeout --kill-after=5s "${total_timeout_seconds}s" env \
59
+ UV_DEFAULT_INDEX="$index_url" \
60
+ UV_INSECURE_HOST="$insecure_host" \
61
+ UV_CONCURRENT_DOWNLOADS=1 \
62
+ UV_HTTP_TIMEOUT=30 \
63
+ UV_HTTP_RETRIES=2 \
64
+ UV_NO_PROGRESS=1 \
65
+ sh -c 'attempt=1; while [ "$attempt" -le 3 ]; do "$@" && exit 0; if [ "$attempt" -lt 3 ]; then echo "[windy] Python 网络操作失败,2 秒后重试" >&2; sleep 2; fi; attempt=$((attempt + 1)); done; exit 1' windy-python "$@"; then
66
+ echo "Agent Server Python index 不可用或总时限已到:${operation}失败" >&2
67
+ exit 70
68
+ fi
69
+ }
70
+
71
+ case "${1:-}" in
72
+ install-uv)
73
+ if ! timeout --kill-after=5s "${total_timeout_seconds}s" env \
74
+ PIP_INDEX_URL="$index_url" \
75
+ PIP_TRUSTED_HOST="$trusted_host" \
76
+ pip install --no-cache-dir --timeout 30 --retries 2 uv==0.9.27; then
77
+ echo "Agent Server Python index 不可用或总时限已到:无法安装 uv" >&2
78
+ exit 70
79
+ fi
80
+ ;;
81
+ lock)
82
+ run_uv_network "lock index 刷新" uv lock
83
+ ;;
84
+ sync)
85
+ shift
86
+ run_uv_network "依赖同步" uv sync "$@"
87
+ ;;
88
+ *)
89
+ echo "未知的 Agent Server Python 安装阶段" >&2
90
+ exit 64
91
+ ;;
92
+ esac
@@ -11,6 +11,8 @@ services:
11
11
  build:
12
12
  context: .
13
13
  dockerfile: apps/agent-server/Dockerfile
14
+ args:
15
+ WINDY_PYPI_INDEX_URL: ${WINDY_PYPI_INDEX_URL:-http://mirrors.cloud.tencent.com/pypi/simple}
14
16
  environment:
15
17
  ADK_DEBUG_PLATFORM_URL: http://server:9747
16
18
  ADK_DEBUG_PLATFORM_TOKEN: ${ADK_DEBUG_PLATFORM_TOKEN:?请先由 create-windy doctor 修复本地调试 Token}
@@ -158,6 +158,8 @@ services:
158
158
  build:
159
159
  context: .
160
160
  dockerfile: apps/agent-server/Dockerfile
161
+ args:
162
+ WINDY_PYPI_INDEX_URL: ${WINDY_PYPI_INDEX_URL:-http://mirrors.cloud.tencent.com/pypi/simple}
161
163
  environment:
162
164
  AGENT_SERVER_INTERNAL_TOKEN: ${AGENT_SERVER_INTERNAL_TOKEN:-}
163
165
  AGENT_RUN_STORE_PATH: /app/data/agent/runs.sqlite3