Skip to content

Commit 293a199

Browse files
69ggclaude
andauthored
feat: 优化webui界面,并添加较全平台的客户端(除iOS) (#48)
* fix: preserve transport message count before prefetch Capture the caller's message count before prefetch inserts a system message so Responses follow-up tool results keep the correct start index. Add a regression test for AIClient.request_model to prevent the transport offset from drifting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(webui): add management api and console app * fix(webui): polish console navigation and i18n * fix(app): improve remote access and console ux * refactor(app): use webui as the primary console * docs(build): document linux no-strip workaround * fix(app): improve native webui login flow * fix(webui): refine launcher return flow * ci(release): add caches for ruff/mypy/pytest/android-sdk/gradle and fix windows shell Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: 修复若干代码审查问题 * fix(security): harden webui bootstrap and release build * fix: 修复1个review docs: 添加AGENT/CLAUDE.md和README.md中的PyPI徽标 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0be20a1 commit 293a199

84 files changed

Lines changed: 15124 additions & 1047 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT=$(git rev-parse --show-toplevel)
5+
cd "$ROOT"
6+
7+
RED='\033[0;31m'
8+
GREEN='\033[0;32m'
9+
YELLOW='\033[1;33m'
10+
NC='\033[0m'
11+
12+
STAGED=$(git diff --cached --name-only --diff-filter=ACMRTUXB || true)
13+
14+
if [ -z "$STAGED" ]; then
15+
exit 0
16+
fi
17+
18+
echo -e "${YELLOW}🔍 运行 pre-commit 检查...${NC}"
19+
20+
if ! command -v uv >/dev/null 2>&1; then
21+
echo -e "${RED}❌ 未找到 uv,请先安装 uv${NC}"
22+
exit 1
23+
fi
24+
25+
if [ ! -f "pyproject.toml" ]; then
26+
echo -e "${RED}❌ 未找到 pyproject.toml${NC}"
27+
exit 1
28+
fi
29+
30+
echo -e "${YELLOW}📝 Python: ruff format --check${NC}"
31+
uv run ruff format --check --exclude "code/" --force-exclude
32+
33+
echo -e "${YELLOW}📝 Python: ruff check${NC}"
34+
uv run ruff check . --exclude "code/" --force-exclude
35+
36+
echo -e "${YELLOW}📝 Python: mypy${NC}"
37+
uv run mypy . --exclude "code/"
38+
39+
if printf '%s\n' "$STAGED" | grep -Eq '^(apps/undefined-console/|src/Undefined/webui/static/js/|biome\.json$|\.github/workflows/(ci|release)\.yml$)'; then
40+
echo -e "${YELLOW}📝 检测到 JS/Tauri 相关改动,运行前端与 Tauri 检查...${NC}"
41+
42+
if ! command -v npm >/dev/null 2>&1; then
43+
echo -e "${RED}❌ 未找到 npm,请先安装 Node.js${NC}"
44+
exit 1
45+
fi
46+
47+
if [ ! -x "apps/undefined-console/node_modules/.bin/biome" ]; then
48+
echo -e "${RED}❌ 缺少 apps/undefined-console/node_modules,请先运行 cd apps/undefined-console && npm install${NC}"
49+
exit 1
50+
fi
51+
52+
npm --prefix apps/undefined-console run check
53+
fi
54+
55+
echo -e "${GREEN}✅ pre-commit 检查通过${NC}"

.githooks/pre-tag

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
TAG_NAME="${1:-}"
5+
TAG_VERSION="${TAG_NAME#v}"
6+
7+
RED='\033[0;31m'
8+
GREEN='\033[0;32m'
9+
YELLOW='\033[1;33m'
10+
NC='\033[0m'
11+
12+
cd "$(git rev-parse --show-toplevel)"
13+
14+
get_pyproject_version() {
15+
grep -E '^version = ' pyproject.toml | sed -E 's/version = "([^"]+)"/\1/'
16+
}
17+
18+
get_init_version() {
19+
grep -E '^__version__' src/Undefined/__init__.py | sed -E "s/__version__ = '([^']+)'/\1/" | sed -E 's/__version__ = "([^"]+)"/\1/'
20+
}
21+
22+
PYPROJECT_VERSION=$(get_pyproject_version)
23+
INIT_VERSION=$(get_init_version)
24+
25+
if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ] || [ "$TAG_VERSION" != "$INIT_VERSION" ]; then
26+
echo -e "${RED}❌ Tag 版本与仓库版本号不一致${NC}"
27+
echo -e "tag: ${YELLOW}$TAG_VERSION${NC}"
28+
echo -e "pyproject.toml: ${YELLOW}$PYPROJECT_VERSION${NC}"
29+
echo -e "src/Undefined/__init__.py: ${YELLOW}$INIT_VERSION${NC}"
30+
exit 1
31+
fi
32+
33+
echo -e "${GREEN}✅ 版本检查通过: $TAG_VERSION${NC}"

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,49 @@ jobs:
6363
- name: Verify wheel contains resources
6464
run: |
6565
uv run python -c "import glob, zipfile; whl=glob.glob('dist/*.whl')[0]; z=zipfile.ZipFile(whl); names=set(z.namelist()); required={'config.toml.example','res/prompts/undefined.xml','img/xlwy.jpg'}; missing=sorted([p for p in required if p not in names]); assert not missing, f'missing in wheel: {missing}'"
66+
67+
console-quality-check:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
73+
- name: Setup Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: "22"
77+
78+
- name: Cache npm and node_modules
79+
uses: actions/cache@v4
80+
with:
81+
path: ~/.npm
82+
key: ${{ runner.os }}-undefined-console-npm-${{ hashFiles('apps/undefined-console/package-lock.json', 'apps/undefined-console/package.json', 'apps/undefined-console/biome.json') }}
83+
restore-keys: |
84+
${{ runner.os }}-undefined-console-npm-
85+
86+
- name: Install Rust toolchain
87+
uses: dtolnay/rust-toolchain@stable
88+
89+
- name: Cache cargo registry and target
90+
uses: Swatinem/rust-cache@v2
91+
with:
92+
workspaces: |
93+
apps/undefined-console/src-tauri -> target
94+
95+
- name: Install Linux system dependencies
96+
run: |
97+
sudo apt-get update
98+
sudo apt-get install -y \
99+
libwebkit2gtk-4.1-dev \
100+
libgtk-3-dev \
101+
libayatana-appindicator3-dev \
102+
librsvg2-dev \
103+
patchelf
104+
105+
- name: Install app dependencies
106+
working-directory: apps/undefined-console
107+
run: npm ci
108+
109+
- name: Run console checks
110+
working-directory: apps/undefined-console
111+
run: npm run check

0 commit comments

Comments
 (0)