Commit Graph
37 Commits
Author SHA1 Message Date
liuxiaopai-ai afeaa6a120 feat: add Linux build support (AppImage, deb, rpm)
Add Linux as a supported platform with AppImage, deb, and rpm targets
for both x64 and arm64 architectures.

Changes:
- electron-builder.yml: add linux section with AppImage/deb/rpm targets,
  icon, category, and desktop entry configuration
- package.json: add electron:pack:linux script
- electron/main.ts: fix getIconPath() to return .png on Linux instead
  of .icns (macOS format); enable loadUserShellEnv() on Linux since GUI
  apps launched from desktop also have limited env
- README.md + README_CN.md: update supported platforms section

The README previously stated 'Linux builds are planned. Contributions
welcome.' — this delivers on that.
2026-02-08 16:01:33 +08:00
7418andClaude Opus 4.6 21226fc010 fix: replace Radix ScrollArea with native overflow-y-auto for Skills list (closes #8)
Radix ScrollArea doesn't reliably get constrained height in flex
layouts, preventing mouse wheel scrolling. Replace with a simple
div using overflow-y-auto and min-h-0 which works correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 22:58:06 +08:00
7418andClaude Opus 4.6 f19053f1b2 docs: beautify README with badges, emojis, and updated content
- Enable GitHub release, platform, and license badges
- Add emojis to feature list for better visual hierarchy
- Update download section with macOS (arm64 + x64) and Windows support
- Correct database path to ~/.codepilot/codepilot.db
- Unify badge style between English and Chinese versions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 22:51:59 +08:00
7418andClaude Opus 4.6 d80477cfac chore: add arch to macOS DMG filename
Use artifactName template to always include architecture in DMG
filename (e.g. CodePilot-0.2.3-x64.dmg) for clarity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 22:33:53 +08:00
7418andClaude Opus 4.6 d554735dca chore: bump version to 0.2.3, add CLAUDE.md
Add CLAUDE.md with release checklist and build notes.
Bump version for new release with ABI fix, Windows path fix,
x64 macOS support, and Extensions scroll fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 22:22:08 +08:00
7418andClaude Opus 4.6 0b1ae6c02f fix: Windows Claude CLI path discovery and Extensions scroll
- Fix Windows Claude CLI not found when installed as .exe or without
  extension in .local\bin (closes #6). Now searches all extensions
  (.cmd, .exe, .bat, and bare) for every candidate directory.
- Fix Extensions/Skills list not scrollable when many items exist.
  Change content container to overflow-hidden so internal ScrollArea
  works correctly. Add overflow-auto to McpManager for its own scroll.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 22:20:03 +08:00
歸藏 f870b5d9c1 feat: support x64/arm64 macOS builds and fix build script errors (#7)
feat: support x64/arm64 macOS builds and fix build script errors
2026-02-07 22:15:34 +08:00
tianshuang b9d68d5051 feat: support x64/arm64 macOS builds and fix build script errors 2026-02-07 21:34:40 +08:00
7418andClaude Opus 4.6 b42d3d2ad8 fix: explicitly rebuild better-sqlite3 for Electron ABI in afterPack
Root cause: electron-builder's @electron/rebuild only rebuilds native
modules found in the `files` config. Since better-sqlite3 enters the
app through extraResources (via .next/standalone/), it was skipped.
The afterPack hook was copying the system Node.js ABI (127) instead
of the required Electron ABI (143).

Fix:
- afterPack now explicitly calls `npx electron-rebuild` targeting the
  exact Electron version and architecture from the build context
- Falls back to @electron/rebuild programmatic API if CLI fails
- Fails the build if rebuild cannot complete (no silent failures)
- Adds file size logging for verification
- Excludes `release/` from extraResources to prevent recursive nesting
- Adds startup ABI compatibility check in Electron main process with
  friendly error dialog instead of cryptic crash

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 16:23:37 +08:00
7418andClaude Opus 4.6 0bf97a3795 fix: support Windows/Linux paths in afterPack hook
The afterPack script only searched macOS-specific paths
(CodePilot.app/Contents/Resources) for better_sqlite3.node replacement.
Add Windows/Linux path (resources/standalone/) so the native module
ABI fix works on all platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 14:28:38 +08:00
7418 b819eb7601 Merge branch 'main' into feat/windows-drive-switcher
Resolve conflict in electron-builder.yml: keep both icon resources
(from PR) and afterPack hook (from main).
2026-02-07 14:20:17 +08:00
xuxu777xuandClaude Opus 4.6 0234240066 feat: full Windows platform adaptation
- Add src/lib/platform.ts: cross-platform Claude CLI discovery
  (candidate paths, .cmd/.bat shell handling, where/which fallback)
- Refactor claude-status route and claude-client to use shared platform utils
- Electron main: Windows process spawning (windowsHide), PATH construction
  with AppData/npm dirs, titleBarOverlay, .ico icon support
- electron-builder.yml: add win/nsis build targets
- package.json: add electron:pack:win script
- FolderPicker: drive switcher dropdown for navigating between drives
- SkillsManager: fix duplicate key warning with filePath fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:35:04 +08:00
7418andClaude Opus 4.6 2506e7f1e8 chore: bump version to 0.2.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:32:08 +08:00
7418andClaude Opus 4.6 ac0546c0b0 fix: ensure better-sqlite3 in standalone uses Electron ABI
Add afterPack hook that copies the @electron/rebuild-compiled
better_sqlite3.node into the standalone resources directory.
Previously the standalone copy retained the system Node ABI from
next build, causing MODULE_VERSION mismatch at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:31:54 +08:00
xuxu777xuandClaude Opus 4.6 3ae44a7277 feat: add Windows drive switcher dropdown in FolderPicker
When navigating to a drive root on Windows (e.g. C:\), path.dirname
returns itself, disabling the "go up" button and trapping the user on
that drive. This adds a compact dropdown next to the up button that
lists all available drives (auto-detected via fs.accessSync), allowing
quick switching between drives. macOS/Linux are unaffected (empty array,
dropdown not rendered).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:29:59 +08:00
7418andClaude Opus 4.6 262b295f63 fix: use stable ~/.codepilot/ data directory to persist across updates
Previously the database path depended on app.getPath('userData') which
varies with app name changes (CodePilot vs codepilot vs Claude GUI).
Now uses a fixed ~/.codepilot/ directory for both dev and production.

Includes automatic migration: on first launch, if the DB doesn't exist
at the new path, it checks old locations (Application Support variants
and the old dev-mode data/ folder) and copies the database over.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:07:08 +08:00
7418andClaude Opus 4.6 d2a926b353 docs: add CodePilot icon to README titles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 11:35:51 +08:00
7418andClaude Opus 4.6 1ef7616991 chore: bump version to 0.2.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 11:13:42 +08:00
7418andClaude Opus 4.6 bd818afeee feat: add copy button on hover for user and assistant messages
Shows a copy icon at the bottom of each message on hover. Clicking
copies the text content to clipboard with a brief checkmark confirmation.
User messages show the button right-aligned; assistant messages show it
alongside the existing timestamp and token usage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 11:09:50 +08:00
7418andClaude Opus 4.6 578762eb44 chore: bump version to 0.2.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 11:02:34 +08:00
7418andClaude Opus 4.6 a5e9fc76a8 Fix streaming content disappearing on window switch and improve skills scanning
- Add useRef + visibilitychange/focus listener to re-sync streaming content
  when Electron window regains focus, preventing blank content flash
- Remove duplicate text SSE events from assistant handler (stream_event
  already provides real-time deltas)
- Make skills scanner recursive to find commands in subdirectories
- Add debug logging for skills directory resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 02:23:53 +08:00
7418andClaude Opus 4.6 fab8b41966 fix: ensure Claude Code finds skills in ~/.claude/commands/
1. Skills API: accept optional cwd query param so project-level skills
   are scanned from the session's working directory, not the standalone
   server's process.cwd().
2. SDK env: explicitly set HOME so Claude Code can resolve ~/.claude/
   for global skills discovery in packaged builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 00:49:40 +08:00
7418andClaude Opus 4.6 f310fab397 fix: scroll bouncing during streaming and skills/cwd awareness
1. Change StickToBottom resize mode from "smooth" to "instant" to
   prevent scroll position bouncing when new streaming content
   arrives faster than the smooth animation completes.

2. Use SDK's preset append mode for system prompts instead of
   replacing Claude Code's default prompt. This preserves Claude
   Code's built-in awareness of skills (.claude/commands/), working
   directory context, and other default behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 00:18:52 +08:00
7418andClaude Opus 4.6 8b27f69a6f feat: add optional API configuration for custom Anthropic endpoints
Add a new "API Configuration" section in settings for users who use
custom Anthropic-compatible APIs (e.g. via ai-claude-start). Users
can optionally set ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL in
CodePilot's settings UI. These are stored in SQLite and injected
into the Claude Code subprocess env only when configured.

Existing authentication methods (claude login, shell env vars) are
not affected - the API config is purely additive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 23:17:49 +08:00
7418andClaude Opus 4.6 e4ae2154af fix: pass env to SDK subprocess and hide server Dock icon
1. Explicitly pass process.env to the Claude Agent SDK's env option,
   ensuring user shell env vars (ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL,
   etc.) reach the claude subprocess in packaged builds.
2. Spawn the standalone server via /bin/sh with exec to prevent the
   Electron binary from appearing as a separate Dock icon on macOS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 23:06:52 +08:00
7418andClaude Opus 4.6 185e138833 fix: load user shell env for API keys in packaged Electron app
When launched from Dock/Finder, Electron's process.env is very limited
and misses vars from .zshrc/.bashrc (API keys, custom PATH, etc.).
Added loadUserShellEnv() to run a login shell and capture the full
environment, then pass it to the standalone server process. This fixes
"organization does not have access" errors for users with custom API
configurations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 22:50:19 +08:00
7418andClaude Opus 4.6 e565d873f9 fix: use Electron's Node.js for standalone server to match ABI
electron-builder's @electron/rebuild compiles better-sqlite3 for
Electron's Node ABI. The standalone server must use Electron's
built-in Node (ELECTRON_RUN_AS_NODE=1) to match, otherwise the
native module fails with NODE_MODULE_VERSION mismatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 22:40:24 +08:00
7418andClaude Opus 4.6 454c7b0e6c fix: show detailed error messages for session creation failures
Return full error stack traces from the sessions API and display
the actual server error in the frontend, instead of a generic
"Failed to create session" message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 22:29:44 +08:00
7418andClaude Opus 4.6 2e6fc2af7d fix: pass claude binary path to Agent SDK for packaged app
The SDK's query() function also needs to find the claude binary.
Added findClaudePath() in claude-client.ts and pass it via
pathToClaudeCodeExecutable option, fixing "Failed to create session"
in packaged builds where PATH is limited.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 22:23:18 +08:00
7418andClaude Opus 4.6 2c5280cd77 fix: expand PATH search for claude binary in packaged app
The claude-status endpoint now searches common installation paths
(/usr/local/bin, /opt/homebrew/bin, ~/.npm-global/bin, ~/.local/bin,
~/.claude/bin) and uses `which` with expanded PATH as fallback,
fixing "Disconnected" status in packaged builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 22:01:07 +08:00
7418andClaude Opus 4.6 43e79dec04 fix: ensure standalone node_modules are included in packaged app
- Split extraResources to explicitly copy node_modules separately
  (electron-builder excludes node_modules by default)
- Exclude unnecessary project files from asar bundle
- Fixes 'Cannot find module next' error in packaged app

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:48:43 +08:00
7418andClaude Opus 4.6 37e5e4ed71 fix: use system Node.js for standalone server, improve error reporting
- Find system Node.js binary instead of using Electron's Node
  (avoids native module ABI mismatch with better-sqlite3)
- Detect server process crash and fail fast instead of waiting 30s
- Include server stdout/stderr in error dialog for debugging
- Expand PATH to include homebrew directories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:39:41 +08:00
7418andClaude Opus 4.6 2f40bd2c62 fix: use spawn with ELECTRON_RUN_AS_NODE for packaged server
- Replace fork() with spawn() + ELECTRON_RUN_AS_NODE=1 so the
  standalone server runs correctly inside the packaged app
- Set cwd to standalone directory for proper dependency resolution
- Show error dialog on startup failure instead of silent quit
- Add Chinese README (README_CN.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:33:27 +08:00
7418andClaude Opus 4.6 337eebb53c docs: add Chinese README and fix repo URLs
- Add README_CN.md with full Chinese translation
- Link between EN/CN README at the top
- Replace placeholder URLs with actual repo URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:25:18 +08:00
7418andClaude Opus 4.6 85ec4f9b96 fix: resolve standalone symlinks and exclude electron from TS check
- Replace symlinks in .next/standalone with real copies for electron-builder
- Exclude electron/, dist-electron/, scripts/, release/ from tsconfig
- Use arm64 target instead of universal to avoid native module merge issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:16:13 +08:00
7418andClaude Opus 4.6 ff1fb38735 feat: CodePilot - desktop GUI for Claude Code
Full-featured desktop application built with Next.js + Electron:
- Streaming chat with Claude Code via Agent SDK
- Session management with SQLite persistence
- Project file tree and file preview
- MCP server and custom skills management
- Permission controls with Code/Plan/Ask modes
- Dark/light theme, token tracking
- macOS DMG packaging with electron-builder

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:04:05 +08:00
7418 6776cc6297 Initial commit from Create Next App 2026-02-06 10:39:12 +08:00