Commit Graph
104 Commits
Author SHA1 Message Date
7418andClaude Opus 4.6 128ccf951c perf: convert sync file I/O to async in API routes (P0-2)
Replace all readFileSync/existsSync/readdirSync with fs.promises
equivalents to unblock the Node event loop under concurrency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:24:21 +08:00
7418andClaude Opus 4.6 f3c49a9e49 fix: deduplicate attachment file writes (P0-1)
Upload route now passes persisted filePath to claude-client, which
reuses it instead of writing the file again.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:24:12 +08:00
7418andClaude Opus 4.6 5878b36ff6 chore: bump version to 0.10.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:05:19 +08:00
7418andClaude Opus 4.6 b22788920b fix: file tree folder — separate toggle trigger from row, remove unused select
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:49:05 +08:00
7418andClaude Opus 4.6 d5b1d6eb9d feat: redesign settings page with sidebar navigation
Extract settings into General / Providers / Claude CLI sections with
a left sidebar layout. Keep Skills and MCP on the Extensions page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:28:29 +08:00
7418andClaude Opus 4.6 a5cff792e3 fix: read MCP servers from both ~/.claude.json and ~/.claude/settings.json
Claude CLI stores user-scoped MCP servers in ~/.claude.json, while
CodePilot was only reading from ~/.claude/settings.json. Now both
the MCP list API and streamClaude merge configs from both sources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 11:28:56 +08:00
7418andClaude Opus 4.6 d3a7fd745e fix: file tree attachment bridge stale closure — use ref for attachments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 02:12:40 +08:00
7418andClaude Opus 4.6 181da8cf09 chore: bump version to 0.10.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 01:33:10 +08:00
7418andClaude Opus 4.6 38ca38e3cb fix: auto-refresh file tree after AI finishes streaming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 01:31:48 +08:00
7418andClaude Opus 4.6 695daa60e1 fix: allow typing in input while AI is streaming, only block sending
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 01:29:13 +08:00
7418andClaude Opus 4.6 25abfb5404 fix: show "generating response" status when tools completed but AI still streaming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 01:25:47 +08:00
7418andClaude Opus 4.6 4fa26032a4 feat: tool timeout auto-retry, file tree attachment, force stop button
- Add configurable tool timeout with auto-retry: when a tool exceeds the
  timeout threshold, abort and send a follow-up message asking Claude to
  try a different approach
- Add "+" button on file tree items to attach files directly to chat
  input via new /api/files/raw endpoint and custom event bridge
- Add force stop button in streaming status bar when tool runs >90s,
  with warning indicators at 60s
- Improve doc preview markdown rendering (padding, list indentation)
- Bump version to 0.10.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:33:21 +08:00
7418andClaude Opus 4.6 8747464c2f fix: doc preview bugs — close on chat switch, copy content, filter binary files
- Close doc preview when switching between chats (pathname change)
- Copy button now copies file content instead of file path
- Skip preview for images, videos, audio, archives, and other binary files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:26:29 +08:00
7418andClaude Opus 4.6 57ba6b2584 docs: update CLAUDE.md with CI auto-release workflow
Clarify that pushing a v* tag triggers CI to automatically build
all platforms and create the GitHub Release. Do not manually create
releases to avoid conflicts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:45:28 +08:00
7418andClaude Opus 4.6 8c6e7bba5b feat: add doc preview panel for HTML and Markdown files
Click files in the file tree to open a dedicated preview panel with
source/rendered toggle for .md/.mdx/.html/.htm files. Preview panel
supports drag-to-resize (320–800px) with localStorage persistence.

Bump version to 0.9.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:50:21 +08:00
7418andClaude Opus 4.6 f335c7f821 docs: update README with new features, CI/CD, and Linux support
Add resizable panels, file attachments, auto update check, graceful
shutdown to features. Update platform badge and download section for
Windows NSIS installer and Linux packages. Add CI/CD section with
tag-based auto-release workflow. Update project structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:55:47 +08:00
7418andClaude Opus 4.6 21ca106720 fix: graceful server shutdown with SIGKILL fallback
Add killServer() that sends SIGTERM via UtilityProcess.kill(), waits
up to 3s, then escalates to SIGKILL via process.kill(pid). Fixes
window-all-closed to await shutdown before quitting, and uses a
persistent isQuitting flag in before-quit to prevent infinite loops.

Closes #51

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:55:04 +08:00
歸藏 7ce93b1102 Merge pull request #45 from eltociear/add-ja-doc
docs: add Japanese README
2026-02-10 22:51:23 +08:00
7418andClaude Opus 4.6 41f08c37cf fix(ci): add author/description for Linux deb/rpm, allow partial release
Linux deb/rpm packaging requires maintainer email. Also make release
job run even if some platform builds fail (e.g. partial release with
available artifacts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:24:32 +08:00
7418andClaude Opus 4.6 63e2521c9b chore: bump version to 0.8.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:05:36 +08:00
7418andClaude Opus 4.6 3e56d358b7 ci: publish release directly instead of draft
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:04:46 +08:00
7418andClaude Opus 4.6 a346ef230b ci: auto-create GitHub Release on tag push
When a v* tag is pushed, all platforms build in parallel then
a release job collects artifacts and creates a draft GitHub
Release with changelog and download instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:03:48 +08:00
7418andClaude Opus 4.6 5d80969b3b fix(ci): add --publish never and simplify Windows matrix
electron-builder auto-publishes in CI without GH_TOKEN, causing
failure. Also remove redundant Windows arch matrix since NSIS
bundles both x64 and arm64 in a single installer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:56:23 +08:00
7418andClaude Opus 4.6 57f1679585 ci: add GitHub Actions workflow for multi-platform builds
Supports Windows (NSIS), macOS (DMG), and Linux (AppImage/deb/rpm)
builds via native runners. Triggered manually or on version tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:50:46 +08:00
7418andClaude Opus 4.6 da07f1bd1b feat: draggable panel resize handles and remove extensions divider
Add ResizeHandle component for drag-to-resize side panels.
ChatListPanel (180–400px) and RightPanel (200–480px) widths
are persisted via localStorage. Also remove the border line
below the Extensions page tab selector.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 12:57:37 +08:00
7418andClaude Opus 4.6 7b64948cb4 feat: compact collapsible tool actions UI
Replace full-card tool rendering with a compact, collapsible group.
Each tool action is a single line with category icon, summary, and
status indicator. Collapsed by default for history, auto-expands
during streaming. Uses blockquote-style left border when expanded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 12:09:20 +08:00
Ikko Ashimine 2d3e1d6998 docs: add Japanese README 2026-02-10 03:14:50 +09:00
7418andClaude Opus 4.6 74fb784f6d feat: auto update check and dangerously-skip-permissions mode
Add automatic update detection (checks GitHub Releases every 8h with
dialog prompt and blue dot on Settings icon) and a skip-permissions
toggle in Settings that uses the SDK's native bypassPermissions mode
to auto-approve all tool actions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:14:42 +08:00
7418andClaude Opus 4.6 e4bbe8578a fix: persist file attachments so images/documents survive page reload
Previously uploaded files were only held in memory (optimistic message)
and lost when navigating away. Now:
- API route saves all uploaded files to .codepilot-uploads/ on disk
- File metadata (with filePath, not base64) is embedded in message content
- New /api/uploads endpoint serves persisted files
- FileAttachmentDisplay handles both base64 (in-memory) and filePath (DB)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:02:34 +08:00
7418andClaude Opus 4.6 183860587f fix: send images as multimodal vision content instead of file path references
Images were being saved to disk and referenced by text path in the prompt,
causing Claude to hallucinate about image contents since it never actually
saw the image data. Now images are sent as base64 content blocks via the
SDK's multimodal SDKUserMessage, enabling Claude's vision capability.
Non-image files continue to be saved to disk for Read tool access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 20:51:23 +08:00
7418andClaude Opus 4.6 9926ce5f64 chore: bump version to 0.6.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 19:48:12 +08:00
7418andClaude Opus 4.6 9635585ab6 feat: blue theme migration and chat input UI polish
- Migrate purple/violet theme to blue across entire codebase (globals.css,
  ToolCallBlock, ChatListPanel, SkillEditor, SkillListItem, e2e tests)
- Increase input box border radius (rounded-md → rounded-2xl) and shadow
- Add arrow flip animation on mode/model selector dropdowns
- Change send button to circular with up-arrow icon
- Increase global Hugeicons stroke weight (1.5 → 2)
- Remove theme-colored focus ring on input box

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 19:48:06 +08:00
7418andClaude Opus 4.6 ee65c62d62 feat: collapse long user messages with expand/collapse toggle (#37)
User messages exceeding 300px are now collapsed by default with a
gradient fade overlay and expand/collapse button. Only applies to
user messages; assistant messages remain fully visible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 17:33:49 +08:00
7418andClaude Opus 4.6 c405d7a677 chore: bump version to 0.6.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 17:05:07 +08:00
7418andClaude Opus 4.6 f861b3fca1 feat: slash command popover redesign, import dialog scroll fix, and new logo
- Slash command popover: add search box, group commands/skills with section
  headers, assign unique icons per built-in command, remove Built-in badge,
  show source labels for skills, deduplicate API skills with built-in names
- Import CLI Session dialog: fix list overflow and enable scrolling by
  replacing Radix ScrollArea with native overflow-y-auto
- New chat empty state: replace BotIcon with custom CodePilotLogo SVG
  component supporting light/dark theme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:57:49 +08:00
7418andClaude Opus 4.6 dc320e7933 chore: bump version to 0.6.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:09:40 +08:00
歸藏 487c0a5cb7 fix: prevent path traversal in file APIs (#16)
fix: prevent path traversal in file tree and preview APIs
2026-02-09 16:08:11 +08:00
歸藏 8dcc19d077 fix: add graceful database shutdown (#20)
fix: add graceful database shutdown to prevent WAL file leaks
2026-02-09 16:08:07 +08:00
歸藏 c2c53e9591 feat: import and resume Claude Code CLI sessions (#28)
feat: import and resume Claude Code CLI sessions (closes #10)
2026-02-09 16:08:02 +08:00
歸藏 336897cded fix: 支持读取 ~/.claude/skills/ 目录下的已安装技能 (#36)
fix: 支持读取 ~/.claude/skills/ 目录下的已安装技能
2026-02-09 16:07:58 +08:00
歸藏 c558b40eb8 fix: 修复加载大消息会话时卡死的问题 (#38)
fix: 修复加载大消息会话时卡死的问题
2026-02-09 16:07:54 +08:00
llg-linwei f437024a96 fix: 修复加载大消息会话时卡死的问题 2026-02-09 14:29:58 +08:00
gy212andClaude Opus 4.6 61e3720ded fix: 支持读取 ~/.claude/skills/ 目录下的已安装技能 (#35)
问题:CodePilot 只扫描 ~/.agents/skills/,缺失了 ~/.claude/skills/ 路径,
导致用户通过 CLI 安装到该目录的技能无法在 CodePilot 中显示和使用。

修改内容:

后端:
- 列表接口 (GET /api/skills) 同时扫描 ~/.agents/skills/ 和 ~/.claude/skills/
- 通过 SHA1 内容哈希去重:同名同内容只保留一条,同名不同内容保留两条
- 详情接口 (GET/PUT/DELETE /api/skills/:name) 新增 ?source= 参数精确定位来源
- 详情接口使用 YAML front matter 的 name 字段匹配,修复列表能看到但点开 404 的问题
- 同名不同内容时返回 409,要求前端传 source 消歧

前端:
- SkillItem 类型新增 installedSource 字段
- Badge 显示 installed:claude 或 installed:agents 明确来源
- 保存/删除时携带 ?source= 防止误操作同名技能
- 聊天补全项描述追加来源提示
- 技能展开时精准请求对应来源

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:10:08 +08:00
7418andClaude Opus 4.6 5b69a63c06 fix: show env vars as overridden when a provider is active
When a manually configured provider is active, environment variables
are now shown with "Overridden" badge, strikethrough text, and muted
colors instead of both appearing as active simultaneously.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:32:37 +08:00
7418andClaude Opus 4.6 8002131692 docs: add release notes format spec to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:26:09 +08:00
7418andClaude Opus 4.6 a42c0e312d fix: resolve session switching stuck on loading spinner
Race condition when quickly switching chat sessions caused the UI to get
stuck on loading. Added cancellation flags and key-based remounting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:19:25 +08:00
7418andClaude Opus 4.6 e17482e652 chore: bump version to 0.5.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:26:52 +08:00
7418andClaude Opus 4.6 37cfaacaf0 fix: file upload bugs and UI adjustment
- Include base64 data in file metadata for chat display (fixes broken images)
- Use file-to-disk + Read tool approach instead of SDK multimodal
  messages (fixes slow response caused by invalid prompt format)
- Move attach button before folder picker in input toolbar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:26:42 +08:00
liuxiaopai-ai 187cc23127 feat: import and resume Claude Code CLI sessions (closes #10)
Add ability to browse and import conversation history from Claude Code CLI
into CodePilot, with full resume support via SDK session ID.

Features:
- JSONL parser for Claude Code session files (~/.claude/projects/)
- REST API: GET /api/claude-sessions (list) + POST /api/claude-sessions/import
- Import dialog UI accessible from sidebar 'Import CLI Session' button
- Imported sessions bind sdk_session_id for seamless resume in CodePilot
- Duplicate import protection (409 with redirect to existing session)
- File size guard (50MB max) to prevent memory issues

Files changed:
- src/lib/claude-session-parser.ts — JSONL parser core
- src/app/api/claude-sessions/route.ts — list API
- src/app/api/claude-sessions/import/route.ts — import API with dedup
- src/components/layout/ImportSessionDialog.tsx — browse & import UI
- src/components/layout/ChatListPanel.tsx — sidebar integration
- src/__tests__/unit/claude-session-parser.test.ts — 17 unit tests
2026-02-08 22:04:12 +08:00
liuxiaopai-ai 746cea1eb7 fix: add graceful database shutdown to prevent WAL file leaks
The SQLite database connection was never explicitly closed when the
process exits. In WAL mode, this can leave behind -wal and -shm files
and risk data loss if the WAL hasn't been checkpointed.

Changes:
- Add closeDb() export for explicit database closure
- Register process shutdown handlers (exit, SIGTERM, SIGINT, SIGHUP)
  that call closeDb() before the process terminates
- Idempotent: multiple calls to closeDb() are safe
- After closeDb(), getDb() transparently re-opens the database
- Add 6 unit tests covering close, idempotency, reopen, data
  persistence, and WAL cleanup (all passing)
2026-02-08 21:37:35 +08:00