Skip to content

Commit 9c1286a

Browse files
blinko-spaceclaude
andcommitted
chore: consolidate recent development changes
- Updated package.json and dependencies across all packages - Fixed Tauri build issues and added CUDA configuration - Updated GitHub workflows for CI/CD improvements - Enhanced voice transcription features and desktop setup - Improved internationalization for multiple languages - Added drag functionality with useDragCard hook - Updated database schema with sort order for notes - Enhanced AI server and embedding providers - Improved file upload and routing functionality - Updated Docker configuration and installation scripts - Code cleanup and dependency optimization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ec19b6a commit 9c1286a

Some content is hidden

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

51 files changed

+1973
-3494
lines changed

.claude/settings.local.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/app-release.yml

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ on:
1919
description: 'Tag Version (e.g. 1.0.0)'
2020
required: true
2121
type: string
22+
disable-rust-cache:
23+
description: 'Disable Rust cache (useful for troubleshooting build issues)'
24+
required: false
25+
type: boolean
26+
default: false
2227

2328
jobs:
2429
# Set version first
@@ -117,8 +122,14 @@ jobs:
117122
args: '--target x86_64-apple-darwin'
118123
- platform: 'ubuntu-22.04' # Linux Platform
119124
args: ''
120-
- platform: 'windows-latest' # Windows Platform
125+
- platform: 'windows-latest' # Windows Platform (CPU)
121126
args: ''
127+
features: '--features whisper-cpu'
128+
variant: 'cpu'
129+
- platform: 'windows-latest' # Windows Platform (CUDA)
130+
args: ''
131+
features: '--features whisper-cuda'
132+
variant: 'cuda'
122133

123134
runs-on: ${{ matrix.platform }}
124135
steps:
@@ -132,19 +143,61 @@ jobs:
132143
name: tauri-config
133144
path: app/src-tauri/
134145

135-
- name: Install CUDA Toolkit (Windows)
136-
if: matrix.platform == 'windows-latest'
137-
uses: Jimver/[email protected]
146+
- name: Install CUDA Toolkit (Windows CUDA)
147+
if: matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
148+
uses: Jimver/[email protected]
149+
id: cuda-toolkit
138150
with:
139-
cuda: '12.1.0'
151+
cuda: '12.5.0'
140152
method: 'network'
141-
sub-packages: '[ "nvcc", "cudart", "cublas", "cublas_dev", "curand", "curand_dev" ]'
153+
sub-packages: '[ "nvcc", "cudart", "cublas", "cublas_dev", "curand", "curand_dev", "visual_studio_integration", "thrust" ]'
142154

143-
- name: Set CUDA environment variables (Windows)
144-
if: matrix.platform == 'windows-latest'
155+
- name: Set CUDA environment variables (Windows CUDA)
156+
if: matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
145157
run: |
146-
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1" >> $GITHUB_ENV
147-
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin" >> $GITHUB_PATH
158+
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
159+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
160+
echo "CUDA_PATH=${{steps.cuda-toolkit.outputs.CUDA_PATH}}" >> $GITHUB_ENV
161+
echo "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" >> $GITHUB_PATH
162+
nvcc -V
163+
164+
165+
- name: Fix CUDA Visual Studio Integration (Windows CUDA)
166+
if: matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
167+
run: |
168+
$cudaPath = "${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
169+
echo "CUDA Path: $cudaPath"
170+
171+
# Source: CUDA Visual Studio integration files
172+
$sourceDir = "$cudaPath\extras\visual_studio_integration\MSBuildExtensions"
173+
echo "Source: $sourceDir"
174+
175+
# Find Visual Studio installation
176+
$vsPaths = @(
177+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise",
178+
"C:\Program Files\Microsoft Visual Studio\2022\Community",
179+
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
180+
)
181+
182+
foreach ($vsPath in $vsPaths) {
183+
$destDir = "$vsPath\MSBuild\Microsoft\VC\v170\BuildCustomizations"
184+
if (Test-Path $destDir) {
185+
echo "Found VS at: $vsPath"
186+
echo "Destination: $destDir"
187+
188+
if (Test-Path $sourceDir) {
189+
echo "Copying CUDA integration files..."
190+
Copy-Item "$sourceDir\*" $destDir -Force -Verbose
191+
echo "Successfully copied CUDA integration files to $destDir"
192+
} else {
193+
echo "ERROR: Source directory not found: $sourceDir"
194+
}
195+
break
196+
}
197+
}
198+
199+
# Set environment variable for CMake to use CUDA toolset
200+
echo "CMAKE_GENERATOR_TOOLSET=cuda=$cudaPath" >> $GITHUB_ENV
148201
149202
- name: Fix version format for Windows MSI
150203
if: matrix.platform == 'windows-latest'
@@ -190,8 +243,10 @@ jobs:
190243
uses: dtolnay/rust-toolchain@stable
191244
with:
192245
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
246+
components: ${{ matrix.platform == 'windows-latest' && 'rustfmt' || '' }}
193247

194248
- name: Rust Cache
249+
if: github.event.inputs.disable-rust-cache != 'true'
195250
uses: Swatinem/rust-cache@v2
196251
with:
197252
workspaces: app/src-tauri
@@ -211,6 +266,14 @@ jobs:
211266
bun install
212267
cd app && bun install
213268
269+
270+
# Copy CUDA config for CUDA builds (with installer checks)
271+
- name: Use CUDA config (Windows CUDA)
272+
if: matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
273+
run: |
274+
Copy-Item "app\src-tauri\tauri.cuda.conf.json" "app\src-tauri\tauri.conf.json" -Force
275+
echo "Using CUDA configuration with installer CUDA detection"
276+
214277
# Using official Tauri Action to build and publish
215278
- name: Build and Publish Desktop App
216279
uses: tauri-apps/tauri-action@v0
@@ -220,10 +283,9 @@ jobs:
220283
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
221284
with:
222285
projectPath: 'app'
223-
tauriScript: '../node_modules/.bin/tauri'
224-
args: ${{ matrix.args }}
286+
args: ${{ matrix.args }} ${{ matrix.features || '' }}
225287
tagName: ${{ needs.set-version.outputs.version }}
226-
releaseName: Blinko ${{ needs.set-version.outputs.version }}
288+
releaseName: Blinko ${{ needs.set-version.outputs.version }}${{ matrix.variant && format(' ({0})', matrix.variant) || '' }}
227289
releaseBody: "Under construction, full changelog will be updated after build completion..."
228290
releaseDraft: false
229291
prerelease: false
@@ -273,6 +335,7 @@ jobs:
273335
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
274336

275337
- name: Rust Cache
338+
if: github.event.inputs.disable-rust-cache != 'true'
276339
uses: Swatinem/rust-cache@v2
277340
with:
278341
workspaces: app/src-tauri
@@ -310,9 +373,7 @@ jobs:
310373
restore-keys: |
311374
${{ runner.os }}-gradle-
312375
313-
- name: Install Tauri CLI
314-
run: cargo install tauri-cli --version "^2.0.0-alpha"
315-
376+
316377
- name: Upload Keystore File
317378
run: |
318379
# Create keystore directory
@@ -439,7 +500,6 @@ jobs:
439500
console.log('Generated Chinese message');
440501
} catch (error) {
441502
console.error('Error calling OpenRouter API:', error.message);
442-
// 如果API调用失败,使用默认消息
443503
const defaultMessage = `🚀 Blinko ${{ needs.set-version.outputs.version }} 已发布!\n\n📝 更新日志:\n${{ needs.generate-changelog.outputs.changelog }}\n\n📥 下载链接:\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.set-version.outputs.version }}`;
444504
core.setOutput('message', defaultMessage);
445505
}
@@ -483,7 +543,6 @@ jobs:
483543
console.log('Generated English message');
484544
} catch (error) {
485545
console.error('Error calling OpenRouter API:', error.message);
486-
// 如果API调用失败,使用默认消息
487546
const defaultMessage = `🚀 Blinko ${{ needs.set-version.outputs.version }} has been released!\n\n📝 Changelog:\n${{ needs.generate-changelog.outputs.changelog }}\n\n📥 Download:\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.set-version.outputs.version }}`;
488547
core.setOutput('message', defaultMessage);
489548
}

.github/workflows/windows-test-release.yml

Lines changed: 74 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ jobs:
9696
needs: [set-version, update-version]
9797
permissions:
9898
contents: write
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
include:
103+
- variant: 'cpu'
104+
features: '--features whisper-cpu'
105+
- variant: 'cuda'
106+
features: '--features whisper-cuda'
99107
runs-on: windows-latest
100108
steps:
101109
- uses: actions/checkout@v4
@@ -108,17 +116,61 @@ jobs:
108116
name: tauri-config
109117
path: app/src-tauri/
110118

111-
- name: Install CUDA Toolkit (Windows)
112-
uses: Jimver/[email protected]
119+
- name: Install CUDA Toolkit (Windows CUDA)
120+
if: matrix.variant == 'cuda'
121+
uses: Jimver/[email protected]
122+
id: cuda-toolkit
113123
with:
114-
cuda: '12.1.0'
124+
cuda: '12.5.0'
115125
method: 'network'
116-
sub-packages: '[ "nvcc", "cudart", "cublas", "cublas_dev", "curand", "curand_dev" ]'
126+
sub-packages: '[ "nvcc", "cudart", "cublas", "cublas_dev", "curand", "curand_dev", "nvrtc", "nvrtc_dev", "visual_studio_integration", "thrust" ]'
117127

118-
- name: Set CUDA environment variables (Windows)
128+
- name: Set CUDA environment variables (Windows CUDA)
129+
if: matrix.variant == 'cuda'
119130
run: |
120-
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1" >> $GITHUB_ENV
121-
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin" >> $GITHUB_PATH
131+
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
132+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
133+
echo "CUDA_PATH=${{steps.cuda-toolkit.outputs.CUDA_PATH}}" >> $GITHUB_ENV
134+
echo "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" >> $GITHUB_PATH
135+
nvcc -V
136+
137+
138+
- name: Fix CUDA Visual Studio Integration
139+
if: matrix.variant == 'cuda'
140+
run: |
141+
$cudaPath = "${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
142+
echo "CUDA Path: $cudaPath"
143+
144+
# Source: CUDA Visual Studio integration files
145+
$sourceDir = "$cudaPath\extras\visual_studio_integration\MSBuildExtensions"
146+
echo "Source: $sourceDir"
147+
148+
# Find Visual Studio installation
149+
$vsPaths = @(
150+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise",
151+
"C:\Program Files\Microsoft Visual Studio\2022\Community",
152+
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
153+
)
154+
155+
foreach ($vsPath in $vsPaths) {
156+
$destDir = "$vsPath\MSBuild\Microsoft\VC\v170\BuildCustomizations"
157+
if (Test-Path $destDir) {
158+
echo "Found VS at: $vsPath"
159+
echo "Destination: $destDir"
160+
161+
if (Test-Path $sourceDir) {
162+
echo "Copying CUDA integration files..."
163+
Copy-Item "$sourceDir\*" $destDir -Force -Verbose
164+
echo "Successfully copied CUDA integration files to $destDir"
165+
} else {
166+
echo "ERROR: Source directory not found: $sourceDir"
167+
}
168+
break
169+
}
170+
}
171+
172+
# Set environment variable for CMake to use CUDA toolset
173+
echo "CMAKE_GENERATOR_TOOLSET=cuda=$cudaPath" >> $GITHUB_ENV
122174
123175
- name: Fix version format for Windows MSI
124176
run: |
@@ -155,6 +207,8 @@ jobs:
155207

156208
- name: Install Rust Stable
157209
uses: dtolnay/rust-toolchain@stable
210+
with:
211+
components: rustfmt
158212

159213
- name: Rust Cache
160214
uses: Swatinem/rust-cache@v2
@@ -176,12 +230,20 @@ jobs:
176230
bun install
177231
cd app && bun install
178232
233+
234+
# Copy CUDA config for CUDA builds (with installer checks)
235+
- name: Use CUDA config (Windows CUDA)
236+
if: matrix.variant == 'cuda'
237+
run: |
238+
Copy-Item "app\src-tauri\tauri.cuda.conf.json" "app\src-tauri\tauri.conf.json" -Force
239+
echo "Using CUDA configuration with installer CUDA detection"
240+
179241
# Build Windows App (without publishing)
180-
- name: Build Windows App
242+
- name: Build Windows App (${{ matrix.variant }})
181243
run: |
182244
cd app
183-
echo "Starting Windows build..."
184-
../node_modules/.bin/tauri build --no-bundle
185-
echo "Windows build completed successfully!"
245+
echo "Starting Windows ${{ matrix.variant }} build..."
246+
../node_modules/.bin/tauri build --no-bundle ${{ matrix.features }}
247+
echo "Windows ${{ matrix.variant }} build completed successfully!"
186248
echo "Build artifacts location: src-tauri/target/release/"
187-
ls -la src-tauri/target/release/
249+
Get-ChildItem src-tauri/target/release/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ keystore.properties
3030
dev-dist
3131
.claudeconfig
3232
.claude/*
33+
.claude/settings.local.json
3334
target

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ Blinko is an AI-powered card note-taking project. Designed for individuals who w
5151

5252
- 🔓**Open for Collaboration** :As an open-source project, Blinko invites contributions from the community. All code is transparent and available on GitHub, fostering a spirit of collaboration and constant improvement.
5353

54+
## 🎤 Offline Voice Recognition (Windows)
55+
56+
The Windows desktop version supports offline voice recognition powered by Whisper, allowing you to convert speech to text without internet connectivity.
57+
58+
### Available Versions
59+
- **Blinko.exe** - CPU-only version for all systems
60+
- **Blinko(CUDA).exe** - GPU-accelerated version for NVIDIA graphics cards
61+
- **Requires [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads) to be installed, otherwise installation will fail due to missing runtime environment**
62+
- Provides significantly faster transcription performance
63+
- Requires manual download of Whisper models from [Hugging Face](https://huggingface.co/ggerganov/whisper.cpp/tree/main)
64+
5465
## 📦Start with Docker in seconds
5566

5667
```bash

README.zh-CN.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ Blinko 是一个AI驱动的卡片笔记项目,专为那些想要快速捕捉
4848

4949
- 🔓**开放协作**:作为开源项目,Blinko 欢迎社区贡献。所有代码都在 GitHub 上公开透明,培养协作和持续改进的精神。
5050

51+
## 🎤 离线语音识别 (Windows)
52+
53+
Windows 桌面版支持基于 Whisper 的离线语音识别功能,让您无需网络连接即可将语音转换为文字。
54+
55+
### 可用版本
56+
- **Blinko.exe** - CPU版本,适用于所有系统
57+
- **Blinko(CUDA).exe** - GPU加速版本,专为NVIDIA显卡优化
58+
- **必须先安装 [CUDA工具包](https://developer.nvidia.com/cuda-downloads),否则会因缺少运行环境导致安装报错**
59+
- 提供显著更快的转录性能
60+
- 需要手动从 [Hugging Face](https://huggingface.co/ggerganov/whisper.cpp/tree/main) 下载 Whisper 模型
61+
5162
## 🤖 AI 模型支持
5263
### OpenAI
5364
- 支持 OpenAI API

0 commit comments

Comments
 (0)