11# AgentEngine Makefile
22# 用于同步 KsADK Web static 和管理项目
33
4- .PHONY : help install clean clean-cache clean-dist clean-static clean-offline dev test publish publish-test public-status public-init-worktree public-worktree-status public-sync-check public-secret-audit public-audit public-version-gate docs-site-build docs-site-dev public-test public-build-check public-build-alias-check public-preflight public-publish-check public-release-approval-check public-publish-gate public-release-tag public-review public-sync-ksadk-web-static open-source-audit-dist open-source-audit-alias-dist openclaw-build openclaw-push openclaw-size hermes-build hermes-push hermes-size sync-ksadk-web-static sync-hosted-ui build-frontend build-webui sync-static webui build-wheel build-all clean-frontend
4+ .PHONY : help install clean clean-cache clean-dist clean-static clean-offline dev test publish publish-test public-status public-init-worktree public-worktree-status public-sync-check public-secret-audit public-audit public-version-gate docs-site-build docs-site-dev public-test public-build-check public-build-alias-check public-preflight public-publish-check public-release-approval-check public-publish-gate public-release-tag public-review public-sync-ksadk-web-static open-source-audit-dist open-source-audit-alias-dist openclaw-build openclaw-push openclaw-size hermes-build hermes-push hermes-size sync-ksadk-web-static verify-ksadk-web-static verify-ksadk-web-wheel-static sync-hosted-ui build-frontend build-webui sync-static webui build-wheel build-all clean-frontend
55
66# 默认目标
77help :
1414 @echo " make test 运行测试"
1515 @echo " "
1616 @echo " \033[1;32mWeb UI 构建:\033[0m"
17- @echo " make sync-ksadk-web-static KSADK_WEB_VERSION=latest "
17+ @echo " make sync-ksadk-web-static KSADK_WEB_VERSION=0.3.0 "
1818 @echo " 从 @kingsoftcloud/ksadk-web npm 包同步 static"
1919 @echo " make build-frontend 同步 ksadk-web static"
2020 @echo " "
@@ -267,7 +267,7 @@ PUBLIC_DOCS_URL ?= https://kingsoftcloud.github.io/ksadk-python/
267267PUBLIC_PYPI_PROJECT ?= ksadk
268268PUBLIC_ALIAS_PYPI_PROJECT ?= agentengine-sdk-python
269269PUBLIC_RELEASE_TAG ?= v$(V )
270- PUBLIC_TEST_TARGETS ?= tests/test_public_release_positioning.py tests/test_config_env_registry.py
270+ PUBLIC_TEST_TARGETS ?= tests/test_public_release_positioning.py tests/test_config_env_registry.py tests/test_managed_runtime_builder.py tests/test_managed_runtime_resolution.py tests/cli/test_cmd_create_codex.py tests/runners/test_codex_runner.py
271271
272272public-status :
273273 @echo " ==> internal worktree"
@@ -329,20 +329,24 @@ public-sync-check:
329329
330330public-secret-audit :
331331 @echo " ==> secret and sensitive-file audit"
332- @if git ls-files | grep -E ' (^|/)(\.pypirc|kubeconfig|.*\.kubeconfig|id_rsa|id_ed25519)$$' ; then \
333- echo " ❌ 发现禁止跟踪的敏感文件" ; \
334- exit 1; \
332+ @if git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then \
333+ if git ls-files | grep -E ' (^|/)(\.pypirc|kubeconfig|.*\.kubeconfig|id_rsa|id_ed25519)$$' ; then \
334+ echo " ❌ 发现禁止跟踪的敏感文件" ; \
335+ exit 1; \
336+ fi ; \
335337 fi
336338 @python3 scripts/public_secret_audit.py
337339 @echo " ✅ secret audit passed"
338340
339341public-audit : public-secret-audit
340342 @echo " ==> public source audit"
341- @blocked=$$(git ls-files | grep -E '^(\.pypirc$$|\.zread/(wiki|site ) /)' || true); \
342- if [ -n " $$ blocked" ]; then \
343- echo " ❌ blocked tracked paths:" ; \
344- echo " $$ blocked" ; \
345- exit 1; \
343+ @if git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then \
344+ blocked=$$(git ls-files | grep -E '^(\.pypirc$$|\.zread/(wiki|site ) /)' || true); \
345+ if [ -n " $$ blocked" ]; then \
346+ echo " ❌ blocked tracked paths:" ; \
347+ echo " $$ blocked" ; \
348+ exit 1; \
349+ fi ; \
346350 fi
347351 @python3 scripts/open_source_audit.py --target public-repo
348352 @echo " ✅ public path audit passed"
@@ -373,6 +377,7 @@ public-sync-ksadk-web-static: sync-ksadk-web-static
373377public-build-check : clean-dist sync-ksadk-web-static
374378 @echo " ==> build and twine check"
375379 @uv build
380+ @$(MAKE ) verify-ksadk-web-wheel-static
376381 @uv run pytest tests/test_runtime_common_packaging.py -q
377382 @uv run --extra dev python -m twine check dist/*
378383 @$(MAKE ) open-source-audit-dist
@@ -558,7 +563,10 @@ openclaw-build openclaw-push openclaw-size hermes-build hermes-push hermes-size:
558563# ============================================================
559564
560565STATIC_DIR := ksadk/server/static
561- KSADK_WEB_VERSION ?= latest
566+ # The wheel must embed a published, reproducible Web bundle. 0.8.0 is coupled
567+ # to the 0.3.0 Web release; the release job must fail rather than silently
568+ # substituting an older npm package when that release is not visible yet.
569+ KSADK_WEB_VERSION ?= 0.3.0
562570KSADK_WEB_PACKAGE ?= @kingsoftcloud/ksadk-web
563571KSADK_WEB_TARBALL_NAME := kingsoftcloud-ksadk-web-$(patsubst v% ,% ,$(KSADK_WEB_VERSION ) ) .tgz
564572KSADK_WEB_RELEASE_URL ?=
@@ -569,7 +577,10 @@ sync-ksadk-web-static:
569577 @echo " Sync KsADK Web static assets from $( KSADK_WEB_PACKAGE) @$( KSADK_WEB_VERSION) "
570578 @rm -rf " $( KSADK_WEB_CACHE_DIR) /package"
571579 @mkdir -p " $( KSADK_WEB_CACHE_DIR) " " $( STATIC_DIR) "
572- @if [ -n " $( KSADK_WEB_RELEASE_URL) " ]; then \
580+ @if [ -f " $( KSADK_WEB_CACHE_DIR) /$( KSADK_WEB_TARBALL_NAME) " ]; then \
581+ echo " Using cached tarball $( KSADK_WEB_TARBALL_NAME) " ; \
582+ echo " $( KSADK_WEB_TARBALL_NAME) " > " $( KSADK_WEB_CACHE_DIR) /.tarball-name" ; \
583+ elif [ -n " $( KSADK_WEB_RELEASE_URL) " ]; then \
573584 echo " Using explicit KSADK_WEB_RELEASE_URL=$( KSADK_WEB_RELEASE_URL) " ; \
574585 curl -fL --retry 3 --retry-delay 2 --retry-all-errors " $( KSADK_WEB_RELEASE_URL) " -o " $( KSADK_WEB_CACHE_DIR) /$( KSADK_WEB_TARBALL_NAME) " ; \
575586 echo " $( KSADK_WEB_TARBALL_NAME) " > " $( KSADK_WEB_CACHE_DIR) /.tarball-name" ; \
@@ -592,8 +603,22 @@ sync-ksadk-web-static:
592603 @rm -rf " $( STATIC_DIR) "
593604 @mkdir -p " $( STATIC_DIR) "
594605 cp -R " $( KSADK_WEB_CACHE_DIR) /package/dist-ksadk/." " $( STATIC_DIR) /"
606+ @$(MAKE ) verify-ksadk-web-static
595607 @echo " Synced KsADK Web $( KSADK_WEB_VERSION) static assets into $( STATIC_DIR) "
596608
609+ verify-ksadk-web-static :
610+ @python3 scripts/verify_ksadk_web_static.py \
611+ --expected " $( KSADK_WEB_CACHE_DIR) /package/dist-ksadk" \
612+ --actual " $( STATIC_DIR) " \
613+ --package-root " $( KSADK_WEB_CACHE_DIR) /package" \
614+ --expected-version " $( patsubst v%,%,$( KSADK_WEB_VERSION) ) "
615+
616+ verify-ksadk-web-wheel-static :
617+ @python3 scripts/verify_ksadk_web_static.py \
618+ --expected " $( KSADK_WEB_CACHE_DIR) /package/dist-ksadk" \
619+ --wheel " $$ (ls dist/ksadk-*.whl)" \
620+ --expected-version " $( patsubst v%,%,$( KSADK_WEB_VERSION) ) "
621+
597622sync-hosted-ui : sync-ksadk-web-static
598623 @echo " sync-hosted-ui is deprecated; static assets now come from $( KSADK_WEB_PACKAGE) ."
599624
0 commit comments