From 2bd7d4999d7e4524614ec2e7c0056f1376e13541 Mon Sep 17 00:00:00 2001 From: Tim Wong <280945586+TimWongUp@users.noreply.github.com> Date: Sun, 6 Dec 2026 15:21:55 +0800 Subject: [PATCH] =?UTF-8?q?chore(tray):=20=E9=A2=84=E8=A7=88=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=B8=8E=E6=A3=80=E6=9F=A5=E6=94=B9=E7=94=A8=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E7=BC=93=E5=AD=98=E5=B9=B6=E5=BF=BD=E7=95=A5=20.claud?= =?UTF-8?q?e=20=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + AGENTS.md | 2 +- scripts/preview_tray.sh | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e547cfc5b..c6ee797b2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ dist/ *.xcresult/ /apps/tray/ui/art/video/ /.worktrees/ +/.claude/ diff --git a/AGENTS.md b/AGENTS.md index c383e4cc9..cde3b21fd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ ## 验证、实机验收与交付 -- 校验门:Python 跑 `uv run ruff format --check .`、`uv run ruff check .`、`uv run pyright`、`uv run pytest`、`uv run python scripts/review_checks.py --base origin/main`;改动 `apps/tray` 另跑 `cargo fmt --check`、`cargo clippy --all-targets -- -D warnings`、`cargo test`(预览改动再跑 `AGENTNAVE_PREVIEW=1 CARGO_TARGET_DIR=target/preview cargo clippy --all-targets -- -D warnings`)。 +- 校验门:Python 跑 `uv run ruff format --check .`、`uv run ruff check .`、`uv run pyright`、`uv run pytest`、`uv run python scripts/review_checks.py --base origin/main`;改动 `apps/tray` 另跑 `cargo fmt --check`、`cargo clippy --all-targets -- -D warnings`、`cargo test`(预览改动再跑 `AGENTNAVE_PREVIEW=1 CARGO_TARGET_DIR="$HOME/.cache/cargo-target-preview" cargo clippy --all-targets -- -D warnings`)。 - 界面预览(macOS)用 `scripts/preview_tray.sh`(仅用于前端/UI 验收,不改正式数据);未合并后端真机试跑仅在用户明确要求且不改 SQLite schema 时走 `scripts/install_local.sh install --ref --dogfood`,事后 `rollback`。交付预览版或正式版前须亲自实机检查运行中的托盘与设置页;合并/放弃 PR 后先退出并删 `~/Applications` 对应预览版再清 worktree。 - 新增 Provider 须同时接员工与 boss,且取得当次授权后至少完成一次真实调用验收(平时测试一律用 fake executable,任何真实 CLI 调用须先获配额授权)。 - 改动默认走独立 worktree、分支与 PR,不直提 `main`;合并前按 `agentnave-review` + `REVIEW.md` 完成独立评审(零席自验不算),涉及未测平台须等其 CI 到终态。 diff --git a/scripts/preview_tray.sh b/scripts/preview_tray.sh index b4120415d..740265cf0 100755 --- a/scripts/preview_tray.sh +++ b/scripts/preview_tray.sh @@ -18,20 +18,22 @@ fi ID=${AGENTNAVE_PREVIEW_ID:-io.github.timwongup.agentnave.preview${SLOT:+.$(printf %s "$SLOT" | tr -c 'A-Za-z0-9-' '-')}} NAME=${AGENTNAVE_PREVIEW_NAME:-AgentNave 预览${SLOT:+ $SLOT}} APP="$HOME/Applications/$NAME.app" +TARGET_DIR="$HOME/.cache/cargo-target-preview" VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' "$TRAY/Cargo.toml" | head -n 1) -# Its own target dir, so the preview flags never mix with a normal build. Optimized, as the installed +# Shared across worktrees to avoid duplicating ~3.7 GB per checkout, yet separate from the normal +# cargo target dir so preview flags never mix with a regular build. Optimized, as the installed # app is: unoptimized, each page of data takes five times as long. AGENTNAVE_PREVIEW=1 \ CARGO_PROFILE_DEV_OPT_LEVEL=2 \ TAURI_CONFIG="{\"identifier\":\"$ID\",\"productName\":\"$NAME\"}" \ -CARGO_TARGET_DIR="$TRAY/target/preview" \ +CARGO_TARGET_DIR="$TARGET_DIR" \ cargo build --manifest-path "$TRAY/Cargo.toml" osascript -e "quit app id \"$ID\"" 2>/dev/null || true rm -rf "$APP" mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" -cp "$TRAY/target/preview/debug/agentnave-tray" "$APP/Contents/MacOS/agentnave-tray" +cp "$TARGET_DIR/debug/agentnave-tray" "$APP/Contents/MacOS/agentnave-tray" cp "$TRAY/icons/icon.icns" "$APP/Contents/Resources/icon.icns" cat > "$APP/Contents/Info.plist" <