🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat(desktop): use Sparkle for all macOS full updates (#19459)
Innei17d9239411e7
diff --git a/.github/actions/business-overlay/action.yml b/.github/actions/business-overlay/action.ymlindex 59a6b4ee3bb..08e58265aba 100644--- a/.github/actions/business-overlay/action.yml+++ b/.github/actions/business-overlay/action.yml@@ -89,6 +89,47 @@ runs:if (skip.has(entry)) continue;copy(path.join(source, entry), path.join(target, entry));}++ const parseAllowBuilds = (text) => {+ const map = {};+ const lines = text.split('\n');+ let inBlock = false;+ for (const line of lines) {+ if (!inBlock) {+ if (/^allowBuilds:\s*$/.test(line)) inBlock = true;+ continue;+ }+ const match = line.match(+ /^(\s+)((?:'[^']+'|"[^"]+"|[A-Za-z0-9@._/-]+)):\s*(true|false)\s*$/,+ );+ if (!match) break;+ map[match[2].replace(/^['"]|['"]$/g, '')] = match[3] === 'true';+ }+ return map;+ };++ const quoteKey = (key) => (/[@:]/.test(key) ? `'${key}'` : key);+ const rootFile = path.join(target, 'pnpm-workspace.yaml');+ const rootText = fs.readFileSync(rootFile, 'utf8');+ const rootMap = parseAllowBuilds(rootText);+ const extras = {};+ for (const rel of ['pnpm-workspace.yaml', 'apps/desktop/pnpm-workspace.yaml']) {+ const extraFile = path.join(process.env.GITHUB_WORKSPACE, rel);+ if (!fs.existsSync(extraFile)) continue;+ Object.assign(extras, parseAllowBuilds(fs.readFileSync(extraFile, 'utf8')));+ }+ const missing = Object.keys(extras)+ .filter((key) => !(key in rootMap))+ .sort();+ if (missing.length > 0) {+ const insert = missing+ .map((key) => ` ${quoteKey(key)}: ${extras[key]}\n`)+ .join('');+ if (!/^allowBuilds:\n/m.test(rootText)) {+ throw new Error('overlay pnpm-workspace.yaml is missing an allowBuilds block');+ }+ fs.writeFileSync(rootFile, rootText.replace(/^allowBuilds:\n/m, `allowBuilds:\n${insert}`));+ }NODEecho "✅ Overlay repository $resolved_overlay_ref applied at $overlay_root"diff --git a/.github/actions/desktop-publish-sparkle/action.yml b/.github/actions/desktop-publish-sparkle/action.ymlnew file mode 100644index 00000000000..9d5e5f44e35--- /dev/null+++ b/.github/actions/desktop-publish-sparkle/action.yml@@ -0,0 +1,157 @@+name: Desktop Publish Sparkle Appcast+description: Generate, sign and upload the macOS Sparkle appcast and delta patches for a published release++inputs:+ channel:+ description: 'Update channel (stable or canary)'+ required: true+ version:+ description: 'Release version (e.g., 2.1.29-canary.1)'+ required: true+ server-url:+ description: 'Public update server base URL (UPDATE_SERVER_URL)'+ required: true+ ed-private-key:+ description: 'Sparkle EdDSA private key value'+ required: true+ default: ''+ release-notes:+ description: 'Markdown release notes embedded into the appcast item'+ required: false+ default: ''+ delta-bases:+ description: 'Previous releases to generate direct delta patches from'+ required: false+ default: '1'+ delta-history:+ description: 'Previous releases kept in the appcast for delta chains (0-32)'+ required: false+ default: '6'+ sparkle-version:+ description: 'Sparkle release providing generate_appcast and sign_update'+ required: false+ default: '2.9.4'+ sparkle-sha256:+ description: 'Expected sha256 of the Sparkle release tarball'+ required: false+ default: 'ce89daf967db1e1893ed3ebd67575ed82d3902563e3191ca92aaec9164fbdef9'+ aws-access-key-id:+ description: 'AWS access key ID'+ required: true+ aws-secret-access-key:+ description: 'AWS secret access key'+ required: true+ s3-bucket:+ description: 'S3 bucket name'+ required: true+ s3-region:+ description: 'S3 region'+ required: false+ default: 'us-east-1'+ s3-endpoint:+ description: 'Custom S3 endpoint (for R2/MinIO etc.)'+ required: false+ default: ''++runs:+ using: composite+ steps:+ - name: Download merged artifacts+ uses: actions/download-artifact@v7+ with:+ name: merged-release+ path: release++ - name: Check Sparkle publishing is configured+ id: gate+ shell: bash+ env:+ VERSION: ${{ inputs.version }}+ ED_PRIVATE_KEY: ${{ inputs.ed-private-key }}+ S3_BUCKET: ${{ inputs.s3-bucket }}+ SERVER_URL: ${{ inputs.server-url }}+ run: |+ if ! find release -name "*-${VERSION}*-mac.zip" -print -quit | grep -q .; then+ echo "No macOS artifacts in this release; skipping Sparkle appcasts"+ echo "enabled=false" >> "$GITHUB_OUTPUT"+ elif [ -z "$ED_PRIVATE_KEY" ] || [ -z "$S3_BUCKET" ] || [ -z "$SERVER_URL" ]; then+ echo "::error::Sparkle publishing requires SPARKLE_ED_PRIVATE_KEY, S3 bucket and UPDATE_SERVER_URL"+ exit 1+ else+ echo "enabled=true" >> "$GITHUB_OUTPUT"+ fi++ - name: Fetch Sparkle tools+ if: steps.gate.outputs.enabled == 'true'+ shell: bash+ env:+ SPARKLE_VERSION: ${{ inputs.sparkle-version }}+ SPARKLE_TARBALL_SHA256: ${{ inputs.sparkle-sha256 }}+ run: |+ set -euo pipefail+ TOOLS_DIR="$RUNNER_TEMP/sparkle-tools"+ TARBALL="$RUNNER_TEMP/sparkle.tar.xz"+ curl -sSL --retry 3 -o "$TARBALL" \+ "https://github.com/sparkle-project/Sparkle/releases/download/${SPARKLE_VERSION}/Sparkle-${SPARKLE_VERSION}.tar.xz"+ echo "${SPARKLE_TARBALL_SHA256} $TARBALL" | shasum -a 256 -c -+ mkdir -p "$TOOLS_DIR"+ tar -xf "$TARBALL" -C "$TOOLS_DIR" bin/+ chmod +x "$TOOLS_DIR"/bin/*+ echo "SPARKLE_BIN=$TOOLS_DIR/bin" >> "$GITHUB_ENV"++ - name: Fetch appcast history tooling from electron-sparkle-updater+ if: steps.gate.outputs.enabled == 'true'+ shell: bash+ run: |+ set -euo pipefail+ SPEC=$(node -p "require('./apps/desktop/package.json').dependencies['electron-sparkle-updater']")+ PKG_DIR="$RUNNER_TEMP/electron-sparkle-updater"+ mkdir -p "$PKG_DIR"+ cd "$PKG_DIR"+ TARBALL=$(npm pack "electron-sparkle-updater@${SPEC}" --silent)+ tar -xzf "$TARBALL" package/native/scripts/appcast-history.py+ echo "SPARKLE_HISTORY_SCRIPT=$PKG_DIR/package/native/scripts/appcast-history.py" >> "$GITHUB_ENV"++ - name: Generate, sign and upload appcasts (EdDSA key lives only on a RAM disk)+ if: steps.gate.outputs.enabled == 'true'+ shell: bash+ env:+ AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }}+ AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }}+ AWS_REGION: ${{ inputs.s3-region }}+ SPARKLE_ED_PRIVATE_KEY: ${{ inputs.ed-private-key }}+ RELEASE_NOTES: ${{ inputs.release-notes }}+ CHANNEL: ${{ inputs.channel }}+ VERSION: ${{ inputs.version }}+ SERVER_URL: ${{ inputs.server-url }}+ S3_BUCKET: ${{ inputs.s3-bucket }}+ S3_ENDPOINT: ${{ inputs.s3-endpoint }}+ DELTA_BASES: ${{ inputs.delta-bases }}+ DELTA_HISTORY: ${{ inputs.delta-history }}+ run: |+ set -euo pipefail+ DEV="$(hdiutil attach -nomount ram://16384 | awk '{print $1}')"+ diskutil erasevolume HFS+ SparkleKeyRAM "$DEV" >/dev/null+ KEY_FILE="/Volumes/SparkleKeyRAM/ed_private_key"+ printf '%s' "$SPARKLE_ED_PRIVATE_KEY" > "$KEY_FILE"++ cleanup() {+ dd if=/dev/urandom of="$KEY_FILE" bs=1024 count=4 conv=notrunc 2>/dev/null || true+ rm -f "$KEY_FILE" || true+ hdiutil detach "$DEV" || true+ }+ trap cleanup EXIT++ node apps/desktop/scripts/sparkleAppcast.mjs \+ --release-dir release \+ --out "$RUNNER_TEMP/sparkle-appcast" \+ --channel "$CHANNEL" \+ --version "$VERSION" \+ --server-url "$SERVER_URL" \+ --bucket "$S3_BUCKET" \+ --endpoint "$S3_ENDPOINT" \+ --key-file "$KEY_FILE" \+ --sparkle-bin "$SPARKLE_BIN" \+ --history-script "$SPARKLE_HISTORY_SCRIPT" \+ --delta-bases "$DELTA_BASES" \+ --delta-history "$DELTA_HISTORY"diff --git a/.github/workflows/manual-build-desktop.yml b/.github/workflows/manual-build-desktop.ymlindex 19f99fb4be4..5556efe0328 100644--- a/.github/workflows/manual-build-desktop.yml+++ b/.github/workflows/manual-build-desktop.yml@@ -125,6 +125,8 @@ jobs:run: npm run desktop:package:appenv:UPDATE_CHANNEL: ${{ inputs.channel }}+ UPDATE_SERVER_URL: ${{ secrets.UPDATE_SERVER_URL }}+ SPARKLE_ED_PUBLIC_KEY: ${{ secrets.SPARKLE_ED_PUBLIC_KEY }}APP_URL: http://localhost:3015DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='diff --git a/.github/workflows/release-desktop-beta.yml b/.github/workflows/release-desktop-beta.ymlindex ea8640dc5b7..d749bb7a799 100644--- a/.github/workflows/release-desktop-beta.yml+++ b/.github/workflows/release-desktop-beta.yml@@ -142,6 +142,7 @@ jobs:UPDATE_CHANNEL: betaUPDATE_SERVER_URL: ${{ secrets.UPDATE_SERVER_URL }}RENDERER_OTA_PUBLIC_KEY: ${{ secrets.RENDERER_OTA_PUBLIC_KEY }}+ SPARKLE_ED_PUBLIC_KEY: ${{ secrets.SPARKLE_ED_PUBLIC_KEY }}CORE_SEQ: ${{ steps.core_seq.outputs.seq }}APP_URL: http://localhost:3015DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'diff --git a/.github/workflows/release-desktop-canary.yml b/.github/workflows/release-desktop-canary.ymlindex c2d43a74951..de5f17d4184 100644--- a/.github/workflows/release-desktop-canary.yml+++ b/.github/workflows/release-desktop-canary.yml@@ -19,6 +19,11 @@ name: Release Desktop Canary# 基于最新 stable tag 的 patch+1, postfix 为递增序号# 格式: X.Y.(Z+1)-canary.N# 例: 当前 tag v2.1.28 → v2.1.29-canary.1, 下次 → v2.1.29-canary.2+#+# macOS Sparkle 试点 (缺少任一 secret 时自动跳过,客户端回退 electron-updater):+# - SPARKLE_ED_PUBLIC_KEY: 打进 Info.plist 的 SUPublicEDKey+# - SPARKLE_ED_PRIVATE_KEY: `generate_keys -x` 导出的 base64 seed,用于签 appcast/delta+# 发布 {channel}/appcast-{arch}.xml 与 {channel}/{version}/*.delta 到 S3# ============================================on:@@ -320,6 +325,7 @@ jobs:UPDATE_SERVER_URL: ${{ secrets.UPDATE_SERVER_URL }}RENDERER_OTA_PUBLIC_KEY: ${{ secrets.RENDERER_OTA_PUBLIC_KEY }}CORE_SEQ: ${{ steps.core_seq.outputs.seq }}+ SPARKLE_ED_PUBLIC_KEY: ${{ secrets.SPARKLE_ED_PUBLIC_KEY }}RELEASE_NOTES: ${{ needs.calculate-version.outputs.release_notes }}APP_URL: http://localhost:3015DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'@@ -523,6 +529,37 @@ jobs:s3-region: ${{ secrets.UPDATE_S3_REGION }}s3-endpoint: ${{ secrets.UPDATE_S3_ENDPOINT }}+ # ============================================+ # 发布 Sparkle appcast + delta(macOS 整包升级)+ # 依赖 publish-s3:appcast 的 enclosure 指向 S3 上已经存在的 zip+ # ============================================+ publish-sparkle:+ needs: [publish-s3, calculate-version]+ name: Publish Sparkle Appcast+ runs-on: macos-15+ steps:+ - name: Checkout repository+ uses: actions/checkout@v6++ - name: Setup Node.js+ uses: actions/setup-node@v6+ with:+ node-version: ${{ env.NODE_VERSION }}+ package-manager-cache: false++ - uses: ./.github/actions/desktop-publish-sparkle+ with:+ channel: canary+ version: ${{ needs.calculate-version.outputs.version }}+ server-url: ${{ secrets.UPDATE_SERVER_URL }}+ ed-private-key: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }}+ release-notes: ${{ needs.calculate-version.outputs.release_notes }}+ aws-access-key-id: ${{ secrets.UPDATE_AWS_ACCESS_KEY_ID }}+ aws-secret-access-key: ${{ secrets.UPDATE_AWS_SECRET_ACCESS_KEY }}+ s3-bucket: ${{ secrets.UPDATE_S3_BUCKET }}+ s3-region: ${{ secrets.UPDATE_S3_REGION }}+ s3-endpoint: ${{ secrets.UPDATE_S3_ENDPOINT }}+# ============================================# 清理旧的 Canary Releases (保留最近 7 个)# ============================================diff --git a/.github/workflows/release-desktop-stable.yml b/.github/workflows/release-desktop-stable.ymlindex 59da291818c..9a33c7454c0 100644--- a/.github/workflows/release-desktop-stable.yml+++ b/.github/workflows/release-desktop-stable.yml@@ -243,6 +243,7 @@ jobs:UPDATE_CHANNEL: stableUPDATE_SERVER_URL: ${{ secrets.UPDATE_SERVER_URL }}RENDERER_OTA_PUBLIC_KEY: ${{ secrets.RENDERER_OTA_PUBLIC_KEY }}+ SPARKLE_ED_PUBLIC_KEY: ${{ secrets.SPARKLE_ED_PUBLIC_KEY }}CORE_SEQ: ${{ steps.core_seq.outputs.seq }}RELEASE_NOTES: ${{ needs.check-stable.outputs.release_notes }}APP_URL: http://localhost:3015@@ -435,3 +436,26 @@ jobs:s3-bucket: ${{ secrets.UPDATE_S3_BUCKET }}s3-region: ${{ secrets.UPDATE_S3_REGION }}s3-endpoint: ${{ secrets.UPDATE_S3_ENDPOINT }}++ publish-sparkle:+ needs: [publish-s3, check-stable]+ name: Publish Sparkle Appcast+ runs-on: macos-15+ steps:+ - uses: actions/checkout@v7+ - uses: actions/setup-node@v6+ with:+ node-version: ${{ env.NODE_VERSION }}+ package-manager-cache: false+ - uses: ./.github/actions/desktop-publish-sparkle+ with:+ channel: stable+ version: ${{ needs.check-stable.outputs.version }}+ server-url: ${{ secrets.UPDATE_SERVER_URL }}+ ed-private-key: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }}+ release-notes: ${{ needs.check-stable.outputs.release_notes }}+ aws-access-key-id: ${{ secrets.UPDATE_AWS_ACCESS_KEY_ID }}+ aws-secret-access-key: ${{ secrets.UPDATE_AWS_SECRET_ACCESS_KEY }}+ s3-bucket: ${{ secrets.UPDATE_S3_BUCKET }}+ s3-region: ${{ secrets.UPDATE_S3_REGION }}+ s3-endpoint: ${{ secrets.UPDATE_S3_ENDPOINT }}diff --git a/apps/desktop/electron-builder.mjs b/apps/desktop/electron-builder.mjsindex 576bcc030b7..33b5dac4fc6 100644--- a/apps/desktop/electron-builder.mjs+++ b/apps/desktop/electron-builder.mjs@@ -15,6 +15,8 @@ import {getNativeModulesFilesConfig,} from './native-deps.config.mjs';import { packBuiltinCore } from './scripts/packBuiltinCore.mjs';+import { toSparkleBuildVersion } from './scripts/sparkleBuildVersion.mjs';+import { resolveSparklePackaging } from './scripts/sparklePackaging.mjs';import { verifyFontListSignature } from './scripts/verifyFontListSigning.mjs';dotenv.config();@@ -128,6 +130,22 @@ const getProtocolScheme = () => {const protocolScheme = getProtocolScheme();+const sparklePublicKey = process.env.SPARKLE_ED_PUBLIC_KEY;+const { useSparkle } = resolveSparklePackaging({+ channel,+ hasAppleCertificate,+ platform: process.platform,+ sparklePublicKey,+ updateServerUrl,+});+const sparklePackageDir = useSparkle+ ? await fs.realpath(path.join(__dirname, 'node_modules/electron-sparkle-updater'))+ : null;+const sparkleFeedUrl =+ useSparkle && updateServerUrl+ ? `${stripChannelSuffix(updateServerUrl).replace(/\/$/, '')}/${isCanary || channel === 'beta' ? 'canary' : 'stable'}/appcast-${arch}.xml`+ : undefined;+// Determine icon file based on version typeconst getIconFileName = () => {if (isStable || isCanary) return 'Icon';@@ -147,6 +165,14 @@ const config = {beforePack: async (context) => {buildFirstPartyNativeAddons();+ if (sparklePackageDir) {+ console.info('🔧 Building Sparkle bridge addon...');+ execSync(+ `node "${path.join(sparklePackageDir, 'bin/electron-sparkle-updater.js')}" rebuild --arch ${arch}`,+ { cwd: __dirname, stdio: 'inherit' },+ );+ }+await copyNativeModulesToSource();await copyExternalRuntimeModulesToSource();@@ -228,6 +254,8 @@ const config = {// Native modules must be unpacked from asar to work correctlyasarUnpack: getAsarUnpackPatterns(),+ ...(useSparkle ? { buildVersion: toSparkleBuildVersion(packageJSON.version) } : {}),+detectUpdateChannel: true,directories: {@@ -259,6 +287,7 @@ const config = {files: ['shell/**','!shell/__tests__',+ ...(useSparkle ? ['!shell/rescue/electron-updater.cjs'] : []),'package.json',// Exclude all node_modules first'!node_modules',@@ -288,6 +317,15 @@ const config = {}: {}),extendInfo: {+ ...(useSparkle+ ? {+ SUDeltaChainHistory: 6,+ SUEnableAutomaticChecks: false,+ SUEnableInstallerLauncherService: false,+ SUFeedURL: sparkleFeedUrl,+ SUPublicEDKey: sparklePublicKey,+ }+ : {}),CFBundleIconName: 'AppIcon',CFBundleURLTypes: [{@@ -343,10 +381,30 @@ const config = {releaseNotes: process.env.RELEASE_NOTES || undefined,},+ ...(sparklePackageDir+ ? {+ extraFiles: [+ {+ from: path.join(sparklePackageDir, 'native/vendor/Sparkle.framework'),+ to: 'Frameworks/Sparkle.framework',+ },+ ],+ }+ : {}),extraResources: [{ from: 'resources/bin', to: 'bin' },{ from: 'core.asar', to: 'core.asar' },{ from: 'core.asar.unpacked', to: 'core.asar.unpacked' },+ // The Sparkle bridge addon is loaded by an explicit path outside app.asar; pnpm's+ // symlinked package dir cannot be matched by asarUnpack, so it ships as a resource.+ ...(sparklePackageDir+ ? [+ {+ from: path.join(sparklePackageDir, 'native/build/Release/sparkle_bridge.node'),+ to: 'sparkle/sparkle_bridge.node',+ },+ ]+ : []),// Local Sandbox helper binaries. The sandbox spawns these by path, so they// must be real files — not entries inside app.asar, and not something the// user is expected to install separately.diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex 58f5a20f982..4113cc24501 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -56,6 +56,7 @@"@lobehub/fluent-emoji": "^4.1.0","@lydell/node-pty": "1.2.0-beta.12","electron-log": "^5.4.4",+ "electron-sparkle-updater": "0.5.2","font-list": "^2.1.0","get-windows": "^9.3.0","node-screenshots": "^0.2.8"diff --git a/apps/desktop/patches/[email protected] b/apps/desktop/patches/[email protected]new file mode 100644index 00000000000..118d4604ce0--- /dev/null+++ b/apps/desktop/patches/[email protected]@@ -0,0 +1,59 @@+diff --git a/native/src/sparkle_bridge.mm b/native/src/sparkle_bridge.mm+index f7c962c73d..645f0a64a6 100644+--- a/native/src/sparkle_bridge.mm++++ b/native/src/sparkle_bridge.mm+@@ -20,0 +21,4 @@ static void EmitSparkleEvent(NSDictionary *payload) {++ if (env == nullptr || jsCallback.IsEmpty()) {++ delete json;++ return;++ }+@@ -43,0 +48,2 @@ @interface SparkleBridgeLogDelegate : NSObject <SPUUpdaterDelegate>++@property(nonatomic, copy, nullable) NSString *appcastUrl;++@property(nonatomic, assign) BOOL checkWhenReady;+@@ -47,0 +54,4 @@ @implementation SparkleBridgeLogDelegate++- (nullable NSString *)feedURLStringForUpdater:(SPUUpdater *)updater {++ return self.appcastUrl;++}+++@@ -55,0 +66,4 @@ - (void)updater:(SPUUpdater *)updater++ if (self.checkWhenReady) {++ self.checkWhenReady = NO;++ dispatch_async(dispatch_get_main_queue(), ^{ [updater checkForUpdates]; });++ }+@@ -262,0 +277,8 @@ - (void)showUpdateInFocus {++ if (![g_logDelegate.appcastUrl isEqualToString:appcastUrl] && g_userDriver.readyToInstallReply != nil) {++ // Discard an uninstalled download from the previous channel. User-initiated++ // checks can still find this version if the user switches back later.++ void (^reply)(SPUUserUpdateChoice) = g_userDriver.readyToInstallReply;++ g_userDriver.readyToInstallReply = nil;++ reply(SPUUserUpdateChoiceSkip);++ }++ g_logDelegate.appcastUrl = appcastUrl;+@@ -268,0 +291 @@ - (void)showUpdateInFocus {++ g_logDelegate.appcastUrl = appcastUrl;+@@ -355,0 +379,4 @@ void RunOnMain(void (^work)(void)) {++ if (g_updater.sessionInProgress) {++ g_logDelegate.checkWhenReady = YES;++ return;++ }+@@ -433,2 +460,2 @@ void RunOnMain(void (^work)(void)) {+- if (info.Length() < 1 || !info[0].IsFunction()) {+- Napi::TypeError::New(env, "setEventHandler(fn) requires a function").ThrowAsJavaScriptException();++ if (info.Length() < 1 || (!info[0].IsFunction() && !info[0].IsNull())) {++ Napi::TypeError::New(env, "setEventHandler(fn) requires a function or null").ThrowAsJavaScriptException();+@@ -439 +466 @@ void RunOnMain(void (^work)(void)) {+- g_eventTsfn.Release();++ g_eventTsfn.Abort();+@@ -440,0 +468 @@ void RunOnMain(void (^work)(void)) {++ if (info[0].IsNull()) return env.Undefined();+diff --git a/dist/index.d.ts b/dist/index.d.ts+index cc2445ca83..4b5d16e0fa 100644+--- a/dist/index.d.ts++++ b/dist/index.d.ts+@@ -25 +25 @@ export interface SparkleBridge {+- setEventHandler(handler: (event: SparkleBridgeEvent) => void): void;++ setEventHandler(handler: ((event: SparkleBridgeEvent) => void) | null): void;+@@ -42 +42 @@ export {};+-//# sourceMappingURL=index.d.ts.map+\ No newline at end of file++//# sourceMappingURL=index.d.ts.mapdiff --git a/apps/desktop/pnpm-lock.yaml b/apps/desktop/pnpm-lock.yamlindex 6824066932b..4ba43daff09 100644--- a/apps/desktop/pnpm-lock.yaml+++ b/apps/desktop/pnpm-lock.yaml@@ -11,6 +11,9 @@ overrides:vitest: 5.0.0zod@^4: 4.5.4+patchedDependencies:+ [email protected]: 6f583444e425a99e21e374a9afab303612eb8255ee21194afdb77f347c6cc045+importers:.:@@ -23,19 +26,22 @@ importers:version: 0.0.22'@lobehub/fluent-emoji':specifier: ^4.1.0- version: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])'@lydell/node-pty':specifier: 1.2.0-beta.12version: 1.2.0-beta.12electron-log:specifier: ^5.4.4version: 5.4.4+ electron-sparkle-updater:+ specifier: 0.5.2+ version: 0.5.2(patch_hash=6f583444e425a99e21e374a9afab303612eb8255ee21194afdb77f347c6cc045)([email protected]([email protected]))font-list:specifier: ^2.1.0version: 2.1.0get-windows:specifier: ^9.3.0- version: 9.3.0([email protected])+ version: 9.3.0([email protected])([email protected])node-screenshots:specifier: ^0.2.8version: 0.2.8@@ -48,19 +54,19 @@ importers:version: 1.8.0(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])'@electron-toolkit/eslint-config-prettier':specifier: ^3.0.0'@electron-toolkit/eslint-config-ts':specifier: ^3.1.0+ version: 3.1.0([email protected]([email protected])([email protected]))([email protected])([email protected])'@electron-toolkit/preload':specifier: ^3.0.2- version: 3.0.2([email protected])+ version: 3.0.2([email protected]([email protected]))'@electron-toolkit/tsconfig':specifier: ^2.0.0version: 2.0.0(@types/[email protected])'@electron-toolkit/utils':specifier: ^4.0.0- version: 4.0.0([email protected])+ version: 4.0.0([email protected]([email protected]))'@lobechat/chat-adapter-imessage':specifier: workspace:*version: link:../../packages/chat-adapter-imessage@@ -108,16 +114,16 @@ importers:version: link:../../packages/utils'@lobehub/i18n-cli':specifier: ^1.27.0- version: 1.27.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 1.27.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])'@modelcontextprotocol/sdk':specifier: ^1.29.0- version: 1.29.0([email protected])+ version: 1.29.0([email protected])([email protected])'@sentry/electron':specifier: 7.15.0- version: 7.15.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ version: 7.15.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected])'@sentry/vite-plugin':specifier: 5.3.0- version: 5.3.0([email protected])([email protected])'@t3-oss/env-core':specifier: ^0.13.11version: 0.13.11([email protected])([email protected])@@ -138,7 +144,7 @@ importers:version: 1.21.1([email protected])'@vanilla-extract/vite-plugin':specifier: ^5.2.3- version: 5.2.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])+ version: 5.2.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])consola:specifier: ^3.4.2version: 3.4.2@@ -159,16 +165,16 @@ importers:version: 0.45.2(@opentelemetry/[email protected])electron:specifier: 43.2.0- version: 43.2.0+ version: 43.2.0([email protected])electron-builder:specifier: 26.16.1- version: 26.16.1([email protected])+ version: 26.16.1([email protected])([email protected])electron-store:specifier: ^8.2.0version: 8.2.0electron-updater:specifier: ^6.8.9- version: 6.8.9+ version: 6.8.9([email protected])electron-window-state:specifier: ^5.0.3version: 5.0.3@@ -177,7 +183,7 @@ importers:version: 1.52.0eslint:specifier: 10.0.0- version: 10.0.0([email protected])+ version: 10.0.0([email protected])([email protected])execa:specifier: ^9.6.1version: 9.6.1@@ -198,10 +204,10 @@ importers:version: 20.10.6http-proxy-agent:specifier: ^7.0.2- version: 7.0.2+ version: 7.0.2([email protected])https-proxy-agent:specifier: ^7.0.6- version: 7.0.6+ version: 7.0.6([email protected])i18next:specifier: ^25.10.10version: 25.10.10([email protected])@@ -216,7 +222,7 @@ importers:version: 3.9.5remark-cli:specifier: ^12.0.1- version: 12.0.1+ version: 12.0.1([email protected])([email protected])resolve:specifier: ^1.22.12version: 1.22.12@@ -231,7 +237,7 @@ importers:version: 6.0.1stylelint:specifier: ^15.11.0- version: 15.11.0([email protected])+ version: 15.11.0([email protected])([email protected])superjson:specifier: ^2.2.6version: 2.2.6@@ -295,14 +301,14 @@ importers:dependencies:chat:specifier: ~4.38.0- version: 4.38.1([email protected])+ version: 4.38.1([email protected])([email protected])devDependencies:'@types/node':specifier: ^24.13.2version: 24.13.3tsup:specifier: ^8.5.1- version: 8.5.1([email protected])([email protected])([email protected])([email protected])([email protected])+ version: 8.5.1([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])typescript:specifier: ^6.0.3version: 6.0.3@@ -317,7 +323,7 @@ importers:version: link:../business/const'@lobehub/ui':specifier: ^5- version: 5.20.0(@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 5.20.0(@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])query-string:specifier: ^9.4.1version: 9.5.1@@ -412,7 +418,7 @@ importers:devDependencies:electron:specifier: ^43.2.0- version: 43.2.0+ version: 43.2.0([email protected])../../packages/electron-mac-notifications:dependencies:@@ -431,7 +437,7 @@ importers:dependencies:debug:specifier: ^4.4.3- version: 4.4.3+ version: 4.4.3([email protected])devDependencies:'@types/debug':specifier: ^4.1.13@@ -463,7 +469,7 @@ importers:version: 2.0.0debug:specifier: ^4.4.3- version: 4.4.3+ version: 4.4.3([email protected])mammoth:specifier: ^1.12.0version: 1.12.0@@ -497,7 +503,7 @@ importers:dependencies:'@anthropic-ai/claude-agent-sdk':specifier: 0.3.204- version: 0.3.204(@anthropic-ai/[email protected]([email protected]))(@modelcontextprotocol/[email protected]([email protected]))([email protected])+ version: 0.3.204(@anthropic-ai/[email protected]([email protected]))(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected])'@anthropic-ai/sdk':specifier: ^0.93.0version: 0.93.0([email protected])@@ -512,10 +518,10 @@ importers:version: link:../utils'@lobehub/icons':specifier: ^5.15.0- version: 5.18.0(@lobehub/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 5.18.0(@lobehub/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])'@modelcontextprotocol/sdk':specifier: ^1.29.0- version: 1.29.0([email protected])+ version: 1.29.0([email protected])([email protected])diff:specifier: ^8.0.4version: 8.0.4@@ -554,7 +560,7 @@ importers:version: link:../file-loadersdebug:specifier: ^4.4.3- version: 4.4.3+ version: 4.4.3([email protected])diff:specifier: ^8.0.4version: 8.0.4@@ -636,13 +642,13 @@ importers:dependencies:'@lobehub/market-sdk':specifier: 0.41.0- version: 0.41.0([email protected])+ version: 0.41.0([email protected])([email protected])'@lobehub/market-types':specifier: ^1.17.1version: 1.17.1'@lobehub/ui':specifier: ^5- version: 5.20.0(@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 5.20.0(@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])ajv:specifier: ^8.20.0version: 8.20.0@@ -693,7 +699,7 @@ importers:version: 1.11.23debug:specifier: ^4.4.3- version: 4.4.3+ version: 4.4.3([email protected])dompurify:specifier: ^3.4.11version: 3.4.15@@ -705,7 +711,7 @@ importers:version: 3.1.3file-type:specifier: ^21.3.4- version: 21.3.4+ version: 21.3.4([email protected])mime:specifier: ^4.1.0version: 4.1.0@@ -726,10 +732,10 @@ importers:version: 7.0.1remark:specifier: ^15.0.1- version: 15.0.1+ version: 15.0.1([email protected])remark-gfm:specifier: ^4.0.1- version: 4.0.1+ version: 4.0.1([email protected])remark-html:specifier: ^16.0.1version: 16.0.1@@ -818,7 +824,7 @@ importers:version: 1.11.23debug:specifier: ^4.4.3- version: 4.4.3+ version: 4.4.3([email protected])diff:specifier: ^8.0.4version: 8.0.4@@ -5195,6 +5201,16 @@ packages:resolution: {integrity: sha512-Vt3KzQIiw9BImvNOYtndg9Mjki+tl4+1sQiC/+G5j8khWaENOJFWodiB+sUl6yyHwtd37avehskdtPw7f8y/+Q==}+ resolution: {integrity: sha512-S7C35axw51hTYer9/TSx28/1QyAxARFJZHIDpXrTDM2owxAeGlqnvcPduzk4FJhNkEah1tF/f3ko21/r/TwvoQ==}+ engines: {node: '>=20.19'}+ hasBin: true+ peerDependencies:+ electron: '>=28'+ peerDependenciesMeta:+ electron:+ optional: true+resolution: {integrity: sha512-ukLL5Bevdil6oieAOXz3CMy+OgaItMiVBg701MNlG6W5RaC0AHN7rvlqTCmeb6O7jP0Qa1KKYTE0xV0xbhF4Hw==}@@ -9350,10 +9366,10 @@ snapshots:'@anthropic-ai/[email protected]':optional: true- '@anthropic-ai/[email protected](@anthropic-ai/[email protected]([email protected]))(@modelcontextprotocol/[email protected]([email protected]))([email protected])':+ '@anthropic-ai/[email protected](@anthropic-ai/[email protected]([email protected]))(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected])':dependencies:'@anthropic-ai/sdk': 0.93.0([email protected])- '@modelcontextprotocol/sdk': 1.29.0([email protected])+ '@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])zod: 4.5.4optionalDependencies:'@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.204@@ -9394,10 +9410,10 @@ snapshots:semifies: 1.0.0source-map: 0.6.1- '@apm-js-collab/[email protected]':+ '@apm-js-collab/[email protected]([email protected])':dependencies:'@apm-js-collab/code-transformer': 0.15.0- debug: 4.4.3+ debug: 4.4.3([email protected])module-details-from-path: 1.0.4transitivePeerDependencies:- supports-color@@ -9446,20 +9462,20 @@ snapshots:'@babel/[email protected]': {}- '@babel/[email protected]':+ '@babel/[email protected]([email protected])':dependencies:'@babel/code-frame': 7.29.7'@babel/generator': 7.29.7'@babel/helper-compilation-targets': 7.29.7- '@babel/helper-module-transforms': 7.29.7(@babel/[email protected])+ '@babel/helper-module-transforms': 7.29.7(@babel/[email protected]([email protected]))([email protected])'@babel/helpers': 7.29.7'@babel/parser': 7.29.7'@babel/template': 7.29.7- '@babel/traverse': 7.29.7+ '@babel/traverse': 7.29.7([email protected])'@babel/types': 7.29.7'@jridgewell/remapping': 2.3.5convert-source-map: 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])gensync: 1.0.0-beta.2json5: 2.2.3semver: 6.3.1@@ -9493,19 +9509,19 @@ snapshots:'@babel/[email protected]': {}- '@babel/[email protected]':+ '@babel/[email protected]([email protected])':dependencies:- '@babel/traverse': 7.29.7+ '@babel/traverse': 7.29.7([email protected])'@babel/types': 7.29.7transitivePeerDependencies:- supports-color- '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.29.7- '@babel/helper-module-imports': 7.29.7+ '@babel/core': 7.29.7([email protected])+ '@babel/helper-module-imports': 7.29.7([email protected])'@babel/helper-validator-identifier': 7.29.7- '@babel/traverse': 7.29.7+ '@babel/traverse': 7.29.7([email protected])transitivePeerDependencies:- supports-color@@ -9540,9 +9556,9 @@ snapshots:dependencies:'@babel/types': 8.0.4- '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.29.7+ '@babel/core': 7.29.7([email protected])'@babel/helper-plugin-utils': 7.29.7'@babel/[email protected]': {}@@ -9555,7 +9571,7 @@ snapshots:'@babel/parser': 7.29.7'@babel/types': 7.29.7- '@babel/[email protected]':+ '@babel/[email protected]([email protected])':dependencies:'@babel/code-frame': 7.29.7'@babel/generator': 7.29.7@@ -9563,7 +9579,7 @@ snapshots:'@babel/parser': 7.29.7'@babel/template': 7.29.7'@babel/types': 7.29.7- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -9689,37 +9705,37 @@ snapshots:'@electron-internal/[email protected]': {}+ '@electron-toolkit/[email protected]([email protected]([email protected])([email protected]))([email protected])':dependencies:- eslint: 10.0.0([email protected])- eslint-config-prettier: 10.1.8([email protected]([email protected]))- eslint-plugin-prettier: 5.5.6([email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])+ eslint: 10.0.0([email protected])([email protected])+ eslint-plugin-prettier: 5.5.6([email protected]([email protected]([email protected])([email protected])))([email protected]([email protected])([email protected]))([email protected])prettier: 3.9.5transitivePeerDependencies:- '@types/eslint'+ '@electron-toolkit/[email protected]([email protected]([email protected])([email protected]))([email protected])([email protected])':dependencies:'@eslint/js': 9.39.4- eslint: 10.0.0([email protected])+ eslint: 10.0.0([email protected])([email protected])globals: 16.5.0+ typescript-eslint: 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])optionalDependencies:typescript: 6.0.3transitivePeerDependencies:- supports-color- '@electron-toolkit/[email protected]([email protected])':dependencies:- electron: 43.2.0+ electron: 43.2.0([email protected])'@electron-toolkit/[email protected](@types/[email protected])':dependencies:'@types/node': 24.13.3- '@electron-toolkit/[email protected]([email protected])':dependencies:- electron: 43.2.0+ electron: 43.2.0([email protected])'@electron/[email protected]':dependencies:@@ -9733,45 +9749,45 @@ snapshots:fs-extra: 9.1.0minimist: 1.2.8- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])env-paths: 2.2.1fs-extra: 8.1.0got: 11.8.6progress: 2.0.3semver: 6.3.1- sumchecker: 3.0.1+ sumchecker: 3.0.1([email protected])optionalDependencies:global-agent: 3.0.0transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])env-paths: 3.0.0graceful-fs: 4.2.11progress: 2.0.3semver: 7.8.5- sumchecker: 3.0.1+ sumchecker: 3.0.1([email protected])optionalDependencies:undici: 7.28.0transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 9.1.0promise-retry: 2.0.1transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:compare-version: 0.1.2- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 10.1.0isbinaryfile: 4.0.10minimist: 1.2.8@@ -9779,22 +9795,22 @@ snapshots:transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:'@malept/cross-spawn-promise': 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])node-abi: 4.33.0node-api-version: 0.2.1node-gyp: 12.4.0- read-binary-file-arch: 1.0.6+ read-binary-file-arch: 1.0.6([email protected])transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:'@electron/asar': 3.4.1'@malept/cross-spawn-promise': 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])dir-compare: 4.2.0fs-extra: 11.4.0minimatch: 9.0.9@@ -9802,10 +9818,10 @@ snapshots:transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:cross-dirname: 0.1.0- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 11.4.0minimist: 1.2.8postject: 1.0.0-alpha.6@@ -9836,9 +9852,9 @@ snapshots:emoji-mart: 5.6.0react: 19.2.7- '@emotion/[email protected]':+ '@emotion/[email protected]([email protected])':dependencies:- '@babel/helper-module-imports': 7.29.7+ '@babel/helper-module-imports': 7.29.7([email protected])'@babel/runtime': 7.29.7'@emotion/hash': 0.9.2'@emotion/memoize': 0.9.0@@ -9860,9 +9876,9 @@ snapshots:'@emotion/weak-memoize': 0.4.0stylis: 4.2.0- '@emotion/[email protected]':+ '@emotion/[email protected]([email protected])':dependencies:- '@emotion/babel-plugin': 11.13.5+ '@emotion/babel-plugin': 11.13.5([email protected])'@emotion/cache': 11.14.0'@emotion/serialize': 1.3.3'@emotion/sheet': 1.4.0@@ -9880,10 +9896,10 @@ snapshots:'@emotion/[email protected]': {}dependencies:'@babel/runtime': 7.29.7- '@emotion/babel-plugin': 11.13.5+ '@emotion/babel-plugin': 11.13.5([email protected])'@emotion/cache': 11.14.0'@emotion/serialize': 1.3.3'@emotion/use-insertion-effect-with-fallbacks': 1.2.0([email protected])@@ -10230,17 +10246,17 @@ snapshots:'@esbuild/[email protected]':optional: truedependencies:- eslint: 10.0.0([email protected])+ eslint: 10.0.0([email protected])([email protected])eslint-visitor-keys: 3.4.3'@eslint-community/[email protected]': {}- '@eslint/[email protected]':+ '@eslint/[email protected]([email protected])':dependencies:'@eslint/object-schema': 3.0.5- debug: 4.4.3+ debug: 4.4.3([email protected])minimatch: 10.2.5transitivePeerDependencies:- supports-color@@ -10396,10 +10412,10 @@ snapshots:'@lobehub/[email protected]': {}- '@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':+ '@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])':dependencies:'@lobehub/emojilib': 1.0.0- antd-style: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ antd-style: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])emoji-regex: 10.6.0es-toolkit: 1.52.0lucide-react: 0.562.0([email protected])@@ -10411,7 +10427,7 @@ snapshots:- antd- supports-color- '@lobehub/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])':+ '@lobehub/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])':dependencies:'@lobehub/cli-ui': 1.13.0(@types/[email protected])chalk: 5.6.2@@ -10434,9 +10450,9 @@ snapshots:p-map: 7.0.5pangu: 4.0.7react: 19.2.7- remark-frontmatter: 5.0.0- remark-gfm: 4.0.1- remark-parse: 11.0.0+ remark-frontmatter: 5.0.0([email protected])+ remark-gfm: 4.0.1([email protected])+ remark-parse: 11.0.0([email protected])remark-stringify: 11.0.0swr: 2.4.2([email protected])unified: 11.0.5@@ -10456,11 +10472,11 @@ snapshots:- ws- zod- '@lobehub/[email protected](@lobehub/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':+ '@lobehub/[email protected](@lobehub/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])':dependencies:- '@lobehub/ui': 5.20.0(@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ '@lobehub/ui': 5.20.0(@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])antd: 6.5.0([email protected])([email protected])([email protected]([email protected]))([email protected])- antd-style: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ antd-style: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])es-toolkit: 1.51.0lucide-react: 0.469.0([email protected])polished: 4.3.1@@ -10470,10 +10486,10 @@ snapshots:- '@types/react'- supports-color- '@lobehub/[email protected]([email protected])':dependencies:'@lobehub/market-types': 1.17.1- debug: 4.4.3+ debug: 4.4.3([email protected])jose: 6.2.4url-join: 5.0.0zod: 4.5.4@@ -10484,7 +10500,7 @@ snapshots:dependencies:zod: 3.25.76- '@lobehub/[email protected](@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':+ '@lobehub/[email protected](@lobehub/[email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected]))(@lobehub/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected](@emotion/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])':dependencies:'@base-ui/react': 1.7.0(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])@@ -10497,9 +10513,9 @@ snapshots:'@emotion/is-prop-valid': 1.4.0- '@lobehub/fluent-emoji': 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])- '@lobehub/icons': 5.18.0(@lobehub/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])- '@mdx-js/mdx': 3.1.1+ '@lobehub/fluent-emoji': 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])+ '@lobehub/icons': 5.18.0(@lobehub/[email protected])(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])+ '@mdx-js/mdx': 3.1.1([email protected])'@mdx-js/react': 3.1.1(@types/[email protected])([email protected])'@radix-ui/react-slot': 1.3.3(@types/[email protected])([email protected])@@ -10508,7 +10524,7 @@ snapshots:'@splinetool/runtime': 0.9.526antd: 6.5.0([email protected])([email protected])([email protected]([email protected]))([email protected])- antd-style: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ antd-style: 4.1.0(@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected])chroma-js: 3.2.0class-variance-authority: 0.7.1clsx: 2.1.1@@ -10516,7 +10532,7 @@ snapshots:emoji-mart: 5.6.0es-toolkit: 1.51.0fast-deep-equal: 3.1.3- hast-util-to-jsx-runtime: 2.3.6+ hast-util-to-jsx-runtime: 2.3.6([email protected])html-url-attributes: 3.0.1immer: 11.1.18katex: 0.16.47@@ -10539,7 +10555,7 @@ snapshots:react-dom: 19.2.7([email protected])react-error-boundary: 6.1.3(@types/[email protected])([email protected])- react-markdown: 10.1.0(@types/[email protected])([email protected])react-merge-refs: 3.0.2([email protected])@@ -10547,11 +10563,11 @@ snapshots:rehype-katex: 7.0.1rehype-raw: 7.0.0remark-breaks: 4.0.0- remark-cjk-friendly: 2.3.1(@types/[email protected])([email protected])([email protected])([email protected])- remark-gfm: 4.0.1+ remark-cjk-friendly: 2.3.1(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])+ remark-gfm: 4.0.1([email protected])remark-github: 12.0.0- remark-math: 6.0.0- remark-parse: 11.0.0+ remark-math: 6.0.0([email protected])+ remark-parse: 11.0.0([email protected])remark-rehype: 11.1.2remend: 1.3.0shiki: 4.4.3@@ -10608,19 +10624,19 @@ snapshots:dependencies:cross-spawn: 7.0.6- '@malept/[email protected]':+ '@malept/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 9.1.0lodash: 4.18.1tmp-promise: 3.0.3transitivePeerDependencies:- supports-color- '@mapbox/[email protected]([email protected])':dependencies:detect-libc: 2.1.2- https-proxy-agent: 5.0.1+ https-proxy-agent: 5.0.1([email protected])make-dir: 3.1.0node-fetch: 2.7.0([email protected])nopt: 5.0.0@@ -10633,7 +10649,7 @@ snapshots:- supports-coloroptional: true- '@mdx-js/[email protected]':+ '@mdx-js/[email protected]([email protected])':dependencies:'@types/estree': 1.0.9'@types/estree-jsx': 1.0.5@@ -10645,14 +10661,14 @@ snapshots:estree-util-is-identifier-name: 3.0.0estree-util-scope: 1.0.1estree-walker: 3.0.3- hast-util-to-jsx-runtime: 2.3.6+ hast-util-to-jsx-runtime: 2.3.6([email protected])markdown-extensions: 2.0.0recma-build-jsx: 1.0.0recma-jsx: 1.0.1([email protected])recma-stringify: 1.0.0- rehype-recma: 1.0.0- remark-mdx: 3.1.1- remark-parse: 11.0.0+ rehype-recma: 1.0.0([email protected])+ remark-mdx: 3.1.1([email protected])+ remark-parse: 11.0.0([email protected])remark-rehype: 11.1.2source-map: 0.7.6unified: 11.0.5@@ -10673,7 +10689,7 @@ snapshots:dependencies:'@chevrotain/types': 11.1.2- '@modelcontextprotocol/[email protected]([email protected])':dependencies:'@hono/node-server': 1.19.14([email protected])ajv: 8.20.0@@ -10683,8 +10699,8 @@ snapshots:cross-spawn: 7.0.6eventsource: 3.0.7eventsource-parser: 3.1.0- express: 5.2.1- express-rate-limit: 8.5.2([email protected])+ express: 5.2.1([email protected])+ express-rate-limit: 8.5.2([email protected]([email protected]))hono: 4.12.28jose: 6.2.3json-schema-typed: 8.0.2@@ -10768,10 +10784,10 @@ snapshots:'@nodelib/fs.scandir': 2.1.5fastq: 1.20.1- '@npmcli/[email protected]':+ '@npmcli/[email protected]([email protected])':dependencies:'@npmcli/map-workspaces': 3.0.6- '@npmcli/package-json': 5.2.1+ '@npmcli/package-json': 5.2.1([email protected])ci-info: 4.4.0ini: 4.1.3nopt: 7.2.1@@ -10781,14 +10797,14 @@ snapshots:transitivePeerDependencies:- bluebird- '@npmcli/[email protected]':+ '@npmcli/[email protected]([email protected])':dependencies:'@npmcli/promise-spawn': 7.0.2ini: 4.1.3lru-cache: 10.4.3npm-pick-manifest: 9.1.0proc-log: 4.2.0- promise-inflight: 1.0.1+ promise-inflight: 1.0.1([email protected])promise-retry: 2.0.1semver: 7.8.5which: 4.0.0@@ -10804,9 +10820,9 @@ snapshots:'@npmcli/[email protected]': {}- '@npmcli/[email protected]':+ '@npmcli/[email protected]([email protected])':dependencies:- '@npmcli/git': 5.0.8+ '@npmcli/git': 5.0.8([email protected])glob: 10.5.0hosted-git-info: 7.0.2json-parse-even-better-errors: 3.0.2@@ -10831,12 +10847,12 @@ snapshots:'@opentelemetry/api': 1.9.1'@opentelemetry/semantic-conventions': 1.43.0- '@opentelemetry/[email protected](@opentelemetry/[email protected])':dependencies:'@opentelemetry/api': 1.9.1'@opentelemetry/api-logs': 0.214.0import-in-the-middle: 3.5.0- require-in-the-middle: 8.0.1+ require-in-the-middle: 8.0.1([email protected])transitivePeerDependencies:- supports-color@@ -11669,11 +11685,11 @@ snapshots:'@sentry/replay': 10.62.0'@sentry/replay-canvas': 10.62.0- '@sentry/[email protected]([email protected])':dependencies:- '@babel/core': 7.29.7+ '@babel/core': 7.29.7([email protected])'@sentry/babel-plugin-component-annotate': 5.3.0- '@sentry/cli': 2.58.6([email protected])+ '@sentry/cli': 2.58.6([email protected])([email protected])dotenv: 16.6.1find-up: 5.0.0glob: 13.0.6@@ -11706,9 +11722,9 @@ snapshots:'@sentry/[email protected]':optional: true- '@sentry/[email protected]([email protected])':dependencies:- https-proxy-agent: 5.0.1+ https-proxy-agent: 5.0.1([email protected])node-fetch: 2.7.0([email protected])progress: 2.0.3proxy-from-env: 1.1.0@@ -11730,11 +11746,11 @@ snapshots:'@sentry/[email protected]': {}+ '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected])':dependencies:'@sentry/browser': 10.62.0'@sentry/core': 10.62.0- '@sentry/node': 10.62.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ '@sentry/node': 10.62.0(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected])transitivePeerDependencies:- '@opentelemetry/core'- '@opentelemetry/exporter-trace-otlp-http'@@ -11744,7 +11760,7 @@ snapshots:dependencies:'@sentry/core': 10.62.0- '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':+ '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected])([email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))':dependencies:'@sentry/conventions': 0.12.0'@sentry/core': 10.62.0@@ -11753,19 +11769,19 @@ snapshots:optionalDependencies:'@opentelemetry/api': 1.9.1'@opentelemetry/core': 2.11.0(@opentelemetry/[email protected])- '@opentelemetry/instrumentation': 0.214.0(@opentelemetry/[email protected])+ '@opentelemetry/instrumentation': 0.214.0(@opentelemetry/[email protected])([email protected])'@opentelemetry/sdk-trace-base': 2.11.0(@opentelemetry/[email protected])+ '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected])':dependencies:'@opentelemetry/api': 1.9.1- '@opentelemetry/instrumentation': 0.214.0(@opentelemetry/[email protected])+ '@opentelemetry/instrumentation': 0.214.0(@opentelemetry/[email protected])([email protected])'@opentelemetry/sdk-trace-base': 2.11.0(@opentelemetry/[email protected])'@opentelemetry/semantic-conventions': 1.43.0'@sentry/core': 10.62.0- '@sentry/node-core': 10.62.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))+ '@sentry/node-core': 10.62.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected])([email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))'@sentry/opentelemetry': 10.62.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))- '@sentry/server-utils': 10.62.0+ '@sentry/server-utils': 10.62.0([email protected])import-in-the-middle: 3.5.0transitivePeerDependencies:- '@opentelemetry/core'@@ -11790,9 +11806,9 @@ snapshots:'@sentry/browser-utils': 10.62.0'@sentry/core': 10.62.0dependencies:- '@sentry/bundler-plugin-core': 5.3.0([email protected])+ '@sentry/bundler-plugin-core': 5.3.0([email protected])([email protected])magic-string: 0.30.21optionalDependencies:rollup: 4.62.2@@ -11800,21 +11816,21 @@ snapshots:- encoding- supports-color- '@sentry/[email protected]':+ '@sentry/[email protected]([email protected])':dependencies:'@apm-js-collab/code-transformer': 0.15.0'@apm-js-collab/code-transformer-bundler-plugins': 0.5.0- '@apm-js-collab/tracing-hooks': 0.10.1+ '@apm-js-collab/tracing-hooks': 0.10.1([email protected])'@sentry/conventions': 0.12.0'@sentry/core': 10.62.0magic-string: 0.30.21transitivePeerDependencies:- supports-colordependencies:- '@sentry/bundler-plugin-core': 5.3.0([email protected])- '@sentry/rollup-plugin': 5.3.0([email protected])([email protected])+ '@sentry/bundler-plugin-core': 5.3.0([email protected])([email protected])transitivePeerDependencies:- encoding- rollup@@ -11929,9 +11945,9 @@ snapshots:typescript: 6.0.3zod: 4.5.4- '@tokenizer/[email protected]':+ '@tokenizer/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])token-types: 6.1.2transitivePeerDependencies:- supports-color@@ -12192,15 +12208,15 @@ snapshots:dependencies:'@types/node': 24.13.3- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':+ '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected])([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected]))([email protected])([email protected])':dependencies:'@eslint-community/regexpp': 4.12.2+ '@typescript-eslint/parser': 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])'@typescript-eslint/scope-manager': 8.63.0+ '@typescript-eslint/type-utils': 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])+ '@typescript-eslint/utils': 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])'@typescript-eslint/visitor-keys': 8.63.0- eslint: 10.0.0([email protected])+ eslint: 10.0.0([email protected])([email protected])ignore: 7.0.5natural-compare: 1.4.0ts-api-utils: 2.5.0([email protected])@@ -12208,23 +12224,23 @@ snapshots:transitivePeerDependencies:- supports-color+ '@typescript-eslint/[email protected]([email protected]([email protected])([email protected]))([email protected])([email protected])':dependencies:'@typescript-eslint/scope-manager': 8.63.0'@typescript-eslint/types': 8.63.0- '@typescript-eslint/typescript-estree': 8.63.0([email protected])+ '@typescript-eslint/typescript-estree': 8.63.0([email protected])([email protected])'@typescript-eslint/visitor-keys': 8.63.0- debug: 4.4.3- eslint: 10.0.0([email protected])+ debug: 4.4.3([email protected])+ eslint: 10.0.0([email protected])([email protected])typescript: 6.0.3transitivePeerDependencies:- supports-color- '@typescript-eslint/[email protected]([email protected])':dependencies:'@typescript-eslint/tsconfig-utils': 8.63.0([email protected])'@typescript-eslint/types': 8.63.0- debug: 4.4.3+ debug: 4.4.3([email protected])typescript: 6.0.3transitivePeerDependencies:- supports-color@@ -12238,13 +12254,13 @@ snapshots:dependencies:typescript: 6.0.3+ '@typescript-eslint/[email protected]([email protected]([email protected])([email protected]))([email protected])([email protected])':dependencies:'@typescript-eslint/types': 8.63.0- '@typescript-eslint/typescript-estree': 8.63.0([email protected])- debug: 4.4.3- eslint: 10.0.0([email protected])+ '@typescript-eslint/typescript-estree': 8.63.0([email protected])([email protected])+ '@typescript-eslint/utils': 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])+ debug: 4.4.3([email protected])+ eslint: 10.0.0([email protected])([email protected])ts-api-utils: 2.5.0([email protected])typescript: 6.0.3transitivePeerDependencies:@@ -12252,13 +12268,13 @@ snapshots:'@typescript-eslint/[email protected]': {}- '@typescript-eslint/[email protected]([email protected])':dependencies:- '@typescript-eslint/project-service': 8.63.0([email protected])+ '@typescript-eslint/project-service': 8.63.0([email protected])([email protected])'@typescript-eslint/tsconfig-utils': 8.63.0([email protected])'@typescript-eslint/types': 8.63.0'@typescript-eslint/visitor-keys': 8.63.0- debug: 4.4.3+ debug: 4.4.3([email protected])minimatch: 10.2.5semver: 7.8.5tinyglobby: 0.2.17@@ -12267,13 +12283,13 @@ snapshots:transitivePeerDependencies:- supports-color+ '@typescript-eslint/[email protected]([email protected]([email protected])([email protected]))([email protected])([email protected])':dependencies:- '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))'@typescript-eslint/scope-manager': 8.63.0'@typescript-eslint/types': 8.63.0- '@typescript-eslint/typescript-estree': 8.63.0([email protected])- eslint: 10.0.0([email protected])+ '@typescript-eslint/typescript-estree': 8.63.0([email protected])([email protected])+ eslint: 10.0.0([email protected])([email protected])typescript: 6.0.3transitivePeerDependencies:- supports-color@@ -12330,16 +12346,16 @@ snapshots:'@use-gesture/core': 10.3.1react: 19.2.7- '@vanilla-extract/[email protected]':+ '@vanilla-extract/[email protected]([email protected])':dependencies:- '@babel/core': 7.29.7+ '@babel/core': 7.29.7([email protected])transitivePeerDependencies:- supports-color- '@vanilla-extract/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])':+ '@vanilla-extract/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:'@vanilla-extract/css': 1.21.1([email protected])- '@vanilla-extract/integration': 8.0.10([email protected])+ '@vanilla-extract/integration': 8.0.10([email protected])([email protected])vite: 8.0.14(@types/[email protected])([email protected])([email protected])([email protected])([email protected])vite-node: 6.0.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:@@ -12374,11 +12390,11 @@ snapshots:transitivePeerDependencies:- babel-plugin-macros- '@vanilla-extract/[email protected]([email protected])':dependencies:- '@babel/core': 7.29.7- '@babel/plugin-syntax-typescript': 7.29.7(@babel/[email protected])- '@vanilla-extract/babel-plugin-debug-ids': 1.2.2+ '@babel/core': 7.29.7([email protected])+ '@babel/plugin-syntax-typescript': 7.29.7(@babel/[email protected]([email protected]))+ '@vanilla-extract/babel-plugin-debug-ids': 1.2.2([email protected])'@vanilla-extract/css': 1.21.1([email protected])dedent: 1.7.2([email protected])esbuild: 0.28.1@@ -12392,10 +12408,10 @@ snapshots:'@vanilla-extract/[email protected]': {}- '@vanilla-extract/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])':+ '@vanilla-extract/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])':dependencies:- '@vanilla-extract/compiler': 0.7.1(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- '@vanilla-extract/integration': 8.0.10([email protected])+ '@vanilla-extract/compiler': 0.7.1(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ '@vanilla-extract/integration': 8.0.10([email protected])([email protected])vite: 8.0.14(@types/[email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:- '@types/node'@@ -12479,9 +12495,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -12548,13 +12564,13 @@ snapshots:- [email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):+ [email protected](@types/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected]):dependencies:'@babel/runtime': 7.29.7'@emotion/cache': 11.14.0- '@emotion/css': 11.13.5- '@emotion/react': 11.14.0(@types/[email protected])([email protected])+ '@emotion/css': 11.13.5([email protected])'@emotion/serialize': 1.3.3'@emotion/utils': 1.4.2antd: 6.5.0([email protected])([email protected])([email protected]([email protected]))([email protected])@@ -12628,33 +12644,33 @@ snapshots:normalize-path: 3.0.0picomatch: 2.3.2dependencies:'@electron/asar': 3.4.1'@electron/fuses': 1.8.0- '@electron/get': 3.1.0- '@electron/notarize': 2.5.0- '@electron/osx-sign': 1.3.3- '@electron/rebuild': 4.2.0- '@electron/universal': 2.0.3- '@malept/flatpak-bundler': 0.4.0+ '@electron/get': 3.1.0([email protected])+ '@electron/notarize': 2.5.0([email protected])+ '@electron/osx-sign': 1.3.3([email protected])+ '@electron/rebuild': 4.2.0([email protected])+ '@electron/universal': 2.0.3([email protected])+ '@malept/flatpak-bundler': 0.4.0([email protected])'@noble/hashes': 1.8.0'@peculiar/webcrypto': 1.7.1'@types/fs-extra': 9.0.13ajv: 8.20.0asn1js: 3.0.10async-exit-hook: 2.0.1- builder-util: 26.16.0- builder-util-runtime: 9.7.0+ builder-util: 26.16.0([email protected])+ builder-util-runtime: 9.7.0([email protected])chromium-pickle-js: 0.2.0ci-info: 4.3.1- debug: 4.4.3- dmg-builder: 26.16.1([email protected])+ debug: 4.4.3([email protected])+ dmg-builder: 26.16.1([email protected])([email protected])dotenv: 16.6.1dotenv-expand: 11.0.7ejs: 3.1.10- electron-builder-squirrel-windows: 26.16.1([email protected])- electron-publish: 26.16.0+ electron-builder-squirrel-windows: 26.16.1([email protected])([email protected])+ electron-publish: 26.16.0([email protected])fs-extra: 10.1.0hosted-git-info: 4.1.0isbinaryfile: 5.0.7@@ -12769,11 +12785,11 @@ snapshots:dependencies:bytes: 3.1.2content-type: 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])http-errors: 2.0.1iconv-lite: 0.7.3on-finished: 2.4.1@@ -12837,23 +12853,23 @@ snapshots:base64-js: 1.5.1ieee754: 1.2.1dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])sax: 1.6.0transitivePeerDependencies:- supports-colordependencies:'@types/debug': 4.1.13- builder-util-runtime: 9.7.0+ builder-util-runtime: 9.7.0([email protected])chalk: 4.1.2cross-spawn: 7.0.6- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 10.1.0- http-proxy-agent: 7.0.2- https-proxy-agent: 7.0.6+ http-proxy-agent: 7.0.2([email protected])+ https-proxy-agent: 7.0.6([email protected])js-yaml: 4.3.0sanitize-filename: 1.6.4source-map-support: 0.5.21@@ -12939,12 +12955,12 @@ snapshots:dependencies:'@workflow/serde': 4.1.0-beta.2mdast-util-to-string: 4.0.0- remark-gfm: 4.0.1- remark-parse: 11.0.0+ remark-gfm: 4.0.1([email protected])+ remark-parse: 11.0.0([email protected])remark-stringify: 11.0.0remend: 1.3.0unified: 11.0.5@@ -13408,9 +13424,11 @@ snapshots:dependencies:mimic-function: 5.0.1dependencies:ms: 2.1.3+ optionalDependencies:+ supports-color: 9.4.0dependencies:@@ -13503,10 +13521,10 @@ snapshots:unescape-js: 1.1.4utf8: 3.0.0dependencies:- app-builder-lib: 26.16.1([email protected])([email protected])- builder-util: 26.16.0+ builder-util: 26.16.0([email protected])fs-extra: 10.1.0js-yaml: 4.3.0transitivePeerDependencies:@@ -13572,23 +13590,23 @@ snapshots:dependencies:- app-builder-lib: 26.16.1([email protected])([email protected])- builder-util: 26.16.0- electron-winstaller: 5.4.0+ builder-util: 26.16.0([email protected])+ electron-winstaller: 5.4.0([email protected])transitivePeerDependencies:- dmg-builder- supports-colordependencies:- app-builder-lib: 26.16.1([email protected])([email protected])- builder-util: 26.16.0- builder-util-runtime: 9.7.0+ builder-util: 26.16.0([email protected])+ builder-util-runtime: 9.7.0([email protected])chalk: 4.1.2ci-info: 4.4.0- dmg-builder: 26.16.1([email protected])+ dmg-builder: 26.16.1([email protected])([email protected])fs-extra: 10.1.0lazy-val: 1.0.5simple-update-notifier: 2.0.0@@ -13599,12 +13617,12 @@ snapshots:dependencies:'@types/fs-extra': 9.0.13aws4: 1.13.2- builder-util: 26.16.0- builder-util-runtime: 9.7.0+ builder-util: 26.16.0([email protected])+ builder-util-runtime: 9.7.0([email protected])chalk: 4.1.2form-data: 4.0.6fs-extra: 10.1.0@@ -13613,6 +13631,13 @@ snapshots:transitivePeerDependencies:- supports-color+ [email protected](patch_hash=6f583444e425a99e21e374a9afab303612eb8255ee21194afdb77f347c6cc045)([email protected]([email protected])):+ dependencies:+ node-addon-api: 8.9.0+ node-gyp: 12.4.0+ optionalDependencies:+ electron: 43.2.0([email protected])+dependencies:conf: 10.2.0@@ -13620,9 +13645,9 @@ snapshots:dependencies:- builder-util-runtime: 9.7.0+ builder-util-runtime: 9.7.0([email protected])fs-extra: 10.1.0js-yaml: 4.3.0lazy-val: 1.0.5@@ -13638,22 +13663,22 @@ snapshots:jsonfile: 4.0.0mkdirp: 0.5.6dependencies:'@electron/asar': 3.4.1- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 7.0.1lodash: 4.18.1temp: 0.9.4optionalDependencies:- '@electron/windows-sign': 1.2.2+ '@electron/windows-sign': 1.2.2([email protected])transitivePeerDependencies:- supports-colordependencies:'@electron-internal/extract-zip': 1.0.5- '@electron/get': 5.1.0+ '@electron/get': 5.1.0([email protected])'@types/node': 24.13.3transitivePeerDependencies:- supports-color@@ -13859,18 +13884,18 @@ snapshots:dependencies:- eslint: 10.0.0([email protected])+ eslint: 10.0.0([email protected])([email protected])- [email protected]([email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected]):+ [email protected]([email protected]([email protected]([email protected])([email protected])))([email protected]([email protected])([email protected]))([email protected]):dependencies:- eslint: 10.0.0([email protected])+ eslint: 10.0.0([email protected])([email protected])prettier: 3.9.5prettier-linter-helpers: 1.0.1synckit: 0.11.13optionalDependencies:- eslint-config-prettier: 10.1.8([email protected]([email protected]))dependencies:@@ -13883,11 +13908,11 @@ snapshots:dependencies:- '@eslint-community/eslint-utils': 4.9.1([email protected]([email protected]))'@eslint-community/regexpp': 4.12.2- '@eslint/config-array': 0.23.5+ '@eslint/config-array': 0.23.5([email protected])'@eslint/config-helpers': 0.5.5'@eslint/core': 1.2.1'@eslint/plugin-kit': 0.6.1@@ -13897,7 +13922,7 @@ snapshots:'@types/estree': 1.0.9ajv: 6.15.0cross-spawn: 7.0.6- debug: 4.4.3+ debug: 4.4.3([email protected])escape-string-regexp: 4.0.0eslint-scope: 9.1.2eslint-visitor-keys: 5.0.1@@ -14021,25 +14046,25 @@ snapshots:dependencies:- express: 5.2.1+ express: 5.2.1([email protected])ip-address: 10.2.0dependencies:accepts: 2.0.0- body-parser: 2.3.0+ body-parser: 2.3.0([email protected])content-disposition: 1.1.0content-type: 1.0.5cookie: 0.7.2cookie-signature: 1.2.2- debug: 4.4.3+ debug: 4.4.3([email protected])depd: 2.0.0encodeurl: 2.0.0escape-html: 1.0.3etag: 1.8.1- finalhandler: 2.1.1+ finalhandler: 2.1.1([email protected])fresh: 2.0.0http-errors: 2.0.1merge-descriptors: 2.0.0@@ -14050,9 +14075,9 @@ snapshots:proxy-addr: 2.0.7qs: 6.15.3range-parser: 1.3.0- router: 2.2.0- send: 1.2.1- serve-static: 2.2.1+ router: 2.2.0([email protected])+ send: 1.2.1([email protected])+ serve-static: 2.2.1([email protected])statuses: 2.0.2type-is: 2.1.0vary: 1.1.2@@ -14144,9 +14169,9 @@ snapshots:strtok3: 6.3.0token-types: 4.2.1dependencies:- '@tokenizer/inflate': 0.4.1+ '@tokenizer/inflate': 0.4.1([email protected])strtok3: 10.3.5token-types: 6.1.2uint8array-extras: 1.5.0@@ -14166,9 +14191,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])encodeurl: 2.0.0escape-html: 1.0.3on-finished: 2.4.1@@ -14356,9 +14381,9 @@ snapshots:optionalDependencies:- '@mapbox/node-pre-gyp': 1.0.11([email protected])+ '@mapbox/node-pre-gyp': 1.0.11([email protected])([email protected])node-addon-api: 8.9.0node-gyp: 12.4.0transitivePeerDependencies:@@ -14574,7 +14599,7 @@ snapshots:'@ungap/structured-clone': 1.3.3unist-util-position: 5.0.0dependencies:'@types/estree': 1.0.9'@types/estree-jsx': 1.0.5@@ -14584,9 +14609,9 @@ snapshots:estree-util-attach-comments: 3.0.0estree-util-is-identifier-name: 3.0.0hast-util-whitespace: 3.0.0- mdast-util-mdx-expression: 2.0.1- mdast-util-mdx-jsx: 3.2.0- mdast-util-mdxjs-esm: 2.0.1+ mdast-util-mdx-expression: 2.0.1([email protected])+ mdast-util-mdx-jsx: 3.2.0([email protected])+ mdast-util-mdxjs-esm: 2.0.1([email protected])property-information: 7.2.0space-separated-tokens: 2.0.2style-to-js: 1.1.21@@ -14609,7 +14634,7 @@ snapshots:stringify-entities: 4.0.4zwitch: 2.0.4dependencies:'@types/estree': 1.0.9'@types/hast': 3.0.5@@ -14618,9 +14643,9 @@ snapshots:devlop: 1.1.0estree-util-is-identifier-name: 3.0.0hast-util-whitespace: 3.0.0- mdast-util-mdx-expression: 2.0.1- mdast-util-mdx-jsx: 3.2.0- mdast-util-mdxjs-esm: 2.0.1+ mdast-util-mdx-expression: 2.0.1([email protected])+ mdast-util-mdx-jsx: 3.2.0([email protected])+ mdast-util-mdxjs-esm: 2.0.1([email protected])property-information: 7.2.0space-separated-tokens: 2.0.2style-to-js: 1.1.21@@ -14690,10 +14715,10 @@ snapshots:statuses: 2.0.2toidentifier: 1.0.1dependencies:agent-base: 7.1.4- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -14702,17 +14727,17 @@ snapshots:quick-lru: 5.1.1resolve-alpn: 1.2.1dependencies:- agent-base: 6.0.2- debug: 4.4.3+ agent-base: 6.0.2([email protected])+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-colordependencies:agent-base: 7.1.4- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -15155,9 +15180,9 @@ snapshots:lit-element: 4.2.2lit-html: 3.3.3dependencies:- '@npmcli/config': 8.3.4+ '@npmcli/config': 8.3.4([email protected])import-meta-resolve: 4.2.0transitivePeerDependencies:- bluebird@@ -15283,14 +15308,14 @@ snapshots:unist-util-is: 6.0.1unist-util-visit-parents: 6.0.2dependencies:'@types/mdast': 4.0.4'@types/unist': 3.0.3decode-named-character-reference: 1.3.0devlop: 1.1.0mdast-util-to-string: 4.0.0- micromark: 4.0.2+ micromark: 4.0.2([email protected])micromark-util-decode-numeric-character-reference: 2.0.2micromark-util-decode-string: 2.0.1micromark-util-normalize-identifier: 2.0.1@@ -15300,12 +15325,12 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4devlop: 1.1.0escape-string-regexp: 5.0.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2micromark-extension-frontmatter: 2.0.0transitivePeerDependencies:@@ -15319,79 +15344,79 @@ snapshots:mdast-util-find-and-replace: 3.0.2micromark-util-character: 2.1.1dependencies:'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2micromark-util-normalize-identifier: 2.0.1transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4devlop: 1.1.0markdown-table: 3.0.4- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-gfm-autolink-literal: 2.0.1- mdast-util-gfm-footnote: 2.1.0- mdast-util-gfm-strikethrough: 2.0.0- mdast-util-gfm-table: 2.0.0- mdast-util-gfm-task-list-item: 2.0.0+ mdast-util-gfm-footnote: 2.1.0([email protected])+ mdast-util-gfm-strikethrough: 2.0.0([email protected])+ mdast-util-gfm-table: 2.0.0([email protected])+ mdast-util-gfm-task-list-item: 2.0.0([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/hast': 3.0.5'@types/mdast': 4.0.4devlop: 1.1.0longest-streak: 3.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2unist-util-remove-position: 5.0.0transitivePeerDependencies:- supports-colordependencies:'@types/estree-jsx': 1.0.5'@types/hast': 3.0.5'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/estree-jsx': 1.0.5'@types/hast': 3.0.5@@ -15399,7 +15424,7 @@ snapshots:'@types/unist': 3.0.3ccount: 2.0.1devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2parse-entities: 4.0.2stringify-entities: 4.0.4@@ -15408,23 +15433,23 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:- mdast-util-from-markdown: 2.0.3- mdast-util-mdx-expression: 2.0.1- mdast-util-mdx-jsx: 3.2.0- mdast-util-mdxjs-esm: 2.0.1+ mdast-util-from-markdown: 2.0.3([email protected])+ mdast-util-mdx-expression: 2.0.1([email protected])+ mdast-util-mdx-jsx: 3.2.0([email protected])+ mdast-util-mdxjs-esm: 2.0.1([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/estree-jsx': 1.0.5'@types/hast': 3.0.5'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-color@@ -15567,10 +15592,10 @@ snapshots:optionalDependencies:micromark-util-types: 2.0.2dependencies:devlop: 1.1.0- micromark: 4.0.2+ micromark: 4.0.2([email protected])micromark-extension-cjk-friendly-util: 3.0.1([email protected])micromark-util-chunked: 2.0.1micromark-util-resolve-all: 2.0.1@@ -15818,10 +15843,10 @@ snapshots:dependencies:'@types/debug': 4.1.13- debug: 4.4.3+ debug: 4.4.3([email protected])decode-named-character-reference: 1.3.0devlop: 1.1.0micromark-core-commonmark: 2.0.3@@ -16428,7 +16453,9 @@ snapshots:- [email protected]: {}+ optionalDependencies:+ bluebird: 3.7.2dependencies:@@ -16676,17 +16703,17 @@ snapshots:dependencies:'@types/hast': 3.0.5'@types/mdast': 4.0.4'@types/react': 19.2.17devlop: 1.1.0- hast-util-to-jsx-runtime: 2.3.6+ hast-util-to-jsx-runtime: 2.3.6([email protected])html-url-attributes: 3.0.1mdast-util-to-hast: 13.2.1react: 19.2.7- remark-parse: 11.0.0+ remark-parse: 11.0.0([email protected])remark-rehype: 11.1.2unified: 11.0.5unist-util-visit: 5.1.0@@ -16718,9 +16745,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -16851,11 +16878,11 @@ snapshots:hast-util-raw: 9.1.0vfile: 6.0.3dependencies:'@types/estree': 1.0.9'@types/hast': 3.0.5- hast-util-to-estree: 3.1.3+ hast-util-to-estree: 3.1.3([email protected])transitivePeerDependencies:- supports-color@@ -16865,10 +16892,10 @@ snapshots:mdast-util-newline-to-break: 2.0.0unified: 11.0.5- [email protected](@types/[email protected])([email protected])([email protected])([email protected]):+ [email protected](@types/[email protected])([email protected])([email protected]([email protected]))([email protected]):dependencies:mdast-util-to-markdown-cjk-friendly: 1.0.0(@types/[email protected])([email protected])- micromark-extension-cjk-friendly: 2.0.1([email protected])([email protected])unified: 11.0.5optionalDependencies:'@types/mdast': 4.0.4@@ -16876,31 +16903,31 @@ snapshots:- micromark- micromark-util-typesdependencies:import-meta-resolve: 4.2.0markdown-extensions: 2.0.0- remark: 15.0.1- unified-args: 11.0.1+ remark: 15.0.1([email protected])+ unified-args: 11.0.1([email protected])([email protected])transitivePeerDependencies:- bluebird- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-frontmatter: 2.0.1+ mdast-util-frontmatter: 2.0.1([email protected])micromark-extension-frontmatter: 2.0.0unified: 11.0.5transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-gfm: 3.1.0+ mdast-util-gfm: 3.1.0([email protected])micromark-extension-gfm: 3.0.0- remark-parse: 11.0.0+ remark-parse: 11.0.0([email protected])remark-stringify: 11.0.0unified: 11.0.5transitivePeerDependencies:@@ -16923,26 +16950,26 @@ snapshots:mdast-util-to-hast: 13.2.1unified: 11.0.5dependencies:'@types/mdast': 4.0.4- mdast-util-math: 3.0.0+ mdast-util-math: 3.0.0([email protected])micromark-extension-math: 3.1.0unified: 11.0.5transitivePeerDependencies:- supports-colordependencies:- mdast-util-mdx: 3.0.0+ mdast-util-mdx: 3.0.0([email protected])micromark-extension-mdxjs: 3.0.0transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])micromark-util-types: 2.0.2unified: 11.0.5transitivePeerDependencies:@@ -16962,10 +16989,10 @@ snapshots:mdast-util-to-markdown: 2.1.2unified: 11.0.5dependencies:'@types/mdast': 4.0.4- remark-parse: 11.0.0+ remark-parse: 11.0.0([email protected])remark-stringify: 11.0.0unified: 11.0.5transitivePeerDependencies:@@ -16981,9 +17008,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])module-details-from-path: 1.0.4transitivePeerDependencies:- supports-color@@ -17145,9 +17172,9 @@ snapshots:points-on-curve: 0.2.0points-on-path: 0.2.1dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])depd: 2.0.0is-promise: 4.0.0parseurl: 1.3.3@@ -17202,9 +17229,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])encodeurl: 2.0.0escape-html: 1.0.3etag: 1.8.1@@ -17223,12 +17250,12 @@ snapshots:type-fest: 0.13.1optional: truedependencies:encodeurl: 2.0.0escape-html: 1.0.3parseurl: 1.3.3- send: 1.2.1+ send: 1.2.1([email protected])transitivePeerDependencies:- supports-color@@ -17496,7 +17523,7 @@ snapshots:dependencies:inline-style-parser: 0.2.7dependencies:'@csstools/css-parser-algorithms': 2.7.1(@csstools/[email protected])'@csstools/css-tokenizer': 2.4.1@@ -17507,7 +17534,7 @@ snapshots:cosmiconfig: 8.3.6([email protected])css-functions-list: 3.3.3css-tree: 2.3.1- debug: 4.4.3+ debug: 4.4.3([email protected])fast-glob: 3.3.3fastest-levenshtein: 1.0.16file-entry-cache: 7.0.2@@ -17556,9 +17583,9 @@ snapshots:tinyglobby: 0.2.17ts-interface-checker: 0.1.13dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -17758,13 +17785,13 @@ snapshots:- [email protected]([email protected])([email protected])([email protected])([email protected])([email protected]):+ [email protected]([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:bundle-require: 5.1.0([email protected])cac: 6.7.14chokidar: 4.0.3consola: 3.4.2- debug: 4.4.3+ debug: 4.4.3([email protected])esbuild: 0.27.7fix-dts-default-cjs-exports: 1.0.1joycon: 3.1.1@@ -17819,13 +17846,13 @@ snapshots:+ [email protected]([email protected]([email protected])([email protected]))([email protected])([email protected]):dependencies:- '@typescript-eslint/eslint-plugin': 8.63.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])- '@typescript-eslint/typescript-estree': 8.63.0([email protected])- eslint: 10.0.0([email protected])+ '@typescript-eslint/eslint-plugin': 8.63.0(@typescript-eslint/[email protected]([email protected]([email protected])([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected]))([email protected])([email protected])+ '@typescript-eslint/parser': 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])+ '@typescript-eslint/typescript-estree': 8.63.0([email protected])([email protected])+ '@typescript-eslint/utils': 8.63.0([email protected]([email protected])([email protected]))([email protected])([email protected])+ eslint: 10.0.0([email protected])([email protected])typescript: 6.0.3transitivePeerDependencies:- supports-color@@ -17861,7 +17888,7 @@ snapshots:dependencies:'@types/text-table': 0.2.5chalk: 5.6.2@@ -17871,12 +17898,12 @@ snapshots:minimist: 1.2.8strip-ansi: 7.2.0text-table: 0.2.0- unified-engine: 11.2.2+ unified-engine: 11.2.2([email protected])([email protected])transitivePeerDependencies:- bluebird- supports-colordependencies:'@types/concat-stream': 2.0.3'@types/debug': 4.1.13@@ -17884,13 +17911,13 @@ snapshots:'@types/node': 22.20.1'@types/unist': 3.0.3concat-stream: 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])extend: 3.0.2glob: 10.5.0ignore: 6.0.2is-empty: 1.2.0is-plain-obj: 4.1.0- load-plugin: 6.0.3+ load-plugin: 6.0.3([email protected])parse-json: 7.1.1trough: 2.2.0unist-util-inspect: 8.1.0diff --git a/apps/desktop/pnpm-workspace.yaml b/apps/desktop/pnpm-workspace.yamlindex d0d2c4cefe3..9050ddcd6d8 100644--- a/apps/desktop/pnpm-workspace.yaml+++ b/apps/desktop/pnpm-workspace.yaml@@ -50,6 +50,7 @@ allowBuilds:'@sentry/cli': trueelectron: trueelectron-builder: true+ electron-sparkle-updater: falseelectron-winstaller: falseesbuild: falseget-windows: false@@ -71,3 +72,6 @@ minimumReleaseAgeExclude:- '@auv-js/[email protected]'- '@auv-js/[email protected]'- '@auv-js/[email protected]'+patchedDependencies:+ [email protected]: patches/[email protected]diff --git a/apps/desktop/scripts/__tests__/sparkleAppcast.test.mjs b/apps/desktop/scripts/__tests__/sparkleAppcast.test.mjsnew file mode 100644index 00000000000..15baa5a741b--- /dev/null+++ b/apps/desktop/scripts/__tests__/sparkleAppcast.test.mjs@@ -0,0 +1,83 @@+import { describe, expect, it } from 'vitest';++import { availableArches, ownZipName, previousArchives, s3KeyFromUrl } from '../sparkleAppcast.mjs';++const files = [+ 'LobeHub-2.2.19-canary.1-arm64-mac.zip',+ 'LobeHub-2.2.19-canary.1-arm64-mac.zip.blockmap',+ 'LobeHub-2.2.19-canary.1-mac.zip',+ 'LobeHub-2.2.19-canary.1-arm64.dmg',+ 'LobeHub-2.2.19-canary.1-x64.dmg',+];++describe('ownZipName', () => {+ it('picks the arm64 zip by its arch suffix', () => {+ expect(ownZipName(files, '2.2.19-canary.1', 'arm64')).toBe(+ 'LobeHub-2.2.19-canary.1-arm64-mac.zip',+ );+ });++ it('picks the x64 zip, which electron-builder names without an arch', () => {+ expect(ownZipName(files, '2.2.19-canary.1', 'x64')).toBe('LobeHub-2.2.19-canary.1-mac.zip');+ });++ it('fails when the version has no matching zip', () => {+ expect(() => ownZipName(files, '2.2.18-canary.9', 'x64')).toThrow(/found 0/);+ });+});++describe('previousArchives', () => {+ const feed = `<?xml version="1.0"?><rss><channel>+<item><title>2.2.18-canary.2</title><sparkle:version>2.2.18-canary.2</sparkle:version>+<enclosure url="https://cdn.example.com/canary/2.2.18-canary.2/LobeHub-2.2.18-canary.2-mac.zip" length="1" type="application/octet-stream" sparkle:edSignature="sig"/>+<sparkle:deltas><enclosure url="https://cdn.example.com/canary/2.2.18-canary.2/LobeHub-1.delta" sparkle:deltaFrom="2.2.18-canary.1"/></sparkle:deltas></item>+<item><title>2.2.18-canary.1</title>+<enclosure url="https://cdn.example.com/canary/2.2.18-canary.1/LobeHub-2.2.18-canary.1-mac.zip" sparkle:version="2.2.18-canary.1"/></item>+</channel></rss>`;++ it('lists the newest full archives first, ignoring delta enclosures', () => {+ expect(previousArchives(feed, 2)).toEqual([+ {+ url: 'https://cdn.example.com/canary/2.2.18-canary.2/LobeHub-2.2.18-canary.2-mac.zip',+ version: '2.2.18-canary.2',+ },+ {+ url: 'https://cdn.example.com/canary/2.2.18-canary.1/LobeHub-2.2.18-canary.1-mac.zip',+ version: '2.2.18-canary.1',+ },+ ]);+ });++ it('bounds the result to the requested delta bases', () => {+ expect(previousArchives(feed, 1)).toHaveLength(1);+ });+});++describe('s3KeyFromUrl', () => {+ it('maps an enclosure back to its bucket key', () => {+ expect(+ s3KeyFromUrl(+ 'https://cdn.example.com/canary/2.2.18-canary.2/a.zip',+ 'https://cdn.example.com/',+ ),+ ).toBe('canary/2.2.18-canary.2/a.zip');+ });++ it('rejects enclosures hosted elsewhere', () => {+ expect(() =>+ s3KeyFromUrl('https://evil.example.com/a.zip', 'https://cdn.example.com'),+ ).toThrow();+ });+});++describe('partial macOS releases', () => {+ it('publishes only the available Stable architecture', () => {+ expect(availableArches(['LobeHub-2.2.19-arm64-mac.zip'], '2.2.19')).toEqual(['arm64']);+ expect(availableArches(['LobeHub-2.2.19-mac.zip'], '2.2.19')).toEqual(['x64']);+ });+ it('ignores other versions and non-macOS archives', () => {+ expect(+ availableArches(['LobeHub-2.2.18-mac.zip', 'LobeHub-2.2.19-setup.exe'], '2.2.19'),+ ).toEqual([]);+ });+});diff --git a/apps/desktop/scripts/__tests__/sparkleBuildVersion.test.mjs b/apps/desktop/scripts/__tests__/sparkleBuildVersion.test.mjsnew file mode 100644index 00000000000..f439c8161c1--- /dev/null+++ b/apps/desktop/scripts/__tests__/sparkleBuildVersion.test.mjs@@ -0,0 +1,15 @@+import { describe, expect, it } from 'vitest';++import { toSparkleBuildVersion } from '../sparkleBuildVersion.mjs';++describe('toSparkleBuildVersion', () => {+ it('turns a canary semver into a dash-free, monotonically increasing build number', () => {+ expect(toSparkleBuildVersion('2.2.19-canary.1')).toBe('2.2.19.1');+ expect(toSparkleBuildVersion('2.2.19-canary.12')).toBe('2.2.19.12');+ });++ it('leaves stable and unknown versions untouched', () => {+ expect(toSparkleBuildVersion('2.2.19')).toBe('2.2.19');+ expect(toSparkleBuildVersion('2.2.19-beta.1')).toBe('2.2.19-beta.1');+ });+});diff --git a/apps/desktop/scripts/__tests__/sparklePackaging.test.mjs b/apps/desktop/scripts/__tests__/sparklePackaging.test.mjsnew file mode 100644index 00000000000..d42b836adad--- /dev/null+++ b/apps/desktop/scripts/__tests__/sparklePackaging.test.mjs@@ -0,0 +1,90 @@+import { describe, expect, it } from 'vitest';++import { resolveSparklePackaging } from '../sparklePackaging.mjs';++const settings = {+ sparklePublicKey: 'public-key',+ updateServerUrl: 'https://updates.example.com',+};++describe('resolveSparklePackaging', () => {+ it('packages Sparkle for signed stable, canary and beta macOS releases', () => {+ for (const channel of ['stable', 'canary', 'beta', undefined]) {+ expect(+ resolveSparklePackaging({+ channel,+ hasAppleCertificate: true,+ platform: 'darwin',+ ...settings,+ }),+ ).toEqual({ useSparkle: true });+ }+ });++ it('skips Sparkle on signed nightly macOS builds that lack the public key', () => {+ expect(+ resolveSparklePackaging({+ channel: 'nightly',+ hasAppleCertificate: true,+ platform: 'darwin',+ sparklePublicKey: undefined,+ updateServerUrl: 'https://updates.example.com',+ }),+ ).toEqual({ useSparkle: false });+ });++ it('does not package Sparkle on nightly even when settings are present', () => {+ expect(+ resolveSparklePackaging({+ channel: 'nightly',+ hasAppleCertificate: true,+ platform: 'darwin',+ ...settings,+ }),+ ).toEqual({ useSparkle: false });+ });++ it('rejects signed stable/canary/beta macOS builds that are missing Sparkle settings', () => {+ expect(() =>+ resolveSparklePackaging({+ channel: 'stable',+ hasAppleCertificate: true,+ platform: 'darwin',+ sparklePublicKey: undefined,+ updateServerUrl: 'https://updates.example.com',+ }),+ ).toThrow(/UPDATE_SERVER_URL and SPARKLE_ED_PUBLIC_KEY/);++ expect(() =>+ resolveSparklePackaging({+ channel: 'canary',+ hasAppleCertificate: true,+ platform: 'darwin',+ sparklePublicKey: 'public-key',+ updateServerUrl: undefined,+ }),+ ).toThrow(/UPDATE_SERVER_URL and SPARKLE_ED_PUBLIC_KEY/);+ });++ it('allows unsigned macOS and non-darwin builds without Sparkle settings', () => {+ expect(+ resolveSparklePackaging({+ channel: 'stable',+ hasAppleCertificate: false,+ platform: 'darwin',+ sparklePublicKey: undefined,+ updateServerUrl: undefined,+ }),+ ).toEqual({ useSparkle: false });++ expect(+ resolveSparklePackaging({+ channel: 'stable',+ hasAppleCertificate: true,+ platform: 'linux',+ sparklePublicKey: undefined,+ updateServerUrl: undefined,+ }),+ ).toEqual({ useSparkle: false });+ });+});diff --git a/apps/desktop/scripts/core-ota-test/README.md b/apps/desktop/scripts/core-ota-test/README.mdindex 13289de9e99..0d18c14200e 100644--- a/apps/desktop/scripts/core-ota-test/README.md+++ b/apps/desktop/scripts/core-ota-test/README.md@@ -2,6 +2,7 @@在本机打一个 arm64 的壳 + 内置 core(v1),再用本地 feed 依次发布 renderer-only(v2,reload)和 main 变更(v3,relaunch),最后验证篡改拒绝和 boot 回滚。+默认使用 Canary 通道(macOS Stable 仅整包升级);可用 `CORE_OTA_TEST_CHANNEL` 和 `CORE_OTA_TEST_PRODUCT` 隔离不同测试实例;`CORE_OTA_TEST_PORT` / `CORE_OTA_TEST_CDP_PORT` 可避开已有服务。这里的 v1–v4 是测试版本号,传输协议均为 schemaVersion 4,使用 `<channel>/<appVersion>/core-v4/<platform>` feed 和 HTTP Range;内置业务位于 `core.asar`,CLI 位于 `core.asar.unpacked/cli/dist/index.js`。所有命令在 `apps/desktop/` 下执行。产物都在 `release/core-ota-e2e/`:`priv.pem`/`pub.pem`、`app/`(打包结果)、`core-v1..v3/`、`feed/`。@@ -80,14 +81,14 @@ node scripts/core-ota-test/run.mjs eval "window.electronAPI.invoke('rendererOta.R=release/core-ota-e2e/app/mac-arm64/lobehub-core-ota-e2e.app/Contents/Resourcesmv "$R/core.asar" "$R/core.asar.saved" # 仅限独立 E2E 应用,结束后移回# --dir 打包没有 app-update.yml,救援靠它拿 feed 地址-printf 'provider: generic\nurl: http://127.0.0.1:8787/stable\n' > $R/app-update.yml+printf 'provider: generic\nurl: http://127.0.0.1:8787/canary\n' > $R/app-update.yml```-在 `feed/` 放一个 `stable-mac.yml`(`version: 1.0.0` 走「已是最新」,更高版本走下载 → `quitAndInstall`)。+在 `feed/` 放一个 `canary/appcast-arm64.xml`(当前 buildVersion 走「已是最新」,更高版本走 Sparkle 下载和安装;包使用测试公钥对应的 EdDSA 签名)。期望:`launch` 后出现救援窗口和对话框,`userData/logs/shell-rescue.log` 记录原始错误和检查结果;`boot.json` 为 `[email protected]` failures 3,下一次启动不再加载 core 直接进救援;「重试启动」清掉计数并真正重新加载 core。-假 zip 会让 Squirrel.Mac 报 `Could not locate update bundle`,此时应回到失败对话框而不是卡在「正在安装」。+假 zip 会让 Sparkle 报 `Could not locate update bundle`,此时应回到失败对话框而不是卡在「正在安装」。## 辅助diff --git a/apps/desktop/scripts/core-ota-test/run.mjs b/apps/desktop/scripts/core-ota-test/run.mjsindex f87a74924a5..7ad73630312 100644--- a/apps/desktop/scripts/core-ota-test/run.mjs+++ b/apps/desktop/scripts/core-ota-test/run.mjs@@ -1,5 +1,5 @@import { execSync, spawn } from 'node:child_process';-import { generateKeyPairSync } from 'node:crypto';+import { createPublicKey, generateKeyPairSync } from 'node:crypto';import {appendFileSync,cpSync,@@ -17,10 +17,10 @@ import { fileURLToPath } from 'node:url';const DESKTOP_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');const WORK = path.join(DESKTOP_DIR, 'release/core-ota-e2e');const FEED = path.join(WORK, 'feed');-const PORT = 8787;-const CDP_PORT = 9333;-const PRODUCT = 'lobehub-core-ota-e2e';-const CHANNEL = 'stable';+const PORT = Number(process.env.CORE_OTA_TEST_PORT || 8787);+const CDP_PORT = Number(process.env.CORE_OTA_TEST_CDP_PORT || 9333);+const PRODUCT = process.env.CORE_OTA_TEST_PRODUCT || 'lobehub-core-ota-e2e';+const CHANNEL = process.env.CORE_OTA_TEST_CHANNEL || 'canary';const APP_VERSION = '1.0.0';const RELEASE = path.join(FEED, CHANNEL, APP_VERSION);const PLATFORM = 'darwin';@@ -76,6 +76,10 @@ const steps = {const { publicKey } = keys();const env = {RENDERER_OTA_PUBLIC_KEY: publicKey,+ SPARKLE_ED_PUBLIC_KEY: createPublicKey(publicKey)+ .export({ format: 'der', type: 'spki' })+ .subarray(-32)+ .toString('base64'),UPDATE_CHANNEL: CHANNEL,UPDATE_SERVER_URL: `http://127.0.0.1:${PORT}/${CHANNEL}`,APP_URL: 'http://localhost:3015',@@ -83,6 +87,10 @@ const steps = {KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE=',};// Electron derives userData from package.json name; productName alone would share the dev instance's data.+ const pkg = JSON.parse(readFileSync(path.join(DESKTOP_DIR, 'package.json'), 'utf8'));+ const backup = path.join(WORK, 'package-metadata.json');+ if (!existsSync(backup))+ writeFileSync(backup, JSON.stringify({ name: pkg.name, version: pkg.version }));sh(`npm pkg set name=${PRODUCT} version=${APP_VERSION}`);if (!existsSync(path.join(DESKTOP_DIR, 'dist/renderer/apps/desktop/index.html'))) {sh('npm run build:main', env);@@ -235,7 +243,14 @@ const steps = {},restore() {- sh('git checkout -- package.json');+ const file = path.join(DESKTOP_DIR, 'package.json');+ const pkg = JSON.parse(readFileSync(file, 'utf8'));+ if (pkg.name !== PRODUCT || pkg.version !== APP_VERSION)+ throw new Error('Test package metadata changed; refusing to overwrite it');+ const backup = path.join(WORK, 'package-metadata.json');+ const original = JSON.parse(readFileSync(backup, 'utf8'));+ writeFileSync(file, JSON.stringify({ ...pkg, ...original }, null, 2) + '\n');+ rmSync(backup);},};diff --git a/apps/desktop/scripts/shellAbi.mjs b/apps/desktop/scripts/shellAbi.mjsindex f9694b67ff2..769b561f78b 100644--- a/apps/desktop/scripts/shellAbi.mjs+++ b/apps/desktop/scripts/shellAbi.mjs@@ -9,6 +9,7 @@ const ABI_FILE = 'apps/desktop/shell/abi.json';const TRACKED_INPUTS = ['apps/desktop/shell',+ 'apps/desktop/patches','apps/desktop/build','apps/desktop/electron-builder.mjs','apps/desktop/scripts/packBuiltinCore.mjs',diff --git a/apps/desktop/scripts/sparkleAppcast.mjs b/apps/desktop/scripts/sparkleAppcast.mjsnew file mode 100644index 00000000000..3555b65853e--- /dev/null+++ b/apps/desktop/scripts/sparkleAppcast.mjs@@ -0,0 +1,222 @@+import { execFileSync } from 'node:child_process';+import {+ copyFileSync,+ existsSync,+ mkdirSync,+ readdirSync,+ readFileSync,+ writeFileSync,+} from 'node:fs';+import path from 'node:path';+import { parseArgs } from 'node:util';++export const ARCHES = ['arm64', 'x64'];++export const ownZipName = (fileNames, version, arch) => {+ const suffix = arch === 'arm64' ? `-${version}-arm64-mac.zip` : `-${version}-mac.zip`;+ const matches = fileNames.filter((name) => name.endsWith(suffix));+ if (matches.length !== 1) {+ throw new Error(`expected exactly one ${arch} zip for ${version}, found ${matches.length}`);+ }+ return matches[0];+};++export const previousArchives = (appcastXml, count) => {+ const items = [];+ for (const [, item] of appcastXml.matchAll(/<item>([\S\s]*?)<\/item>/g)) {+ const url = item.match(/<enclosure[^>]*\surl="([^"]+)"/)?.[1];+ const version =+ item.match(/<sparkle:version>([^<]+)<\/sparkle:version>/)?.[1] ??+ item.match(/<enclosure[^>]*\ssparkle:version="([^"]+)"/)?.[1];+ if (url && version) items.push({ url, version });+ }+ return items.slice(0, count);+};++export const s3KeyFromUrl = (url, serverUrl) => {+ const base = serverUrl.replace(/\/$/, '');+ if (!url.startsWith(`${base}/`)) throw new Error(`enclosure ${url} is outside ${serverUrl}`);+ return url.slice(base.length + 1);+};++const run = (command, args, options = {}) => {+ console.info(`$ ${command} ${args.join(' ')}`);+ return execFileSync(command, args, {+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'inherit'],+ ...options,+ });+};++const createS3 = ({ bucket, endpoint }) => {+ const endpointArgs = endpoint ? ['--endpoint-url', endpoint] : [];+ const aws = (args) => run('aws', ['s3', ...args, ...endpointArgs]);+ return {+ download: (key, dest) => {+ try {+ aws(['cp', `s3://${bucket}/${key}`, dest]);+ return true;+ } catch {+ return false;+ }+ },+ upload: (src, key, cacheControl) =>+ aws(['cp', src, `s3://${bucket}/${key}`, '--cache-control', cacheControl]),+ };+};++export const publishArch = (arch, options) => {+ const {+ channel,+ deltaBases,+ deltaHistory,+ historyScript,+ keyFile,+ out,+ releaseDir,+ releaseNotes,+ s3,+ serverUrl,+ sparkleBin,+ version,+ } = options;+ const dir = path.join(out, arch);+ const historyDir = path.join(dir, 'history');+ mkdirSync(path.join(historyDir, '00'), { recursive: true });++ const zipName = ownZipName(readdirSync(releaseDir), version, arch);+ copyFileSync(path.join(releaseDir, zipName), path.join(dir, zipName));+ if (releaseNotes) writeFileSync(path.join(dir, zipName.replace(/\.zip$/, '.md')), releaseNotes);++ const feedKey = `${channel}/appcast-${arch}.xml`;+ const previousFeed = path.join(historyDir, '00', 'appcast.xml');+ if (s3.download(feedKey, previousFeed)) {+ for (const archive of previousArchives(readFileSync(previousFeed, 'utf8'), deltaBases)) {+ const key = s3KeyFromUrl(archive.url, serverUrl);+ if (!s3.download(key, path.join(dir, path.basename(key)))) {+ console.warn(`delta base ${archive.version} missing at ${key}; skipping`);+ }+ }+ } else {+ console.info(`no previous ${feedKey}; publishing a first appcast without deltas`);+ }++ const buildVersion = run('python3', [historyScript, 'version', path.join(dir, zipName)]).trim();+ const appcast = path.join(dir, 'appcast.xml');+ run(+ path.join(sparkleBin, 'generate_appcast'),+ [+ '--versions',+ buildVersion,+ '--maximum-versions',+ '1',+ '--maximum-deltas',+ String(deltaBases),+ '--ed-key-file',+ keyFile,+ '--download-url-prefix',+ `${serverUrl}/${channel}/${version}/`,+ '--embed-release-notes',+ '-o',+ appcast,+ dir,+ ],+ { stdio: 'inherit' },+ );+ run(+ 'python3',+ [+ historyScript,+ 'merge',+ appcast,+ '--history-dir',+ historyDir,+ '--history',+ String(deltaHistory),+ ],+ { stdio: 'inherit' },+ );+ run(path.join(sparkleBin, 'sign_update'), ['--ed-key-file', keyFile, appcast], {+ stdio: 'inherit',+ });++ for (const name of readdirSync(dir).filter((f) => f.endsWith('.delta'))) {+ s3.upload(+ path.join(dir, name),+ `${channel}/${version}/${name}`,+ 'public,max-age=31536000,immutable',+ );+ }+ s3.upload(appcast, `${channel}/${version}/appcast-${arch}.xml`, 'no-store');+ s3.upload(appcast, feedKey, 'no-store');+ console.info(`published ${feedKey} for ${version}`);+};++export const availableArches = (fileNames, version) =>+ ARCHES.filter((arch) => {+ const suffix = arch === 'arm64' ? `-${version}-arm64-mac.zip` : `-${version}-mac.zip`;+ return fileNames.some((name) => name.endsWith(suffix));+ });++const main = () => {+ const { values } = parseArgs({+ options: {+ 'arches': { type: 'string' },+ 'bucket': { type: 'string' },+ 'channel': { type: 'string' },+ 'delta-bases': { default: '1', type: 'string' },+ 'delta-history': { default: '6', type: 'string' },+ 'endpoint': { default: '', type: 'string' },+ 'history-script': { type: 'string' },+ 'key-file': { type: 'string' },+ 'out': { type: 'string' },+ 'release-dir': { type: 'string' },+ 'server-url': { type: 'string' },+ 'sparkle-bin': { type: 'string' },+ 'version': { type: 'string' },+ },+ });+ for (const key of [+ 'bucket',+ 'channel',+ 'history-script',+ 'key-file',+ 'out',+ 'release-dir',+ 'server-url',+ 'sparkle-bin',+ 'version',+ ]) {+ if (!values[key]) throw new Error(`--${key} is required`);+ }+ if (!existsSync(values['key-file'])) throw new Error('EdDSA key file not found');++ const serverUrl = values['server-url'].replace(/\/(stable|nightly|canary|beta)?\/?$/, '');+ const options = {+ channel: values.channel,+ deltaBases: Number(values['delta-bases']),+ deltaHistory: Number(values['delta-history']),+ historyScript: values['history-script'],+ keyFile: values['key-file'],+ out: values.out,+ releaseDir: values['release-dir'],+ releaseNotes: process.env.RELEASE_NOTES,+ s3: createS3({ bucket: values.bucket, endpoint: values.endpoint }),+ serverUrl,+ sparkleBin: values['sparkle-bin'],+ version: values.version,+ };+ const fileNames = readdirSync(values['release-dir']);+ const arches = values.arches+ ? values.arches.split(',')+ : availableArches(fileNames, values.version);+ if (!arches.length) throw new Error('No macOS archives to publish');+ for (const arch of arches) {+ if (!ARCHES.includes(arch)) throw new Error(`Unsupported architecture: ${arch}`);+ publishArch(arch, options);+ }+};++if (process.argv[1] && path.resolve(process.argv[1]) === new URL(import.meta.url).pathname) {+ main();+}diff --git a/apps/desktop/scripts/sparkleBuildVersion.mjs b/apps/desktop/scripts/sparkleBuildVersion.mjsnew file mode 100644index 00000000000..761a131e219--- /dev/null+++ b/apps/desktop/scripts/sparkleBuildVersion.mjs@@ -0,0 +1,8 @@+// Sparkle's SUStandardVersionComparator truncates CFBundleVersion at the first dash, so+// `2.2.19-canary.1` and `2.2.19-canary.2` compare equal and no update is ever offered.+// Canary builds therefore carry a dash-free build number and keep the semver as+// CFBundleShortVersionString (what app.getVersion() and electron-updater still read).+export const toSparkleBuildVersion = (version) => {+ const match = version.match(/^(\d+\.\d+\.\d+)-canary\.(\d+)$/);+ return match ? `${match[1]}.${match[2]}` : version;+};diff --git a/apps/desktop/scripts/sparklePackaging.mjs b/apps/desktop/scripts/sparklePackaging.mjsnew file mode 100644index 00000000000..d8c53f19d41--- /dev/null+++ b/apps/desktop/scripts/sparklePackaging.mjs@@ -0,0 +1,21 @@+const SPARKLE_RELEASE_CHANNELS = new Set(['stable', 'canary', 'beta']);++export const isSparkleReleaseChannel = (channel) =>+ !channel || SPARKLE_RELEASE_CHANNELS.has(channel);++export const resolveSparklePackaging = ({+ channel,+ hasAppleCertificate,+ platform,+ sparklePublicKey,+ updateServerUrl,+}) => {+ const hasSparkleSettings = Boolean(updateServerUrl && sparklePublicKey);+ const sparkleRelease = platform === 'darwin' && isSparkleReleaseChannel(channel);++ if (sparkleRelease && hasAppleCertificate && !hasSparkleSettings) {+ throw new Error('macOS releases require UPDATE_SERVER_URL and SPARKLE_ED_PUBLIC_KEY');+ }++ return { useSparkle: sparkleRelease && hasSparkleSettings };+};diff --git a/apps/desktop/shell/__tests__/core-loader.test.mjs b/apps/desktop/shell/__tests__/core-loader.test.mjsindex ac77af80c1a..c03ebbe8df9 100644--- a/apps/desktop/shell/__tests__/core-loader.test.mjs+++ b/apps/desktop/shell/__tests__/core-loader.test.mjs@@ -34,7 +34,7 @@ const writeJson = (file, value) => {fs.writeFileSync(file, JSON.stringify(value));};-const writeCore = (dir, version, { shellAbi = ABI, seq, channel, mutate } = {}) => {+const writeCore = (dir, version, { shellAbi = ABI, seq, channel, schemaVersion, mutate } = {}) => {const files = {'cli/lobe-cli.js': 'cli','dist/main/index.js': `module.exports = ${JSON.stringify(version)};`,@@ -53,6 +53,7 @@ const writeCore = (dir, version, { shellAbi = ABI, seq, channel, mutate } = {})tree,version,...(seq === undefined ? {} : { seq }),+ ...(schemaVersion === undefined ? {} : { schemaVersion }),...(channel === undefined ? {} : { channel }),});mutate?.(dir, manifest);@@ -64,7 +65,8 @@ const writePointer = (pointer) => writeJson(pointerFile(), { abi: ABI, ...pointeconst writeExternal = (version, opts) =>writeCore(path.join(otaRoot(), 'cores', version), version, opts);-const resolve = () => resolveCore({ abi: ABI, builtinDir, publicKey: publicKeyPem, userData });+const resolve = () =>+ resolveCore({ abi: ABI, builtinDir, platform: 'linux', publicKey: publicKeyPem, userData });beforeEach(() => {tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'core-loader-'));@@ -79,6 +81,46 @@ afterEach(() => {});describe('resolveCore', () => {+ it('drops an older shell namespace after a full update even when its OTA seq is higher', () => {+ writeCore(builtinDir, '1.0.2-canary.1', { channel: 'canary', seq: 0, schemaVersion: 4 });+ writeExternal('1.0.1-canary.1-core.101', { channel: 'canary', seq: 101, schemaVersion: 4 });+ writePointer({ channel: 'canary', current: '1.0.1-canary.1-core.101' });+ const core = resolve();+ expect(core.source).toBe('builtin');+ expect(core.log.join(' ')).toContain('does not belong to 1.0.2-canary.1');+ });++ it('ignores staged and current OTA cores on macOS Stable even with a Canary pointer', () => {+ writeCore(builtinDir, '1.0.0', { channel: 'stable', seq: 0 });+ writeExternal('1.0.1-core.1', { channel: 'canary', seq: 1 });+ writePointer({ channel: 'canary', current: '1.0.1-core.1', staged: '1.0.1-core.1' });+ writeJson(path.join(userData, 'lobehub-settings.json'), { updateChannel: 'stable' });+ const core = resolveCore({+ abi: ABI,+ builtinDir,+ platform: 'darwin',+ publicKey: publicKeyPem,+ userData,+ });+ expect(core.source).toBe('builtin');+ expect(readPointer()).toMatchObject({ channel: 'stable', current: null, staged: null });+ });++ it('loads OTA when a macOS Stable build has opted into Canary', () => {+ writeCore(builtinDir, '1.0.0', { channel: 'stable', seq: 0 });+ writeExternal('1.0.1-core.1', { channel: 'canary', seq: 1 });+ writePointer({ channel: 'canary', current: '1.0.1-core.1' });+ writeJson(path.join(userData, 'lobehub-settings.json'), { updateChannel: 'canary' });+ const core = resolveCore({+ abi: ABI,+ builtinDir,+ platform: 'darwin',+ publicKey: publicKeyPem,+ userData,+ });+ expect(core.source).toBe('external');+ });+it('falls back to builtin when there is no pointer', () => {const core = resolve();expect(core.source).toBe('builtin');diff --git a/apps/desktop/shell/__tests__/rescue.test.mjs b/apps/desktop/shell/__tests__/rescue.test.mjsindex f6667e2d778..3dc038efd19 100644--- a/apps/desktop/shell/__tests__/rescue.test.mjs+++ b/apps/desktop/shell/__tests__/rescue.test.mjs@@ -11,6 +11,7 @@ const updaterPath = fileURLToPath(new URL('../rescue/electron-updater.cjs', impoconst require = createRequire(rescuePath);const electronPath = require.resolve('electron');+const originalPlatform = process.platform;let tmp;let userData;let resourcesPath;@@ -117,6 +118,7 @@ const run = async (electron, updater) => {};beforeEach(() => {+ Object.defineProperty(process, 'platform', { value: 'win32' });tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'shell-rescue-'));userData = path.join(tmp, 'userData');resourcesPath = process.resourcesPath;@@ -129,6 +131,7 @@ beforeEach(() => {});afterEach(() => {+ Object.defineProperty(process, 'platform', { value: originalPlatform });for (const file of [electronPath, rescuePath, updaterPath]) delete require.cache[file];process.resourcesPath = resourcesPath;fs.rmSync(tmp, { force: true, recursive: true });@@ -150,7 +153,7 @@ describe('rescue config', () => {[undefined, 'beta', 'canary'],[undefined, 'canary', 'canary'],[undefined, 'stable', 'stable'],- [undefined, undefined, 'stable'],+ [undefined, undefined, 'canary'],])('stored %s with builtin %s resolves to %s', (stored, built, expected) => {if (stored) writeJson(path.join(userData, 'lobehub-settings.json'), { updateChannel: stored });if (built)@@ -217,7 +220,7 @@ describe('runRescue', () => {expect(updater.setFeedURL).toHaveBeenCalledWith({provider: 'generic',- url: 'https://releases.example.com/stable',+ url: 'https://releases.example.com/canary',});expect(updater.downloadUpdate).toHaveBeenCalled();expect(electron.app.releaseSingleInstanceLock).toHaveBeenCalled();@@ -316,3 +319,47 @@ describe('vendored electron-updater', () => {expect(banner).toBe(`/* electron-updater@${version} generated by shell:vendor */`);});});++describe('macOS Sparkle rescue', () => {+ it('repairs a broken Canary core through Sparkle without loading electron-updater', async () => {+ Object.defineProperty(process, 'platform', { value: 'darwin' });+ const electron = fakeElectron();+ const addonFile = path.join(process.resourcesPath, 'sparkle', 'sparkle_bridge.node');+ fs.mkdirSync(path.dirname(addonFile), { recursive: true });+ fs.writeFileSync(addonFile, '');+ const addonPath = require.resolve(addonFile);+ let emit;+ const bridge = {+ init: vi.fn(() => true),+ setAutomaticChecks: vi.fn(),+ setEventHandler: vi.fn((handler) => {+ emit = handler;+ }),+ checkForUpdates: vi.fn(() => {+ emit({ type: 'update-available', version: '2.0.0-canary.1' });+ emit({ type: 'update-downloaded', version: '2.0.0-canary.1' });+ }),+ installUpdateNow: vi.fn(),+ };+ require.cache[addonPath] = { exports: bridge, id: addonPath, loaded: true };+ const fallback = vi.fn();+ try {+ loadRescue(electron, new Error('legacy updater must not load')).runRescue({+ downloadUrl: 'https://example.com/downloads',+ error: new Error('broken core'),+ fallback,+ });+ await vi.waitFor(() => expect(bridge.installUpdateNow).toHaveBeenCalledOnce());+ expect(bridge.init).toHaveBeenCalledWith({+ appcastUrl: `https://releases.example.com/canary/appcast-${process.arch}.xml`,+ });+ expect(fallback).not.toHaveBeenCalled();+ expect(electron.app.releaseSingleInstanceLock).toHaveBeenCalledOnce();+ const quit = electron.app.on.mock.calls.find(([event]) => event === 'will-quit')?.[1];+ quit();+ expect(bridge.setEventHandler).toHaveBeenLastCalledWith(null);+ } finally {+ delete require.cache[addonPath];+ }+ });+});diff --git a/apps/desktop/shell/core-loader.js b/apps/desktop/shell/core-loader.jsindex e90b2f2cd24..bbe2bbbcf98 100644--- a/apps/desktop/shell/core-loader.js+++ b/apps/desktop/shell/core-loader.js@@ -78,7 +78,7 @@ const verifyCandidate = (dir, { abi, builtinHashes, publicKey, storeDir }) => {return manifest;};-function resolveCore({ userData, builtinDir, abi, publicKey }) {+function resolveCore({ userData, builtinDir, abi, publicKey, platform = process.platform }) {const otaRoot = path.join(userData, 'core-ota');const bootFile = path.join(otaRoot, 'boot.json');const pointerFile = path.join(otaRoot, 'pointer.json');@@ -106,6 +106,13 @@ function resolveCore({ userData, builtinDir, abi, publicKey }) {};const builtinManifest = readJson(path.join(builtinDir, 'manifest.json')) ?? null;+ const updateChannel =+ readJson(path.join(userData, 'lobehub-settings.json'))?.updateChannel ??+ builtinManifest?.channel;+ if (platform === 'darwin' && updateChannel !== 'canary' && updateChannel !== 'beta') {+ log.push('macOS Stable uses full updates only; ignoring external core');+ savePointer({ channel: 'stable', current: null, previous: null, staged: null });+ }const builtinSeq = typeof builtinManifest?.seq === 'number' ? builtinManifest.seq : null;const builtinHashes = new Set(Array.isArray(builtinManifest?.tree) ? builtinManifest.tree.map((file) => file.sha256) : [],@@ -117,6 +124,15 @@ function resolveCore({ userData, builtinDir, abi, publicKey }) {const rejectReason = (manifest) => {if (channel && manifest.channel && manifest.channel !== channel)return `channel ${manifest.channel} != ${channel}`;+ // v4 seq counters restart for each shell version. A full update must not keep+ // an older shell's core just because that namespace had a higher seq.+ if (+ manifest.schemaVersion === 4 &&+ builtinManifest?.version &&+ manifest.version !== builtinManifest.version &&+ !manifest.version.startsWith(`${builtinManifest.version}-core.`)+ )+ return `app version ${manifest.version} does not belong to ${builtinManifest.version}`;if (builtinSeq !== null &&manifest.channel === builtinManifest.channel &&diff --git a/apps/desktop/shell/rescue/index.js b/apps/desktop/shell/rescue/index.jsindex 25a9b8bd206..ae3bd1ceec3 100644--- a/apps/desktop/shell/rescue/index.js+++ b/apps/desktop/shell/rescue/index.js@@ -15,7 +15,16 @@ const readJson = (file) => {const resolveChannel = ({ resourcesPath, userData }) => {const stored = readJson(path.join(userData, 'lobehub-settings.json'))?.updateChannel;if (stored != null) return stored === 'canary' ? 'canary' : 'stable';- const built = readJson(path.join(resourcesPath, 'core.asar', 'manifest.json'))?.channel;+ let built = readJson(path.join(resourcesPath, 'core.asar', 'manifest.json'))?.channel;+ if (built == null) {+ try {+ built = /\/(stable|nightly|canary|beta)\/?['"]?\s*$/m.exec(+ fs.readFileSync(path.join(resourcesPath, 'app-update.yml'), 'utf8'),+ )?.[1];+ } catch {+ // A missing core still has its packaged feed; without either, use Stable.+ }+ }return built === 'canary' || built === 'beta' ? 'canary' : 'stable';};@@ -137,8 +146,17 @@ function runRescue({ downloadUrl, error, fallback, log = [] }) {app.whenReady().then(() => {- const { autoUpdater } = require('./electron-updater.cjs');- configureUpdater(autoUpdater, { channel, feedUrl, logger });+ let autoUpdater;+ if (process.platform === 'darwin') {+ autoUpdater = require('./sparkle').createSparkleUpdater({+ app,+ feedUrl,+ resourcesPath: process.resourcesPath,+ });+ } else {+ autoUpdater = require('./electron-updater.cjs').autoUpdater;+ configureUpdater(autoUpdater, { channel, feedUrl, logger });+ }const t = strings(app.getLocale().startsWith('zh'));const status = createStatusWindow(t.checking);@@ -197,7 +215,7 @@ function runRescue({ downloadUrl, error, fallback, log = [] }) {}};- // Squirrel.Mac reports install failures only through this event, after quitAndInstall.+ // Installation can fail asynchronously after quitAndInstall.autoUpdater.on('error', (installError) => {if (!installing) return;installing = false;diff --git a/apps/desktop/shell/rescue/sparkle.js b/apps/desktop/shell/rescue/sparkle.jsnew file mode 100644index 00000000000..1c41a5400e6--- /dev/null+++ b/apps/desktop/shell/rescue/sparkle.js@@ -0,0 +1,76 @@+const { EventEmitter } = require('node:events');+const path = require('node:path');++// Rescue cannot import the core: this bridge remains usable when core startup fails.+function createSparkleUpdater({ app, feedUrl, resourcesPath }) {+ if (!feedUrl) throw new Error('Sparkle rescue requires an update server URL');+ const bridge = require(path.join(resourcesPath, 'sparkle', 'sparkle_bridge.node'));+ app.on('will-quit', () => bridge.setEventHandler(null));+ const events = new EventEmitter();+ let updateInfo;+ let downloaded = false;+ let resolveCheck;+ let rejectCheck;+ let resolveDownload;+ let rejectDownload;++ bridge.setEventHandler((event) => {+ switch (event.type) {+ case 'update-available': {+ updateInfo = { version: event.version };+ resolveCheck?.({ isUpdateAvailable: true, updateInfo });+ resolveCheck = rejectCheck = undefined;+ break;+ }+ case 'update-not-available': {+ resolveCheck?.({ isUpdateAvailable: false });+ resolveCheck = rejectCheck = undefined;+ break;+ }+ case 'download-progress': {+ if (event.phase === 'download') events.emit('download-progress', event);+ break;+ }+ case 'update-downloaded': {+ downloaded = true;+ resolveCheck?.({ isUpdateAvailable: true, updateInfo: { version: event.version } });+ resolveCheck = rejectCheck = undefined;+ resolveDownload?.();+ resolveDownload = rejectDownload = undefined;+ break;+ }+ case 'error': {+ const error = new Error(event.message ?? 'Sparkle rescue update failed');+ rejectCheck?.(error);+ rejectDownload?.(error);+ resolveCheck = rejectCheck = resolveDownload = rejectDownload = undefined;+ events.emit('error', error);+ break;+ }+ }+ });+ if (!bridge.init({ appcastUrl: `${feedUrl}/appcast-${process.arch}.xml` })) {+ throw new Error('Sparkle rescue initialization failed');+ }+ bridge.setAutomaticChecks(false);++ return {+ checkForUpdates: () =>+ new Promise((resolve, reject) => {+ resolveCheck = resolve;+ rejectCheck = reject;+ bridge.checkForUpdates();+ }),+ downloadUpdate: () =>+ downloaded+ ? Promise.resolve()+ : new Promise((resolve, reject) => {+ resolveDownload = resolve;+ rejectDownload = reject;+ }),+ on: events.on.bind(events),+ quitAndInstall: () => bridge.installUpdateNow(),+ };+}++module.exports = { createSparkleUpdater };diff --git a/apps/desktop/src/main/core/App.ts b/apps/desktop/src/main/core/App.tsindex 18aa7b9e3db..f6eb1095870 100644--- a/apps/desktop/src/main/core/App.ts+++ b/apps/desktop/src/main/core/App.ts@@ -615,7 +615,8 @@ export class App {.then(() => {this.destroyOnQuit();this.quitReady = true;- app.quit();+ // Let the cancelled native termination return before requesting another quit.+ setImmediate(() => app.quit());});};diff --git a/apps/desktop/src/main/core/__tests__/App.test.ts b/apps/desktop/src/main/core/__tests__/App.test.tsindex 6968533c6db..2775f77bb26 100644--- a/apps/desktop/src/main/core/__tests__/App.test.ts+++ b/apps/desktop/src/main/core/__tests__/App.test.ts@@ -248,8 +248,14 @@ describe('App', () => {expect(destroy).not.toHaveBeenCalled();expect(managedProcess.shutdownManagedProcesses).toHaveBeenCalledOnce();finish();- await vi.waitFor(() => expect(destroy).toHaveBeenCalledOnce());- expect(electronApp.quit).toHaveBeenCalledOnce();+ await Promise.resolve();+ await Promise.resolve();+ // Retrying inside the cancelled native quit's microtask checkpoint is ignored on macOS.+ expect(electronApp.quit).not.toHaveBeenCalled();+ await vi.waitFor(() => {+ expect(destroy).toHaveBeenCalledOnce();+ expect(electronApp.quit).toHaveBeenCalledOnce();+ });event.preventDefault.mockClear();beforeQuitHandler(event);expect(event.preventDefault).not.toHaveBeenCalled();diff --git a/apps/desktop/src/main/core/infrastructure/UpdaterManager.ts b/apps/desktop/src/main/core/infrastructure/UpdaterManager.tsindex bf58d6a755c..f84fcfceddc 100644--- a/apps/desktop/src/main/core/infrastructure/UpdaterManager.ts+++ b/apps/desktop/src/main/core/infrastructure/UpdaterManager.ts@@ -6,20 +6,16 @@ import type {UpdaterState,} from '@lobechat/electron-client-ipc';import { app as electronApp } from 'electron';-import log from 'electron-log';-import { autoUpdater } from 'electron-updater';import semver from 'semver';import { isDev, isWindows } from '@/const/env';-import { getDesktopEnv } from '@/env';import { UPDATE_CHANNEL, UPDATE_SERVER_URL, updaterConfig } from '@/modules/updater/configs';+import { createUpdateEngine, type UpdateEngine } from '@/modules/updater/engine';import { extractRestoreRoute } from '@/modules/updater/utils';import { createLogger } from '@/utils/logger';import type { App as AppCore } from '../App';-const FORCE_DEV_UPDATE_CONFIG = getDesktopEnv().FORCE_DEV_UPDATE_CONFIG;-const logger = createLogger('core:UpdaterManager');export class UpdaterManager {@@ -28,6 +24,7 @@ export class UpdaterManager {private downloading: boolean = false;private updateAvailable: boolean = false;private currentChannel: UpdateChannel = UPDATE_CHANNEL;+ private engine?: UpdateEngine;/** Incremented on each channel switch to invalidate in-flight checks */private checkGeneration: number = 0;/** Generation at the start of the current active check */@@ -50,11 +47,6 @@ export class UpdaterManager {constructor(app: AppCore) {this.app = app;-- log.transports.file.level = 'info';- autoUpdater.logger = log;-- logger.debug(`[Updater] Log file should be at: ${log.transports.file.getFile().path}`);}get mainWindow() {@@ -110,28 +102,14 @@ export class UpdaterManager {// Read persisted channel from store (defaults to build-time UPDATE_CHANNEL)this.currentChannel = this.app.storeManager.get('updateChannel') ?? UPDATE_CHANNEL;- autoUpdater.autoDownload = false;- autoUpdater.autoInstallOnAppQuit = false;-- const useDevConfig = isDev || FORCE_DEV_UPDATE_CONFIG;- if (useDevConfig) {- autoUpdater.forceDevUpdateConfig = true;- logger.info(- `Using dev update config (isDev=${isDev}, FORCE_DEV_UPDATE_CONFIG=${FORCE_DEV_UPDATE_CONFIG})`,- );- logger.info('Dev mode: Using dev-app-update.yml for update configuration');- } else {- autoUpdater.allowPrerelease = this.currentChannel !== 'stable';- logger.info(- `Production mode: channel=${this.currentChannel}, allowPrerelease=${this.currentChannel !== 'stable'}`,- );- this.configureUpdateProvider();+ try {+ this.engine = await createUpdateEngine(this.currentChannel);+ this.engine.configure(this.currentChannel);+ } catch (error) {+ logger.error('Failed to initialize updater:', error);+ this.setStage('error', { error: error instanceof Error ? error.message : String(error) });+ return;}-- // Keep every release channel rollback-capable. Assign this after configuring the provider because- // electron-updater's channel setter mutates allowDowngrade as a side effect.- autoUpdater.allowDowngrade = true;-this.registerEvents();if (updaterConfig.app.autoCheckUpdate) {@@ -139,10 +117,6 @@ export class UpdaterManager {setInterval(() => this.checkForUpdates(), updaterConfig.app.checkUpdateInterval);}- logger.debug(- `Initialized with channel: ${autoUpdater.channel}, allowPrerelease: ${autoUpdater.allowPrerelease}`,- );-logger.info('UpdaterManager initialization completed');};@@ -153,20 +127,15 @@ export class UpdaterManager {logger.info(`Switching update channel: ${this.currentChannel} -> ${channel}`);this.currentChannel = channel;- autoUpdater.allowPrerelease = channel !== 'stable';- this.configureUpdateProvider();-- // Reapply after configureUpdateProvider for the same channel-setter side effect as initialize.- autoUpdater.allowDowngrade = true;- logger.info('allowDowngrade=true');-this.installLaterVersion = null;+ this.updateAvailable = false;+ this.latestUpdateInfo = null;this.mainWindow.broadcast('updateChannelChanged', channel);// Invalidate any in-flight check and schedule a recheckthis.checkGeneration++;- if (this.checking) {+ if (this.checking || this.downloading) {this.pendingRecheck = true;} else {this.checkForUpdates();@@ -178,31 +147,20 @@ export class UpdaterManager {*/public checkForUpdates = async ({ manual = false }: { manual?: boolean } = {}) => {if (manual) void this.app.coreUpdateManager.checkForUpdates({ manual: true });- if (this.checking || this.downloading) return;+ if (!this.engine || this.checking || this.downloading) return;this.checking = true;this.activeGeneration = this.checkGeneration;- autoUpdater.allowPrerelease = this.currentChannel !== 'stable';-logger.info(`${manual ? 'Manually checking' : 'Auto checking'} for updates... (gen=${this.activeGeneration})`,);- logger.info('[Updater Config] Channel:', autoUpdater.channel);- logger.info('[Updater Config] currentChannel:', this.currentChannel);- logger.info('[Updater Config] allowPrerelease:', autoUpdater.allowPrerelease);- logger.info('[Updater Config] currentVersion:', autoUpdater.currentVersion?.version);- logger.info('[Updater Config] allowDowngrade:', autoUpdater.allowDowngrade);- logger.info('[Updater Config] autoDownload:', autoUpdater.autoDownload);- logger.info('[Updater Config] forceDevUpdateConfig:', autoUpdater.forceDevUpdateConfig);- logger.info('[Updater Config] Build channel from config:', UPDATE_CHANNEL);- logger.info('[Updater Config] UPDATE_SERVER_URL:', UPDATE_SERVER_URL || '(not set)');-this.setStage('checking');try {- await autoUpdater.checkForUpdates();+ this.engine.configure(this.currentChannel);+ await this.engine.checkForUpdates();} catch (error) {if (this.isStaleCheck()) return;@@ -251,7 +209,7 @@ export class UpdaterManager {* Download update*/public downloadUpdate = async () => {- if (this.downloading || !this.updateAvailable) return;+ if (!this.engine || this.downloading || !this.updateAvailable) return;this.downloading = true;logger.info('Downloading update...');@@ -259,7 +217,7 @@ export class UpdaterManager {this.setStage('downloading');try {- await autoUpdater.downloadUpdate();+ await this.engine.downloadUpdate();} catch (error) {this.downloading = false;logger.error('Error downloading update:', error);@@ -289,6 +247,7 @@ export class UpdaterManager {* Install update immediately*/public installNow = () => {+ if (!this.engine || !this.updateAvailable) return;logger.info('Installing update now...');this.captureRestoreRoute();@@ -310,8 +269,8 @@ export class UpdaterManager {app.releaseSingleInstanceLock();setTimeout(() => {- logger.info('Calling autoUpdater.quitAndInstall...');- autoUpdater.quitAndInstall(true, true);+ logger.info(`Calling ${this.engine?.kind} quitAndInstall...`);+ this.engine?.quitAndInstall();}, 100);};@@ -321,7 +280,8 @@ export class UpdaterManager {public installLater = () => {logger.info('Update will be installed on next restart');- autoUpdater.autoInstallOnAppQuit = true;+ if (!this.engine) return;+ this.engine.installOnQuit();if (this.latestUpdateInfo?.version) {this.installLaterVersion = this.latestUpdateInfo.version;logger.info(`Suppressing further prompts for version ${this.installLaterVersion}`);@@ -416,62 +376,17 @@ export class UpdaterManager {}, 300);};- /**- * Strip trailing channel path from URL so we can re-append the correct channel.- * Handles both base URL (https://cdn.example.com) and legacy URLs with channel suffixes.- */- private getBaseUpdateUrl(): string | undefined {- if (!UPDATE_SERVER_URL) return undefined;- return UPDATE_SERVER_URL.replace(/\/(stable|nightly|canary|beta)\/?$/, '');- }-- /**- * Configure update provider — all channels use generic HTTP provider (S3)- * URL format: {base}/{channel}/- * electron-updater looks for {channel}-mac.yml- */- private configureUpdateProvider() {- const baseUrl = this.getBaseUpdateUrl();- if (baseUrl) {- const feedUrl = `${baseUrl}/${this.currentChannel}`;- autoUpdater.channel = this.currentChannel;-- logger.info(`Configuring generic provider for ${this.currentChannel} channel`);- logger.info(`Update server URL: ${feedUrl}`);- logger.info(- `Channel set to: ${this.currentChannel} (will look for ${this.currentChannel}-mac.yml)`,- );-- autoUpdater.setFeedURL({- provider: 'generic',- url: feedUrl,- });- } else {- // Fallback to GitHub when no S3 URL configured (local dev)- logger.info(- `No UPDATE_SERVER_URL configured, falling back to GitHub provider for ${this.currentChannel} channel`,- );-- autoUpdater.setFeedURL({- owner: 'lobehub',- provider: 'github',- repo: 'lobehub',- });-- autoUpdater.allowPrerelease = this.currentChannel !== 'stable';- }- }-private registerEvents() {- logger.debug('Registering updater events');+ if (this.engine) this.bindEngine(this.engine);+ }- autoUpdater.on('checking-for-update', () => {+ private bindEngine(engine: UpdateEngine) {+ engine.on('checking-for-update', () => {logger.info('[Updater] Checking for update...');- logger.info('[Updater] Current channel:', autoUpdater.channel);- logger.info('[Updater] Current allowPrerelease:', autoUpdater.allowPrerelease);+ logger.info('[Updater] Current channel:', this.currentChannel);});- autoUpdater.on('update-available', (info) => {+ engine.on('update-available', (info) => {logger.info(`Update available: ${info.version} (activeGen=${this.activeGeneration}, currentGen=${this.checkGeneration})`,);@@ -497,7 +412,8 @@ export class UpdaterManager {this.downloadUpdate();});- autoUpdater.on('update-not-available', (info) => {+ engine.on('update-not-available', (info) => {+ if (this.isStaleCheck()) return;logger.info(`Update not available. Current: ${info.version}`);this.setStage('latest');@@ -506,7 +422,9 @@ export class UpdaterManager {}, 5000);});- autoUpdater.on('error', async (err) => {+ engine.on('error', async (err) => {+ this.downloading = false;+ if (this.isStaleCheck()) return;const message = err instanceof Error ? err.message : String(err);if (this.isMissingUpdateManifestError(err)) {@@ -519,9 +437,7 @@ export class UpdaterManager {}logger.error('Error in auto-updater:', err);- logger.error('[Updater Error Context] Channel:', autoUpdater.channel);logger.error('[Updater Error Context] currentChannel:', this.currentChannel);- logger.error('[Updater Error Context] allowPrerelease:', autoUpdater.allowPrerelease);logger.error('[Updater Error Context] UPDATE_SERVER_URL:', UPDATE_SERVER_URL || '(not set)');this.mainWindow.broadcast('updateError', err.message);@@ -531,7 +447,8 @@ export class UpdaterManager {}, 3000);});- autoUpdater.on('download-progress', (progressObj) => {+ engine.on('download-progress', (progressObj) => {+ if (this.isStaleCheck()) return;logger.debug(`Download speed: ${progressObj.bytesPerSecond} - Downloaded ${progressObj.percent}% (${progressObj.transferred}/${progressObj.total})`,);@@ -541,9 +458,10 @@ export class UpdaterManager {this.mainWindow.broadcast('updateDownloadProgress', progressObj);});- autoUpdater.on('update-downloaded', (info) => {+ engine.on('update-downloaded', (info) => {logger.info(`Update downloaded: ${info.version}`);this.downloading = false;+ if (this.isStaleCheck()) return;this.maybeClearInstallLaterGuard(info.version);@@ -559,8 +477,6 @@ export class UpdaterManager {this.mainWindow.broadcast('updateReady', updateInfo);});-- logger.debug('Updater events registered');}/**@@ -604,7 +520,7 @@ export class UpdaterManager {}private getCurrentUpdateInfo(): UpdateInfo {- const version = autoUpdater.currentVersion?.version || electronApp.getVersion();+ const version = electronApp.getVersion();return {kind: 'app',releaseDate: new Date().toISOString(),diff --git a/apps/desktop/src/main/core/infrastructure/__tests__/UpdaterManager.test.ts b/apps/desktop/src/main/core/infrastructure/__tests__/UpdaterManager.test.tsindex c2c8ca570e4..a110584a511 100644--- a/apps/desktop/src/main/core/infrastructure/__tests__/UpdaterManager.test.ts+++ b/apps/desktop/src/main/core/infrastructure/__tests__/UpdaterManager.test.ts@@ -1,14 +1,33 @@import { autoUpdater } from 'electron-updater';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import type * as EngineModule from '@/modules/updater/engine';+import type { App as AppCore } from '../../App';import { UpdaterManager } from '../UpdaterManager';// Use vi.hoisted to ensure mocks work with require()-const { mockGetAllWindows, mockReleaseSingleInstanceLock } = vi.hoisted(() => ({- mockGetAllWindows: vi.fn().mockReturnValue([]),- mockReleaseSingleInstanceLock: vi.fn(),-}));+const { mockGetAllWindows, mockLoadSparkleBridge, mockReleaseSingleInstanceLock } = vi.hoisted(+ () => ({+ mockGetAllWindows: vi.fn().mockReturnValue([]),+ mockLoadSparkleBridge: vi.fn(),+ mockReleaseSingleInstanceLock: vi.fn(),+ }),+);++vi.mock('electron-sparkle-updater', () => ({ loadSparkleBridge: mockLoadSparkleBridge }));++// Production resolves engine.mac.ts through the existing Vite platform plugin.+vi.mock('@/modules/updater/engine', async (importOriginal) => {+ const original = await importOriginal<typeof EngineModule>();+ return {+ ...original,+ createUpdateEngine: async (channel: 'stable' | 'canary') =>+ process.platform === 'darwin'+ ? (await import('@/modules/updater/engine.mac')).createUpdateEngine(channel)+ : original.createUpdateEngine(channel),+ };+});// Mock electron-logvi.mock('electron-log', () => ({@@ -58,12 +77,15 @@ vi.mock('electron', () => ({},app: {getVersion: vi.fn().mockReturnValue('0.0.0'),+ isPackaged: true,+ on: vi.fn(),releaseSingleInstanceLock: mockReleaseSingleInstanceLock,},}));// Mock updater configs-vi.mock('@/modules/updater/configs', () => ({+vi.mock('@/modules/updater/configs', async (importOriginal) => ({+ ...(await importOriginal<Record<string, unknown>>()),UPDATE_CHANNEL: 'stable',UPDATE_SERVER_URL: 'https://mock.update.server',updaterConfig: {@@ -86,8 +108,11 @@ vi.mock('@/env', () => ({// Mock isDevvi.mock('@/const/env', () => ({isDev: false,+ isWindows: false,}));+const originalPlatform = process.platform;+describe('UpdaterManager', () => {let updaterManager: UpdaterManager;let mockApp: AppCore;@@ -96,7 +121,9 @@ describe('UpdaterManager', () => {beforeEach(() => {vi.clearAllMocks();+ Object.defineProperty(process, 'platform', { value: 'win32' });vi.useFakeTimers();+ mockLoadSparkleBridge.mockReturnValue(null);// Reset autoUpdater state(autoUpdater as any).autoDownload = false;@@ -141,11 +168,13 @@ describe('UpdaterManager', () => {});afterEach(() => {+ Object.defineProperty(process, 'platform', { value: originalPlatform });vi.useRealTimers();});describe('constructor', () => {- it('should set up electron-log for autoUpdater', () => {+ it('should set up electron-log for autoUpdater', async () => {+ await updaterManager.initialize();expect(autoUpdater.logger).not.toBeNull();});});@@ -183,8 +212,149 @@ describe('UpdaterManager', () => {});});+ describe('sparkle engine', () => {+ const createBridge = () => ({+ checkForUpdates: vi.fn(),+ init: vi.fn().mockReturnValue(true),+ installUpdateNow: vi.fn(),+ installUpdateOnQuit: vi.fn(),+ setAutomaticChecks: vi.fn(),+ setEventHandler: vi.fn(),+ });++ let bridge: ReturnType<typeof createBridge>;+ let sparkleEvents: ((event: any) => void) | undefined;++ beforeEach(() => {+ bridge = createBridge();+ bridge.setEventHandler.mockImplementation((handler) => {+ sparkleEvents = handler;+ });+ bridge.checkForUpdates.mockImplementation(() => {+ sparkleEvents?.({ type: 'update-not-available' });+ });+ mockLoadSparkleBridge.mockReturnValue(bridge);+ Object.defineProperty(process, 'platform', { value: 'darwin' });+ });++ afterEach(() => {+ Object.defineProperty(process, 'platform', { value: originalPlatform });+ });++ it('drives canary through Sparkle with the arch-specific appcast', async () => {+ vi.mocked(mockApp.storeManager.get).mockReturnValue('canary');+ await updaterManager.initialize();++ expect(bridge.init).toHaveBeenCalledWith({+ appcastUrl: `https://mock.update.server/canary/appcast-${process.arch}.xml`,+ });++ await updaterManager.checkForUpdates();+ expect(bridge.checkForUpdates).toHaveBeenCalledTimes(1);+ expect(autoUpdater.checkForUpdates).not.toHaveBeenCalled();+ });++ it('uses Sparkle for stable without loading electron-updater', async () => {+ await updaterManager.initialize();+ await updaterManager.checkForUpdates();++ expect(bridge.init).toHaveBeenCalledWith({+ appcastUrl: `https://mock.update.server/stable/appcast-${process.arch}.xml`,+ });+ expect(bridge.checkForUpdates).toHaveBeenCalledTimes(1);+ expect(autoUpdater.setFeedURL).not.toHaveBeenCalled();+ expect(autoUpdater.on).not.toHaveBeenCalled();+ expect(autoUpdater.checkForUpdates).not.toHaveBeenCalled();+ });++ it('switches the Sparkle feed between stable and canary', async () => {+ await updaterManager.initialize();+ updaterManager.switchChannel('canary');+ await vi.advanceTimersByTimeAsync(0);+ updaterManager.switchChannel('stable');+ await vi.advanceTimersByTimeAsync(0);++ expect(bridge.init).toHaveBeenLastCalledWith({+ appcastUrl: `https://mock.update.server/stable/appcast-${process.arch}.xml`,+ });+ expect(bridge.checkForUpdates).toHaveBeenCalledTimes(2);+ expect(autoUpdater.setFeedURL).not.toHaveBeenCalled();+ });++ it('discards the old channel download and rechecks after its native cycle completes', async () => {+ vi.mocked(mockApp.storeManager.get).mockReturnValue('canary');+ bridge.checkForUpdates.mockImplementation(() => {});+ await updaterManager.initialize();+ const check = updaterManager.checkForUpdates();+ sparkleEvents?.({ type: 'update-available', version: '9.9.9-canary.1' });+ updaterManager.switchChannel('stable');+ sparkleEvents?.({ type: 'download-progress', phase: 'download', percent: 50 });+ sparkleEvents?.({ type: 'update-downloaded', version: '9.9.9-canary.1' });+ await check;+ expect(mockBroadcast).not.toHaveBeenCalledWith('updateReady', expect.anything());+ expect(mockBroadcast).not.toHaveBeenCalledWith('updateDownloadProgress', expect.anything());+ expect(bridge.init).toHaveBeenLastCalledWith({+ appcastUrl: `https://mock.update.server/stable/appcast-${process.arch}.xml`,+ });+ expect(bridge.checkForUpdates).toHaveBeenCalledTimes(2);+ sparkleEvents?.({ type: 'update-not-available' });+ await vi.advanceTimersByTimeAsync(0);+ expect(updaterManager.getUpdaterState().stage).toBe('latest');+ });++ it('reports a missing Sparkle bridge without falling back to electron-updater', async () => {+ mockLoadSparkleBridge.mockReturnValue(null);+ await updaterManager.initialize();+ await updaterManager.checkForUpdates();+ expect(updaterManager.getUpdaterState()).toEqual({+ stage: 'error',+ errorMessage: 'Sparkle bridge unavailable',+ });+ expect(autoUpdater.setFeedURL).not.toHaveBeenCalled();+ expect(autoUpdater.checkForUpdates).not.toHaveBeenCalled();+ });++ it('defers install-later to Sparkle on canary', async () => {+ vi.mocked(mockApp.storeManager.get).mockReturnValue('canary');+ await updaterManager.initialize();++ updaterManager.installLater();++ expect(bridge.installUpdateOnQuit).toHaveBeenCalledTimes(1);+ expect(autoUpdater.autoInstallOnAppQuit).toBe(false);+ });++ it('unblocks the next check when a Sparkle download fails', async () => {+ let sparkleEvents: ((event: any) => void) | undefined;+ bridge.setEventHandler.mockImplementation((fn) => {+ sparkleEvents = fn;+ });+ vi.mocked(mockApp.storeManager.get).mockReturnValue('canary');+ await updaterManager.initialize();++ sparkleEvents?.({ type: 'update-available', version: '9.9.9' });+ sparkleEvents?.({ message: 'download failed', type: 'error' });+ const next = updaterManager.checkForUpdates();+ sparkleEvents?.({ type: 'update-not-available' });+ await next;++ expect(bridge.checkForUpdates).toHaveBeenCalledTimes(1);+ expect(mockBroadcast).toHaveBeenCalledWith('updateError', 'download failed');+ });++ it('never loads Sparkle outside macOS', async () => {+ Object.defineProperty(process, 'platform', { value: 'win32' });+ vi.mocked(mockApp.storeManager.get).mockReturnValue('canary');++ await updaterManager.initialize();++ expect(mockLoadSparkleBridge).not.toHaveBeenCalled();+ });+ });+describe('switchChannel', () => {- it('should allow rollback whenever canary is the target channel', () => {+ it('should allow rollback whenever canary is the target channel', async () => {+ await updaterManager.initialize();updaterManager.switchChannel('canary');expect(autoUpdater.allowDowngrade).toBe(true);@@ -199,7 +369,8 @@ describe('UpdaterManager', () => {expect(autoUpdater.allowDowngrade).toBe(true);});- it('should allow rollback when stable remains the target channel', () => {+ it('should allow rollback when stable remains the target channel', async () => {+ await updaterManager.initialize();updaterManager.switchChannel('stable');expect(autoUpdater.allowDowngrade).toBe(true);@@ -455,6 +626,9 @@ describe('UpdaterManager', () => {});describe('installLater', () => {+ beforeEach(async () => {+ await updaterManager.initialize();+ });it('should set autoInstallOnAppQuit to true', () => {updaterManager.installLater();diff --git a/apps/desktop/src/main/core/infrastructure/coreOta/CoreUpdateManager.ts b/apps/desktop/src/main/core/infrastructure/coreOta/CoreUpdateManager.tsindex e724af5827f..75c1fadb88f 100644--- a/apps/desktop/src/main/core/infrastructure/coreOta/CoreUpdateManager.ts+++ b/apps/desktop/src/main/core/infrastructure/coreOta/CoreUpdateManager.ts@@ -56,7 +56,7 @@ export class CoreUpdateManager {private readonly otaRoot: string;private readonly store: CoreStore;private readonly builtinManifest: CoreManifest | null;- readonly disabledReasons: string[];+ private readonly baseDisabledReasons: string[];private activeChannel: CoreChannel;private pointer: CorePointer;private staged: Staged | null = null;@@ -76,6 +76,7 @@ export class CoreUpdateManager {private loadPingTimer: NodeJS.Timeout | null = null;private checkTimer: NodeJS.Timeout | null = null;private checkInterval: NodeJS.Timeout | null = null;+ private scheduledChecksStarted = false;private idleTimer: NodeJS.Timeout | null = null;private gcTask: Promise<void> = Promise.resolve();private checkTask: Promise<void> = Promise.resolve();@@ -92,11 +93,10 @@ export class CoreUpdateManager {);this.builtinManifest = this.shell ? readBuiltinManifest(this.shell) : null;this.activeChannel = this.coreChannel(- coerceStoredUpdateChannel(this.app.storeManager.get('updateChannel') as string | undefined) ||- UPDATE_CHANNEL,+ coerceStoredUpdateChannel(this.app.storeManager.get('updateChannel') ?? UPDATE_CHANNEL),);this.pointer = emptyPointer(this.shell?.abi ?? '');- this.disabledReasons = [+ this.baseDisabledReasons = [!this.shell && 'missing-shell',this.shell && !this.shell.manifest && 'missing-core-manifest',this.shell && !this.builtinManifest && 'missing-builtin-manifest',@@ -105,6 +105,12 @@ export class CoreUpdateManager {].filter((reason): reason is string => typeof reason === 'string');}+ get disabledReasons() {+ return process.platform === 'darwin' && this.activeChannel === 'stable'+ ? [...this.baseDisabledReasons, 'macos-stable-full-updates-only']+ : this.baseDisabledReasons;+ }+get enabled() {return this.disabledReasons.length === 0;}@@ -173,12 +179,14 @@ export class CoreUpdateManager {}startScheduledChecks = () => {+ if (this.baseDisabledReasons.length || this.scheduledChecksStarted) return;+ this.scheduledChecksStarted = true;+ electronApp.on('browser-window-blur', this.handleWindowBlur);+ electronApp.on('browser-window-focus', this.clearIdleTimer);if (!this.enabled) return;if (this.runningVersion && !this.mountedSeen && this.isFirstBootOfRunningCore()) {this.armBootCheck({ cold: true });}- electronApp.on('browser-window-blur', this.handleWindowBlur);- electronApp.on('browser-window-focus', this.clearIdleTimer);this.scheduleChecks();};@@ -187,19 +195,25 @@ export class CoreUpdateManager {if (next === this.activeChannel) return;logger.info('Core OTA channel changed', { from: this.activeChannel, to: next });this.activeChannel = next;- if (!this.enabled) return;+ if (this.baseDisabledReasons.length) return;this.checkGeneration += 1;this.busy = false;this.savePointer({channel: next,staged: null,- ...(this.staged?.applyMode === 'relaunch'+ ...(!this.enabled ? { current: null, previous: null } : {}),+ ...(this.enabled && this.staged?.applyMode === 'relaunch'? { current: this.pointer.previous, previous: null }: {}),});this.staged = null;this.gc();- if (this.checkTimer || this.checkInterval) this.scheduleChecks();+ if (this.checkTimer) clearTimeout(this.checkTimer);+ if (this.checkInterval) clearInterval(this.checkInterval);+ this.checkTimer = null;+ this.checkInterval = null;+ this.clearIdleTimer();+ if (this.scheduledChecksStarted && this.enabled) this.scheduleChecks();};handleBootPing = (stage?: 'loaded' | 'mounted') => {diff --git a/apps/desktop/src/main/core/infrastructure/coreOta/__tests__/CoreUpdateManager.int.test.ts b/apps/desktop/src/main/core/infrastructure/coreOta/__tests__/CoreUpdateManager.int.test.tsindex 01e14d8d9fd..b04195c2619 100644--- a/apps/desktop/src/main/core/infrastructure/coreOta/__tests__/CoreUpdateManager.int.test.ts+++ b/apps/desktop/src/main/core/infrastructure/coreOta/__tests__/CoreUpdateManager.int.test.ts@@ -27,7 +27,8 @@ const PUBLIC_KEY_PEM = publicKey.export({ format: 'pem', type: 'spki' }).toStrinconst ABI = 'a'.repeat(64);const SERVER = 'https://updates.test';const OBJECTS = 'https://cdn.test/cas';-const PLATFORM = process.platform as CoreManifest['platform'];+const ORIGINAL_PLATFORM = process.platform;+const PLATFORM = 'linux' as CoreManifest['platform'];const BASE_FILES: Record<string, string> = {'dist/main/index.js': 'main-v1',@@ -202,6 +203,7 @@ const flushGc = (manager: unknown) => (manager as { gcTask: Promise<void> }).gcTlet builtinManifest: CoreManifest;beforeEach(() => {+ Object.defineProperty(process, 'platform', { value: 'linux' });vi.clearAllMocks();served = new Map();userDataDir = mkdtempSync(path.join(tmpdir(), 'core-ota-user-'));@@ -212,6 +214,7 @@ beforeEach(() => {});afterEach(() => {+ Object.defineProperty(process, 'platform', { value: ORIGINAL_PLATFORM });rmSync(userDataDir, { force: true, recursive: true });rmSync(builtinDir, { force: true, recursive: true });});@@ -226,6 +229,33 @@ const mainChanged = (version: string, seq: number) =>buildManifest(version, seq, { ...BASE_FILES, 'dist/main/index.js': `main-${version}` });describe('CoreUpdateManager initialize', () => {+ it('disables manual and scheduled OTA on macOS Stable', async () => {+ Object.defineProperty(process, 'platform', { value: 'darwin' });+ const { manager } = await loadManager();+ manager.startScheduledChecks();+ await manager.checkForUpdates({ manual: true });+ expect(manager.enabled).toBe(false);+ expect(fetchImpl).not.toHaveBeenCalled();+ });++ it('enables Canary OTA after leaving macOS Stable and clears it when switching back', async () => {+ Object.defineProperty(process, 'platform', { value: 'darwin' });+ const { manager } = await loadManager();+ manager.startScheduledChecks();+ manager.switchChannel('canary');+ expect(manager.enabled).toBe(true);+ manager.switchChannel('stable');+ expect(manager.enabled).toBe(false);+ expect(readPointer(otaRoot(), ABI)).toMatchObject({+ current: null,+ previous: null,+ staged: null,+ channel: 'stable',+ });+ await manager.checkForUpdates({ manual: true });+ expect(fetchImpl).not.toHaveBeenCalled();+ });+it('checks for updates in the background immediately after startup and hourly thereafter', async () => {vi.useFakeTimers();try {diff --git a/apps/desktop/src/main/modules/updater/__tests__/sparkleEngine.test.ts b/apps/desktop/src/main/modules/updater/__tests__/sparkleEngine.test.tsnew file mode 100644index 00000000000..e87577fa5a9--- /dev/null+++ b/apps/desktop/src/main/modules/updater/__tests__/sparkleEngine.test.ts@@ -0,0 +1,203 @@+import type { SparkleBridge, SparkleBridgeEvent } from 'electron-sparkle-updater';+import { beforeEach, describe, expect, it, vi } from 'vitest';++import { SparkleEngine } from '../sparkleEngine';++const { mockLoadBridge, mockAppOn } = vi.hoisted(() => ({+ mockAppOn: vi.fn(),+ mockLoadBridge: vi.fn(),+}));++vi.mock('electron-sparkle-updater', () => ({ loadSparkleBridge: mockLoadBridge }));++vi.mock('electron', () => ({ app: { isPackaged: true, on: mockAppOn } }));++vi.mock('@/utils/logger', () => ({+ createLogger: () => ({ debug: vi.fn(), error: vi.fn(), info: vi.fn(), warn: vi.fn() }),+}));++const createBridge = () => {+ let handler: ((event: SparkleBridgeEvent) => void) | null | undefined;+ const bridge: SparkleBridge = {+ checkForUpdates: vi.fn(),+ init: vi.fn().mockReturnValue(true),+ installUpdateNow: vi.fn(),+ installUpdateOnQuit: vi.fn(),+ setAutomaticChecks: vi.fn(),+ setEventHandler: vi.fn((fn) => {+ handler = fn;+ }),+ };+ return { bridge, emit: (event: SparkleBridgeEvent) => handler?.(event) };+};++describe('SparkleEngine.create', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ (process as any).resourcesPath = '/Applications/LobeHub.app/Contents/Resources';+ });++ it('rejects when no bridge is available', async () => {+ mockLoadBridge.mockReturnValue(null);++ await expect(+ SparkleEngine.create({ appcastUrl: 'https://cdn/appcast.xml', currentVersion: '1.0.0' }),+ ).rejects.toThrow(/Sparkle bridge/);+ });++ it('rejects when Sparkle fails to initialize', async () => {+ const { bridge } = createBridge();+ vi.mocked(bridge.init).mockReturnValue(false);+ mockLoadBridge.mockReturnValue(bridge);++ await expect(+ SparkleEngine.create({ appcastUrl: 'https://cdn/appcast.xml', currentVersion: '1.0.0' }),+ ).rejects.toThrow(/Sparkle bridge/);+ });++ it('initializes with the feed url and disables Sparkle scheduled checks', async () => {+ const { bridge } = createBridge();+ mockLoadBridge.mockReturnValue(bridge);++ const engine = await SparkleEngine.create({+ appcastUrl: 'https://cdn/canary/appcast-arm64.xml',+ currentVersion: '1.0.0',+ });++ expect(engine?.kind).toBe('sparkle');+ expect(mockLoadBridge).toHaveBeenCalledWith(+ expect.objectContaining({+ addonPath: expect.stringMatching(/[/\\]sparkle[/\\]sparkle_bridge\.node$/),+ isPackaged: true,+ }),+ );+ expect(bridge.init).toHaveBeenCalledWith({+ appcastUrl: 'https://cdn/canary/appcast-arm64.xml',+ });+ expect(bridge.setAutomaticChecks).toHaveBeenCalledWith(false);+ });+});++describe('SparkleEngine', () => {+ const setup = () => {+ const { bridge, emit } = createBridge();+ const engine = new SparkleEngine(bridge, '1.0.0', 'https://cdn');+ return { bridge, emit, engine };+ };++ it('releases native callbacks on quit so deferred installation can finish', () => {+ const { bridge } = setup();+ const quit = mockAppOn.mock.calls.findLast(([event]) => event === 'will-quit')?.[1];+ quit();+ expect(bridge.setEventHandler).toHaveBeenLastCalledWith(null);+ });++ it('delegates commands to the bridge without a separate download step', async () => {+ const { bridge, emit, engine } = setup();++ const check = engine.checkForUpdates();+ emit({ type: 'update-not-available' });+ await check;+ await engine.downloadUpdate();+ engine.installOnQuit();+ engine.quitAndInstall();++ expect(bridge.checkForUpdates).toHaveBeenCalledTimes(1);+ expect(bridge.installUpdateOnQuit).toHaveBeenCalledTimes(1);+ expect(bridge.installUpdateNow).toHaveBeenCalledTimes(1);+ });++ it('keeps a native check pending until the download completes', async () => {+ const { emit, engine } = setup();+ engine.on('error', () => {});+ const complete = vi.fn();+ const check = engine.checkForUpdates().then(complete);+ emit({ type: 'update-available', version: '2.0.0' });+ await Promise.resolve();+ expect(complete).not.toHaveBeenCalled();+ emit({ type: 'update-downloaded', version: '2.0.0' });+ await check;+ expect(complete).toHaveBeenCalledOnce();+ });++ it('maps the Sparkle lifecycle onto electron-updater events', () => {+ const { emit, engine } = setup();+ const events: Array<[string, unknown]> = [];+ for (const name of [+ 'checking-for-update',+ 'update-available',+ 'update-not-available',+ 'update-downloaded',+ 'error',+ ] as const) {+ engine.on(name, (...args: unknown[]) => events.push([name, args[0]]));+ }++ emit({ type: 'checking' });+ emit({+ releaseDate: '2026-09-12T00:00:00Z',+ releaseNotes: 'notes',+ type: 'update-available',+ version: '1.1.0',+ });+ emit({ type: 'update-downloaded', version: '1.1.0' });+ emit({ type: 'update-not-available' });+ emit({ message: 'boom', type: 'error' });++ expect(events[0]).toEqual(['checking-for-update', undefined]);+ expect(events[1]).toEqual([+ 'update-available',+ expect.objectContaining({+ releaseDate: '2026-09-12T00:00:00Z',+ releaseNotes: 'notes',+ version: '1.1.0',+ }),+ ]);+ expect(events[2]).toEqual([+ 'update-downloaded',+ expect.objectContaining({ releaseNotes: 'notes', version: '1.1.0' }),+ ]);+ expect(events[3]).toEqual([+ 'update-not-available',+ expect.objectContaining({ version: '1.0.0' }),+ ]);+ expect(events[4]).toEqual(['error', expect.any(Error)]);+ expect((events[4][1] as Error).message).toBe('boom');+ });++ it('reports download progress only for the download phase and restarts on fallback', () => {+ vi.useFakeTimers();+ vi.setSystemTime(new Date('2026-09-12T00:00:00Z'));+ const { emit, engine } = setup();+ const progress: unknown[] = [];+ engine.on('download-progress', (info) => progress.push(info));++ emit({ type: 'download-progress', phase: 'download', percent: 0, transferred: 0 });+ vi.setSystemTime(new Date('2026-09-12T00:00:02Z'));+ emit({+ type: 'download-progress',+ phase: 'download',+ percent: 50,+ total: 200,+ transferred: 100,+ });+ emit({ type: 'download-progress', phase: 'apply', percent: 30 });+ emit({+ type: 'download-progress',+ phase: 'download',+ percent: 0,+ transferred: 0,+ fallback: true,+ });++ expect(progress).toHaveLength(3);+ expect(progress[1]).toEqual({+ bytesPerSecond: 50,+ percent: 50,+ total: 200,+ transferred: 100,+ });+ expect(progress[2]).toMatchObject({ percent: 0, transferred: 0 });+ vi.useRealTimers();+ });+});diff --git a/apps/desktop/src/main/modules/updater/configs.ts b/apps/desktop/src/main/modules/updater/configs.tsindex c086ec38a7f..de21b7abbe6 100644--- a/apps/desktop/src/main/modules/updater/configs.ts+++ b/apps/desktop/src/main/modules/updater/configs.ts@@ -26,3 +26,6 @@ export const updaterConfig = {},enableAppUpdate: !isDev,};++export const getSparkleFeedUrl = (baseUrl: string, channel: UpdateChannel) =>+ `${baseUrl.replace(/\/(stable|nightly|canary|beta)\/?$/, '').replace(/\/$/, '')}/${channel}/appcast-${process.arch}.xml`;diff --git a/apps/desktop/src/main/modules/updater/electronUpdaterEngine.ts b/apps/desktop/src/main/modules/updater/electronUpdaterEngine.tsnew file mode 100644index 00000000000..74059b07eaf--- /dev/null+++ b/apps/desktop/src/main/modules/updater/electronUpdaterEngine.ts@@ -0,0 +1,44 @@+import log from 'electron-log';+import { autoUpdater } from 'electron-updater';++import { isDev } from '@/const/env';+import { getDesktopEnv } from '@/env';++import { UPDATE_SERVER_URL } from './configs';+import type { UpdateEngine } from './engine';++autoUpdater.autoInstallOnAppQuit = false;++export const electronUpdaterEngine: UpdateEngine = {+ checkForUpdates: () => autoUpdater.checkForUpdates(),+ configure: (channel) => {+ log.transports.file.level = 'info';+ autoUpdater.logger = log;+ autoUpdater.autoDownload = false;+ autoUpdater.forceDevUpdateConfig = isDev || getDesktopEnv().FORCE_DEV_UPDATE_CONFIG;+ autoUpdater.allowPrerelease = channel !== 'stable';+ if (!autoUpdater.forceDevUpdateConfig) {+ const baseUrl = UPDATE_SERVER_URL?.replace(/\/(stable|nightly|canary|beta)\/?$/, '').replace(+ /\/$/,+ '',+ );+ autoUpdater.channel = channel;+ autoUpdater.setFeedURL(+ baseUrl+ ? { provider: 'generic', url: `${baseUrl}/${channel}` }+ : { owner: 'lobehub', provider: 'github', repo: 'lobehub' },+ );+ }+ // The channel setter mutates this flag. Windows/Linux retain rollback support.+ autoUpdater.allowDowngrade = true;+ },+ downloadUpdate: () => autoUpdater.downloadUpdate(),+ installOnQuit: () => {+ autoUpdater.autoInstallOnAppQuit = true;+ },+ kind: 'electron-updater',+ on: (event, listener) => {+ autoUpdater.on(event, listener as (...args: any[]) => void);+ },+ quitAndInstall: () => autoUpdater.quitAndInstall(true, true),+};diff --git a/apps/desktop/src/main/modules/updater/engine.mac.ts b/apps/desktop/src/main/modules/updater/engine.mac.tsnew file mode 100644index 00000000000..fb80257bd22--- /dev/null+++ b/apps/desktop/src/main/modules/updater/engine.mac.ts@@ -0,0 +1,14 @@+import type { UpdateChannel } from '@lobechat/electron-client-ipc';+import { app } from 'electron';++import { getSparkleFeedUrl, UPDATE_SERVER_URL } from './configs';+import type { UpdateEngine } from './engine';+import { SparkleEngine } from './sparkleEngine';++export const createUpdateEngine = async (channel: UpdateChannel): Promise<UpdateEngine> => {+ if (!UPDATE_SERVER_URL) throw new Error('Sparkle requires UPDATE_SERVER_URL');+ return SparkleEngine.create({+ appcastUrl: getSparkleFeedUrl(UPDATE_SERVER_URL, channel),+ currentVersion: app.getVersion(),+ });+};diff --git a/apps/desktop/src/main/modules/updater/engine.ts b/apps/desktop/src/main/modules/updater/engine.tsnew file mode 100644index 00000000000..a5192a61bbe--- /dev/null+++ b/apps/desktop/src/main/modules/updater/engine.ts@@ -0,0 +1,30 @@+import type { ProgressInfo, UpdateChannel, UpdateInfo } from '@lobechat/electron-client-ipc';++type AppUpdateInfo = Omit<UpdateInfo, 'kind'>;++export interface UpdateEngineEvents {+ 'checking-for-update': [];+ 'download-progress': [ProgressInfo];+ 'error': [Error];+ 'update-available': [AppUpdateInfo];+ 'update-downloaded': [AppUpdateInfo];+ 'update-not-available': [AppUpdateInfo];+}++export type UpdateEngineKind = 'electron-updater' | 'sparkle';++export interface UpdateEngine {+ checkForUpdates: () => Promise<unknown>;+ configure: (channel: UpdateChannel) => void;+ downloadUpdate: () => Promise<unknown>;+ installOnQuit: () => void;+ kind: UpdateEngineKind;+ on: <K extends keyof UpdateEngineEvents>(+ event: K,+ listener: (...args: UpdateEngineEvents[K]) => void,+ ) => void;+ quitAndInstall: () => void;+}++export const createUpdateEngine = async (_channel: UpdateChannel): Promise<UpdateEngine> =>+ (await import('./electronUpdaterEngine')).electronUpdaterEngine;diff --git a/apps/desktop/src/main/modules/updater/sparkleEngine.ts b/apps/desktop/src/main/modules/updater/sparkleEngine.tsnew file mode 100644index 00000000000..755154ccb84--- /dev/null+++ b/apps/desktop/src/main/modules/updater/sparkleEngine.ts@@ -0,0 +1,183 @@+import { EventEmitter } from 'node:events';+import path from 'node:path';++import type { ProgressInfo, UpdateChannel, UpdateInfo } from '@lobechat/electron-client-ipc';+import { app } from 'electron';+import type { SparkleBridge, SparkleBridgeEvent } from 'electron-sparkle-updater';+import { loadSparkleBridge } from 'electron-sparkle-updater';++import { createLogger } from '@/utils/logger';++import { getSparkleFeedUrl } from './configs';+import type { UpdateEngine, UpdateEngineEvents } from './engine';++const logger = createLogger('modules:updater:sparkle');++const toUpdateInfo = (version: string, event: Partial<SparkleBridgeEvent> = {}): UpdateInfo => ({+ kind: 'app',+ releaseDate: event.releaseDate ?? new Date().toISOString(),+ releaseNotes: event.releaseNotes,+ version,+});++export class SparkleEngine extends EventEmitter<UpdateEngineEvents> implements UpdateEngine {+ readonly kind = 'sparkle';+ private available: UpdateInfo | null = null;+ private progressStartedAt = 0;+ private lastTransferred = 0;+ private downloaded = false;+ private feedUrl = '';+ private finishCheck?: () => void;++ constructor(+ private readonly bridge: SparkleBridge,+ private readonly currentVersion: string,+ private readonly baseUrl: string,+ ) {+ super();+ bridge.setEventHandler(this.handleEvent);+ // Electron shutdown waits for native thread-safe callbacks to be released.+ app.on('will-quit', () => bridge.setEventHandler(null));+ }++ static async create(options: {+ appcastUrl: string;+ currentVersion: string;+ }): Promise<SparkleEngine> {+ const resourcesPath = process.resourcesPath ?? '';+ const bridge = loadSparkleBridge({+ addonPath:+ app.isPackaged && resourcesPath+ ? path.join(resourcesPath, 'sparkle', 'sparkle_bridge.node')+ : undefined,+ isPackaged: app.isPackaged,+ log: (message) => logger.info(message),+ resourcesPath,+ });+ if (!bridge) throw new Error('Sparkle bridge unavailable');++ if (!bridge.init({ appcastUrl: options.appcastUrl })) {+ throw new Error('Sparkle bridge failed to initialize');+ }++ bridge.setAutomaticChecks(false);+ const engine = new SparkleEngine(+ bridge,+ options.currentVersion,+ options.appcastUrl.replace(/\/(stable|canary)\/appcast-[^/]+\.xml$/, ''),+ );+ engine.feedUrl = options.appcastUrl;+ return engine;+ }++ configure = (channel: UpdateChannel) => {+ const feedUrl = getSparkleFeedUrl(this.baseUrl, channel);+ if (feedUrl === this.feedUrl) return;+ if (!this.bridge.init({ appcastUrl: feedUrl }))+ throw new Error('Sparkle feed configuration failed');+ this.feedUrl = feedUrl;+ this.available = null;+ this.downloaded = false;+ };++ checkForUpdates = async () => {+ if (this.downloaded && this.available) {+ this.emit('update-downloaded', this.available);+ return;+ }+ // The bridge starts an asynchronous native cycle. Keep it in flight through download+ // so a channel switch cannot reuse the old cycle's events for the new channel.+ await new Promise<void>((resolve, reject) => {+ const timer = setTimeout(+ () => {+ this.finishCheck = undefined;+ reject(new Error('Sparkle update check timed out'));+ },+ 15 * 60 * 1000,+ );+ this.finishCheck = () => {+ clearTimeout(timer);+ this.finishCheck = undefined;+ resolve();+ };+ try {+ this.bridge.checkForUpdates();+ } catch (error) {+ clearTimeout(timer);+ this.finishCheck = undefined;+ reject(error);+ }+ });+ };++ // Sparkle starts downloading as soon as the silent driver accepts the found update.+ downloadUpdate = async () => {};++ installOnQuit = () => this.bridge.installUpdateOnQuit();++ quitAndInstall = () => this.bridge.installUpdateNow();++ private handleEvent = (event: SparkleBridgeEvent) => {+ switch (event.type) {+ case 'checking': {+ this.emit('checking-for-update');+ return;+ }+ case 'update-available': {+ this.available = toUpdateInfo(event.version ?? '', event);+ this.progressStartedAt = 0;+ this.lastTransferred = 0;+ this.emit('update-available', this.available);+ return;+ }+ case 'download-progress': {+ this.handleProgress(event);+ return;+ }+ case 'update-downloaded': {+ const info = this.available ?? toUpdateInfo(event.version ?? '');+ this.available = event.version ? { ...info, version: event.version } : info;+ this.downloaded = true;+ this.emit('update-downloaded', this.available);+ this.finishCheck?.();+ return;+ }+ case 'update-not-available': {+ this.emit('update-not-available', toUpdateInfo(this.currentVersion));+ this.finishCheck?.();+ return;+ }+ case 'error': {+ this.emit('error', new Error(event.message ?? 'Sparkle update failed'));+ this.finishCheck?.();+ return;+ }+ default: {+ logger.debug(`Ignoring Sparkle event: ${event.type}`);+ }+ }+ };++ private handleProgress(event: SparkleBridgeEvent) {+ if (event.phase !== 'download') return;++ const transferred = event.transferred ?? 0;+ if (event.fallback || transferred < this.lastTransferred) {+ this.progressStartedAt = 0;+ this.lastTransferred = 0;+ }++ const now = Date.now();+ if (!this.progressStartedAt) this.progressStartedAt = now;+ const elapsedSeconds = (now - this.progressStartedAt) / 1000;++ const progress: ProgressInfo = {+ bytesPerSecond: elapsedSeconds > 0 ? Math.round(transferred / elapsedSeconds) : 0,+ percent: event.percent ?? 0,+ total: event.total ?? 0,+ transferred,+ };+ this.lastTransferred = transferred;+ this.emit('download-progress', progress);+ }+}diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 1ea0ae40302..13c2233801d 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -51,6 +51,7 @@ allowBuilds:'@sentry/cli': true'@vercel/speed-insights': truecore-js: false+ electron-sparkle-updater: falsees5-ext: falseesbuild: falseffmpeg-static: true