- git mv 保留历史:ui/(Vue3+Vite)、sdk/(BFF 中间层)
- 路径语义修正:db_path/figures_cache 改相对 sdk/(BFF cwd),
历史库 sdk/backend/data 迁移至 sdk/data/(会话/图片缓存无损)
- 引用修复 ~15 处:config.py、deploy/*.sh、vitest/playwright 配置、
单测导入路径、docs、README、gitignore、.env.example
- 骨架:agent/{qa,methodology,legacy-rag,vendor}、knowledge/manifest.yaml、
tooling/{compile,kb,crypto,assemble,audit,tools,scripts} + README
- 门禁验证:sdk pytest 125 通过、ui vitest 158 通过、
生产 BFF 脚本重启四上游全绿 + 静态托管 + 会话库无损
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
22 lines
780 B
Bash
Executable File
22 lines
780 B
Bash
Executable File
#!/usr/bin/env bash
|
||
# run.sh —— 本地起 BFF(ARCHITECTURE.md §3:127.0.0.1:8090,占用则退 8091)。
|
||
# 用法:bash sdk/run.sh
|
||
set -euo pipefail
|
||
cd "$(dirname "$0")"
|
||
|
||
PORT="${PORT:-8090}"
|
||
|
||
if ! command -v conda >/dev/null 2>&1; then
|
||
echo "run.sh: 未找到 conda,尝试直接使用当前 python 运行" >&2
|
||
exec python -m uvicorn app.main:app --host 127.0.0.1 --port "$PORT"
|
||
fi
|
||
|
||
if ! conda env list | awk '{print $1}' | grep -qx "plantai-bff"; then
|
||
echo "run.sh: conda 环境 plantai-bff 不存在" >&2
|
||
echo " 创建:conda create -n plantai-bff python=3.11 -y && conda activate plantai-bff && pip install -e '.[dev]'" >&2
|
||
exit 1
|
||
fi
|
||
|
||
exec conda run --no-capture-output -n plantai-bff \
|
||
python -m uvicorn app.main:app --host 127.0.0.1 --port "$PORT"
|