WorkBuddy、CodeBuddy 桌面端增强助手:签到猫猫旅行成长计划查询、多账号独立备份、点切即用;免打扰模式让 AI 无人值守跑长任务;跨账号会话迁移、异常中断自动续接;暂存/快捷提示词;毛玻璃主题与更多实用功能。
feat: publish WorkDaddy 1.1.6 feature release
[email protected]d81a0b8b0ef3
diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.ymlindex d688f6b..8a49a65 100644--- a/.github/workflows/build-win.yml+++ b/.github/workflows/build-win.yml@@ -54,16 +54,20 @@ jobs:echo "version=$VER" >> "$GITHUB_OUTPUT"echo "检测到版本: $VER"- - name: 打包内置资产 builtin(build-win-zip.sh 需要)+ - name: 校验内置资产 builtin(Windows 安装包必须包含)shell: bashrun: |- SRC="WorkDaddy.app/Contents/Resources/scripts/builtin"- if [ -d "$SRC" ]; then- cp -R "$SRC/." scripts/builtin/- echo "已复制 builtin 资产"- else- echo "警告: 未找到 builtin,面板将无官方壁纸(不影响安装功能)"+ SRC="scripts/builtin"+ if [ ! -f "$SRC/nebula/theme.json" ] || [ ! -d "$SRC/wallpapers" ]; then+ echo "::error::缺少内置资产 $SRC(需要 nebula/theme.json 和 wallpapers/)"+ exit 1fi+ COUNT=$(find "$SRC/wallpapers" -maxdepth 1 -type f -iname '*.webp' | wc -l | tr -d ' ')+ if [ "$COUNT" -lt 1 ]; then+ echo "::error::内置资产没有任何官方壁纸"+ exit 1+ fi+ echo "已校验 builtin 资产:$COUNT 张壁纸"- name: 生成 Windows 安装暂存包(仅供 Inno Setup 使用)shell: bashdiff --git a/release/macos/WorkDaddy-1.1.29.dmg b/release/macos/WorkDaddy-1.1.29.dmgdeleted file mode 100644index 270ea1a..0000000Binary files a/release/macos/WorkDaddy-1.1.29.dmg and /dev/null differdiff --git a/release/macos/WorkDaddy-AI-1.1.29.dmg b/release/macos/WorkDaddy-1.1.6.dmgsimilarity index 81%rename from release/macos/WorkDaddy-AI-1.1.29.dmgrename to release/macos/WorkDaddy-1.1.6.dmgindex ca95eee..11a3f4d 100644Binary files a/release/macos/WorkDaddy-AI-1.1.29.dmg and b/release/macos/WorkDaddy-1.1.6.dmg differdiff --git a/release/macos/WorkDaddy-AI-1.1.5.dmg b/release/macos/WorkDaddy-AI-1.1.5.dmgdeleted file mode 100644index d83a612..0000000Binary files a/release/macos/WorkDaddy-AI-1.1.5.dmg and /dev/null differdiff --git a/release/macos/WorkDaddy-1.1.5.dmg b/release/macos/WorkDaddy-AI-1.1.6.dmgsimilarity index 81%rename from release/macos/WorkDaddy-1.1.5.dmgrename to release/macos/WorkDaddy-AI-1.1.6.dmgindex da916d1..a41408e 100644Binary files a/release/macos/WorkDaddy-1.1.5.dmg and b/release/macos/WorkDaddy-AI-1.1.6.dmg differdiff --git a/release/windows/WorkDaddy-AI-Setup-1.1.5.exe b/release/windows/WorkDaddy-AI-Setup-1.1.6.exesimilarity index 71%rename from release/windows/WorkDaddy-AI-Setup-1.1.5.exerename to release/windows/WorkDaddy-AI-Setup-1.1.6.exeindex 98b7949..d4eb772 100644Binary files a/release/windows/WorkDaddy-AI-Setup-1.1.5.exe and b/release/windows/WorkDaddy-AI-Setup-1.1.6.exe differdiff --git a/release/windows/WorkDaddy-Setup-1.1.5.exe b/release/windows/WorkDaddy-Setup-1.1.6.exesimilarity index 71%rename from release/windows/WorkDaddy-Setup-1.1.5.exerename to release/windows/WorkDaddy-Setup-1.1.6.exeindex b71a303..992279a 100644Binary files a/release/windows/WorkDaddy-Setup-1.1.5.exe and b/release/windows/WorkDaddy-Setup-1.1.6.exe differdiff --git a/scripts/build-mac-dmg.sh b/scripts/build-mac-dmg.shindex 1d3c597..99763df 100644--- a/scripts/build-mac-dmg.sh+++ b/scripts/build-mac-dmg.sh@@ -55,7 +55,7 @@ chmod 644 "$APP/Contents/Resources/AppIcon.icns"echo "==> 应用图标已同步(背景 #e1e1e1)"# 2) 只覆盖前端代码(保留壳的其余一切:launcher/Info.plist/builtin/node_modules/theme-audit.js)-for f in daemon.js session-db.js secure-transfer.js windows-process-boundary.js workbuddy-compat.js inject.js theme-patches.js credit-segments.js credit-resource-queries.js credit-request-usage.js credit-usage-store.js atomic-file-write.js ui-port.js checkin-result.js lib.js profiles.js workbuddy-target.js cdp-targets.js sentry-report.js install.sh relaunch-with-cdp.sh uninstall.sh apply-update.sh; do+for f in daemon.js session-db.js secure-transfer.js windows-process-boundary.js workbuddy-compat.js inject.js theme-patches.js credit-segments.js credit-resource-queries.js credit-request-usage.js credit-usage-store.js growth-active.js atomic-file-write.js ui-port.js checkin-result.js lib.js profiles.js workbuddy-target.js cdp-targets.js sentry-report.js install.sh relaunch-with-cdp.sh uninstall.sh apply-update.sh; do[ -f "scripts/$f" ] && cp "scripts/$f" "$APP/Contents/Resources/scripts/$f"doneif [ -f "scripts/picker-internal.js" ]; thendiff --git a/scripts/build-win-installer.ps1 b/scripts/build-win-installer.ps1index 26a1025..feda24a 100644--- a/scripts/build-win-installer.ps1+++ b/scripts/build-win-installer.ps1@@ -56,6 +56,17 @@ try {if (-not (Test-Path -LiteralPath (Join-Path $scriptsPayload 'runtime\node\node.exe') -PathType Leaf)) {throw 'The ZIP payload does not contain the bundled Node runtime.'}+ $builtinPayload = Join-Path $scriptsPayload 'builtin'+ $wallpaperPayload = Join-Path $builtinPayload 'wallpapers'+ $themePayload = Join-Path $builtinPayload 'nebula\theme.json'+ if (-not (Test-Path -LiteralPath $wallpaperPayload -PathType Container) -or+ -not (Test-Path -LiteralPath $themePayload -PathType Leaf)) {+ throw 'ZIP 内部缺少内置官方壁纸或 nebula/theme.json。'+ }+ $wallpaperCount = @(Get-ChildItem -LiteralPath $wallpaperPayload -Filter '*.webp' -File -ErrorAction SilentlyContinue).Count+ if ($wallpaperCount -le 0) {+ throw 'ZIP 内置官方壁纸为空,拒绝生成安装包。'+ }$stagedDaemon = Get-Content -LiteralPath (Join-Path $scriptsPayload 'daemon.js') -Raw -Encoding UTF8$stagedVersionMatch = [regex]::Match($stagedDaemon, "const DAEMON_VERSION = '([^']+)'")if (-not $stagedVersionMatch.Success -or $stagedVersionMatch.Groups[1].Value -ne $version) {diff --git a/scripts/build-win-zip.sh b/scripts/build-win-zip.shindex 33cf732..24dbb2e 100644--- a/scripts/build-win-zip.sh+++ b/scripts/build-win-zip.sh@@ -106,21 +106,31 @@ if [ ! -d scripts/node_modules/ws ]; thenrm -rf "$TMPNODE"fi-# 2) 内置资产(官方壁纸 + nebula 主题,单一来源:WorkDaddy.app/Contents/Resources/scripts/builtin)-# 仓库 scripts/ 本身不含 builtin,必须从 app 打包产物复制,否则 Windows 面板会显示「暂无官方壁纸」-BUILTIN_SRC="$DIR/WorkDaddy.app/Contents/Resources/scripts/builtin"-if [ -d "$BUILTIN_SRC" ]; then- echo "==> 内置资产 builtin -> scripts/builtin($(find "$BUILTIN_SRC/wallpapers" -name '*.webp' | wc -l | tr -d ' ') 张壁纸 + 主题)"- mkdir -p scripts/builtin- cp -R "$BUILTIN_SRC/." scripts/builtin/-else- echo "==> 警告: 未找到内置资产 $BUILTIN_SRC(无 WorkDaddy.app?),打包将不含官方壁纸/主题"+# 2) 内置资产(官方壁纸 + nebula 主题)。Windows 安装包必须自带这些文件,+# 否则首次启动无法初始化 themes/wallpapers,面板会永久显示「暂无官方壁纸」。+# 优先使用 staging/源码目录,其次使用仓库内的 macOS app 壳;显式工作目录+# 兼容从外部 app 产物构建。缺失或为空时硬失败,禁止生成坏包。+has_builtin_assets() {+ [ -f "$1/nebula/theme.json" ] && [ -d "$1/wallpapers" ]+}+BUILTIN_SRC="$DIR/scripts/builtin"+if ! has_builtin_assets "$BUILTIN_SRC"; then+ BUILTIN_SRC="$DIR/WorkDaddy.app/Contents/Resources/scripts/builtin"fi-WALLPAPER_OVERRIDE="$DIR/scripts/builtin-overrides/wallpaper-06.webp"-if [ -f "$WALLPAPER_OVERRIDE" ] && [ -d scripts/builtin ]; then- cp "$WALLPAPER_OVERRIDE" scripts/builtin/wallpapers/wallpaper-06.webp- cp "$WALLPAPER_OVERRIDE" scripts/builtin/nebula/background.webp+if ! has_builtin_assets "$BUILTIN_SRC" && [ -n "${WBSWITCH_DIR:-}" ]; then+ BUILTIN_SRC="$WBSWITCH_DIR/WorkDaddy.app/Contents/Resources/scripts/builtin"+fi+if ! has_builtin_assets "$BUILTIN_SRC"; then+ echo "错误:未找到内置资产(需要 builtin/nebula/theme.json 和 builtin/wallpapers)" >&2+ exit 2+fi+WALLPAPER_COUNT="$(find "$BUILTIN_SRC/wallpapers" -type f -name '*.webp' | wc -l | tr -d '[:space:]')"+if [ "${WALLPAPER_COUNT:-0}" -le 0 ]; then+ echo "错误:内置官方壁纸为空:$BUILTIN_SRC/wallpapers" >&2+ exit 2fi+echo "==> 内置资产来源: $BUILTIN_SRC(${WALLPAPER_COUNT} 张壁纸 + 主题)"+WALLPAPER_OVERRIDE="$DIR/scripts/builtin-overrides/wallpaper-06.webp"# 3) 打包:staging 目录,把两个顶层入口文件 + scripts/ 一起打进 zip 根(解压即见一键安装/启动)# 注意 apply-update.ps1 复用本结构(需 zip 内存在 scripts\daemon.js 做 srcRoot 判定)@@ -134,6 +144,20 @@ cp scripts/Install-WorkDaddy.cmd "$STAGE/Install-WorkDaddy.cmd"cp scripts/Start-WorkDaddy.cmd "$STAGE/Start-WorkDaddy.cmd"# 3.2) scripts\ 本体(含 node_modules/ws、builtin)cp -R scripts "$STAGE/scripts"+# 内置资产直接写入 staging,避免修改源码树,也确保最终 ZIP/Setup.exe 一定包含它们。+rm -rf "$STAGE/scripts/builtin"+mkdir -p "$STAGE/scripts/builtin"+cp -R "$BUILTIN_SRC/." "$STAGE/scripts/builtin/"+if [ -f "$WALLPAPER_OVERRIDE" ]; then+ mkdir -p "$STAGE/scripts/builtin/wallpapers" "$STAGE/scripts/builtin/nebula"+ cp "$WALLPAPER_OVERRIDE" "$STAGE/scripts/builtin/wallpapers/wallpaper-06.webp"+ cp "$WALLPAPER_OVERRIDE" "$STAGE/scripts/builtin/nebula/background.webp"+fi+STAGED_WALLPAPER_COUNT="$(find "$STAGE/scripts/builtin/wallpapers" -type f -name '*.webp' | wc -l | tr -d '[:space:]')"+if [ "${STAGED_WALLPAPER_COUNT:-0}" -le 0 ] || [ ! -s "$STAGE/scripts/builtin/nebula/theme.json" ]; then+ echo "错误:staging 内置资产不完整(wallpapers=${STAGED_WALLPAPER_COUNT:-0},缺少 nebula/theme.json)" >&2+ exit 2+ficp "$NATIVE_LAUNCHER" "$STAGE/WorkDaddyLauncher.exe"printf '%s\n' "$PROFILE" > "$STAGE/scripts/profile-id.txt"echo "==> 原生入口: WorkDaddyLauncher.exe (${PROFILE})"@@ -375,10 +399,5 @@ if [ -d "$STAGE" ]; thenfind "$STAGE" -depth -delete 2>/dev/null || rm -rf "$STAGE" || truefi-# 4) 清理临时内置到 scripts/ 的 builtin(避免污染仓库);rm 可能触发安全删除钩子,失败不中断-if [ -d "$BUILTIN_SRC" ] && [ -d scripts/builtin ]; then- rm -rf scripts/builtin 2>/dev/null || true-fi-echo "==> 安装暂存包完成: $(ls -lh "$OUT" | awk '{print $5}')"echo "==> 下一步由 build-win-installer.ps1 生成 Setup.exe;正式发行不保留该 ZIP。"diff --git a/scripts/builtin/nebula/background.webp b/scripts/builtin/nebula/background.webpnew file mode 100644index 0000000..09f26dbBinary files /dev/null and b/scripts/builtin/nebula/background.webp differdiff --git a/scripts/builtin/nebula/theme.json b/scripts/builtin/nebula/theme.jsonnew file mode 100644index 0000000..02761e8--- /dev/null+++ b/scripts/builtin/nebula/theme.json@@ -0,0 +1,679 @@+{+ "id": "nebula",+ "name": "Nebula 星云",+ "author": "HappyBuddy",+ "dark": true,+ "image": "background.webp",+ "colors": {+ "--vscode-editor-background": "#0a0a0a",+ "--vscode-editor-foreground": "#f2f2f4",+ "--vscode-sideBar-background": "#0c0c0e",+ "--vscode-sideBar-foreground": "#d0d0d4",+ "--vscode-sideBar-border": "#1c1c22",+ "--vscode-activityBar-background": "#0c0c0e",+ "--vscode-activityBar-foreground": "#f2f2f4",+ "--vscode-activityBar-inactiveForeground": "rgba(242,242,244,0.45)",+ "--vscode-activityBarBadge-background": "#f2f2f4",+ "--vscode-activityBarBadge-foreground": "#0a0a0a",+ "--vscode-titleBar-activeBackground": "#0a0a0a",+ "--vscode-titleBar-activeForeground": "#f2f2f4",+ "--vscode-tab-activeBackground": "#0a0a0a",+ "--vscode-tab-activeForeground": "#f2f2f4",+ "--vscode-tab-inactiveBackground": "#111113",+ "--vscode-tab-inactiveForeground": "rgba(242,242,244,0.5)",+ "--vscode-tab-border": "rgba(255,255,255,0.1)",+ "--vscode-input-background": "#111113",+ "--vscode-input-foreground": "#f2f2f4",+ "--vscode-input-border": "rgba(255,255,255,0.18)",+ "--vscode-input-placeholderForeground": "rgba(242,242,244,0.4)",+ "--vscode-button-background": "rgba(255,255,255,0.92)",+ "--vscode-button-foreground": "#0a0a0a",+ "--vscode-button-hoverBackground": "rgba(255,255,255,0.8)",+ "--vscode-list-activeSelectionBackground": "rgba(255,255,255,0.14)",+ "--vscode-list-activeSelectionForeground": "#ffffff",+ "--vscode-list-hoverBackground": "rgba(255,255,255,0.07)",+ "--vscode-list-inactiveSelectionBackground": "rgba(255,255,255,0.09)",+ "--vscode-menu-background": "#111113",+ "--vscode-menu-foreground": "#f2f2f4",+ "--vscode-dropdown-background": "#111113",+ "--vscode-dropdown-foreground": "#f2f2f4",+ "--vscode-dropdown-border": "rgba(255,255,255,0.18)",+ "--vscode-panel-background": "#0a0a0a",+ "--vscode-panel-border": "rgba(255,255,255,0.1)",+ "--vscode-badge-background": "#f2f2f4",+ "--vscode-badge-foreground": "#0a0a0a",+ "--vscode-foreground": "#f2f2f4",+ "--vscode-descriptionForeground": "rgba(242,242,244,0.7)",+ "--vscode-focusBorder": "rgba(255,255,255,0.55)",+ "--vscode-scrollbarSlider-background": "rgba(255,255,255,0.2)",+ "--vscode-scrollbarSlider-hoverBackground": "rgba(255,255,255,0.35)",+ "--vscode-editorGroupHeader-tabsBackground": "#0c0c0e",+ "--vscode-editorGroupHeader-tabsBorder": "rgba(255,255,255,0.1)",+ "--vscode-editorGroup-border": "#1c1c22",+ "--vscode-statusBar-background": "#0c0c0e",+ "--vscode-statusBar-foreground": "#f2f2f4",+ "--vscode-checkbox-background": "#111113",+ "--vscode-checkbox-border": "rgba(255,255,255,0.25)",+ "--vscode-checkbox-foreground": "#f2f2f4",+ "--vscode-editorWidget-background": "#111113",+ "--vscode-editorWidget-border": "rgba(255,255,255,0.18)",+ "--wb-color-border-secondary": "#1b1b20",+ "--wb-shadow-dropdown": "0px 6px 24px 0px rgba(0, 0, 0, 0.04), 0px 4px 6px 0px rgba(0, 0, 0, 0.04)",+ "--wb-color-bg-primary-default": "#161619",+ "--wb-color-text-disabled": "rgba(230,230,233,0.3)",+ "--wb-color-text-secondary": "rgba(242,242,244,0.72)",+ "--wb-sidebar-bg": "#0c0c0e",+ "--wb-bg-popover": "#111113",+ "--wb-border-popover": "rgba(255,255,255,0.14)",+ "--wb-color-text-primary": "#f2f2f4",+ "--wb-color-bg-primary-hover": "#1a1a1d",+ "--wb-shadow-selection-quote-popup": "0px 4px 12px 0px rgba(0, 0, 0, 0.04), 0px 3px 6px 0px rgba(0, 0, 0, 0.04)",+ "--wb-scrollbar-thumb": "rgba(230,230,233,0.2)",+ "--wb-scrollbar-thumb-hover": "rgba(230,230,233,0.3)",+ "--wb-bg-tooltip": "rgba(10,10,10,0.95)",+ "--wb-text-white": "#0a0a0a",+ "--wb-bg-primary": "#0a0a0a",+ "--wb-border-default": "rgba(255,255,255,0.12)",+ "--wb-button-primary-fg": "#0a0a0a",+ "--wb-button-primary-bg": "rgba(255,255,255,0.92)",+ "--wb-shadow-lg": "0 4px 16px color-mix(in srgb, #000000 16%, transparent)",+ "--wb-bg-secondary": "#111113",+ "--wb-error-foreground": "#F64041",+ "--wb-bg-overlay": "rgba(230,230,233,0.4)",+ "--wb-border-hover": "rgba(255,255,255,0.3)",+ "--wb-color-text-tertiary": "rgba(242,242,244,0.5)",+ "--wb-text-muted": "rgba(242,242,244,0.36)",+ "--wb-error": "#F64041",+ "--wb-bg-hover": "rgba(255,255,255,0.07)",+ "--wb-palette-black-20": "rgba(230,230,233,0.2)",+ "--wb-todo-menu-bg-hover": "#1b1b20",+ "--wb-bg-tab-active": "#161619",+ "--wb-border-focus": "rgba(255,255,255,0.55)",+ "--wb-color-text-link-default": "#a5b4fc",+ "--wb-status-warning": "#fbbf24",+ "--wb-bg-active": "rgba(255,255,255,0.12)",+ "--wb-button-primary-bg-hover": "rgba(255,255,255,0.8)",+ "--wb-bg-focus-soft": "rgba(26, 121, 255, 0.10)",+ "--wb-status-info-blue": "#60a5fa",+ "--wb-status-success": "#2ee59d",+ "--wb-status-error-soft": "#FCE8E8",+ "--wb-status-error": "#fb7185",+ "--wb-status-error-soft-bg": "rgba(255, 77, 79, 0.1)",+ "--wb-status-neutral-soft-bg": "rgba(148, 163, 184, 0.12)",+ "--wb-status-neutral": "#94a3b8",+ "--wb-bg-inverse": "#000000",+ "--wb-border-weak": "color-mix(in srgb, #e6e6e9 4%, transparent)",+ "--wb-status-warning-soft": "#FFEDDF",+ "--wb-status-warning-soft-bg": "rgba(245, 158, 11, 0.1)",+ "--wb-status-success-soft-bg": "rgba(16, 185, 129, 0.1)",+ "--wb-status-info-blue-soft-bg": "rgba(96, 165, 250, 0.08)",+ "--wb-bg-tertiary": "#161619",+ "--wb-modify-marker-bg": "rgba(255, 187, 0, 0.15)",+ "--wb-status-warning-muted": "#f59e0b",+ "--wb-bg-elevated": "#3c3c3c",+ "--wb-discover-text-expert": "#7C5CFC",+ "--wb-color-text-placeholder": "#2c2c33",+ "--wb-code-syntax-keyword": "#0550ae",+ "--wb-code-syntax-string": "#0a3069",+ "--wb-code-syntax-error": "#cf222e",+ "--wb-code-syntax-number": "#953800",+ "--wb-code-syntax-function": "#8250df",+ "--wb-code-border-input": "color-mix(in srgb, #d0d7de 20%, transparent)",+ "--wb-color-text-brand-default": "#00C29A",+ "--wb-icon-secondary": "rgba(242,242,244,0.7)",+ "--wb-brand-primary": "#00C29A",+ "--wb-bg-hover-light": "#161619",+ "--wb-motion-duration-fast": "120ms",+ "--wb-motion-easing-standard": "cubic-bezier(0.4, 0, 0.2, 1)",+ "--wb-radius-full": "9999px",+ "--wb-radius-md": "6px",+ "--wb-button-border-radius-medium": "8px",+ "--wb-button-height-medium": "32px",+ "--wb-button-padding-medium": "12px",+ "--wb-button-font-size-medium": "14px",+ "--wb-button-gap-medium": "4px",+ "--wb-button-min-width-medium": "68px",+ "--wb-button-line-height-medium": "22px",+ "--wb-button-height-small": "24px",+ "--wb-button-padding-small": "8px",+ "--wb-button-font-size-small": "12px",+ "--wb-button-gap-small": "2px",+ "--wb-button-min-width-small": "40px",+ "--wb-button-border-radius-small": "6px",+ "--wb-button-line-height-small": "20px",+ "--wb-button-icon-size-small": "12px",+ "--wb-button-height-large": "48px",+ "--wb-button-padding-large": "32px",+ "--wb-button-font-size-large": "14px",+ "--wb-button-gap-large": "8px",+ "--wb-button-border-radius-large": "12px",+ "--wb-button-line-height-large": "22px",+ "--wb-button-primary-bg-active": "rgba(255,255,255,0.7)",+ "--wb-button-primary-bg-disabled": "rgba(230,230,233,0.92)",+ "--wb-button-primary-fg-disabled": "#0a0a0c",+ "--wb-button-secondary-bg": "#111113",+ "--wb-button-secondary-fg": "rgba(242,242,244,0.9)",+ "--wb-button-secondary-border": "rgba(255,255,255,0.18)",+ "--wb-button-secondary-bg-hover": "#131316",+ "--wb-button-secondary-bg-active": "#131316",+ "--wb-button-secondary-fg-disabled": "rgba(230,230,233,0.3)",+ "--wb-button-grey-bg": "#161619",+ "--wb-button-grey-fg": "rgba(242,242,244,0.9)",+ "--wb-button-grey-bg-hover": "#1b1b20",+ "--wb-button-grey-bg-active": "#1b1b20",+ "--wb-button-grey-bg-disabled": "#1b1b20",+ "--wb-button-grey-fg-disabled": "rgba(230,230,233,0.3)",+ "--wb-button-ghost-bg": "transparent",+ "--wb-button-ghost-fg": "rgba(242,242,244,0.9)",+ "--wb-button-ghost-bg-hover": "rgba(255,255,255,0.08)",+ "--wb-button-ghost-fg-hover": "rgba(242,242,244,0.9)",+ "--wb-button-ghost-bg-active": "rgba(230,230,233,0.06)",+ "--wb-button-ghost-fg-disabled": "rgba(230,230,233,0.3)",+ "--wb-button-link-bg": "transparent",+ "--wb-button-link-fg": "#1470B4",+ "--wb-button-link-bg-hover": "transparent",+ "--wb-button-link-fg-hover": "#1470B4",+ "--wb-button-link-bg-active": "transparent",+ "--wb-button-link-fg-disabled": "#94B7D1",+ "--wb-button-danger-bg": "#E85C5C",+ "--wb-button-danger-fg-on-solid": "#0a0a0c",+ "--wb-button-danger-bg-hover": "#EC7474",+ "--wb-button-danger-bg-active": "#EC7474",+ "--wb-button-danger-bg-disabled": "#F5B9B9",+ "--wb-button-danger-fg-on-solid-disabled": "#0a0a0c",+ "--wb-button-danger-fg": "#F64041",+ "--wb-button-danger-border": "#F64041",+ "--wb-button-danger-bg-soft-hover": "color-mix(in srgb, #F64041 8%, transparent)",+ "--wb-button-danger-bg-soft-active": "color-mix(in srgb, #F64041 16%, transparent)",+ "--wb-button-danger-fg-disabled": "#F5B9B9",+ "--wb-button-danger-border-disabled": "#F5B9B9",+ "--wb-button-loading-secondary-fg": "#000000",+ "--wb-button-loading-grey-fg": "#000000",+ "--wb-button-loading-ghost-fg": "#000000",+ "--wb-button-loading-danger-fg": "#F5B9B9",+ "--wb-button-loading-danger-fg-on-solid": "#0a0a0c",+ "--wb-button-loading-link-fg": "#1470B4",+ "--wb-button-loading-primary-fg": "#0a0a0c",+ "--wb-button-icon-size-medium": "16px",+ "--wb-spacing-3": "8px",+ "--wb-font-body-size": "14px",+ "--wb-font-body-line-height": "22px",+ "--wb-radius-lg": "8px",+ "--wb-text-placeholder-soft": "rgba(230,230,233,0.3)",+ "--wb-border-strong": "rgba(255,255,255,0.22)",+ "--wb-font-caption-size": "12px",+ "--wb-radius-sm": "4px",+ "--wb-spacing-2": "4px",+ "--wb-spacing-6": "20px",+ "--wb-font-caption-line-height": "18px",+ "--wb-badge-success-bg": "#E7F8F0",+ "--wb-status-info": "#7dd3fc",+ "--wb-radius-xl": "12px",+ "--wb-shadow-md": "0 2px 8px color-mix(in srgb, #000000 12%, transparent)",+ "--wb-shadow-none": "none",+ "--wb-spacing-5": "16px",+ "--wb-spacing-7": "24px",+ "--wb-spacing-1": "2px",+ "--wb-shadow-sm": "0 1px 2px color-mix(in srgb, #000000 8%, transparent)",+ "--wb-color-mask-color": "rgba(230,230,233,0.6)",+ "--wb-motion-duration-base": "200ms",+ "--wb-spacing-10": "48px",+ "--wb-color-border-primary": "#1b1b20",+ "--wb-radius-4xl": "24px",+ "--wb-shadow-dialog": "0px 8px 48px 0px rgba(0, 0, 0, 0.08), 0px 6px 12px 0px rgba(0, 0, 0, 0.04)",+ "--wb-motion-easing-emphasized": "cubic-bezier(0.2, 0, 0, 1)",+ "--wb-modal-width": "100%",+ "--wb-modal-max-width-s": "480px",+ "--wb-modal-max-height": "calc(100vh - 160px)",+ "--wb-modal-max-width-m": "640px",+ "--wb-modal-max-width-ml": "640px",+ "--wb-modal-max-width-l": "960px",+ "--wb-spacing-4": "12px",+ "--wb-font-h3-size": "16px",+ "--wb-font-h3-line-height": "24px",+ "--wb-font-h3-weight": "600",+ "--wb-size-control-sm": "24px",+ "--wb-icon-size-md": "16px",+ "--wb-font-body-weight": "400",+ "--wb-modal-scrollbar-thumb": "rgba(230,230,233,0.1)",+ "--wb-icon-size-lg": "20px",+ "--wb-radius-2xl": "16px",+ "--wb-shadow-message-toolbar": "0px 6px 24px 0px rgba(0, 0, 0, 0.04), 0px 4px 6px 0px rgba(0, 0, 0, 0.04)",+ "--wb-dropdown-border-color": "color-mix(in srgb, #e6e6e9 8%, transparent)",+ "--wb-dropdown-bg-color": "#111113",+ "--wb-spacing-2-5": "5px",+ "--wb-size-control-md": "32px",+ "--wb-border-subtle": "rgba(255,255,255,0.08)",+ "--wb-font-body-strong-size": "14px",+ "--wb-font-body-strong-line-height": "22px",+ "--wb-font-body-strong-weight": "600",+ "--wb-font-caption-weight": "400",+ "--wb-icon-primary": "rgba(242,242,244,0.92)",+ "--wb-control-selected-fg": "#0a0a0c",+ "--wb-control-selected-bg": "rgba(230,230,233,0.92)",+ "--wb-control-selected-bg-hover": "rgba(230,230,233,0.92)",+ "--wb-bg-inset-strong": "#161619",+ "--wb-shadow-popover": "0 4px 12px -4px color-mix(in srgb, #000000 4%, transparent), 0 3px 6px -8px color-mix(in srgb, #000000 4%, transparent)",+ "--wb-badge-warning-bg": "#FFEDDF",+ "--wb-badge-warning-fg": "#FF7800",+ "--wb-shadow-dialog-md": "0 8px 24px rgba(0, 0, 0, 0.08)",+ "--wb-bg-card-hover": "#1a1a1d",+ "--wb-bg-card": "#111113",+ "--wb-home-bg-secondary": "#0a0a0a",+ "--wb-text-weak": "rgba(242,242,244,0.5)",+ "--wb-shadow-card-soft": "0 16px 32px -8px rgba(0, 0, 0, 0.03)",+ "--wb-avatar-bg-accent": "#a6d5da",+ "--wb-tag-operational-text": "#393939",+ "--wb-palette-black-100": "#000000",+ "--wb-brand-accent": "#1f1f1f",+ "--wb-border-card": "rgba(230,230,233,0.08)",+ "--wb-border-popover-strong": "color-mix(in srgb, #e6e6e9 24%, transparent)",+ "--wb-tab-active-fg": "#b0a0c8",+ "--wb-tab-active-border": "#F1EEFF",+ "--wb-card-selected-border": "#1b1b20",+ "--wb-card-selected-bg": "#131316",+ "--wb-border-warning": "#ffe1a8",+ "--wb-alert-warning-text": "#d97706",+ "--wb-avatar-bg-fallback-6": "#14b8a6",+ "--wb-avatar-bg-fallback-2": "#8b5cf6",+ "--wb-bg-warning-soft-strong": "rgba(245, 158, 11, 0.16)",+ "--wb-brand-accent-bg": "#f5f2ff",+ "--wb-bg-error-soft": "#fef2f2",+ "--wb-alert-warning-bg": "#fef3c7",+ "--wb-badge-gold-fg": "#856404",+ "--wb-badge-gold": "#d4a017",+ "--wb-badge-gold-bg": "#f0c040",+ "--wb-alert-error-text": "#dc2626",+ "--wb-alert-success-bg": "#d1fae5",+ "--wb-alert-success-text": "#047857",+ "--wb-alert-info-bg": "#dbeafe",+ "--wb-alert-info-text": "#2563eb",+ "--wb-accent-purple-light": "#c8a2ff",+ "--wb-bg-action": "#2563eb",+ "--wb-text-action": "#2563eb",+ "--wb-color-mask-strong": "rgba(230,230,233,0.8)",+ "--wb-checkbox-border-default": "rgba(230,230,233,0.2)",+ "--wb-checkbox-bg-default": "transparent",+ "--wb-check-checkmark": "#0a0a0c",+ "--wb-checkbox-border-hover": "rgba(230,230,233,0.5)",+ "--wb-color-text-link-hover": "#c7d2fe",+ "--wb-color-text-solid": "#f2f2f4",+ "--wb-color-border-focus": "rgba(230,230,233,0.75)",+ "--wb-color-border-tertiary": "#131316",+ "--wb-scrollbar-thumb-bg": "rgba(230,230,233,0.12)",+ "--wb-palette-black-90": "rgba(230,230,233,0.9)",+ "--wb-border-input": "rgba(255,255,255,0.16)",+ "--wb-bg-input-inset": "transparent",+ "--wb-info": "#00C29A",+ "--wb-warning": "#FF7800",+ "--wb-color-bg-primary-active": "#1e1e22",+ "--wb-success": "#0CBF5B",+ "--wb-spacing-8": "32px",+ "--wb-font-h2-line-height": "28px",+ "--wb-spacing-0": "0",+ "--wb-palette-black-40": "rgba(230,230,233,0.4)",+ "--wb-color-bg-primary-hover-strong": "#1b1b20",+ "--wb-claw-text-link": "#4a90d9",+ "--wb-claw-text-link-hover": "#2a6cb8",+ "--wb-claw-text-wecom": "#1565c0",+ "--wb-claw-text-feishu": "#00796b",+ "--wb-claw-text-qq": "#7b1fa2",+ "--wb-claw-text-dingtalk": "#e65100",+ "--wb-claw-text-wechat": "#2e7d32",+ "--wb-claw-text-yuanbao": "#f57f17",+ "--wb-palette-black-30": "rgba(230,230,233,0.3)",+ "--wb-text-strong": "#f2f2f4",+ "--wb-color-text-success-default": "#0CBF5B",+ "--wb-switcher-bg": "rgba(230,230,233,0.06)",+ "--wb-home-bg-primary": "#0c0c0e",+ "--wb-shadow-thumb": "0 1px 2px rgba(0, 0, 0, 0.18)",+ "--wb-switcher-text": "rgba(230,230,233,0.7)",+ "--wb-switcher-text-hover": "rgba(230,230,233,0.85)",+ "--wb-todo-menu-text-view-more": "rgba(230,230,233,0.5)",+ "--wb-checkin-bg": "linear-gradient(180deg, #0DC7A4 0%, #4DE49E 100%)",+ "--wb-checkin-shadow": "0 4px 12px -4px rgba(0, 0, 0, 0.06), 0 3px 6px -8px rgba(0, 0, 0, 0.06)",+ "--wb-checkin-header-icon": "#0a0a0c",+ "--wb-checkin-header-fg": "#0a0a0c",+ "--wb-checkin-period-tag-bg": "rgba(255, 255, 255, 0.5)",+ "--wb-checkin-period-tag-fg": "#008e70",+ "--wb-checkin-info-bg": "#131316",+ "--wb-checkin-divider": "#131316",+ "--wb-checkin-tomorrow-bg": "#d6f0e2",+ "--wb-checkin-tomorrow-fg": "#2a8a66",+ "--wb-checkin-btn-primary-bg": "rgba(230,230,233,0.92)",+ "--wb-checkin-btn-primary-border": "transparent",+ "--wb-checkin-btn-primary-fg": "#0a0a0c",+ "--wb-checkin-btn-primary-bg-hover": "rgba(230,230,233,0.92)",+ "--wb-checkin-btn-primary-bg-disabled": "rgba(230,230,233,0.92)",+ "--wb-checkin-btn-primary-border-disabled": "transparent",+ "--wb-checkin-btn-primary-fg-disabled": "#0a0a0c",+ "--wb-checkin-btn-success-bg": "#10a37f",+ "--wb-checkin-btn-success-border": "#10a37f",+ "--wb-checkin-btn-success-fg": "#131316",+ "--wb-checkin-btn-secondary-bg": "transparent",+ "--wb-checkin-btn-secondary-border": "#1b1b20",+ "--wb-checkin-btn-secondary-fg": "rgba(230,230,233,0.9)",+ "--wb-checkin-btn-secondary-bg-hover": "rgba(230,230,233,0.04)",+ "--wb-checkin-pop-flash": "#4ecba0",+ "--wb-todo-menu-icon-default": "rgba(230,230,233,0.7)",+ "--wb-text-on-primary": "#0a0a0a",+ "--wb-brand-wechat-green": "#0BC160",+ "--wb-brand-wechat-green-hover": "#07A152",+ "--wb-brand-wechat-green-connected": "#07C160",+ "--wb-switcher-thumb-bg": "#1e1e22",+ "--wb-shadow-card": "0 1px 2px rgba(0, 0, 0, 0.04)",+ "--wb-text-link-default": "#60a5fa",+ "--wb-palette-white-100": "#131316",+ "--wb-color-text-success-hover": "#29C770",+ "--wb-color-text-success-active": "#088F50",+ "--wb-brand-bright": "#4ecba0",+ "--wb-border-subtle-soft": "#131316",+ "--wb-color-text-brand-active": "#009273",+ "--wb-shadow-xl": "0 8px 32px color-mix(in srgb, #000000 20%, transparent)",+ "--wb-accent-unread": "#00C29A",+ "--wb-icon-tertiary": "rgba(242,242,244,0.5)",+ "--wb-todo-menu-text-default": "rgba(230,230,233,0.9)",+ "--wb-todo-menu-bg-active": "#1b1b20",+ "--wb-icon-muted": "rgba(230,230,233,0.3)",+ "--wb-badge-pending-bg": "#35353d",+ "--wb-badge-pending-fg": "#0a0a0c",+ "--wb-todo-menu-text-heading": "rgba(230,230,233,0.3)",+ "--wb-border-drag-indicator": "#00C29A",+ "--wb-badge-success-fg": "#088F50",+ "--wb-color-bg-card-default": "#131316",+ "--wb-color-bg-card-hover": "#1b1b20",+ "--wb-button-soft-bg": "color-mix(in srgb, #e6e6e9 8%, transparent)",+ "--wb-button-secondaryfill-bg-hover": "#131316",+ "--wb-motion-duration-sm": "150ms",+ "--wb-bg-pill-active": "rgba(255,255,255,0.9)",+ "--wb-voice-input-card-bg": "#131316",+ "--wb-voice-input-card-border": "#1b1b20",+ "--wb-voice-input-text-secondary": "#2c2c33",+ "--wb-voice-input-hover-bg": "color-mix(in srgb, #e6e6e9 5%, transparent)",+ "--wb-voice-input-text-primary": "#e6e6e9",+ "--wb-voice-input-guide-link": "#0078d4",+ "--wb-voice-input-btn-primary-bg": "#0078d4",+ "--wb-voice-input-btn-primary-fg": "#131316",+ "--wb-voice-input-pill-bg": "#131316",+ "--wb-voice-input-confirm": "#00c29a",+ "--wb-palette-brand-1": "#DFF7F2",+ "--wb-bg-card-strong": "#161619",+ "--wb-color-text-on-scrim-light": "rgba(230,230,233,0.42)",+ "--wb-palette-gray-3": "#131316",+ "--wb-palette-gray-5": "#1b1b20",+ "--wb-color-text-subtle": "#2c2c33",+ "--wb-onboarding-brand-bg-green": "#e8f8f1",+ "--wb-onboarding-brand-bg-blue": "#e8f0ff",+ "--wb-brand-soft": "#a8d9c5",+ "--wb-text-medium": "rgba(242,242,244,0.72)",+ "--wb-button-login-bg": "#1a1a1a",+ "--wb-button-login-bg-hover": "#000000",+ "--wb-button-login-bg-active": "#000000",+ "--wb-text-on-inverse": "#e6e6e9",+ "--wb-text-link": "#00C29A",+ "--wb-icon-folder": "#e89a2d",+ "--wb-accent-link-soft": "rgba(26, 121, 255, 0.14)",+ "--wb-border-action": "#2563eb",+ "--wb-accent-blue-soft": "color-mix(in srgb, #4f86ff 8%, transparent)",+ "--wb-accent-link-soft-hover": "rgba(64, 128, 255, 0.12)",+ "--wb-text-inverse": "#0a0a0a",+ "--wb-text-disable": "rgba(230,230,233,0.3)",+ "--wb-kb-checkbox-accent": "rgba(230,230,233,0.92)",+ "--wb-kb-checkbox-check-color": "#0a0a0c",+ "--wb-bg-content": "#0e0e10",+ "--wb-menu-item-danger-fg": "#f14c4c",+ "--wb-button-cancel-bg": "#1b1b20",+ "--wb-kb-btn-primary-bg": "rgba(255,255,255,0.92)",+ "--wb-kb-btn-primary-fg": "#0a0a0c",+ "--wb-kb-btn-primary-bg-hover": "rgba(255,255,255,0.8)",+ "--wb-kb-brand-hover": "#3db890",+ "--wb-onboarding-arrow-default": "#232329",+ "--wb-onboarding-arrow-active": "#4ecba0",+ "--wb-onboarding-arrow-fade": "#a8d9c5",+ "--wb-bg-skeleton": "rgba(128, 128, 128, 0.1)",+ "--wb-bg-skeleton-highlight": "rgba(128, 128, 128, 0.18)",+ "--wb-palette-black-10": "rgba(230,230,233,0.1)",+ "--wb-border-tooltip": "#1b1b20",+ "--wb-shadow-heavy": "0 20px 60px rgba(0, 0, 0, 0.15)",+ "--wb-control-checkbox-selected-bg": "rgba(230,230,233,0.92)",+ "--wb-control-checkbox-selected-fg": "#0a0a0c",+ "--wb-palette-brand-7": "#40D1B3",+ "--wb-brand-primary-subtle": "rgba(0, 194, 154, 0.12)",+ "--wb-bg-info": "#131316",+ "--wb-bg-error-subtle": "#131316",+ "--wb-bg-warning-subtle": "#fff8e6",+ "--wb-border-warning-subtle": "#ffe1a8",+ "--wb-border-error-subtle": "#fecdca",+ "--wb-kb-card-bg": "#131316",+ "--wb-kb-card-border": "#232329",+ "--wb-kb-text-muted": "rgba(230,230,233,0.42)",+ "--wb-kb-text-tertiary": "rgba(230,230,233,0.55)",+ "--wb-kb-row-selected-bg": "color-mix(in srgb,#ffffff 10%,transparent)",+ "--wb-kb-text-primary": "#1b1b20",+ "--wb-kb-banner-avatar-bg": "#fde68a",+ "--wb-kb-text-secondary": "rgba(230,230,233,0.72)",+ "--wb-kb-radio-border": "rgba(228, 233, 241, 0.6)",+ "--wb-kb-input-bg": "#0a0a0c",+ "--wb-kb-dialog-shadow": "0 8px 24px rgba(0, 0, 0, 0.08)",+ "--wb-kb-row-hover-bg": "color-mix(in srgb,#ffffff 7%,transparent)",+ "--wb-kb-input-border": "color-mix(in srgb,#ffffff 13%,transparent)",+ "--wb-kb-btn-border-hover": "rgba(230,230,233,0.2)",+ "--wb-kb-input-icon": "#232329",+ "--wb-kb-input-placeholder": "rgba(230,230,233,0.42)",+ "--wb-kb-tabs-container-bg": "#101013",+ "--wb-kb-tabs-container-border": "#1e1e24",+ "--wb-kb-tab-hover-bg": "rgba(230,230,233,0.04)",+ "--wb-kb-tabs-active-bg": "#0a0a0c",+ "--wb-kb-tabs-active-shadow": "0 1px 4px rgba(0, 0, 0, 0.1)",+ "--wb-bg-item-selected": "#1a1a1e",+ "--wb-shadow-elevated": "0 8px 24px rgba(15, 23, 42, 0.10)",+ "--wb-badge-img": "#f9ab00",+ "--wb-shadow-card-hover": "0 8px 20px rgba(0, 0, 0, 0.12)",+ "--wb-color-text-hint": "rgba(242,242,244,0.36)",+ "--wb-text-danger": "#DC2626",+ "--wb-switcher-text-active": "rgba(230,230,233,0.88)",+ "--wb-accent-blue": "#4f86ff",+ "--wb-border-faint": "rgba(230,230,233,0.1)",+ "--wb-bg-blue-soft": "rgba(74, 144, 217, 0.04)",+ "--wb-shadow-focus-blue": "0 0 0 2px rgba(74, 144, 217, 0.15)",+ "--wb-bg-scrim-light": "rgba(255, 255, 255, 0.8)",+ "--wb-color-text-error-default": "#F64041",+ "--wb-badge-doc": "#4285f4",+ "--wb-bg-green-soft": "rgba(52, 168, 83, 0.08)",+ "--wb-badge-sheet": "#34a853",+ "--wb-accent-orange-soft": "rgba(245, 166, 35, 0.08)",+ "--wb-accent-purple-soft": "color-mix(in srgb, #7c3aed 8%, transparent)",+ "--wb-accent-purple": "#7c3aed",+ "--wb-bg-pill-hover": "#131316",+ "--wb-button-success-bg": "#0CBF5B",+ "--wb-button-success-bg-hover": "#09a84f",+ "--wb-bg-success-soft": "#e8f5e9",+ "--wb-status-success-muted": "#10b981",+ "--wb-avatar-bg": "rgb(96, 125, 139)",+ "--wb-text-author": "rgb(107, 114, 128)",+ "--wb-bg-overlay-dropzone": "rgba(30, 30, 46, 0.7)",+ "--wb-bg-card-action": "rgba(30, 30, 46, 0.9)",+ "--wb-bg-error-hover": "rgba(234, 67, 53, 0.12)",+ "--wb-bg-error-hover-dark": "rgba(239, 83, 80, 0.1)",+ "--wb-bg-success-soft-dark": "rgba(76, 175, 80, 0.15)",+ "--wb-shadow-error": "0 4px 12px rgba(244, 67, 54, 0.3)",+ "--wb-button-secondary-fg-hover": "#000000",+ "--wb-bg-slate": "#64748B",+ "--wb-shadow-drawer": "-4px -2px 16px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03)",+ "--wb-shadow-drawer-fullscreen": "0 -2px 16px rgba(0, 0, 0, 0.1)",+ "--wb-border-control": "#1b1b20",+ "--wb-button-confirm-bg": "rgba(230,230,233,0.92)",+ "--wb-shadow-medium": "0 12px 32px rgba(0, 0, 0, 0.10)",+ "--wb-shadow-focus-ring": "0 0 0 2px rgba(26, 121, 255, 0.10)",+ "--wb-shadow-tooltip": "0 4px 12px rgba(0, 0, 0, 0.16)",+ "--wb-bg-row-selected": "#1a1a1e",+ "--wb-dropdown-item-hover-bg-color": "#131316",+ "--wb-color-bg-input": "rgba(230,230,233,0.04)",+ "--wb-netdrive-text-primary": "#e6e6e9",+ "--wb-netdrive-text-secondary": "#2c2c33",+ "--wb-checkbox-border-selected": "rgba(230,230,233,0.92)",+ "--wb-checkbox-bg-selected": "rgba(230,230,233,0.92)",+ "--wb-netdrive-text-disabled": "rgba(230,230,233,0.6)",+ "--wb-netdrive-border": "#1b1b20",+ "--wb-netdrive-error-fg": "#cf222e",+ "--wb-palette-gray-2": "#131316",+ "--wb-palette-red-7": "#E85C5C",+ "--wb-palette-red-9": "#B42C3F",+ "--wb-palette-gray-4": "#1b1b20",+ "--wb-color-bg-secondary-default": "#131316",+ "--wb-favorite-bg-soft": "rgba(239, 68, 68, 0.06)",+ "--wb-border-teams": "#6fc3df",+ "--wb-status-error-vivid": "#DC2626",+ "--wb-status-warning-vivid": "#CA8A04",+ "--wb-bg-warning-vivid-soft": "color-mix(in srgb, #CA8A04 10%, transparent)",+ "--wb-status-success-vivid": "#16A34A",+ "--wb-bg-success-vivid-soft": "color-mix(in srgb, #16A34A 10%, transparent)",+ "--wb-bg-error-vivid-soft": "color-mix(in srgb, #DC2626 10%, transparent)",+ "--wb-bg-error-vivid-subtle": "color-mix(in srgb, #DC2626 8%, transparent)",+ "--wb-border-error-vivid-subtle": "color-mix(in srgb, #DC2626 20%, transparent)",+ "--wb-accent-violet": "#7C5CFC",+ "--wb-accent-cyan": "#06B6D4",+ "--wb-accent-violet-soft": "color-mix(in srgb, #7C5CFC 6%, transparent)",+ "--wb-accent-cyan-soft": "color-mix(in srgb, #06B6D4 6%, transparent)",+ "--wb-bg-favorite-soft": "rgba(239, 68, 68, 0.08)",+ "--wb-shadow-input": "0 12px 24px -8px color-mix(in srgb, #000000 2%, transparent), 0 2px 4px -4px color-mix(in srgb, #000000 2%, transparent)",+ "--wb-spacing-12": "64px",+ "--wb-palette-brand-3": "#9FE8D9",+ "--wb-colleagues-layer-promo-loading": "1410",+ "--wb-palette-gray-1": "#131316",+ "--wb-checkbox-icon-selected": "#0a0a0c",+ "--wb-apps-toggle-color": "rgba(230,230,233,0.25)",+ "--wb-apps-toggle-color-hover": "rgba(230,230,233,0.45)",+ "--wb-apps-toggle-line-dark": "rgba(255, 255, 255, 0.08)",+ "--wb-apps-toggle-line-dark-hover": "rgba(255, 255, 255, 0.15)",+ "--wb-bg-surface-overlay-strong": "rgba(230,230,233,0.08)",+ "--wb-bg-surface-overlay-soft": "rgba(230,230,233,0.04)",+ "--wb-text-faded": "rgba(230,230,233,0.3)",+ "--wb-activity-card-border": "rgba(15, 23, 42, 0.05)",+ "--wb-activity-card-shadow": "0 18px 44px rgba(15, 23, 42, 0.10)",+ "--wb-activity-card-close-default": "rgba(31, 41, 55, 0.35)",+ "--wb-activity-card-close-hover": "rgba(31, 41, 55, 0.65)",+ "--wb-activity-card-action-fg": "rgba(255, 255, 255, 0.90)",+ "--wb-activity-card-dark-bg": "#2A2D3A",+ "--wb-mode-selector-label": "#232329",+ "--wb-mode-switch-bg": "#1b1b20",+ "--wb-mode-btn-text": "#666",+ "--wb-mode-btn-active-bg": "#000",+ "--wb-mode-btn-active-fg": "#fff",+ "--wb-mode-btn-hover-bg": "rgba(230,230,233,0.08)",+ "--wb-mode-tag-fg": "#fff",+ "--wb-quick-actions-fade-bg": "#131316",+ "--wb-quick-action-arrow-bg": "#131316",+ "--wb-quick-action-item-bg-hover": "#1b1b20",+ "--wb-quick-action-item-border-hover": "#1b1b20",+ "--wb-quick-action-selected-bg": "rgba(230,230,233,0.92)",+ "--wb-quick-action-selected-fg": "#0a0a0c",+ "--wb-home-composer-card-bg": "#111113",+ "--wb-home-composer-arrow-fg": "#35353d",+ "--wb-quick-action-sub-item-bg": "#1b1b20",+ "--wb-quick-action-sub-item-hover-bg": "rgba(230,230,233,0.06)",+ "--wb-bg-pill-active-hover": "rgba(255,255,255,0.95)",+ "--wb-home-composer-chip-bg-hover": "#161619",+ "--wb-bg-input-slot-gradient": "linear-gradient(180deg, #f0f0f0 0%, #f5f5f5 100%)",+ "--wb-kb-dialog-bg": "#131316",+ "--wb-kb-dialog-border": "color-mix(in srgb,#ffffff 13%,transparent)",+ "--wb-kb-dialog-divider": "#202025",+ "--wb-palette-black-75": "rgba(230,230,233,0.75)",+ "--wb-palette-black-60": "rgba(230,230,233,0.6)",+ "--wb-palette-black-70": "rgba(230,230,233,0.7)",+ "--wb-palette-black-50": "rgba(230,230,233,0.5)",+ "--wb-palette-brand-8": "#00C29A",+ "--wb-palette-brand-5": "#60D9C0",+ "--wb-palette-brand-9": "#009273",+ "--wb-palette-red-8": "#F64041",+ "--wb-palette-red-5": "#EF8B8B",+ "--wb-palette-red-3": "#F5B9B9",+ "--wb-palette-green-8": "#0CBF5B",+ "--wb-palette-green-7": "#29C770",+ "--wb-palette-green-5": "#66D799",+ "--wb-palette-green-9": "#088F50",+ "--wb-palette-green-3": "#A3E7C2",+ "--wb-palette-orange-8": "#FF7800",+ "--wb-palette-orange-7": "#FF8420",+ "--wb-color-bg-secondary-hover-active": "#131316",+ "--wb-palette-purple-1": "#f5f2ff",+ "--wb-palette-green-1": "#E7F8F0",+ "--wb-palette-cyan-3": "#6fc3df",+ "--wb-palette-blue-8": "#2563eb",+ "--wb-palette-blue-2": "#BFDBFE",+ "--wb-palette-purple-4": "#c8a2ff",+ "--wb-palette-purple-2": "#F1EEFF",+ "--wb-palette-purple-3": "#e0d4ff",+ "--wb-palette-white-70": "rgba(255, 255, 255, 0.7)",+ "--wb-palette-white-40": "rgba(255, 255, 255, 0.4)",+ "--wb-palette-red-6": "#EC7474",+ "--wb-palette-green-6": "#47CF84",+ "--wb-palette-white-10": "rgba(255, 255, 255, 0.1)",+ "--wb-color-text-brand-hover": "#40D1B3",+ "--wb-palette-blue-6": "#4F7DF3",+ "--wb-palette-white-20": "rgba(255, 255, 255, 0.2)",+ "--wb-palette-cyan-5": "#06B6D4",+ "--wb-palette-blue-4": "#60a5fa",+ "--wb-palette-blue-1": "#EAF2FF",+ "--wb-palette-blue-3": "#93C5FD",+ "--wb-palette-purple-7": "#7B61FF",+ "--wb-palette-purple-5": "#b0a0c8",+ "--wb-palette-white-30": "rgba(255, 255, 255, 0.3)",+ "--wb-palette-orange-1": "#FFEDDF",+ "--wb-palette-red-1": "#FCE8E8",+ "--wb-color-text-warning-default": "#FF7800",+ "--wb-connector-blue": "#4F7DF3",+ "--wb-connector-amber": "#F3B434",+ "--wb-connector-purple": "#7B61FF",+ "--wb-connector-green": "#31A354",+ "--wb-connector-red": "#E05243",+ "--wb-connector-orange": "#F97316",+ "--wb-palette-cyan-2": "#a6d5da",+ "--wb-palette-purple-8": "#7c3aed",+ "--wb-palette-blue-5": "#4f86ff",+ "--wb-palette-cyan-6": "#14b8a6",+ "--wb-palette-cyan-7": "#00796b",+ "--wb-bg-modal": "#111113",+ "--wb-palette-blue-10": "#0550ae",+ "--wb-palette-purple-6": "#7C5CFC",+ "--wb-palette-green-vivid": "#16A34A",+ "--wb-palette-amber-vivid": "#CA8A04",+ "--wb-palette-red-vivid": "#DC2626",+ "--wb-palette-success-vivid": "#16A34A",+ "--wb-palette-warning-vivid": "#CA8A04",+ "--wb-palette-error-vivid": "#DC2626",+ "--wb-palette-white-90": "rgba(255, 255, 255, 0.9)",+ "--wb-palette-white-50": "rgba(255, 255, 255, 0.5)",+ "--wb-color-text-warning-hover": "#FF8420",+ "--wb-palette-blue-7": "#3370ff",+ "--wb-palette-cyan-4": "#22D3EE",+ "--wb-palette-purple-9": "#8250df",+ "--wb-font-code-family": "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",+ "--wb-color-text-error-disabled": "#F5B9B9",+ "--wb-palette-white-60": "rgba(255, 255, 255, 0.6)",+ "--wb-palette-white-75": "rgba(255, 255, 255, 0.75)",+ "--wb-palette-white-80": "rgba(255, 255, 255, 0.8)",+ "--wb-color-text-error-active": "#B42C3F",+ "--wb-main-area-border-color": "#131316",+ "--wb-main-area-box-shadow": "0px 12px 24px -8px rgba(0, 0, 0, 0.02), 0px 2px 4px -4px rgba(0, 0, 0, 0.02)",+ "--wb-input-button-text": "rgba(230,230,233,0.90)",+ "--wb-model-tip-bg": "rgba(230,230,233,0.70)",+ "--wb-model-tip-text-color": "rgba(255, 255, 255, 0.90)",+ "--wb-ring-bg-progress": "rgba(230,230,233,0.70)",+ "--wb-ring-bg-track": "rgba(230,230,233,0.20)",+ "--wb-palette-brand-2": "#BFF0E6",+ "--wb-question-floating-card-bg": "#111113",+ "--wb-question-floating-card-border": "color-mix(in srgb, #e6e6e9 8%, transparent)",+ "--wb-question-floating-card-shadow": "0px 16px 32px -8px rgba(0, 0, 0, 0.02), 0px 2px 4px -4px rgba(0, 0, 0, 0.02)",+ "--wb-question-floating-hover-bg": "color-mix(in srgb, #e6e6e9 5%, transparent)",+ "--wb-question-floating-number-active-bg": "#131316",+ "--wb-question-floating-number-bg": "#161619",+ "--wb-main-area-background": "#0a0a0a",+ "--wb-scene-tag-grey-bg": "rgba(230,230,233,0.1)",+ "--wb-scene-tag-grey-bg-hover": "#1b1b20",+ "--wb-font-mono": "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",+ "--wb-shadow-input-card": "inset 0 -1px 0 rgba(0, 0, 0, 0.04)",+ "--wb-color-accent-brand": "#00C29A",+ "--wb-color-text-on-primary": "#0a0a0a"+ }+}\ No newline at end of filediff --git a/scripts/builtin/wallpapers/wallpaper-01.webp b/scripts/builtin/wallpapers/wallpaper-01.webpnew file mode 100644index 0000000..b8f6a29Binary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-01.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-02.webp b/scripts/builtin/wallpapers/wallpaper-02.webpnew file mode 100644index 0000000..5464355Binary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-02.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-03.webp b/scripts/builtin/wallpapers/wallpaper-03.webpnew file mode 100644index 0000000..766445fBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-03.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-04.webp b/scripts/builtin/wallpapers/wallpaper-04.webpnew file mode 100644index 0000000..b427001Binary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-04.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-05.webp b/scripts/builtin/wallpapers/wallpaper-05.webpnew file mode 100644index 0000000..cfbd74dBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-05.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-06.webp b/scripts/builtin/wallpapers/wallpaper-06.webpnew file mode 100644index 0000000..09f26dbBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-06.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-07.webp b/scripts/builtin/wallpapers/wallpaper-07.webpnew file mode 100644index 0000000..e46d25aBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-07.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-08.webp b/scripts/builtin/wallpapers/wallpaper-08.webpnew file mode 100644index 0000000..4b6f07fBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-08.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-09.webp b/scripts/builtin/wallpapers/wallpaper-09.webpnew file mode 100644index 0000000..8a4716cBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-09.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-10.webp b/scripts/builtin/wallpapers/wallpaper-10.webpnew file mode 100644index 0000000..218b82bBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-10.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-11.webp b/scripts/builtin/wallpapers/wallpaper-11.webpnew file mode 100644index 0000000..01d7fa9Binary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-11.webp differdiff --git a/scripts/builtin/wallpapers/wallpaper-12.webp b/scripts/builtin/wallpapers/wallpaper-12.webpnew file mode 100644index 0000000..978776eBinary files /dev/null and b/scripts/builtin/wallpapers/wallpaper-12.webp differdiff --git a/scripts/daemon.js b/scripts/daemon.jsindex 4fa9d94..1df029d 100644--- a/scripts/daemon.js+++ b/scripts/daemon.js@@ -75,12 +75,17 @@ const {updateMeta,canonicalWorkspace,getAutoCopyRules,+ dedupeAutoCopySessionRows,setAutoCopyRule,+ setAutoCopyAllSessions,+ isAutoCopySessionSelected,getAutoCopySession,getAutoCopySessionMembers,getAutoCopySessionMemberRecords,selectLatestAutoCopyMember,+ ensureAutoCopySessions,ensureAutoCopySession,+ normalizeAutoCopyLineages,addAutoCopySessionMember,moveAutoCopySession,removeAutoCopySession,@@ -106,6 +111,7 @@ const { buildCreditResourceBody } = require('./credit-resource-queries.js');const { fetchUsageSinceAnchor, startOfLocalDay } = require('./credit-request-usage.js');const { createCreditUsageStore } = require('./credit-usage-store.js');const { classifyCheckinResult } = require('./checkin-result.js');+const { fetchGrowthTodayActive, activateGrowthAccount } = require('./growth-active.js');const {captureException,captureMessage,@@ -235,8 +241,13 @@ const DATA_DIR = defaultDataDir();// 1.1.28:Windows 安装向导支持选择并锁定 WorkBuddy 客户端,企业版使用进程级环境变量 CDP。// 1.1.28:修复首次会话播种的 profile 目录缺失,以及 native lifecycle helper 误计自身进程。// 1.1.29:自动复制会话按 lineage 内最新消息文件做双向全成员同步,避免跨账号往返后历史分叉。-const DAEMON_VERSION = '1.1.29';-const DAEMON_BUILD_ID = 'release-1.1.29-20260831-merged-release';+// 1.1.30:会话页支持独立的全量自动复制覆盖开关,新会话在切换账号时自动进入幂等复制计划。+// 1.1.30:新增「今日活跃」查询接口(成长中心热力墙 is_active),复用签到 Bearer 鉴权与 profile 归属域名。+// 1.1.31:支持用备份账号 token 独立创建 cloud conversation 并发送最小 prompt,不切换当前登录账号。+// 1.1.32:主题页支持独立调节背景毛玻璃模糊程度。+// 1.1.33:按账号和 lineage 折叠历史重复会话,避免全量自动复制后两账号计数分叉。+const DAEMON_VERSION = '1.1.33';+const DAEMON_BUILD_ID = 'release-1.1.33-20260903-auto-copy-lineage';const HOST = '127.0.0.1';const IS_WIN = process.platform === 'win32'; // Windows 移植:平台分支开关(macOS 行为保持不变)// Windows 安装目录(install.ps1 铺、launcher 用、更新替换目标),对应 macOS 的 /Applications/WorkDaddy.app@@ -252,6 +263,8 @@ const CDP_PORT_HINT = process.env.WBSWITCH_CDP_PORTconst CDP_PORT_FILE = path.join(DATA_DIR, 'cdp-port.json');const UI_PORT_FILE = path.join(DATA_DIR, 'ui-port.json');const API_TOKEN_FILE = path.join(DATA_DIR, '.api-token');+const BACKGROUND_BLUR_FILE = path.join(DATA_DIR, 'background-blur.json');+const MAX_BACKGROUND_BLUR_PX = 32;const CREDIT_USAGE_DB_FILE = path.join(DATA_DIR, 'credit-usage.db');const CREDIT_USAGE_STORE = createCreditUsageStore({ dbPath: CREDIT_USAGE_DB_FILE, profileId: PROFILE.id });const CREDIT_USAGE_REFRESH_MS = 15000;@@ -3152,27 +3165,28 @@ async function buildAutoCopyPlan(sourceUid, targetUid) {const source = String(sourceUid || '').trim();const target = String(targetUid || '').trim();if (!source || !target || source === target) return [];+ normalizeAutoCopyLineages(DATA_DIR);const rules = getAutoCopyRules(DATA_DIR, source);- if (!rules.sessionIds.length && !rules.workspaces.length) return [];+ if (!rules.allSessions && !rules.sessionIds.length && !rules.workspaces.length) return [];const rows = await sqliteQuery('SELECT id, cwd, user_id, title, custom_title, status, created_at, updated_at, last_activity_at, is_playground, source_mode, is_background_automation, mode, model, expert_id, expert_locale, expert_runtime_identity, expert_marketplace, permission_mode, use_sandbox_cli, project_id ' +'FROM sessions WHERE deleted_at IS NULL AND user_id = ? ORDER BY created_at DESC;',[source]);- const sessionSet = new Set(rules.sessionIds);const workspaceSet = new Set(rules.workspaces.map(canonicalWorkspace));- return rows- .filter((row) => sessionSet.has(String(row.id)) || workspaceSet.has(canonicalWorkspace(row.cwd)))- .map((row) => {- let lineageId = rules.lineages[String(row.id)] || null;- // Workspace rules also represent shared sessions. Give each matching- // row a lineage so later switches reuse one target and reconcile its- // newest snapshot instead of inserting a duplicate every time.- if (!lineageId && workspaceSet.has(canonicalWorkspace(row.cwd))) {- lineageId = ensureAutoCopySession(DATA_DIR, source, row.id);- }- return Object.assign({}, row, { lineageId });- });+ const selectedRows = dedupeAutoCopySessionRows(rows, { [source]: rules.allLineages })+ .filter((row) => isAutoCopySessionSelected(rules, row));+ // Full-copy and workspace matches need stable hidden lineages for idempotent+ // repeated switches. Prepare the whole batch with one metadata write.+ const lineageSessionIds = selectedRows+ .filter((row) => rules.allSessions || workspaceSet.has(canonicalWorkspace(row.cwd)))+ .map((row) => row.id);+ const ensuredLineages = lineageSessionIds.length+ ? ensureAutoCopySessions(DATA_DIR, source, lineageSessionIds, { enabled: !rules.allSessions })+ : {};+ return selectedRows.map((row) => Object.assign({}, row, {+ lineageId: rules.allLineages[String(row.id)] || ensuredLineages[String(row.id)] || null,+ }));}const autoCopyJobs = new Map();@@ -4035,6 +4049,14 @@ function currentAccount() {}}+function accountBackupFile(uid) {+ const value = String(uid || '').trim();+ if (!/^[A-Za-z0-9_-]{1,128}$/.test(value)) {+ throw new Error('uid 格式无效');+ }+ return path.join(DATA_DIR, 'accounts', `${value}.info`);+}+/* ================= 暂存提示词(stash)辅助 ================= */function stashDir() {@@ -4271,7 +4293,12 @@ function initBuiltinAssets() {fs.writeFileSync(maskFile, JSON.stringify({ opacity: 0.1 }, null, 2));log('[init] 首次初始化:背景蒙版默认 10% -> mask.json');}- // 4) 默认主题 → WorkDaddy 壁纸主题(仅当 profile 从未设置过主题)+ // 4) 背景毛玻璃默认关闭(仅当配置不存在,不覆盖用户设置)+ if (!fs.existsSync(BACKGROUND_BLUR_FILE)) {+ fs.writeFileSync(BACKGROUND_BLUR_FILE, JSON.stringify({ blur: 0 }, null, 2));+ log('[init] 首次初始化:背景毛玻璃默认 0% -> background-blur.json');+ }+ // 5) 默认主题 → WorkDaddy 壁纸主题(仅当 profile 从未设置过主题)const curFile = path.join(DATA_DIR, 'current-theme.json');if (!fs.existsSync(curFile)) {fs.writeFileSync(curFile, JSON.stringify({ id: 'nebula', at: new Date().toISOString() }, null, 2));@@ -4600,6 +4627,17 @@ function themeVarsCss(isDark) {return out;}+function readBackgroundBlur() {+ let blur = 0;+ try {+ if (fs.existsSync(BACKGROUND_BLUR_FILE)) {+ const value = parseFloat(JSON.parse(fs.readFileSync(BACKGROUND_BLUR_FILE, 'utf8')).blur);+ if (!Number.isNaN(value)) blur = Math.min(1, Math.max(0, value));+ }+ } catch (_) {}+ return blur;+}+async function applyThemeByCdp(id) {if (!PROFILE.capabilities.theme) throw new Error(`${PROFILE.name} 暂不支持主题功能`);if (!cdp.connected) throw new Error('CDP 未连接');@@ -4661,13 +4699,18 @@ async function applyThemeByCdp(id) {if (!Number.isNaN(v)) mask = Math.min(1, Math.max(0, v));}} catch (_) {}+ const blur = readBackgroundBlur();+ const blurPx = Math.round(blur * MAX_BACKGROUND_BLUR_PX * 10) / 10;+ const blurCss = blurPx > 0+ ? 'backdrop-filter:blur(' + blurPx + 'px);-webkit-backdrop-filter:blur(' + blurPx + 'px);'+ : 'backdrop-filter:none;-webkit-backdrop-filter:none;';bgCssStr = ['#root{background:','linear-gradient(rgba(0,0,0,' + mask + '),rgba(0,0,0,' + mask + ')),','linear-gradient(90deg,color-mix(in srgb,var(--wb-bg-primary) 40%,transparent) 0 18%,transparent 42%),','linear-gradient(180deg,transparent 0 58%,color-mix(in srgb,var(--wb-bg-primary) 50%,transparent) 100%),','url(' + dataUrl + ') right center / cover no-repeat fixed !important;}',- 'body[data-vscode-theme-name] .teams-container,body[data-vscode-theme-name] .teams-container.is-mac{background:transparent !important}',+ 'body[data-vscode-theme-name] .teams-container,body[data-vscode-theme-name] .teams-container.is-mac{background:transparent !important;' + blurCss + '}','body[data-vscode-theme-name] [data-view-id]{background:transparent !important}','body[data-vscode-theme-name] .main-content{background:transparent !important}',// 左侧菜单(会话列表)透明(用户 08-30 00:46 要求去掉毛玻璃,连同子组件全透明,背景图直接透出)@@ -5654,6 +5697,7 @@ function handleApi(req, res) {return readBody(req).then((body) => {const uid = (body.uid || '').trim();if (!uid) return json(res, 400, { ok: false, error: '缺少 uid' });+ if (!/^[A-Za-z0-9_-]{1,128}$/.test(uid)) return json(res, 400, { ok: false, error: 'uid 格式无效' });try {const r = deleteAccount(DATA_DIR, uid);const rulesRemoved = removeAutoCopyAccount(DATA_DIR, uid);@@ -5867,8 +5911,9 @@ function handleApi(req, res) {return readBody(req).then(async (body) => {const uid = (body.uid || '').trim();if (!uid) return json(res, 400, { ok: false, error: '缺少 uid' });+ if (!/^[A-Za-z0-9_-]{1,128}$/.test(uid)) return json(res, 400, { ok: false, error: 'uid 格式无效' });try {- const file = path.join(DATA_DIR, 'accounts', `${uid}.info`);+ const file = accountBackupFile(uid);if (!fs.existsSync(file)) return json(res, 404, { ok: false, error: '账号备份不存在' });const j = JSON.parse(fs.readFileSync(file, 'utf8'));const tk = j.auth && j.auth.accessToken;@@ -5907,6 +5952,58 @@ function handleApi(req, res) {});}+ // 查询指定账号今日是否活跃(成长中心热力墙 is_active)+ if (req.method === 'POST' && p === '/api/growth/today-active') {+ return readBody(req).then(async (body) => {+ const uid = (body.uid || '').trim();+ if (!uid) return json(res, 400, { ok: false, error: '缺少 uid' });+ if (!/^[A-Za-z0-9_-]{1,128}$/.test(uid)) return json(res, 400, { ok: false, error: 'uid 格式无效' });+ try {+ const file = accountBackupFile(uid);+ if (!fs.existsSync(file)) return json(res, 404, { ok: false, error: '账号备份不存在' });+ const j = JSON.parse(fs.readFileSync(file, 'utf8'));+ const tk = j.auth && j.auth.accessToken;+ if (!tk) return json(res, 400, { ok: false, error: '备份中无 accessToken' });+ const today = await fetchGrowthTodayActive(tk, { apiHost: PROFILE.apiHost });+ return json(res, 200, { ok: true, uid, ...today });+ } catch (e) {+ log(`[growth] 查询 ${uid} 今日活跃失败: ${e.message}`);+ return json(res, 500, { ok: false, error: e.message });+ }+ });+ }++ // 使用备份账号 token 独立发起一次最小 cloud conversation,达到今日活跃。+ // 不修改当前 auth 文件,不通过 CDP 输入,也不改变当前 renderer 的登录态。+ if (req.method === 'POST' && p === '/api/growth/activate') {+ return readBody(req).then(async (body) => {+ const uid = String(body && body.uid || '').trim();+ if (!uid) return json(res, 400, { ok: false, error: '缺少 uid' });+ if (!/^[A-Za-z0-9_-]{1,128}$/.test(uid)) return json(res, 400, { ok: false, error: 'uid 格式无效' });+ try {+ const file = accountBackupFile(uid);+ if (!fs.existsSync(file)) return json(res, 404, { ok: false, error: '账号备份不存在' });+ const j = JSON.parse(fs.readFileSync(file, 'utf8'));+ const tk = j.auth && j.auth.accessToken;+ if (!tk) return json(res, 400, { ok: false, error: '备份中无 accessToken' });+ const before = await fetchGrowthTodayActive(tk, { apiHost: PROFILE.apiHost });+ if (before.is_active) return json(res, 200, { ok: true, uid, activated: false, alreadyActive: true, ...before });+ const created = await activateGrowthAccount(tk, { apiHost: PROFILE.apiHost });+ let after = before;+ for (let attempt = 0; attempt < 3; attempt++) {+ after = await fetchGrowthTodayActive(tk, { apiHost: PROFILE.apiHost });+ if (after.is_active || attempt === 2) break;+ await new Promise((resolve) => setTimeout(resolve, 500));+ }+ log(`[growth] 账号 ${uid} 已通过独立会话发起活跃探测(active=${after.is_active})`);+ return json(res, 200, { ok: true, uid, activated: after.is_active, alreadyActive: false, conversationId: created.conversationId, ...after });+ } catch (e) {+ log(`[growth] 账号 ${uid} 独立会话活跃失败: ${e.message}`);+ return json(res, 500, { ok: false, error: e.message });+ }+ });+ }+// 导出账号:密码必填;v2 使用随机 salt,密码只在本次请求内存在if (req.method === 'POST' && p === '/api/accounts/export') {return readBody(req).then((body) => {@@ -6137,6 +6234,31 @@ function handleApi(req, res) {});}+ // 背景图毛玻璃模糊程度(0~1,默认 0):GET 读取、POST 保存并重应用当前主题。+ // 百分比到像素的映射只在主题应用时执行,避免把 CSS 实现细节暴露给前端。+ if (req.method === 'GET' && p === '/api/blur') {+ return json(res, 200, { ok: true, blur: readBackgroundBlur() });+ }+ if (req.method === 'POST' && p === '/api/blur') {+ return readBody(req).then((body) => {+ try {+ const blur = Math.min(1, Math.max(0, parseFloat(body && body.blur)));+ if (Number.isNaN(blur)) return json(res, 400, { ok: false, error: 'blur 必须是数字' });+ fs.writeFileSync(BACKGROUND_BLUR_FILE, JSON.stringify({ blur }, null, 2));+ log('[theme] 背景毛玻璃模糊程度 -> ' + blur);+ const cur = fs.existsSync(path.join(DATA_DIR, 'current-theme.json'))+ ? JSON.parse(fs.readFileSync(path.join(DATA_DIR, 'current-theme.json'), 'utf8')).id+ : 'default';+ if (cur === 'default') return json(res, 200, { ok: true, blur, applied: false });+ return applyThemeByCdp(cur)+ .then((info) => json(res, 200, { ok: true, blur, applied: info.ok }))+ .catch((e) => json(res, 500, { ok: false, error: '模糊设置已保存但应用失败: ' + e.message }));+ } catch (e) {+ return json(res, 500, { ok: false, error: e.message });+ }+ });+ }+// 电脑休眠控制:GET/POST /api/sleep-mode(三模式 allow/keep/until-done + 显示器开关)+ POST /api/sleep-now(立即休眠)if (req.method === 'GET' && p === '/api/sleep-mode') {let st = { mode: 'allow', displaySleep: false };@@ -6160,6 +6282,7 @@ function handleApi(req, res) {// 会话列表:GET /api/sessions?uid=<账号uid>&range=today|7d|30d|all(uid 缺省=当前账号;uid=空=全部账号)if (req.method === 'GET' && p === '/api/sessions') {+ normalizeAutoCopyLineages(DATA_DIR);const uidParam = url.searchParams.get('uid');const uid = uidParam === null ? (((currentAccount() || {}).uid || '').trim()) : uidParam.trim();const range = url.searchParams.get('range') || '7d';@@ -6171,14 +6294,17 @@ function handleApi(req, res) {// 时间筛选和排序按最近活动/修改时间;旧记录缺字段时回退到创建时间。return sqliteQuery("SELECT id, cwd, user_id, title, custom_title, status, created_at, updated_at, last_activity_at, is_playground, project_id FROM sessions WHERE " + clauses.join(' AND ') + " ORDER BY COALESCE(last_activity_at, updated_at, created_at) DESC, created_at DESC;", params).then((rows) => {+ const autoCopyAll = getAutoCopyRules(DATA_DIR, uid).allSessions;const rulesByUid = {};rows.forEach((row) => {const owner = String(row.user_id || '').trim();if (!owner || rulesByUid[owner]) return;const rules = getAutoCopyRules(DATA_DIR, owner);- rulesByUid[owner] = { sessions: new Set(rules.sessionIds), workspaces: new Set(rules.workspaces) };+ rulesByUid[owner] = { allSessions: rules.allSessions, sessions: new Set(rules.sessionIds), workspaces: new Set(rules.workspaces), lineages: rules.allLineages };});- const sessions = rows.map((row) => {+ const lineagesByUid = {};+ Object.keys(rulesByUid).forEach((owner) => { lineagesByUid[owner] = rulesByUid[owner].lineages; });+ const sessions = dedupeAutoCopySessionRows(rows, lineagesByUid).map((row) => {const rules = rulesByUid[String(row.user_id || '').trim()] || { sessions: new Set(), workspaces: new Set() };return Object.assign({}, row, {autoCopySession: rules.sessions.has(String(row.id)),@@ -6188,7 +6314,7 @@ function handleApi(req, res) {const currentRules = uid? (rulesByUid[uid] || (() => {const rules = getAutoCopyRules(DATA_DIR, uid);- return { sessions: new Set(rules.sessionIds), workspaces: new Set(rules.workspaces) };+ return { allSessions: rules.allSessions, sessions: new Set(rules.sessionIds), workspaces: new Set(rules.workspaces), lineages: rules.allLineages };})()): null;return json(res, 200, {@@ -6197,6 +6323,7 @@ function handleApi(req, res) {count: sessions.length,uid,range,+ autoCopyAll,autoCopy: currentRules ? { sessionIds: Array.from(currentRules.sessions), workspaces: Array.from(currentRules.workspaces) } : null,});})@@ -6386,6 +6513,18 @@ function handleApi(req, res) {}});}+ // 全量自动复制覆盖:独立于逐会话/空间规则,关闭后原规则原样恢复。+ if (req.method === 'POST' && p === '/api/sessions/auto-copy-all') {+ return readBody(req).then((body) => {+ try {+ if (!body || typeof body.enabled !== 'boolean') return json(res, 400, { ok: false, error: '缺少全量自动复制开关状态' });+ const result = setAutoCopyAllSessions(DATA_DIR, body.enabled);+ return json(res, 200, { ok: true, autoCopyAll: result.allSessions });+ } catch (e) {+ return json(res, 400, { ok: false, error: e.message });+ }+ });+ }// 自动复制任务状态:GET /api/sessions/auto-copy/status?id=<jobId>if (req.method === 'GET' && p === '/api/sessions/auto-copy/status') {const job = autoCopyJobs.get(url.searchParams.get('id') || '');@@ -7033,8 +7172,8 @@ function handleApi(req, res) {}// 空间规则可能因切换前后的会话索引时序暂时无法生成初始计划,但规则本身仍需触发复制任务;// 任务规则通常能直接命中,所以旧逻辑只表现为“任务能复制、空间不复制”。- const sourceRules = sourceUid ? getAutoCopyRules(DATA_DIR, sourceUid) : { sessionIds: [], workspaces: [] };- const hasSourceAutoCopyRules = !!(sourceRules.sessionIds.length || sourceRules.workspaces.length);+ const sourceRules = sourceUid ? getAutoCopyRules(DATA_DIR, sourceUid) : { allSessions: false, sessionIds: [], workspaces: [] };+ const hasSourceAutoCopyRules = !!(sourceRules.allSessions || sourceRules.sessionIds.length || sourceRules.workspaces.length);const autoCopyJob = (autoCopyPlan.length || hasSourceAutoCopyRules || hasPendingAutoCopyTo(sourceUid))? startAutoCopyJob(sourceUid, uid, autoCopyPlan): null;diff --git a/scripts/growth-active.js b/scripts/growth-active.jsnew file mode 100644index 0000000..91fdfed--- /dev/null+++ b/scripts/growth-active.js@@ -0,0 +1,329 @@+'use strict';++const GROWTH_ACTIVE_TIMEOUT_MS = 12000;+const GROWTH_SESSION_TIMEOUT_MS = 30000;+const DEFAULT_GROWTH_PROMPT = '你好';+const DEFAULT_GROWTH_MODEL = 'deepseek-r1';++function responseData(payload) {+ if (payload && typeof payload === 'object' && payload.data && typeof payload.data === 'object') {+ return payload.data;+ }+ return payload;+}++async function readJsonResponse(response, label) {+ const text = await response.text();+ let payload;+ try {+ payload = JSON.parse(text);+ } catch (_) {+ throw new Error(`${label}接口返回了无法解析的数据`);+ }+ if (!response.ok) {+ const message = payload && (payload.msg || payload.message || payload.error);+ throw new Error(`${label}接口 HTTP ${response.status}${message ? `: ${message}` : ''}`);+ }+ if (payload && payload.code !== undefined && payload.code !== null && payload.code !== 0) {+ throw new Error(payload.msg || payload.message || `${label}接口 code=${payload.code}`);+ }+ return responseData(payload);+}++function requestHeaders(apiHost, accessToken, extra = {}) {+ return Object.assign({+ accept: 'application/json, text/plain, */*',+ 'content-type': 'application/json',+ 'x-codebuddy-request': '1',+ 'x-client-platform': 'web',+ origin: apiHost,+ referer: `${apiHost}/`,+ authorization: `Bearer ${accessToken}`,+ }, extra);+}++function resolveAcpEndpoint(link) {+ const value = String(link || '').trim().replace(/^http:\/\//, 'https://').replace(/\/+$/, '');+ if (!value) return '';+ try {+ const url = new URL(value);+ if (!/\/api\/v1\/acp$/.test(url.pathname) && !/\/acp$/.test(url.pathname)) {+ url.pathname = `${url.pathname.replace(/\/+$/, '')}/api/v1/acp`;+ }+ return url.toString().replace(/\/+$/, '');+ } catch (_) {+ return value;+ }+}++function timeoutSignal(timeoutMs) {+ const controller = new AbortController();+ const timer = setTimeout(() => controller.abort(), timeoutMs);+ return { controller, timer };+}++function sseEventParser(onMessage) {+ let buffer = '';+ let event = {};+ return (chunk, flush = false) => {+ buffer += chunk;+ const lines = buffer.split(/\r?\n/);+ const remainder = lines.pop() || '';+ buffer = flush ? '' : remainder;+ if (flush && remainder) lines.push(remainder);+ for (const line of lines) {+ if (!line) {+ if (event.data) {+ try { onMessage(JSON.parse(event.data)); } catch (_) {}+ }+ event = {};+ continue;+ }+ if (line.startsWith(':')) continue;+ const separator = line.indexOf(':');+ const field = separator >= 0 ? line.slice(0, separator) : line;+ const value = separator >= 0 ? line.slice(separator + 1).replace(/^ /, '') : '';+ if (field === 'data') event.data = event.data ? `${event.data}\n${value}` : value;+ }+ };+}++/**+ * 通过指定备份账号的 token 发起一次独立 cloud conversation。+ * 该流程只使用云端 conversation/ACP 凭证,不写当前 auth 文件,也不触碰 renderer。+ */+async function activateGrowthAccount(accessToken, options = {}) {+ const apiHost = String(options.apiHost || 'https://www.workbuddy.cn').replace(/\/+$/, '');+ const fetchImpl = options.fetchImpl || globalThis.fetch;+ const timeoutMs = Number.isFinite(options.timeoutMs) && options.timeoutMs > 0+ ? options.timeoutMs+ : GROWTH_SESSION_TIMEOUT_MS;+ if (!accessToken || typeof fetchImpl !== 'function') throw new Error('成长活跃发起参数不完整');++ const prompt = typeof options.prompt === 'string' && options.prompt.trim()+ ? options.prompt.trim().slice(0, 100)+ : DEFAULT_GROWTH_PROMPT;+ const model = typeof options.model === 'string' && options.model.trim()+ ? options.model.trim()+ : DEFAULT_GROWTH_MODEL;+ const signalState = timeoutSignal(timeoutMs);+ let connectionId = '';+ let endpoint = '';+ let sseController;+ let sseTask;+ const pending = new Map();+ let nextRpcId = 1;+ const deliverRpc = (payload) => {+ const entry = pending.get(payload && payload.id);+ if (!entry) return;+ pending.delete(payload.id);+ clearTimeout(entry.timer);+ if (payload.error) entry.reject(new Error(payload.error.message || 'ACP 请求失败'));+ else entry.resolve(payload.result);+ };++ const requestJson = async (url, init = {}) => {+ try {+ const response = await fetchImpl(url, Object.assign({ signal: signalState.controller.signal }, init));+ return await readJsonResponse(response, '会话');+ } catch (error) {+ if (error && error.name === 'AbortError') throw new Error('成长会话请求超时');+ throw error;+ }+ };++ const sendRpc = async (endpoint, message) => {+ if (!connectionId) throw new Error('ACP 连接未建立');+ const responsePromise = new Promise((resolve, reject) => {+ const timer = setTimeout(() => {+ pending.delete(message.id);+ reject(new Error(`ACP ${message.method} 响应超时`));+ }, timeoutMs);+ pending.set(message.id, { resolve, reject, timer });+ });+ // A transport error may happen before the caller reaches the await below.+ // Attach a sink so the timeout/rejection cannot become an unhandled rejection.+ responsePromise.catch(() => {});+ const response = await fetchImpl(endpoint, {+ method: 'POST',+ headers: requestHeaders(apiHost, runtimeToken, {+ accept: 'application/json, text/event-stream',+ 'acp-connection-id': connectionId,+ }),+ body: JSON.stringify(message),+ signal: signalState.controller.signal,+ });+ if (!response.ok) {+ const body = await response.text().catch(() => '');+ throw new Error(`ACP 请求 HTTP ${response.status}${body ? `: ${body.slice(0, 160)}` : ''}`);+ }+ const contentType = String(response.headers.get('content-type') || '');+ if (contentType.includes('application/json')) {+ const payload = await response.json().catch(() => null);+ if (payload && payload.jsonrpc) deliverRpc(payload);+ } else if (contentType.includes('text/event-stream') && response.body) {+ const reader = response.body.getReader();+ const decoder = new TextDecoder();+ const parse = sseEventParser((payload) => {+ deliverRpc(payload);+ });+ try {+ while (true) {+ const part = await reader.read();+ if (part.done) break;+ parse(decoder.decode(part.value, { stream: true }));+ }+ parse(decoder.decode(), true);+ } finally {+ reader.releaseLock();+ }+ }+ return await responsePromise;+ };++ let runtimeToken = '';+ let conversationId = '';+ try {+ const created = await requestJson(`${apiHost}/console/as/conversations/`, {+ method: 'POST',+ headers: requestHeaders(apiHost, accessToken),+ body: JSON.stringify({+ prompt,+ model,+ plugins: [{ name: 'weixinpay', marketplace: 'codebuddy-builtin' }],+ }),+ });+ const createdSession = created && created.session && typeof created.session === 'object' ? created.session : null;+ conversationId = String((created && (created.id || created.conversationId || (created.info && created.info.id))) || '');+ if (!conversationId) throw new Error('创建会话响应缺少 conversation id');+ let session = createdSession;+ if (!session || !session.link || !session.token) {+ session = await requestJson(`${apiHost}/console/as/conversations/${encodeURIComponent(conversationId)}/session`, {+ method: 'GET',+ headers: requestHeaders(apiHost, accessToken),+ });+ }+ endpoint = resolveAcpEndpoint(session && (session.link || session.endpoint));+ runtimeToken = String(session && (session.token || session.accessToken) || '');+ const sessionId = String(session && (session.sessionId || session.session_id) || '');+ if (!endpoint || !runtimeToken || !sessionId) throw new Error('会话响应缺少 ACP 连接凭证');++ sseController = new AbortController();+ signalState.controller.signal.addEventListener('abort', () => sseController.abort(), { once: true });+ const connectResponse = await fetchImpl(endpoint, {+ method: 'GET',+ headers: requestHeaders(apiHost, runtimeToken, { accept: 'text/event-stream' }),+ signal: sseController.signal,+ });+ if (!connectResponse.ok) throw new Error(`ACP 连接 HTTP ${connectResponse.status}`);+ connectionId = String(connectResponse.headers.get('acp-connection-id') || '');+ if (!connectionId) throw new Error('ACP 连接响应缺少 connection id');+ if (connectResponse.body) {+ const reader = connectResponse.body.getReader();+ sseTask = (async () => {+ const decoder = new TextDecoder();+ const parse = sseEventParser((payload) => {+ deliverRpc(payload);+ });+ try {+ while (true) {+ const part = await reader.read();+ if (part.done) break;+ parse(decoder.decode(part.value, { stream: true }));+ }+ parse(decoder.decode(), true);+ } catch (_) {+ // The one-shot activation only needs the RPC response; stream closure is expected afterwards.+ } finally {+ reader.releaseLock();+ }+ })();+ }+ await sendRpc(endpoint, { jsonrpc: '2.0', id: nextRpcId++, method: 'initialize', params: {+ protocolVersion: 1,+ clientInfo: { name: 'workdaddy-growth', version: '1.1.31' },+ clientCapabilities: {+ fs: { readTextFile: false, writeTextFile: false },+ _meta: { 'codebuddy.ai': { question: false, terminalOutput: false } },+ },+ } });+ const result = await sendRpc(endpoint, { jsonrpc: '2.0', id: nextRpcId++, method: 'session/prompt', params: {+ sessionId,+ prompt: [{ type: 'text', text: prompt }],+ } });+ return { conversationId, sessionId, stopReason: result && result.stopReason ? result.stopReason : null };+ } finally {+ clearTimeout(signalState.timer);+ if (sseController) sseController.abort();+ if (sseTask) await sseTask.catch(() => {});+ if (connectionId && runtimeToken) {+ await fetchImpl(endpoint, {+ method: 'DELETE',+ headers: requestHeaders(apiHost, runtimeToken, { 'acp-connection-id': connectionId }),+ }).catch(() => {});+ }+ for (const [id, entry] of pending) {+ clearTimeout(entry.timer);+ pending.delete(id);+ entry.reject(new Error('ACP 连接已关闭'));+ }+ }+}++/**+ * 查询指定账号今日是否活跃(WorkBuddy 成长中心活跃地图)。+ * 复用签到/积分的 Bearer 鉴权与 profile 归属域名(国内 www.workbuddy.cn / 国际 www.workbuddy.ai)。+ * 返回 { is_active, date, score, status_text };失败抛 Error。+ */+async function fetchGrowthTodayActive(accessToken, options = {}) {+ const apiHost = String(options.apiHost || 'https://www.workbuddy.cn').replace(/\/+$/, '');+ const fetchImpl = options.fetchImpl || globalThis.fetch;+ const timeoutMs = Number.isFinite(options.timeoutMs) && options.timeoutMs > 0+ ? options.timeoutMs+ : GROWTH_ACTIVE_TIMEOUT_MS;+ if (!accessToken || typeof fetchImpl !== 'function') {+ throw new Error('成长活跃查询参数不完整');+ }++ const controller = new AbortController();+ const timer = setTimeout(() => controller.abort(), timeoutMs);+ try {+ const response = await fetchImpl(`${apiHost}/activity/growth/heatmap`, {+ method: 'GET',+ headers: {+ accept: 'application/json, text/plain, */*',+ 'x-client-platform': 'web',+ origin: apiHost,+ referer: `${apiHost}/profile/growth-center`,+ authorization: `Bearer ${accessToken}`,+ },+ signal: controller.signal,+ });+ const text = await response.text();+ let payload;+ try {+ payload = JSON.parse(text);+ } catch (_) {+ throw new Error('成长活跃接口返回了无法解析的数据');+ }+ if (!response.ok) throw new Error(`成长活跃接口 HTTP ${response.status}`);+ if (payload.code !== 0 && payload.code !== undefined && payload.code !== null) {+ throw new Error(payload.msg || `成长活跃接口 code=${payload.code}`);+ }+ const today = payload.data && typeof payload.data === 'object' ? payload.data.today : null;+ if (!today || typeof today !== 'object') throw new Error('成长活跃接口缺少 data.today');+ return {+ is_active: today.is_active === true,+ date: typeof today.date === 'string' ? today.date : null,+ score: Number.isFinite(Number(today.score)) ? Number(today.score) : null,+ status_text: typeof today.status_text === 'string' ? today.status_text : '',+ };+ } catch (error) {+ if (error && error.name === 'AbortError') throw new Error('成长活跃接口请求超时');+ throw error;+ } finally {+ clearTimeout(timer);+ }+}++module.exports = { fetchGrowthTodayActive, activateGrowthAccount };diff --git a/scripts/inject.js b/scripts/inject.jsindex 41e7d4f..e332934 100644--- a/scripts/inject.js+++ b/scripts/inject.js@@ -5,7 +5,7 @@* 1. 右下角圆形黑色悬浮按钮(hover 展开为胶囊显示"WorkDaddy")* 2. 点击按钮弹出账号面板(白色主题):面板右下角与按钮右下角重叠;面板打开时按钮隐藏,关闭后恢复* 3. 账号列表展示 昵称 / 手机(明文) / Token 过期时间(<7 天红字);不展示 uid/uin/上次登录- * 4. 每账号右侧为「切换」「删除」纯图标按钮(当前登录账号隐藏这两个按钮);「删除」红色、二次确认永久删除+ * 4. 每账号右侧为「发起会话」「切换」「删除」纯图标按钮;发起会话使用备份 token,不切换当前账号* 5. 面板底部「退出登录」(假退出:仅退回登录页,token 不过期,可随时切回)* 6. 每日签到改为打开面板即自动调接口(见 daemon 的 claimDailyForAll),带每日缓存,无需按钮* 6. 备份由守护进程自动完成,面板不提供备份按钮@@ -2104,7 +2104,16 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {}function ensureRoot() {- if (root && root.isConnected) return;+ if (root && root.isConnected) {+ // 挂载点必须是无 transform 祖先链的 document.body:+ // WorkBuddy 网格容器(如 _gridViewItem_*)带 transform: matrix(...),+ // 会把 position:fixed 的 containing block 从视口改到该容器,+ // 导致视口坐标系(position() 计算的 left/top)被整体平移错位。+ if (root.parentNode !== document.body && typeof document.body.appendChild === 'function') {+ document.body.appendChild(root);+ }+ return;+ }root = document.createElement('div');root.className = 'wbs-message-nav-root';renderedSignature = '';@@ -2119,7 +2128,12 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {tooltip.hidden = true;root.appendChild(rail);root.appendChild(tooltip);- document.body.appendChild(root);+ // 挂 document.body:view 容器祖先里的 transform(_gridViewItem_* 恒等矩阵)+ // 会劫持 position:fixed 的 containing block,使视口坐标偏移。+ var mount = document.body;+ if (!mount || typeof mount.appendChild !== 'function') mount = surface && surface.viewportElement;+ if (!mount || typeof mount.appendChild !== 'function') mount = null;+ mount.appendChild(root);listen(root, 'pointerover', onPointerOver);listen(root, 'pointerout', onPointerOut);listen(root, 'focusin', onFocusIn);@@ -2134,8 +2148,8 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {}function position() {- if (!root || !surface || !surface.scrollElement || hidden) return;- var rect = surface.scrollElement.getBoundingClientRect();+ if (!root || !surface || !surface.viewportElement || hidden) return;+ var rect = surface.viewportElement.getBoundingClientRect();if (!rect || rect.width <= 0 || rect.height <= 0) {root.style.display = 'none';return;@@ -2343,8 +2357,9 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {}if (typeof ResizeObserver !== 'undefined' && !resizeObserver) {resizeObserver = new ResizeObserver(position);- resizeObserver.observe(surface.scrollElement);+ resizeObserver.observe(surface.viewportElement);}+ if (root && root.parentNode !== document.body) ensureRoot();if (scrollElement !== surface.scrollElement) {if (scrollElement) scrollElement.removeEventListener('scroll', scheduleActive);scrollElement = surface.scrollElement;@@ -3774,7 +3789,11 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {var panes = root.querySelectorAll('.wbs-pane');for (var i = 0; i < tabs.length; i++) tabs[i].classList.toggle('active', tabs[i].getAttribute('data-tab') === name);for (var j = 0; j < panes.length; j++) panes[j].classList.toggle('active', panes[j].getAttribute('data-pane') === name);- if (name === 'theme') { if (themePane && !themePane.dataset.built) buildThemePane(); loadWallpapers(); }+ if (name === 'theme') {+ if (themePane && !themePane.dataset.built) buildThemePane();+ var themeBtn = themePane && themePane.querySelector('.wbs-theme-opt.active');+ syncWallpaperCardVisibility(themeBtn ? themeBtn.getAttribute('data-theme') : 'default');+ }if (name === 'sessions' && sessionsPane && !sessionsPane.dataset.built) buildSessionsPane();if (name === 'models' && modelsPane && !modelsPane.dataset.built) buildModelsPane();if (name === 'enhance' && enhancePane && !enhancePane.dataset.built) buildEnhancePane();@@ -3789,7 +3808,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {}// ===== 会话 pane(构建:账号/时间筛选 + 按空间分组[默认2条/展开10条] + 刷新 + 批量操作[迁移/删除])=====- var sessionsState = { uid: undefined, currentUid: '', range: '7d', list: [], selected: {}, wsExpanded: {}, accounts: [], batchMode: false, autoCopy: null };+ var sessionsState = { uid: undefined, currentUid: '', range: '7d', list: [], selected: {}, wsExpanded: {}, accounts: [], batchMode: false, autoCopy: null, autoCopyAll: false };function isTaskSessionRecordUI(s) {// 任务(未选择项目/一次性)会话:以官方 is_playground=1 为准。// 普通工作区也用 WorkBuddy\\YYYY-MM-DD-HH-MM-SS 命名,仅凭 cwd 无法区分。@@ -3829,6 +3848,10 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {'<div class="wbs-sess-toolbar">' +'<button class="wbs-sess-bbtn" type="button" id="wbs-sess-batch">批量操作</button>' +'<button class="wbs-sess-bbtn" type="button" id="wbs-sess-import" title="从加密文件导入会话">' + IMPORT_ICON + '<span>导入</span></button>' ++ '<button class="wbs-sess-auto-all" type="button" id="wbs-sess-auto-all" role="checkbox" aria-checked="false" aria-label="自动复制所有会话" title="切换账号时自动复制当前账号的所有会话,包括之后新增的会话">' ++ '<span class="wbs-sess-auto-all-box" aria-hidden="true"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="12" height="12" rx="2"/><path class="wbs-sess-auto-all-check" d="m4.5 8 2.2 2.2L11.5 5.5"/></svg></span>' ++ '<span class="wbs-sess-auto-all-label">自动复制所有会话</span>' ++ '</button>' +'<span class="wbs-sess-count" id="wbs-sess-count"></span>' +'<div class="wbs-sess-batchbar" id="wbs-sess-batchbar" style="display:none">' +'<button class="wbs-sess-bbtn wbs-sess-check-all" type="button" id="wbs-sess-check-all">全选</button>' +@@ -3899,6 +3922,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {// 任务会话(is_playground=1)保留在列表中,由渲染层归入「任务」分组展示与操作。sessionsState.list = ((d && d.sessions) || []);sessionsState.autoCopy = (d && d.autoCopy) || null;+ sessionsState.autoCopyAll = !!(d && d.autoCopyAll);sessionsState.selected = {};sessionsState.wsExpanded = {};renderSessions();@@ -3918,14 +3942,15 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {var listEl = sessionsPane.querySelector('#wbs-sess-list');var countEl = sessionsPane.querySelector('#wbs-sess-count');if (!listEl) return;+ updateAutoCopyAllButton();if (!sessionsState.list.length) {listEl.innerHTML = '<div class="wbs-empty">当前筛选下没有会话</div>';- if (countEl) countEl.textContent = '0 个会话';+ updateSessionSummary(countEl);return;}function canEditAutoCopy(uid) { return sessionsState.uid !== '' && !!uid; }function autoCopyButton(kind, key, uid, enabled, inherited) {- if (!canEditAutoCopy(uid)) return '';+ if (sessionsState.autoCopyAll || !canEditAutoCopy(uid)) return '';var title = inherited ? '随空间自动复制' : (enabled ? '取消自动复制' : '切换账号时自动复制');var disabled = inherited ? ' disabled' : '';return '<button class="wbs-sess-auto' + (enabled ? ' active' : '') + (inherited ? ' inherited' : '') + '" type="button" data-auto-kind="' + kind + '" data-auto-key="' + escAttr(key) + '" data-auto-uid="' + escAttr(uid) + '" aria-label="' + escAttr(title) + '" title="' + escAttr(title) + '" aria-pressed="' + (enabled ? 'true' : 'false') + '"' + disabled + '><span class="wbs-sess-auto-label">自动复制</span><span class="wbs-sess-auto-switch' + (enabled ? ' on' : '') + '" aria-hidden="true"><span></span></span></button>';@@ -4007,6 +4032,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {bindSessEvents(listEl);}function activeAutoCopyCount() {+ if (sessionsState.autoCopyAll) return sessionsState.list.length;return sessionsState.list.filter(function (s) {return !!s.autoCopySession || !!s.autoCopyWorkspace;}).length;@@ -4016,6 +4042,37 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {countEl.innerHTML = '<span class="wbs-sess-summary-tag">共 ' + sessionsState.list.length + ' 个会话</span>' +'<span class="wbs-sess-summary-tag wbs-sess-summary-auto">自动复制 ' + activeAutoCopyCount() + '</span>';}+ function updateAutoCopyAllButton() {+ if (!sessionsPane) return;+ var button = sessionsPane.querySelector('#wbs-sess-auto-all');+ if (!button) return;+ var enabled = !!sessionsState.autoCopyAll;+ button.classList.toggle('active', enabled);+ button.setAttribute('aria-checked', enabled ? 'true' : 'false');+ }+ function toggleAutoCopyAll(enabled) {+ var button = sessionsPane && sessionsPane.querySelector('#wbs-sess-auto-all');+ if (!button || button.disabled) return;+ var previous = !!sessionsState.autoCopyAll;+ sessionsState.autoCopyAll = !!enabled;+ button.disabled = true;+ renderSessions();+ api('/api/sessions/auto-copy-all', {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ enabled: !!enabled }),+ }).then(function (response) {+ sessionsState.autoCopyAll = !!(response && response.autoCopyAll);+ button.disabled = false;+ renderSessions();+ toast(sessionsState.autoCopyAll ? '已开启自动复制所有会话' : '已关闭自动复制所有会话', false, root);+ }).catch(function (e) {+ sessionsState.autoCopyAll = previous;+ button.disabled = false;+ renderSessions();+ toast('自动复制所有会话设置失败: ' + (e.message || e), true, root);+ });+ }function shortWs(w) {var parts = String(w || '').replace(/\\/g, '/').split('/').filter(Boolean);return parts.length >= 2 ? parts.slice(-2).join('/') : w;@@ -4177,14 +4234,22 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {var bar = sessionsPane.querySelector('#wbs-sess-batchbar');var bb = sessionsPane.querySelector('#wbs-sess-batch');var importBtn = sessionsPane.querySelector('#wbs-sess-import');+ var autoCopyAllBtn = sessionsPane.querySelector('#wbs-sess-auto-all');var cnt = sessionsPane.querySelector('#wbs-sess-count');if (bb) { bb.style.display = on ? 'none' : ''; bb.classList.toggle('active', on); }if (importBtn) importBtn.style.display = on ? 'none' : '';+ if (autoCopyAllBtn) autoCopyAllBtn.style.display = on ? 'none' : '';if (cnt) cnt.style.display = on ? 'none' : '';if (bar) bar.style.display = on ? 'flex' : 'none';}function wireSessionsPane() {+ var autoCopyAllBtn = sessionsPane.querySelector('#wbs-sess-auto-all');+ if (autoCopyAllBtn) {+ autoCopyAllBtn.addEventListener('click', function () {+ toggleAutoCopyAll(autoCopyAllBtn.getAttribute('aria-checked') !== 'true');+ });+ }// 时间 Segment 组件var rangeSeg = sessionsPane.querySelector('#wbs-sess-range-seg');if (rangeSeg) {@@ -4724,7 +4789,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {};}- // ===== 主题 pane(构建:主题选择 + 背景图来源切换[官方壁纸/自定义上传] + 毛玻璃 + 头像)=====+ // ===== 主题 pane(构建:主题选择 + 头像 + WorkDaddy 壁纸)=====function buildThemePane() {if (!themePane) return;themePane.dataset.built = '1';@@ -4735,11 +4800,20 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {'<button class="wbs-theme-opt active" type="button" data-theme="default">默认</button>' +'<button class="wbs-theme-opt" type="button" data-theme="eye-care">护眼绿</button>' +'<button class="wbs-theme-opt" type="button" data-theme="cyber-purple">赛博紫</button>' +- '<button class="wbs-theme-opt" type="button" data-theme="nebula">' + WBS_BRAND + '</button>' ++ '<button class="wbs-theme-opt" type="button" data-theme="nebula">' + WBS_BRAND + ' 主题</button>' +'</div>' +'</div>' +- '<div class="wbs-pcard">' +- '<div class="wbs-pcard-title">背景与头像</div>' ++ '<div class="wbs-pcard wbs-avatar-card">' ++ '<div class="wbs-pcard-title">头像</div>' ++ '<div class="wbs-avatar-row">' ++ '<img class="wbs-avatar-preview" id="wbs-avatar-preview" alt="头像预览" title="点击恢复官方头像">' ++ '<button class="wbs-theme-upload" id="wbs-avatar-upload" type="button" title="上传图片替换左下角头像">更换头像</button>' ++ '<button class="wbs-theme-upload" id="wbs-avatar-reset" type="button" title="恢复 WorkBuddy 官方头像">恢复默认</button>' ++ '<input type="file" id="wbs-avatar-file" accept="image/png,image/jpeg,image/webp" style="display:none">' ++ '</div>' ++ '</div>' ++ '<div class="wbs-pcard wbs-wallpaper-card" id="wbs-wallpaper-card" style="display:none">' ++ '<div class="wbs-pcard-title">壁纸</div>' +'<div class="wbs-bg-source">' +'<button class="wbs-bg-src active" type="button" data-src="official">' + WBS_BRAND + ' 壁纸</button>' +'<button class="wbs-bg-src" type="button" data-src="custom">自定义壁纸</button>' +@@ -4752,17 +4826,16 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {'<div class="wbs-wallpapers wbs-custom-wallpapers" id="wbs-custom-wallpapers"><div class="wbs-wp-loading">壁纸加载中…</div></div>' +'<input type="file" id="wbs-theme-file" accept="image/png,image/jpeg,image/webp" style="display:none">' +'</div>' +- '<div class="wbs-avatar-row">' +- '<img class="wbs-avatar-preview" id="wbs-avatar-preview" alt="头像预览" title="点击恢复官方头像">' +- '<button class="wbs-theme-upload" id="wbs-avatar-upload" type="button" title="上传图片替换左下角头像">更换头像</button>' +- '<button class="wbs-theme-upload" id="wbs-avatar-reset" type="button" title="恢复 WorkBuddy 官方头像">恢复默认</button>' +- '<input type="file" id="wbs-avatar-file" accept="image/png,image/jpeg,image/webp" style="display:none">' +- '</div>' +'<div class="wbs-mask-row">' +'<label class="wbs-blur-label" for="wbs-mask-range">背景蒙版<span class="wbs-blur-hint">黑色半透明遮罩,压暗背景图</span></label>' +'<input type="range" id="wbs-mask-range" min="0" max="100" step="1" value="30">' +'<span class="wbs-mask-val" id="wbs-mask-val">30%</span>' +'</div>' ++ '<div class="wbs-mask-row">' ++ '<label class="wbs-blur-label" for="wbs-bg-blur-range">背景毛玻璃</label>' ++ '<input type="range" id="wbs-bg-blur-range" min="0" max="100" step="1" value="0">' ++ '<span class="wbs-mask-val" id="wbs-bg-blur-val">0%</span>' ++ '</div>' +'</div>';wireThemePane();}@@ -5327,6 +5400,15 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {});}+ function syncWallpaperCardVisibility(themeId) {+ if (!themePane) return;+ var card = themePane.querySelector('#wbs-wallpaper-card');+ if (!card) return;+ var visible = themeId === 'nebula';+ card.style.display = visible ? '' : 'none';+ if (visible) loadWallpapers();+ }+// 主题 pane 事件绑定(元素在 buildThemePane 之后才存在,延迟到首次切换时绑定)function wireThemePane() {// 主题选择:segmented 按钮直接切换@@ -5338,11 +5420,13 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {// 不做 active 拦截:即使当前已是该主题也强制重新应用(保证「切换到默认主题=强制浅色 / 切换到 WorkDaddy 主题=强制深色」始终生效,面板状态与真实主题不一致时也能纠正)var previous = themePane.querySelector('.wbs-theme-opt.active');themePane.querySelectorAll('.wbs-theme-opt').forEach(function (b) { b.classList.toggle('active', b === segBtn); });+ syncWallpaperCardVisibility(id);applyTheme(id).then(function () {var names = { 'default': '默认', 'nebula': WBS_BRAND + ' 主题', 'eye-care': '护眼绿', 'cyber-purple': '赛博紫' };toast('已应用主题「' + (names[id] || id) + '」', false, root);}).catch(function (er) {themePane.querySelectorAll('.wbs-theme-opt').forEach(function (b) { b.classList.toggle('active', b === previous); });+ syncWallpaperCardVisibility(previous ? previous.getAttribute('data-theme') : 'default');toast('应用主题失败: ' + (er.message || er), true, root);});return;@@ -5438,6 +5522,33 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {}}).catch(function () {});}+ // 背景毛玻璃滑块:拖动防抖 300ms 调 /api/blur(daemon 保存 + 重应用主题)+ var blurRange = themePane.querySelector('#wbs-bg-blur-range');+ var blurVal = themePane.querySelector('#wbs-bg-blur-val');+ var blurTimer = null;+ if (blurRange) {+ blurRange.addEventListener('input', function () {+ var pct = parseInt(this.value, 10) || 0;+ if (blurVal) blurVal.textContent = pct + '%';+ clearTimeout(blurTimer);+ blurTimer = setBuildTimeout(function () {+ api('/api/blur', {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ blur: pct / 100 }),+ }).catch(function (e) {+ toast('毛玻璃设置失败: ' + (e.message || e), true, root);+ });+ }, 300);+ });+ api('/api/blur').then(function (d) {+ if (d && typeof d.blur === 'number') {+ var pct = Math.round(d.blur * 100);+ blurRange.value = String(pct);+ if (blurVal) blurVal.textContent = pct + '%';+ }+ }).catch(function () {});+ }// 自定义背景图上传区:点击 / 拖拽var bgUpload = themePane.querySelector('#wbs-bg-upload');if (bgUpload) {@@ -5868,6 +5979,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {seg.querySelectorAll('.wbs-theme-opt').forEach(function (b) {b.classList.toggle('active', b.getAttribute('data-theme') === cur);});+ syncWallpaperCardVisibility(cur);// 若当前主题不在允许列表(如之前应用了自定义主题),回退到默认主题if (d.current && ALLOWED_THEMES.indexOf(d.current) < 0 && cur === 'default') {applyTheme('default').catch(function () {});@@ -8715,12 +8827,11 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {var curMark = isCur ? '<span class="wbs-cur-marker" title="当前使用中">' + CUR_MARK_SVG + '</span>' : '';// 当前登录账号隐藏操作;认证已过期的账号保留删除,但隐藏切换,避免进入登录页。var expired = isIdentityExpired(a);- var ops = isCur+ var ops = (isCur? ''- : '<div class="wbs-ops">' +- (expired ? '' : '<button class="wbs-icon-btn wbs-acc-switch" type="button" title="切换" data-uid="' + escAttr(a.uid) + '" data-name="' + escAttr(a.nickname || '未命名') + '">' + SWITCH_SVG + '</button>') +- '<button class="wbs-icon-btn wbs-del" type="button" title="删除" data-uid="' + escAttr(a.uid) + '" data-name="' + escAttr(a.nickname || '未命名') + '">' + TRASH_SVG + '</button>' +- '</div>';+ : (expired ? '' : '<button class="wbs-icon-btn wbs-acc-switch" type="button" title="切换" data-uid="' + escAttr(a.uid) + '" data-name="' + escAttr(a.nickname || '未命名') + '">' + SWITCH_SVG + '</button>') ++ '<button class="wbs-icon-btn wbs-del" type="button" title="删除" data-uid="' + escAttr(a.uid) + '" data-name="' + escAttr(a.nickname || '未命名') + '">' + TRASH_SVG + '</button>');+ ops = ops ? '<div class="wbs-ops">' + ops + '</div>' : '';// 国际版没有手机号:用 UIN(账号唯一数字标识)替代展示;国内版仍显示手机。// UIN 与手机号共用同一标签和值间距,确保与“剩余”额度列对齐。var isUinMode = !a.phone;@@ -9592,6 +9703,16 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {'.wbs-sess-bbtn{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:7px 12px;border:1px solid var(--wb-border-default,#e5e5e5);border-radius:9px;background:var(--wb-bg-popover,#fff);color:var(--wb-icon-secondary,#555);font-size:12px;cursor:pointer;line-height:1;transition:all .15s}','.wbs-sess-bbtn:hover{background:var(--wb-bg-hover,#f5f5f5);color:var(--wb-color-text-primary,#1f1f1f)}','.wbs-sess-bbtn.active{background:#fff;color:#1f1f1f;border-color:#fff}',+ '.wbs-sess-auto-all{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:30px;flex:0 0 auto;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--wb-icon-secondary,#555);font:inherit;font-size:11px;font-weight:600;line-height:1;cursor:pointer;transition:background .15s,color .15s,border-color .15s}',+ '.wbs-sess-auto-all:hover{background:var(--wb-bg-hover,#f5f5f5);color:var(--wb-color-text-primary,#1f1f1f)}',+ '.wbs-sess-auto-all.active{background:color-mix(in srgb,var(--wb-button-primary-bg,#1f1f1f) 10%,transparent);border-color:color-mix(in srgb,var(--wb-button-primary-bg,#1f1f1f) 28%,transparent);color:var(--wb-button-primary-bg,#1f1f1f)}',+ '.wbs-sess-auto-all:disabled{opacity:.58;cursor:wait}',+ '.wbs-sess-auto-all-box{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex:0 0 16px;color:var(--wb-icon-tertiary,#999)}',+ '.wbs-sess-auto-all-box svg{display:block}',+ '.wbs-sess-auto-all-check{opacity:0;transition:opacity .15s}',+ '.wbs-sess-auto-all.active .wbs-sess-auto-all-box{color:var(--wb-button-primary-bg,#1f1f1f)}',+ '.wbs-sess-auto-all.active .wbs-sess-auto-all-check{opacity:1}',+ '.wbs-sess-auto-all-label{white-space:nowrap}','.wbs-sess-batchbar{display:flex;align-items:center;gap:5px;flex-wrap:nowrap;margin:0;padding:0;border:none;background:transparent}','.wbs-sess-done{margin-left:auto;color:#fff;background:#141416;border-color:#141416}','.wbs-sess-done:hover{background:#2a2a2e;color:#fff}',@@ -9600,8 +9721,9 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {'.wbs-sess-delbtn:hover{color:#ff6b6b;border-color:color-mix(in srgb,#ff6b6b 45%,transparent);background:color-mix(in srgb,#ff6b6b 8%,transparent)}','.wbs-sess-delbtn.armed{color:#fff;background:#ff6b6b;border-color:#ff6b6b}','.wbs-sess-count{display:flex;align-items:center;gap:5px;margin-left:auto;min-width:0}',- '.wbs-sess-summary-tag{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--wb-border-default,#e5e5e5);border-radius:999px;background:color-mix(in srgb,var(--wb-bg-tertiary,#f0f0f0) 70%,transparent);color:var(--wb-icon-secondary,#666);font-size:11px;white-space:nowrap}',- '.wbs-sess-summary-auto{border-color:color-mix(in srgb,var(--wb-button-primary-bg,#1f1f1f) 24%,var(--wb-border-default,#e5e5e5));color:var(--wb-button-primary-bg,#1f1f1f);background:color-mix(in srgb,var(--wb-button-primary-bg,#1f1f1f) 8%,transparent)}',+ '.wbs-sess-summary-tag{display:inline-flex;align-items:center;padding:0;border:0;border-radius:0;background:transparent;color:var(--wb-icon-tertiary,#999);font-size:10px;line-height:22px;white-space:nowrap}',+ '.wbs-sess-summary-auto{color:var(--wb-icon-tertiary,#999)}',+ '.wbs-sess-summary-auto::before{content:"·";margin-right:5px;opacity:.7}','.wbs-sess-summary-selected{font-size:11px;color:var(--wb-icon-tertiary,#999);white-space:nowrap}','.wbs-model-card{display:flex;flex:1;flex-direction:column;min-height:0;padding:10px 12px 12px}','.wbs-model-tabs{display:flex;gap:4px;padding:3px;margin-bottom:10px;border-radius:10px;background:var(--wb-bg-tertiary,#f0f0f0)}',@@ -9899,7 +10021,7 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {'.wbs-transfer-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}','.wbs-transfer-title{overflow:hidden;color:var(--wb-color-text-primary,#1f1f1f);font-size:12px;font-weight:650;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}','.wbs-transfer-sub{overflow:hidden;color:var(--wb-icon-tertiary,#888);font-size:11px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}',- '.wbs-transfer-option:focus-within,.wbs-transfer-toggle:focus-visible,.wbs-modal-btn:focus-visible,.wbs-sess-bbtn:focus-visible,.wbs-acct-io:focus-visible{outline:2px solid var(--wb-accent-blue,#4f86ff);outline-offset:2px}',+ '.wbs-transfer-option:focus-within,.wbs-transfer-toggle:focus-visible,.wbs-modal-btn:focus-visible,.wbs-sess-bbtn:focus-visible,.wbs-sess-auto-all:focus-visible,.wbs-acct-io:focus-visible{outline:2px solid var(--wb-accent-blue,#4f86ff);outline-offset:2px}','.wbs-login-body{display:flex;flex-direction:column;gap:9px;margin-bottom:16px}','.wbs-login-option{display:flex;align-items:flex-start;gap:10px;width:100%;box-sizing:border-box;padding:12px 13px;border:1px solid transparent;border-radius:11px;background:var(--wb-bg-popover,#fff);cursor:pointer;text-align:left;transition:border-color .16s,background .16s,box-shadow .16s;font-family:inherit}','.wbs-login-option:hover{border-color:var(--wb-border-strong,#b9b9bd);background:var(--wb-bg-hover,#f5f5f5)}',diff --git a/scripts/lib.js b/scripts/lib.jsindex f1cc565..aa57a1b 100644--- a/scripts/lib.js+++ b/scripts/lib.js@@ -414,7 +414,7 @@ function ensureAutoCopyMeta(meta) {// 1.0.15 stored rules under sourceUid. Convert them once to global session lineages// and global workspace paths so a migration/copy keeps the same shared identity.const legacy = current && typeof current === 'object' && !Array.isArray(current) ? current : {};- const next = { version: 2, sessions: {}, sessionIndex: {}, workspaces: {}, copies: {} };+ const next = { version: 2, allSessions: false, sessions: {}, sessionIndex: {}, workspaces: {}, copies: {} };const legacySessions = legacy.sessions && typeof legacy.sessions === 'object' ? legacy.sessions : {};for (const sourceUid of Object.keys(legacySessions)) {const bucket = legacySessions[sourceUid];@@ -457,6 +457,7 @@ function readAutoCopyConfig(dataDir) {const autoCopy = ensureAutoCopyMeta(meta);if (!wasCurrent) writeMeta(dataDir, meta);return {+ allSessions: autoCopy.allSessions === true,sessions: autoCopy.sessions,sessionIndex: autoCopy.sessionIndex,workspaces: autoCopy.workspaces,@@ -474,21 +475,61 @@ function getAutoCopyRules(dataDir, uid) {const index = config.sessionIndex[sourceUid] || {};const sessionIds = [];const lineages = {};+ const allLineages = {};for (const sessionId of Object.keys(index)) {const lineageId = index[sessionId];const lineage = config.sessions[lineageId];+ if (lineage) allLineages[sessionId] = lineageId;if (lineage && lineage.enabled !== false) {sessionIds.push(sessionId);lineages[sessionId] = lineageId;}}return {+ allSessions: config.allSessions === true,sessionIds,lineages,+ allLineages,workspaces: Object.keys(config.workspaces),};}+// A lineage represents one logical session per account. Older copies can+// leave multiple physical rows indexed under the same lineage; keep the first+// row (the SQL callers order newest activity first) for plans and UI counts.+function dedupeAutoCopySessionRows(rows, lineagesByUid) {+ if (!Array.isArray(rows)) return [];+ const seen = new Set();+ return rows.filter((row) => {+ const uid = String(row && row.user_id || '').trim();+ const id = String(row && row.id || '').trim();+ const lineageId = lineagesByUid && lineagesByUid[uid] && lineagesByUid[uid][id];+ if (!lineageId) return true;+ const key = uid + '::' + String(lineageId);+ if (seen.has(key)) return false;+ seen.add(key);+ return true;+ });+}++function setAutoCopyAllSessions(dataDir, enabled) {+ const meta = readMeta(dataDir);+ const config = ensureAutoCopyMeta(meta);+ config.allSessions = enabled === true;+ writeMeta(dataDir, meta);+ return { allSessions: config.allSessions };+}++function isAutoCopySessionSelected(rules, session) {+ if (rules && rules.allSessions === true) return true;+ const sessionId = String(session && session.id || '');+ const workspace = canonicalWorkspace(session && session.cwd);+ const sessionIds = rules && Array.isArray(rules.sessionIds) ? rules.sessionIds : [];+ const workspaces = rules && Array.isArray(rules.workspaces) ? rules.workspaces : [];+ return sessionIds.some((id) => String(id) === sessionId)+ || workspaces.some((cwd) => canonicalWorkspace(cwd) === workspace);+}+function setAutoCopyRule(dataDir, { uid, kind, key, enabled }) {const sourceUid = String(uid || '').trim();if (kind !== 'session' && kind !== 'workspace') throw new Error('无效的自动复制规则类型');@@ -599,22 +640,71 @@ function selectLatestAutoCopyMember(members) {return best ? members[best.memberIndex] : null;}-function ensureAutoCopySession(dataDir, uid, sessionId) {+function ensureAutoCopySessions(dataDir, uid, sessionIds, options) {const meta = readMeta(dataDir);const config = ensureAutoCopyMeta(meta);const sourceUid = String(uid || '').trim();- const id = String(sessionId || '').trim();- if (!sourceUid || !id) throw new Error('缺少共享会话标识');+ const ids = Array.from(new Set((Array.isArray(sessionIds) ? sessionIds : [sessionIds])+ .map((id) => String(id || '').trim())+ .filter(Boolean)));+ if (!sourceUid || !ids.length) throw new Error('缺少共享会话标识');if (!config.sessionIndex[sourceUid]) config.sessionIndex[sourceUid] = {};- let lineageId = config.sessionIndex[sourceUid][id];- if (!lineageId || !config.sessions[lineageId]) {- lineageId = crypto.randomUUID();- config.sessions[lineageId] = { enabled: true, members: [], createdAt: Date.now() };- config.sessionIndex[sourceUid][id] = lineageId;- }- addLineageMember(config.sessions[lineageId], sourceUid, id);+ const lineages = {};+ ids.forEach((id) => {+ let lineageId = config.sessionIndex[sourceUid][id];+ if (!lineageId || !config.sessions[lineageId]) {+ lineageId = crypto.randomUUID();+ config.sessions[lineageId] = { enabled: !(options && options.enabled === false), members: [], createdAt: Date.now() };+ config.sessionIndex[sourceUid][id] = lineageId;+ }+ addLineageMember(config.sessions[lineageId], sourceUid, id);+ lineages[id] = lineageId;+ });writeMeta(dataDir, meta);- return lineageId;+ return lineages;+}++function ensureAutoCopySession(dataDir, uid, sessionId, options) {+ const id = String(sessionId || '').trim();+ if (!id) throw new Error('缺少共享会话标识');+ return ensureAutoCopySessions(dataDir, uid, [id], options)[id];+}++// Keep the core lineage invariant: one physical session per account in each+// lineage. Older copy jobs could append a second session for the same account+// when a mapping was stale. Preserve every physical row, but move duplicates+// to their own lineage so the next all-session reconciliation can pair them.+function normalizeAutoCopyLineages(dataDir) {+ const meta = readMeta(dataDir);+ const config = ensureAutoCopyMeta(meta);+ let changed = false;+ for (const lineageId of Object.keys(config.sessions)) {+ const lineage = config.sessions[lineageId];+ if (!lineage || !Array.isArray(lineage.members)) continue;+ const seenUids = new Set();+ const kept = [];+ for (const member of lineage.members) {+ const uid = String(member && member.uid || '').trim();+ const id = String(member && member.id || '').trim();+ if (!uid || !id || !seenUids.has(uid)) {+ if (uid) seenUids.add(uid);+ kept.push(member);+ continue;+ }+ const replacementId = crypto.randomUUID();+ config.sessions[replacementId] = {+ enabled: lineage.enabled !== false,+ members: [{ uid, id }],+ createdAt: Date.now(),+ };+ if (!config.sessionIndex[uid]) config.sessionIndex[uid] = {};+ config.sessionIndex[uid][id] = replacementId;+ changed = true;+ }+ if (kept.length !== lineage.members.length) lineage.members = kept;+ }+ if (changed) writeMeta(dataDir, meta);+ return changed;}function addAutoCopySessionMember(dataDir, lineageId, uid, sessionId) {@@ -1086,12 +1176,17 @@ module.exports = {updateMeta,canonicalWorkspace,getAutoCopyRules,+ dedupeAutoCopySessionRows,setAutoCopyRule,+ setAutoCopyAllSessions,+ isAutoCopySessionSelected,getAutoCopySession,getAutoCopySessionMembers,getAutoCopySessionMemberRecords,selectLatestAutoCopyMember,+ ensureAutoCopySessions,ensureAutoCopySession,+ normalizeAutoCopyLineages,addAutoCopySessionMember,removeAutoCopySessionMember,moveAutoCopySession,diff --git a/scripts/profiles.js b/scripts/profiles.jsindex 8789449..2c99faa 100644--- a/scripts/profiles.js+++ b/scripts/profiles.js@@ -88,7 +88,7 @@ function applyWorkBuddyTarget(profile, target) {configuredTarget: true,customTarget: false,targetVersion: target.version || '',- lockTargetVersion: target.lockVersion === true,+ lockTargetVersion: false,};}return {@@ -106,7 +106,7 @@ function applyWorkBuddyTarget(profile, target) {configuredTarget: true,customTarget: true,targetVersion: target.version || '',- lockTargetVersion: target.lockVersion === true,+ lockTargetVersion: false,};}diff --git a/scripts/theme-patches.js b/scripts/theme-patches.jsindex 2dde512..a89f2b4 100644--- a/scripts/theme-patches.js+++ b/scripts/theme-patches.js@@ -472,6 +472,11 @@ module.exports = [desc: '代码块头部(cr-code-like-box__header)背景半透明(用户 08-30 01:16):官方硬编码 rgb(20,21,24) 不透明 → 32% 主题深色底(比容器略深形成层次,无独立 blur 透出容器毛玻璃)',css: 'body[data-vscode-theme-name] .cr-code-like-box__header{background:color-mix(in srgb,var(--wb-bg-primary) 32%,transparent) !important;background-color:color-mix(in srgb,var(--wb-bg-primary) 32%,transparent) !important;border-color:var(--wb-border-subtle) !important;}',},+ {+ id: 'patch-99',+ desc: 'WorkBuddy 主题会话 widget 卡片(.cr-widget-card)使用主题毛玻璃,标题(.cr-widget-header)改为半透明以透出卡片层次',+ css: 'body[data-vscode-theme-name] .cr-widget-card{background:color-mix(in srgb,var(--wb-bg-primary) 42%,transparent) !important;background-color:color-mix(in srgb,var(--wb-bg-primary) 42%,transparent) !important;backdrop-filter:blur(18px) saturate(1.15) !important;-webkit-backdrop-filter:blur(18px) saturate(1.15) !important;border-color:var(--wb-border-subtle) !important;}body[data-vscode-theme-name] .cr-widget-header{background:color-mix(in srgb,var(--wb-bg-primary) 30%,transparent) !important;background-color:color-mix(in srgb,var(--wb-bg-primary) 30%,transparent) !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important;border-color:var(--wb-border-subtle) !important;}',+ },/* 原 patch-82(AI 端快捷短语弹层 z-index 抬升)已移入 inject.js 常驻样式:theme-patches 仅在非默认主题时注入,默认浅色主题下会失效;层级修复不依赖主题,随注入脚本常驻更可靠。 */];diff --git a/scripts/win-launcher.js b/scripts/win-launcher.jsindex 4b980be..d3d8be5 100644--- a/scripts/win-launcher.js+++ b/scripts/win-launcher.js@@ -1113,7 +1113,10 @@ function launchWorkBuddy(wb) {? { ...process.env, WORKBUDDY_REMOTE_DEBUGGING_PORT: String(CDP_PORT) }: process.env;const child = spawn(wb, args, {- cwd: path.dirname(wb), detached: true, stdio: 'ignore', windowsHide: true, env,+ // WorkBuddy 是 GUI 程序:windowsHide:true 会把 STARTUPINFO 的 wShowWindow 置为 SW_HIDE,+ // 新版 Electron 主窗口显示走 ShowWindow(SW_SHOWDEFAULT) 会继承该值,导致主窗口隐藏启动、+ // 只剩托盘图标。windowsHide 只应用于控制台子进程防黑窗。+ cwd: path.dirname(wb), detached: true, stdio: 'ignore', windowsHide: false, env,});const state = { method: 'node-spawn', pid: Number.isSafeInteger(child.pid) ? child.pid : null, errorCode: null, exitCode: null, signal: null };child.on('error', (e) => {@@ -1261,28 +1264,6 @@ function runNativeHelper(args, options = {}) {return result;}-function comparableVersion(value) {- const parts = String(value || '').trim().split('.').map((part) => Number(part));- if (!parts.length || parts.some((part) => !Number.isInteger(part) || part < 0)) return '';- while (parts.length > 2 && parts[parts.length - 1] === 0) parts.pop();- return parts.join('.');-}--function nativeFileVersion(binary) {- const result = runNativeHelper(['--file-version', '--binary', binary], { timeout: 10000 });- if (result.status !== 0) return '';- return String(result.stdout || '').trim();-}--function verifyConfiguredWorkBuddyVersion(binary) {- if (!PROFILE.configuredTarget || !PROFILE.lockTargetVersion || !PROFILE.targetVersion) return;- const actual = nativeFileVersion(binary);- if (!actual) throw new Error('无法读取所选 WorkBuddy 的版本,已停止启动;请重新运行 WorkDaddy 安装程序确认客户端路径');- if (comparableVersion(actual) !== comparableVersion(PROFILE.targetVersion)) {- throw new Error(`所选 WorkBuddy 版本已变化(期望 ${PROFILE.targetVersion},实际 ${actual}),请重新运行 WorkDaddy 安装程序确认新版本`);- }-}-let nativeDiscoveryState = null;let nativeWatchdogAttempts = [];let nativeLaunchState = null;@@ -1412,7 +1393,8 @@ function findWorkBuddyNative() {try {if (!fs.statSync(item.path).isFile()) continue;if (!PROFILE_BINARY_NAMES.has(path.win32.basename(item.path).toLowerCase())) continue;- if (PROFILE.customTarget && !sameWindowsPath(path.win32.dirname(item.path), path.win32.dirname(PROFILE.appPath))) continue;+ if (PROFILE.configuredTarget &&+ !sameWindowsPath(path.win32.dirname(item.path), path.win32.dirname(PROFILE.appPath))) continue;summary.validCandidateCount += 1;summary.selectedSource = item.source;summary.completed = true;@@ -1640,7 +1622,6 @@ async function nativeStartupMain() {await configureCdpPort();await configureUiPort();- verifyConfiguredWorkBuddyVersion(PROFILE.appPath);let wb = null;if (!(await isWorkBuddyCdp())) {wb = findWorkBuddyNative();diff --git a/scripts/workbuddy-compat.js b/scripts/workbuddy-compat.jsindex 3aca287..45d1d9e 100644--- a/scripts/workbuddy-compat.js+++ b/scripts/workbuddy-compat.js@@ -52,16 +52,17 @@function findMessageNavigationSurface(doc) {if (!doc || typeof doc.querySelector !== 'function') return null;try {- var scrollElement = doc.querySelector('.cr-message-list');- var viewportElement = doc.querySelector('.cr-message-list-viewport');- var contentElement = doc.querySelector('.cr-message-list__content');- var conversationElement = doc.querySelector('.cr-document[data-root-id]');- if (!scrollElement || !viewportElement || !contentElement || !conversationElement) return null;+ // WorkBuddy keeps this host stable across renderer layout revisions. The+ // nested viewport/content/document classes are implementation details and+ // may disappear even while the message list remains mounted.+ var messageList = doc.querySelector('div.cr-message-list');+ if (!messageList) return null;+ var viewportElement = messageList.parentElement || messageList;return {- scrollElement: scrollElement,+ scrollElement: messageList,viewportElement: viewportElement,- contentElement: contentElement,- conversationElement: conversationElement,+ contentElement: messageList,+ conversationElement: messageList,};} catch (_) {return null;@@ -176,7 +177,9 @@return !!value && typeof value === 'object' && value.conversationId &&value.messageStore && typeof value.messageStore.getState === 'function' &&typeof value.messageStore.subscribe === 'function' &&- typeof value.getMessagesViewState === 'function';+ (typeof value.getMessagesViewState === 'function' ||+ typeof value.getSessionViewState === 'function' ||+ typeof value.getMessageStore === 'function');}function isMessageNavigationHandle(value) {diff --git a/scripts/workbuddy-target.js b/scripts/workbuddy-target.jsindex 0471543..9f77377 100644--- a/scripts/workbuddy-target.js+++ b/scripts/workbuddy-target.js@@ -101,7 +101,9 @@ function validateTarget(target, options = {}) {profileId,binary,...(version ? { version } : {}),- lockVersion: target.lockVersion !== false && !!version,+ // WorkBuddy updates replace the executable in place. The installation+ // path is the stable identity; never block startup on a recorded version.+ lockVersion: false,processNames: uniqueProcessNames,...(target.dataRoot ? { dataRoot: clean(target.dataRoot) } : {}),...(target.authFile ? { authFile: clean(target.authFile) } : {}),@@ -190,7 +192,7 @@ function buildTargetFromBinary(options = {}) {profileId,binary,version: clean(options.version),- lockVersion: !!clean(options.version),+ lockVersion: false,processNames,dataRoot,...(authFile ? { authFile } : {}),@@ -219,7 +221,7 @@ function buildOfficialTargetFromBinary(options = {}) {profileId,binary,version: clean(options.version),- lockVersion: !!clean(options.version),+ lockVersion: false,processNames: [pathApi.basename(binary)],targetHints: [],cdp: { mode: 'argument', port: profileId === 'workbuddy-ai' ? 9223 : 9222 },diff --git a/test/auto-copy-rules.test.js b/test/auto-copy-rules.test.jsindex 44fa626..9f3362b 100644--- a/test/auto-copy-rules.test.js+++ b/test/auto-copy-rules.test.js@@ -12,7 +12,13 @@ const {canonicalWorkspace,getAutoCopyRules,setAutoCopyRule,+ setAutoCopyAllSessions,+ isAutoCopySessionSelected,+ dedupeAutoCopySessionRows,getAutoCopySession,+ ensureAutoCopySession,+ ensureAutoCopySessions,+ normalizeAutoCopyLineages,getAutoCopySessionMembers,addAutoCopySessionMember,removeAutoCopySessionMember,@@ -151,6 +157,79 @@ test('workspace rules are global across source accounts', () => {assert.deepEqual(getAutoCopyRules(dataDir, 'h').workspaces, []);});+test('copy-all defaults off and never rewrites existing per-session rules', () => {+ const dataDir = tempDataDir();+ setAutoCopyRule(dataDir, { uid: 'source', kind: 'session', key: 'marked-session', enabled: true });++ assert.equal(getAutoCopyRules(dataDir, 'source').allSessions, false);+ assert.equal(setAutoCopyAllSessions(dataDir, true).allSessions, true);+ assert.deepEqual(getAutoCopyRules(dataDir, 'source').sessionIds, ['marked-session']);++ const hiddenLineageId = ensureAutoCopySession(dataDir, 'source', 'unmarked-session', { enabled: false });+ assert.ok(hiddenLineageId);+ assert.deepEqual(getAutoCopyRules(dataDir, 'source').sessionIds, ['marked-session']);++ assert.equal(setAutoCopyAllSessions(dataDir, false).allSessions, false);+ assert.deepEqual(getAutoCopyRules(dataDir, 'source').sessionIds, ['marked-session']);+});++test('copy-all selects newly created unmarked sessions only while the override is enabled', () => {+ const markedRules = {+ allSessions: false,+ sessionIds: ['marked-session'],+ workspaces: ['/Users/h/Marked'],+ };+ const newSession = { id: 'new-session', cwd: '/Users/h/New' };++ assert.equal(isAutoCopySessionSelected(markedRules, newSession), false);+ assert.equal(isAutoCopySessionSelected({ ...markedRules, allSessions: true }, newSession), true);+ assert.equal(isAutoCopySessionSelected(markedRules, { id: 'marked-session', cwd: '/Users/h/New' }), true);+ assert.equal(isAutoCopySessionSelected(markedRules, { id: 'other-session', cwd: '/Users/h/Marked/' }), true);+});++test('copy-all can prepare hidden lineages for a session batch without enabling row markers', () => {+ const dataDir = tempDataDir();+ const lineages = ensureAutoCopySessions(dataDir, 'source', ['new-a', 'new-b', 'new-a'], { enabled: false });++ assert.deepEqual(Object.keys(lineages).sort(), ['new-a', 'new-b']);+ assert.notEqual(lineages['new-a'], lineages['new-b']);+ assert.deepEqual(getAutoCopyRules(dataDir, 'source').sessionIds, []);+});++test('duplicate session rows sharing one lineage collapse per account without deleting rows', () => {+ const rows = [+ { id: 's-new', user_id: 'account-s' },+ { id: 's-old', user_id: 'account-s' },+ { id: 'a-copy', user_id: 'account-a' },+ { id: 'unmarked', user_id: 'account-s' },+ ];+ const lineagesByUid = {+ 'account-s': { 's-new': 'lineage-1', 's-old': 'lineage-1' },+ 'account-a': { 'a-copy': 'lineage-1' },+ };+ assert.deepEqual(dedupeAutoCopySessionRows(rows, lineagesByUid), [+ { id: 's-new', user_id: 'account-s' },+ { id: 'a-copy', user_id: 'account-a' },+ { id: 'unmarked', user_id: 'account-s' },+ ]);+});++test('normalizing lineages separates duplicate physical sessions without deleting them', () => {+ const dataDir = tempDataDir();+ const lineageId = ensureAutoCopySession(dataDir, 'source', 'source-session');+ addAutoCopySessionMember(dataDir, lineageId, 'target', 'target-old');+ addAutoCopySessionMember(dataDir, lineageId, 'target', 'target-new');++ assert.equal(normalizeAutoCopyLineages(dataDir), true);+ const meta = JSON.parse(fs.readFileSync(metaFile(dataDir), 'utf8'));+ const targetLineages = Object.keys(meta.autoCopy.sessions).filter((id) =>+ (meta.autoCopy.sessions[id].members || []).some((member) => member.uid === 'target'));+ assert.equal(targetLineages.length, 2);+ assert.deepEqual(targetLineages.map((id) =>+ meta.autoCopy.sessions[id].members.filter((member) => member.uid === 'target').length), [1, 1]);+ assert.notEqual(meta.autoCopy.sessionIndex.target['target-old'], meta.autoCopy.sessionIndex.target['target-new']);+});+test('long account chains reuse one lineage and clean up without duplicate members', () => {const dataDir = tempDataDir();setAutoCopyRule(dataDir, { uid: 'h', kind: 'session', key: 'session-chain', enabled: true });diff --git a/test/builtin-wallpaper.test.js b/test/builtin-wallpaper.test.jsindex 90ac499..42d1f49 100644--- a/test/builtin-wallpaper.test.js+++ b/test/builtin-wallpaper.test.js@@ -8,7 +8,10 @@ const test = require('node:test');const daemon = fs.readFileSync(path.join(__dirname, '..', 'scripts', 'daemon.js'), 'utf8');const macBuild = fs.readFileSync(path.join(__dirname, '..', 'scripts', 'build-mac-dmg.sh'), 'utf8');const winBuild = fs.readFileSync(path.join(__dirname, '..', 'scripts', 'build-win-zip.sh'), 'utf8');+const winInstaller = fs.readFileSync(path.join(__dirname, '..', 'scripts', 'build-win-installer.ps1'), 'utf8');+const winWorkflow = fs.readFileSync(path.join(__dirname, '..', '.github', 'workflows', 'build-win.yml'), 'utf8');const wallpaperOverride = path.join(__dirname, '..', 'scripts', 'builtin-overrides', 'wallpaper-06.webp');+const builtinDir = path.join(__dirname, '..', 'scripts', 'builtin');test('built-in official wallpapers refresh stale managed copies', () => {const start = daemon.indexOf('function initBuiltinAssets()');@@ -38,3 +41,25 @@ test('release builders stage the tracked wallpaper override as wallpaper 6 and tassert.match(source, /builtin\/nebula\/background\.webp/);}});++test('Windows builds have a tracked full built-in gallery independent of the macOS app shell', () => {+ const wallpapers = fs.readdirSync(path.join(builtinDir, 'wallpapers')).filter((name) => /\.webp$/i.test(name));+ assert.ok(wallpapers.length > 1, 'tracked builtin gallery must contain more than the single override');+ assert.ok(fs.existsSync(path.join(builtinDir, 'nebula', 'theme.json')));+ assert.match(winBuild, /BUILTIN_SRC=\"\$DIR\/scripts\/builtin\"/);+});++test('Windows packaging fails closed when the official wallpaper gallery is unavailable', () => {+ assert.match(winBuild, /BUILTIN_SRC=.*WorkDaddy\.app[\\/]Contents[\\/]Resources[\\/]scripts[\\/]builtin/);+ assert.match(winBuild, /WALLPAPER_COUNT=.*find[\s\S]*builtin\/wallpapers/);+ assert.match(winBuild, /WALLPAPER_COUNT.*-le 0[\s\S]*exit 2/);+ assert.match(winBuild, /nebula[\\/]theme\.json/);+ assert.match(winBuild, /STAGE\/scripts\/builtin\/wallpapers/);+ assert.match(winBuild, /STAGE\/scripts\/builtin\/nebula\/theme\.json/);+ assert.match(winInstaller, /runtime\\node\\node\.exe/);+ assert.match(winInstaller, /\$wallpaperPayload\s*=\s*Join-Path\s+\$builtinPayload\s+'wallpapers'/);+ assert.match(winInstaller, /\$themePayload\s*=\s*Join-Path\s+\$builtinPayload\s+'nebula\\theme\.json'/);+ assert.match(winInstaller, /内置官方壁纸/);+ assert.match(winWorkflow, /::error::缺少内置资产/);+ assert.doesNotMatch(winWorkflow, /警告: 未找到 builtin/);+});diff --git a/test/enterprise-target.test.js b/test/enterprise-target.test.jsindex 771526e..5688f3d 100644--- a/test/enterprise-target.test.js+++ b/test/enterprise-target.test.js@@ -99,6 +99,7 @@ test('custom target persists outside the install and overlays only its base profconst { processName, ...targetWithoutLegacyName } = target;assert.deepEqual(persisted, {...targetWithoutLegacyName,+ lockVersion: false,clientType: 'enterprise',processNames: ['workbuddy-ent.exe'],configured: true,@@ -116,6 +117,7 @@ test('custom target persists outside the install and overlays only its base profassert.equal(profile.capabilities.accounts, true);assert.equal(profile.capabilities.checkin, false);assert.equal(profile.customTarget, true);+ assert.equal(profile.lockTargetVersion, false);assert.deepEqual(getProfile('workbuddy-ai', { dataDir, env: {}, platform: 'win32' }), PROFILES['workbuddy-ai']);removeWorkBuddyTarget({ dataDir });@@ -172,6 +174,7 @@ test('selecting the official executable pins its path without changing officialassert.equal(profile.appPath, 'D:\\Portable\\WorkBuddy.exe');assert.equal(profile.configuredTarget, true);assert.equal(profile.customTarget, false);+ assert.equal(profile.lockTargetVersion, false);assert.equal(profile.cdp.mode, 'argument');assert.equal(profile.apiHost, PROFILES['workbuddy-cn'].apiHost);assert.equal(profile.authFile, PROFILES['workbuddy-cn'].authFile);@@ -295,6 +298,6 @@ test('the existing Windows installer owns the single client selection flow', ()assert.doesNotMatch(inject, /wbs-client-target|选择其他 WorkBuddy 客户端|恢复自动识别/);assert.match(daemon, /u\.origin === PROFILE\.apiHost/);assert.doesNotMatch(launcher + daemon + native, /\bsetx(?:\.exe)?\b/i);- assert.match(launcher, /所选 WorkBuddy 版本已变化/);- assert.match(launcher, /重新运行 WorkDaddy 安装程序/);+ assert.doesNotMatch(launcher, /verifyConfiguredWorkBuddyVersion|所选 WorkBuddy 版本已变化/);+ assert.match(launcher, /PROFILE\.configuredTarget[\s\S]*sameWindowsPath\(path\.win32\.dirname\(item\.path\), path\.win32\.dirname\(PROFILE\.appPath\)\)/);});diff --git a/test/growth-active.test.js b/test/growth-active.test.jsnew file mode 100644index 0000000..a8c112e--- /dev/null+++ b/test/growth-active.test.js@@ -0,0 +1,156 @@+'use strict';++const assert = require('node:assert/strict');+const test = require('node:test');+const { fetchGrowthTodayActive, activateGrowthAccount } = require('../scripts/growth-active.js');++function mockFetch(payload, { ok = true, status = 200 } = {}) {+ const text = typeof payload === 'string' ? payload : JSON.stringify(payload);+ return async () => ({ ok, status, text: async () => text });+}++function jsonResponse(payload, { ok = true, status = 200, headers = {} } = {}) {+ const responseHeaders = Object.assign({ 'content-type': 'application/json' }, headers);+ return {+ ok,+ status,+ headers: { get: (name) => responseHeaders[String(name).toLowerCase()] || null },+ text: async () => JSON.stringify(payload),+ json: async () => payload,+ };+}++test('返回今日活跃 true 与今日字段', async () => {+ const today = { date: '2026-09-01', score: 106, is_active: true, status_text: '今日已活跃' };+ const r = await fetchGrowthTodayActive('tok', {+ fetchImpl: mockFetch({ code: 0, msg: 'OK', data: { today } }),+ });+ assert.deepEqual(r, { is_active: true, date: '2026-09-01', score: 106, status_text: '今日已活跃' });+});++test('is_active=false 返回 false,缺省字段归 null/空', async () => {+ const r = await fetchGrowthTodayActive('tok', {+ fetchImpl: mockFetch({ code: 0, data: { today: { date: '2026-09-01', is_active: false } } }),+ });+ assert.equal(r.is_active, false);+ assert.equal(r.score, null);+ assert.equal(r.status_text, '');+});++test('code 非 0 抛错', async () => {+ await assert.rejects(+ fetchGrowthTodayActive('tok', { fetchImpl: mockFetch({ code: 401, msg: '未授权' }) }),+ /未授权/+ );+});++test('HTTP 非 ok 抛错', async () => {+ await assert.rejects(+ fetchGrowthTodayActive('tok', { fetchImpl: mockFetch('{}', { ok: false, status: 500 }) }),+ /HTTP 500/+ );+});++test('无法解析的 JSON 抛错', async () => {+ await assert.rejects(+ fetchGrowthTodayActive('tok', { fetchImpl: mockFetch('not-json') }),+ /无法解析/+ );+});++test('缺 data.today 抛错', async () => {+ await assert.rejects(+ fetchGrowthTodayActive('tok', { fetchImpl: mockFetch({ code: 0, data: {} }) }),+ /缺少 data\.today/+ );+});++test('缺 accessToken 抛错', async () => {+ await assert.rejects(+ fetchGrowthTodayActive('', { fetchImpl: mockFetch({ code: 0 }) }),+ /参数不完整/+ );+});++test('独立会话活跃流程不依赖当前 renderer,按 create/session/ACP 顺序发送', async () => {+ const calls = [];+ const fetchImpl = async (url, init = {}) => {+ calls.push({+ url,+ method: init.method || 'GET',+ body: init.body || null,+ authorization: init.headers && init.headers.authorization,+ requestHeader: init.headers && init.headers['x-codebuddy-request'],+ });+ if (url.endsWith('/console/as/conversations/')) {+ return jsonResponse({ code: 0, data: { id: 'conv-test' } });+ }+ if (url.endsWith('/console/as/conversations/conv-test/session')) {+ return jsonResponse({ code: 0, data: { sessionId: 'session-test', link: 'https://acp.test/api/v1/acp', token: 'runtime-token' } });+ }+ if (url === 'https://acp.test/api/v1/acp' && (init.method || 'GET') === 'GET') {+ return jsonResponse({}, { headers: { 'acp-connection-id': 'connection-test' } });+ }+ if (url === 'https://acp.test/api/v1/acp' && init.method === 'POST') {+ const request = JSON.parse(init.body);+ const result = request.method === 'initialize' ? { protocolVersion: 1 } : { stopReason: 'end_turn' };+ return jsonResponse({ jsonrpc: '2.0', id: request.id, result });+ }+ if (url === 'https://acp.test/api/v1/acp' && init.method === 'DELETE') return jsonResponse({});+ throw new Error(`unexpected URL: ${url}`);+ };+ const result = await activateGrowthAccount('account-token', { apiHost: 'https://api.test', fetchImpl, timeoutMs: 1000 });+ assert.deepEqual(result, { conversationId: 'conv-test', sessionId: 'session-test', stopReason: 'end_turn' });+ assert.deepEqual(calls.map((call) => `${call.method} ${call.url}`), [+ 'POST https://api.test/console/as/conversations/',+ 'GET https://api.test/console/as/conversations/conv-test/session',+ 'GET https://acp.test/api/v1/acp',+ 'POST https://acp.test/api/v1/acp',+ 'POST https://acp.test/api/v1/acp',+ 'DELETE https://acp.test/api/v1/acp',+ ]);+ assert.equal(calls[0].authorization, 'Bearer account-token');+ assert.equal(calls[2].authorization, 'Bearer runtime-token');+ assert.equal(calls[2].requestHeader, '1');+ assert.equal(calls[3].requestHeader, '1');+ assert.deepEqual(JSON.parse(calls[3].body).params.clientInfo, {+ name: 'workdaddy-growth',+ version: '1.1.31',+ });+ assert.deepEqual(JSON.parse(calls[4].body).params, {+ sessionId: 'session-test',+ prompt: [{ type: 'text', text: '你好' }],+ });+});++test('独立会话结束时会中止长连接 SSE,不会卡在清理阶段', async () => {+ let sseAborted = false;+ const fetchImpl = async (url, init = {}) => {+ if (url.endsWith('/console/as/conversations/')) return jsonResponse({ data: { id: 'conv-test' } });+ if (url.endsWith('/console/as/conversations/conv-test/session')) {+ return jsonResponse({ data: { sessionId: 'session-test', link: 'https://acp.test', token: 'runtime-token' } });+ }+ if (url === 'https://acp.test/api/v1/acp' && (init.method || 'GET') === 'GET') {+ return {+ ...jsonResponse({}, { headers: { 'acp-connection-id': 'connection-test' } }),+ body: {+ getReader: () => ({+ read: () => new Promise((resolve) => init.signal.addEventListener('abort', () => {+ sseAborted = true;+ resolve({ done: true });+ }, { once: true })),+ releaseLock: () => {},+ }),+ },+ };+ }+ if (url === 'https://acp.test/api/v1/acp' && init.method === 'POST') {+ const request = JSON.parse(init.body);+ return jsonResponse({ jsonrpc: '2.0', id: request.id, result: {} });+ }+ if (url === 'https://acp.test/api/v1/acp' && init.method === 'DELETE') return jsonResponse({});+ throw new Error(`unexpected URL: ${url}`);+ };+ await activateGrowthAccount('account-token', { apiHost: 'https://api.test', fetchImpl, timeoutMs: 1000 });+ assert.equal(sseAborted, true);+});diff --git a/test/message-navigation.test.js b/test/message-navigation.test.jsindex 97a06e9..86dcb8c 100644--- a/test/message-navigation.test.js+++ b/test/message-navigation.test.js@@ -7,23 +7,23 @@ const test = require('node:test');const compat = require('../scripts/workbuddy-compat.js');-test('modern conversation surface is discovered without treating mounted virtual items as the message source', () => {- const conversationElement = { name: 'conversation' };- const scrollElement = { name: 'scroll' };- const viewportElement = { name: 'viewport' };- const contentElement = { name: 'content' };+test('message navigation uses cr-message-list as the single stable surface seam', () => {+ const viewport = { name: 'viewport' };+ const messageList = { name: 'message-list', parentElement: viewport };const documentLike = {querySelector(selector) {- if (selector === '.cr-message-list') return scrollElement;- if (selector === '.cr-message-list-viewport') return viewportElement;- if (selector === '.cr-message-list__content') return contentElement;- if (selector === '.cr-document[data-root-id]') return conversationElement;+ if (selector === 'div.cr-message-list') return messageList;return null;},};const surface = compat.findMessageNavigationSurface(documentLike);- assert.deepEqual(surface, { scrollElement, viewportElement, contentElement, conversationElement });+ assert.deepEqual(surface, {+ scrollElement: messageList,+ viewportElement: viewport,+ contentElement: messageList,+ conversationElement: messageList,+ });});test('all navigation turns are built from the structured message store regardless of DOM virtualization', () => {@@ -81,10 +81,7 @@ test('message navigation adapter discovers the complete store and official virtuconst contentElement = {};const documentLike = {querySelector(selector) {- if (selector === '.cr-message-list') return scrollElement;- if (selector === '.cr-message-list-viewport') return viewportElement;- if (selector === '.cr-message-list__content') return contentElement;- if (selector === '.cr-document[data-root-id]') return conversationElement;+ if (selector === 'div.cr-message-list') return scrollElement;return null;},};@@ -126,7 +123,7 @@ test('injected navigation rail is theme-aware, glassy, accessible, and profile aassert.doesNotMatch(navigationSource, /WBS_PROFILE_IS_AI|PROFILE_ID/);assert.doesNotMatch(navigationSource, /scrollIntoView/);assert.match(navigationSource, /scrollToMessage\(turn\.messageId, \{ behavior: 'auto'/);- assert.match(navigationSource, /surface\.scrollElement\.getBoundingClientRect\(\)/);+ assert.match(navigationSource, /surface\.viewportElement\.getBoundingClientRect\(\)/);assert.match(navigationSource, /rect\.left \+ 12/);assert.doesNotMatch(navigationSource, /rect\.height \* 0\.7|420/);assert.match(navigationSource, /Math\.min\(desiredRailHeight, rect\.height\)/);@@ -143,6 +140,7 @@ test('injected navigation rail is theme-aware, glassy, accessible, and profile aassert.match(inject, /localStorage\.getItem\(MESSAGE_NAV_ENABLED_KEY\) !== '0'/);assert.match(navigationSource, /function setEnabled\(enabled\)/);assert.match(inject, /messageNavigation\.setEnabled\(sessState\.messageNav\)/);+ assert.match(inject, /mount = surface && surface\.viewportElement/);const stashSwitch = inject.indexOf('id="wbs-sess-stash"');const navigationSwitch = inject.indexOf('id="wbs-sess-message-nav"');diff --git a/test/theme-blur.test.js b/test/theme-blur.test.jsnew file mode 100644index 0000000..96ae02c--- /dev/null+++ b/test/theme-blur.test.js@@ -0,0 +1,40 @@+const test = require('node:test');+const assert = require('node:assert/strict');+const fs = require('node:fs');+const path = require('node:path');++const daemon = fs.readFileSync(path.join(__dirname, '..', 'scripts', 'daemon.js'), 'utf8');+const inject = fs.readFileSync(path.join(__dirname, '..', 'scripts', 'inject.js'), 'utf8');++test('background blur persists as a normalized setting and is applied to the theme surface', () => {+ assert.match(daemon, /BACKGROUND_BLUR_FILE = path\.join\(DATA_DIR, 'background-blur\.json'\)/);+ assert.match(daemon, /MAX_BACKGROUND_BLUR_PX = 32/);+ assert.match(daemon, /p === '\/api\/blur'/);+ assert.match(daemon, /JSON\.stringify\(\{ blur \}, null, 2\)/);+ assert.match(daemon, /Math\.min\(1, Math\.max\(0, parseFloat\(body && body\.blur\)\)\)/);+ assert.match(daemon, /backdrop-filter:blur\(' \+ blurPx \+ 'px\)/);+ assert.match(daemon, /backdrop-filter:none;-webkit-backdrop-filter:none/);+});++test('theme pane exposes a percentage blur slider and syncs it with the daemon', () => {+ assert.match(inject, /id="wbs-bg-blur-range" min="0" max="100" step="1" value="0"/);+ assert.match(inject, /id="wbs-bg-blur-val">0%/);+ assert.match(inject, /api\('\/api\/blur'\)/);+ assert.match(inject, /JSON\.stringify\(\{ blur: pct \/ 100 \}\)/);+});++test('theme pane keeps avatar controls visible and gates wallpaper controls to WorkDaddy theme', () => {+ assert.doesNotMatch(inject, /背景与头像/);+ assert.match(inject, /wbs-avatar-card/);+ assert.match(inject, /<div class="wbs-pcard wbs-wallpaper-card" id="wbs-wallpaper-card" style="display:none">/);+ assert.match(inject, /function syncWallpaperCardVisibility\(themeId\)/);+ assert.match(inject, /var visible = themeId === 'nebula'/);+ assert.match(inject, /syncWallpaperCardVisibility\(id\)/);+ assert.match(inject, /syncWallpaperCardVisibility\(cur\)/);+});++test('theme pane uses the requested WorkDaddy and blur labels', () => {+ assert.match(inject, /data-theme="nebula">' \+ WBS_BRAND \+ ' 主题<\/button>/);+ assert.doesNotMatch(inject, /背景毛玻璃<span class="wbs-blur-hint">0% 不调节背景图<\/span>/);+ assert.match(inject, /<label class="wbs-blur-label" for="wbs-bg-blur-range">背景毛玻璃<\/label>/);+});diff --git a/test/theme-patches.test.js b/test/theme-patches.test.jsindex 2d639e0..ee8951b 100644--- a/test/theme-patches.test.js+++ b/test/theme-patches.test.js@@ -15,3 +15,13 @@ test('conversation shell and grouped agent cards use global theme patch rules',assert.match(patch.css, /backdrop-filter:blur\(14px\)/);assert.doesNotMatch(patch.css, /WBS_PROFILE|workbuddy-ai|data-theme="dark"/);});++test('WorkBuddy widget cards use translucent theme surfaces', () => {+ const patch = patches.find((item) => item && item.id === 'patch-99');+ assert.ok(patch, 'patch-99 must be registered');+ assert.match(patch.css, /\.cr-widget-card\{[^}]*background:color-mix/);+ assert.match(patch.css, /\.cr-widget-card\{[^}]*backdrop-filter:blur\(/);+ assert.match(patch.css, /\.cr-widget-header\{[^}]*background:color-mix/);+ assert.match(patch.css, /\.cr-widget-header\{[^}]*background-color:color-mix/);+ assert.doesNotMatch(patch.css, /WBS_PROFILE|workbuddy-ai/);+});diff --git a/test/update-layout.test.js b/test/update-layout.test.jsindex c2fc54f..b9ea1b3 100644--- a/test/update-layout.test.js+++ b/test/update-layout.test.js@@ -694,6 +694,9 @@ test('account cards keep the compact three-row layout', () => {assert.match(script, /row0\.insertBefore\(stashBtn, row0\.firstChild\)/);assert.match(script, /wbs-credit-hidden/);assert.match(script, /var expired = isIdentityExpired\(a\)/);+ // 账号页暂不展示“发起独立会话保持活跃”入口;daemon 接口保留供内部/后续流程使用。+ assert.doesNotMatch(script, /wbs-growth-activate/);+ assert.doesNotMatch(script, /api\('\/api\/growth\/activate'/);assert.match(script, /expired \? '' : '<button class="wbs-icon-btn wbs-acc-switch"/);assert.match(script, /switchBtn\.style\.display = hidden \? 'none' : ''/);assert.match(script, /height:5px;min-height:5px/);@@ -1023,12 +1026,41 @@ test('automatic session copy includes workspace-only rules when the initial planassert.match(daemon, /startAutoCopyJob\(sourceUid, uid, autoCopyPlan\)/);assert.match(daemon, /syncAutoCopyLineage\(src\.lineageId, targetUid\)/);assert.match(daemon, /selectLatestAutoCopyMember\(live\)/);- assert.match(daemon, /lineageId = ensureAutoCopySession\(DATA_DIR, source, row\.id\)/);+ assert.match(daemon, /ensureAutoCopySessions\(DATA_DIR, source, lineageSessionIds, \{ enabled: !rules\.allSessions \}\)/);assert.match(inject, /data-auto-kind="' \+ kind \+ '"/);assert.match(inject, /autoCopyButton\('workspace'/);assert.match(inject, /autoCopyButton\('session'/);});+test('session copy-all is a separate override with a distinct toggle and hidden row controls', () => {+ const daemon = read('daemon.js');+ const inject = read('inject.js');+ assert.match(daemon, /POST' && p === '\/api\/sessions\/auto-copy-all'/);+ assert.match(daemon, /sourceRules\.allSessions/);+ assert.match(inject, /id="wbs-sess-auto-all"/);+ assert.match(inject, /id="wbs-sess-import"[\s\S]*id="wbs-sess-auto-all"/);+ assert.match(inject, /id="wbs-sess-auto-all"[^>]*role="checkbox"[^>]*aria-checked="false"/);+ assert.match(inject, /wbs-sess-auto-all-box/);+ assert.match(inject, /getAttribute\('aria-checked'\)/);+ assert.match(inject, /\.wbs-sess-auto-all\{display:inline-flex/);+ assert.doesNotMatch(inject, /wbs-sess-auto-all-switch/);+ assert.match(inject, /自动复制所有会话/);+ assert.match(inject, /sessionsState\.autoCopyAll/);+ assert.match(inject, /if \(sessionsState\.autoCopyAll \|\| !canEditAutoCopy\(uid\)\) return ''/);+ assert.match(inject, /\/api\/sessions\/auto-copy-all/);+ assert.match(inject, /\.wbs-sess-summary-tag\{[^}]*border:0[^}]*background:transparent/);+});++test('session auto-copy plans and API responses collapse duplicate rows by account lineage', () => {+ const daemon = read('daemon.js');+ const lib = read('lib.js');+ assert.match(lib, /function dedupeAutoCopySessionRows\(rows, lineagesByUid\)/);+ assert.match(lib, /const allLineages = \{\}/);+ assert.match(daemon, /dedupeAutoCopySessionRows\(rows, \{ \[source\]: rules\.allLineages \}\)/);+ assert.match(daemon, /dedupeAutoCopySessionRows\(rows, lineagesByUid\)/);+ assert.match(daemon, /const DAEMON_VERSION = '\d+\.\d+\.\d+'/);+});+test('session summary counts effective sessions and models tab only exposes sanitized model APIs', () => {const daemon = read('daemon.js');const inject = read('inject.js');diff --git a/test/windows-native-flow.test.js b/test/windows-native-flow.test.jsindex 53eb1e9..c98a653 100644--- a/test/windows-native-flow.test.js+++ b/test/windows-native-flow.test.js@@ -47,6 +47,19 @@ test('normal Windows startup does not use Explorer de-elevation or CIM', () => {assert.doesNotMatch(watchdog, /Get-CimInstance|windows-process-boundary|pending\.json/);});+test('WorkBuddy GUI startup stays visible while the watchdog stays hidden', () => {+ const launcher = read('scripts/win-launcher.js');+ const watchdog = read('scripts/watchdog.js');+ const start = launcher.indexOf('function launchWorkBuddy(wb)');+ const end = launcher.indexOf('\nasync function waitForWorkBuddyCdp', start);+ assert.ok(start >= 0 && end > start);++ const launchBlock = launcher.slice(start, end);+ assert.match(launchBlock, /stdio: 'ignore', windowsHide: false, env/);+ assert.doesNotMatch(launchBlock, /stdio: 'ignore', windowsHide: true, env/);+ assert.match(watchdog, /spawn\(process\.execPath, args, \{ stdio: 'ignore', windowsHide: true/);+});+test('installer waits for the exact profile client with a visible recheck dialog', () => {const installer = read('scripts/win/workdaddy.iss');