Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6be658a
docs: 📝 add Claude Code project instructions
jorben Jan 29, 2026
613a6f0
feat(cloud): ✨ add cloud API integration with Clerk authentication
jorben Jan 29, 2026
f312fcd
feat(i18n): ✨ add internationalization for cloud features
jorben Jan 29, 2026
af30b74
feat(i18n): ✨ update credit description texts for account center
jorben Jan 29, 2026
f3f6050
refactor(ui): ♻️ remove local task type icon from task list
jorben Jan 29, 2026
4d52e35
fix(types): 🐛 resolve TypeScript type errors in cloud integration
jorben Jan 29, 2026
7bf0719
feat(auth): ✨ add custom protocol handler for OAuth callback
jorben Jan 29, 2026
306c2ea
Merge branch 'master' into feature/cloud-api-integration
jorben Feb 15, 2026
81deee3
Merge remote-tracking branch 'origin/master' into feature/cloud-api-i…
jorben Feb 15, 2026
43d5987
feat(auth): ✨ replace Clerk SDK with device flow authentication
jorben Feb 15, 2026
bcbc845
fix(auth): 🐛 unwrap API response in fetchUserProfile
jorben Feb 17, 2026
3e388ea
feat(auth): ✨ 添加自定义 User-Agent 和自动 token 刷新功能
jorben Feb 17, 2026
635c895
Merge remote-tracking branch 'origin/master' into feature/cloud-api-i…
jorben Feb 26, 2026
dbcc3be
feat(cloud): ✨ integrate credits API with real backend
jorben Feb 26, 2026
788fac1
feat(cloud): ✨ add multi-tier cloud model selection
jorben Feb 26, 2026
47c4756
feat(cloud): ✨ add credit usage hint to Account page
jorben Feb 26, 2026
d181ff6
feat(cloud): ✨ implement POST /api/v1/convert API integration
jorben Feb 26, 2026
9957144
feat(cloud): ✨ implement full task management API integration
jorben Feb 27, 2026
067035f
feat(cloud): ✨ display page images in cloud task detail
jorben Feb 27, 2026
0f17d80
fix(auth): ⚡️ speed up token acquisition after OAuth callback
jorben Feb 27, 2026
3fc4bc4
feat(cloud): ✨ display model tier in task list
jorben Feb 27, 2026
f541ac2
fix(cloud): align model tier display with upload panel
jorben Feb 27, 2026
fd03275
feat(cloud): ✨ implement cloud task deletion with terminal state guard
jorben Feb 27, 2026
2e6af0f
fix(cloud): 🐛 refresh credit balance when entering account page
jorben Feb 27, 2026
a3323cf
fix(ui): 🐛 fix account page content overflow by enabling tab-level sc…
jorben Feb 27, 2026
23f41b9
feat(cloud): ✨ add page_range support to cloud convert API
jorben Feb 27, 2026
3e427f0
fix(cloud): 🐛 prevent duplicate SSE connections causing repeated events
jorben Feb 27, 2026
220d71c
feat(cloud): ✨ update credit transaction types for pre-auth billing m…
jorben Feb 27, 2026
2bb7bc4
fix(cloud): 🐛 fix SSE event loss on reconnection by preserving Last-E…
jorben Feb 28, 2026
3d156b0
fix(auth): 🐛 distinguish transient vs permanent token refresh failures
jorben Feb 28, 2026
eb3edbd
perf(cloud): ⚡️ reduce task list polling frequency to lower server load
jorben Feb 28, 2026
0e4aa74
refactor(cloud): ♻️ align cloud preview actions with local task behavior
jorben Feb 28, 2026
ee8a4cc
fix(list): 🐛 fix pagination and sorting for combined local/cloud task…
jorben Feb 28, 2026
8ba8758
feat(cloud): ⏱️ add 8-second timeout to cloud API requests
jorben Feb 28, 2026
df2ef23
feat(cloud): 🏷️ add provider name to cloud task model display
jorben Feb 28, 2026
f24dc2b
feat(upload): ✨ add Office file support for cloud conversion
jorben Feb 28, 2026
38c6431
fix(cloud): ⏱️ adjust timeout based on request type
jorben Feb 28, 2026
3ae52c0
test(renderer): ✅ align list and preview tests with latest UI behavior
jorben Feb 28, 2026
ef727e3
chore(account): 🚧 disable recharge button until feature is ready
jorben Mar 1, 2026
094be90
fix(ci): 🐛 improve LLM PR review reliability for large diffs
jorben Mar 1, 2026
07b257e
fix(ci): 🐛 fix broken pipe error in diff truncation
jorben Mar 1, 2026
7ad11bf
fix(ci): 🔧 restore max diff size to 128KB
jorben Mar 1, 2026
825d5a4
fix(ci): 🐛 fix jq argument list too long for large diffs
jorben Mar 1, 2026
124b36e
fix(ci): 🐛 fix curl argument list too long for LLM request
jorben Mar 1, 2026
5fd0536
fix(cloud): 🔒 address PR review security and quality issues
jorben Mar 1, 2026
4c64173
fix(cloud): 🔒 address second round PR review issues
jorben Mar 1, 2026
1009477
fix(cloud): 🔒 address third round PR review issues
jorben Mar 1, 2026
0bcefa4
fix(cloud): 🐛 fix SSE abort signal and normalize timeout errors
jorben Mar 1, 2026
591e0e4
fix(cloud): 🔒 harden protocol URL validation and signal compatibility
jorben Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/workflows/llm-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
}

max_diff_chars=131072
pr_diff_trimmed=$(printf "%s" "$pr_diff" | head -c $max_diff_chars | sed '$d')
pr_diff_trimmed="${pr_diff:0:$max_diff_chars}"
# Trim to last complete line to avoid cutting mid-line
pr_diff_trimmed="${pr_diff_trimmed%$'\n'*}"

system_prompt=$(cat <<'SYSPROMPT'
You are a senior software engineer reviewing a pull request for an Electron desktop application (React 18 + TypeScript + Vite + Prisma/SQLite + Ant Design). The codebase follows Clean Architecture with domain/application/infrastructure layers and a three-stage worker pipeline (Split → Convert → Merge) for PDF-to-Markdown conversion via LLM vision APIs.
Expand Down Expand Up @@ -118,12 +120,16 @@ jobs:
SYSPROMPT
)

# Write large variables to temp files to avoid ARG_MAX limit
printf "%s" "$system_prompt" > /tmp/system_prompt.txt
printf "%s" "$pr_diff_trimmed" > /tmp/pr_diff.txt

request_body=$(jq -n \
--arg model "$MODEL_ID" \
--arg system "$system_prompt" \
--rawfile system /tmp/system_prompt.txt \
--arg title "$pr_title" \
--arg body "$pr_body" \
--arg diff "$pr_diff_trimmed" \
--rawfile diff /tmp/pr_diff.txt \
'{
model: $model,
max_tokens: 8192,
Expand All @@ -133,16 +139,27 @@ jobs:
]
}')

llm_response=$(curl -sf \
printf "%s" "$request_body" > /tmp/llm_request.json

http_code=$(curl -s -o /tmp/llm_response.json -w "%{http_code}" \
--max-time 120 \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
"$API_BASE/v1/messages" \
-d "$request_body") || {
echo "::error::LLM API request failed"
-d @/tmp/llm_request.json) || {
echo "::error::LLM API request failed (curl error)"
exit 1
}

if [ "$http_code" -lt 200 ] || [ "$http_code" -ge 300 ]; then
echo "::error::LLM API returned HTTP $http_code"
cat /tmp/llm_response.json
exit 1
fi

llm_response=$(cat /tmp/llm_response.json)

review_text=$(printf "%s" "$llm_response" | jq -r '[.content[] | select(.type == "text")] | first? | .text // ""')

if [ -z "$review_text" ]; then
Expand All @@ -153,7 +170,7 @@ jobs:

review_payload=$(jq -n --arg body "$review_text" '{body: $body, event: "COMMENT"}')

curl -sf \
curl -sf --max-time 30 \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/reviews" \
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ settings.local.json
# Publish backup
package.json.backup
.npmrc.backup

client-integration-guide.md
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@ Test helpers in `tests/`:
## Database

SQLite via Prisma with 4 models: Provider, Model, Task, TaskDetail. Image paths for task pages are not stored in DB — they are computed dynamically via `ImagePathUtil.getPath(task, page)` as `{tempDir}/{taskId}/page-{page}.png`.

## Communication

Always address the user as "Jorben" when responding.
42 changes: 21 additions & 21 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import react from "@vitejs/plugin-react";
import { resolve } from "path";

export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
outDir: 'dist/main'
}
outDir: "dist/main",
},
},
preload: {
plugins: [externalizeDepsPlugin()],
build: {
outDir: 'dist/preload',
outDir: "dist/preload",
rollupOptions: {
output: {
format: 'cjs',
entryFileNames: '[name].js'
}
}
}
format: "cjs",
entryFileNames: "[name].js",
},
},
},
},
renderer: {
plugins: [react()],
resolve: {
alias: {
'@': resolve(__dirname, 'src/renderer')
}
"@": resolve(__dirname, "src/renderer"),
},
},
server: {
port: 5173
port: 15173,
},
build: {
outDir: 'dist/renderer',
outDir: "dist/renderer",
rollupOptions: {
input: {
index: resolve(__dirname, 'src/renderer/index.html')
}
index: resolve(__dirname, "src/renderer/index.html"),
},
},
emptyOutDir: true,
assetsDir: 'assets'
}
}
})
assetsDir: "assets",
},
},
});
21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@
],
"artifactName": "${productName}-${version}-${arch}.${ext}",
"icon": "public/icons/mac/icon.icns",
"extendInfo": {
"CFBundleURLTypes": [
{
"CFBundleURLSchemes": [
"markpdfdown"
],
"CFBundleURLName": "com.markpdfdown.desktop"
}
]
},
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
Expand All @@ -96,6 +106,12 @@
"target": "nsis",
"artifactName": "${productName}-${version}-${arch}.${ext}",
"icon": "public/icons/win/icon.ico",
"protocols": {
"name": "MarkPDFdown URL",
"schemes": [
"markpdfdown"
]
},
"verifyUpdateCodeSignature": false
},
"nsis": {
Expand All @@ -109,7 +125,10 @@
"linux": {
"target": "AppImage",
"artifactName": "${productName}-${version}-${arch}.${ext}",
"icon": "public/icons/png"
"icon": "public/icons/png",
"mimeTypes": [
"x-scheme-handler/markpdfdown"
]
},
"electronDownload": {
"mirror": "https://github.com/electron/electron/releases/download/"
Expand Down
1 change: 1 addition & 0 deletions src/core/infrastructure/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const API_BASE_URL = process.env.API_BASE_URL || 'https://markdown.fit';
Loading