124 Commits

Author SHA1 Message Date
程序员阿江(Relakkes)
4e66ef10c7 feat(pairing): add generatePairingCode and removePairedUser to adapter store
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:10:22 +08:00
程序员阿江(Relakkes)
5fe7542160 fix: prevent duplicate concurrent executions of the same scheduled task
executeTask() lacked a runningTasks guard, so manual "Run Now" or
server restarts could spawn a second subprocess while one was already
running. Now checks runningTasks at entry and skips if already in flight.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:09:32 +08:00
程序员阿江(Relakkes)
d9905c78fd feat(pairing): integrate pairing check into telegram adapter - private chat only
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:09:11 +08:00
程序员阿江(Relakkes)
74cf078ed3 feat(pairing): integrate pairing check into feishu adapter - DM only
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:08:52 +08:00
程序员阿江(Relakkes)
4bcac9d25f feat(pairing): implement core pairing logic module
Add adapters/common/pairing.ts with generatePairingCode(), isPaired(),
and tryPair() — one-time-use 6-char code flow with atomic config writes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 20:07:44 +08:00
程序员阿江(Relakkes)
88e7e14598 feat(pairing): extend type definitions with pairing and pairedUsers fields
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:06:37 +08:00
程序员阿江(Relakkes)
be2e9acdaa chore: update .gitignore to exclude temp screenshots and build artifacts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 19:50:46 +08:00
程序员阿江(Relakkes)
82e6e27687 feat: add IM adapter integration (Telegram + Feishu) with web settings UI
Implement IM adapters allowing users to chat with Claude Code from Telegram
and Feishu/Lark. Includes persistent session management (chatId→sessionId
mapping), project selection via /projects command, and a web UI settings page
for configuring bot tokens, allowed users, and default project directory.

Key changes:
- adapters/: Telegram and Feishu adapter scripts with shared common modules
  (WsBridge, MessageBuffer, SessionStore, HttpClient, config, formatting)
- Backend: adapterService + REST API (GET/PUT /api/adapters) with secret masking
- Frontend: AdapterSettings page in Settings tab with i18n support
- DirectoryPicker: use React Portal for dropdown to fix overflow clipping

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 19:38:51 +08:00
程序员阿江(Relakkes)
983d83f86b feat: enhance scheduled tasks with flexible scheduling, run now, execution logs, and edit support
- Add 7 frequency modes (every N min/hours, daily, weekdays, specific days, monthly, custom cron) with progressive disclosure UI
- Add "Run Now" button with confirmation popover and fire-and-forget API
- Add execution logs panel (TaskRunsPanel) with auto-polling and accordion behavior
- Add task edit mode with cron reverse-parsing (parseCron) to populate form
- Add server-side extractAssistantText to store meaningful AI responses instead of raw NDJSON
- Fix session linking: pass --session-id to CLI subprocess so "View conversation" navigates to actual content
- Fix MACRO undefined error by adding --preload to Bun.spawn
- Add confirmation popovers for all destructive actions (run/disable/delete)
- Add DayOfWeekPicker component for specific-days scheduling
- Add cronDescribe utility with i18n support and unit tests
- Display task creation time and last run time
- Add ~50 i18n keys (en/zh) for all new UI elements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:40:13 +08:00
程序员阿江(Relakkes)
41fb22790a feat: self-host fonts to eliminate Google CDN dependency
Replace Google Fonts CDN links with locally hosted woff2 files to avoid
FOUT/FOIT on slow networks and ensure the app works in regions where
Google is blocked. Material Symbols uses font-display: block to prevent
raw icon text from flashing on load.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 22:30:18 +08:00
程序员阿江(Relakkes)
b5d970dc8d fix: translate prompt placeholder in new task modal 2026-04-07 22:26:48 +08:00
程序员阿江(Relakkes)
5a8fb8ad4e feat: add i18n to ScheduledTasks page
Translate the scheduled tasks header, subtitle, desktop notice,
and new task button that were missed in the initial i18n pass.
2026-04-07 22:23:48 +08:00
程序员阿江(Relakkes)
d23b739abd fix: resolve EmptySession popup positioning and IME composition conflicts
Fix FileSearchMenu and slash command popups appearing incorrectly in
EmptySession by adding relative positioning to container and absolute
positioning to slash menu. Prevent IME composition Enter from triggering
message send in both ChatInput and EmptySession.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 22:21:57 +08:00
程序员阿江(Relakkes)
a2bf92079b feat: add i18n support with English and Chinese locales
Add a lightweight custom i18n system supporting English (default)
and Chinese, with a language switcher in Settings > General.
All 35+ UI components internationalized with ~270 translation keys,
including 189 Chinese spinner verbs and server error code mapping.
2026-04-07 22:18:16 +08:00
程序员阿江(Relakkes)
602c61ad4c feat: redesign scheduled task dialog to match Claude Code original
Refactor PermissionModeSelector and ModelSelector to support controlled
(prop-driven) mode alongside the existing store-driven mode, enabling
reuse in the new task creation dialog. Rewrite NewTaskModal with embedded
prompt editor that combines textarea + permission/model/folder controls,
matching Claude's original design. Add desktop-online warning banner on
the scheduled tasks list page and default folder to current session workDir.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 21:56:23 +08:00
程序员阿江(Relakkes)
f81fe41797 feat: migrate code blocks to shiki for VS Code-quality syntax highlighting
Replace prism-react-renderer with shiki/react-shiki in CodeViewer for
dramatically better tokenization (50+ TextMate scopes vs ~15 Prism tokens).
Custom warm-code theme with improved comment contrast (#5C6B7A, ~5:1 ratio)
and warm off-white background (#FDFCF9). Update DiffViewer to use matching
warm color palette with CSS variables instead of hardcoded GitHub colors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 21:24:14 +08:00
程序员阿江(Relakkes)
ad4ba88a62 feat: add @-triggered file search popup with directory navigation
- Input @ in composer to open file search popup showing project root
- Filter files/directories by typing, navigate with keyboard or mouse
- Click directory to enter subdirectory, type / to navigate deeper
- Enter selects item and inserts path text at cursor, popup closes
- Parse filter path (e.g. @src/components/) to auto-navigate and search
- Desktop: filesystem browse/search API supports includeFiles and search
- Web: directory tree browser with real-time search filtering
2026-04-07 19:05:01 +08:00
程序员阿江(Relakkes)
da3d51b006 fix: suppress sticky TaskBar on page refresh when tasks already dismissed
When all tasks were completed and the user continued chatting, the inline
task summary was shown correctly. But on page refresh, loadHistory and
fetchSessionTasks would re-populate the task store, making the sticky bar
reappear.

- Add completedAndDismissed flag to cliTaskStore
- Detect user messages after last task tool call in history (V1 + V2)
- SessionTaskBar skips render when allCompleted && completedAndDismissed
- refreshTasks/setTasksFromTodos reset the flag for new task activity
- Fix InlineTaskSummary width to match parent container

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:27:50 +08:00
程序员阿江(Relakkes)
7183cc85fe fix: enable task/plan display for WebApp sessions using TodoWrite
The CLI subprocess runs in --print (non-interactive) mode, which disabled
V2 task tools (TaskCreate/TaskUpdate). Only TodoWrite was available, but
the frontend only tracked V2 tool names for task refresh — so the Tasks
bar never appeared for new WebApp sessions.

Changes:
- Set CLAUDE_CODE_ENABLE_TASKS=1 in CLI subprocess env to enable V2 tasks
- Add TodoWrite to TASK_TOOL_NAMES for backward compat with V1 sessions
- Parse TodoWrite input.todos directly into TaskBar state (no disk read)
- Extract last TodoWrite from history on session load for V1 sessions
- Inline completed task summary into message flow when user continues chat
  (sticky TaskBar converts to scrollable inline summary)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:12:05 +08:00
程序员阿江(Relakkes)
a3e58064cc feat: add confirmation dialog when enabling bypass permissions
Shows a warning dialog with the current working directory and a list
of granted capabilities before enabling bypass mode. Dialog is
centered in the content area with a full-screen backdrop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:37:24 +08:00
程序员阿江(Relakkes)
0d71d8acb6 feat: use native folder dialog in Tauri, keep directory tree for web
DirectoryPicker now detects runtime environment:
- Tauri desktop: opens native OS folder picker via @tauri-apps/plugin-dialog
- Web browser: falls back to backend API directory tree browser

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:28:08 +08:00
程序员阿江(Relakkes)
f9c42c3b40 feat: Tauri desktop app with sidecar, brand identity, and CORS fix
- Add Tauri sidecar architecture: Rust shell spawns claude-server binary,
  dynamic port allocation, health-check wait loop, graceful shutdown
- Fix CORS middleware to accept `tauri://localhost` and `https://tauri.localhost`
  origins from Tauri WebView, and add CORS headers to /health endpoint
- Enable native macOS window decorations (traffic lights) with Overlay title bar,
  add data-tauri-drag-region on sidebar for window dragging
- Conditionally apply desktop-only padding (44px for traffic lights) vs web (12px)
- Generate brand identity: light-background app icon, horizontal logo, full icon
  set (icns/ico/png) for Tauri bundle
- Add brand mark + GitHub link in sidebar, replace mascot SVG with app icon
  in EmptySession page
- Update README (zh/en) and docs hero image with new branding
- Add sidecar build scripts and launcher entry points
- Gitignore Rust target/, Tauri gen/, and brand-assets candidates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 16:07:38 +08:00
程序员阿江(Relakkes)
352b547bff chore: remove Google AdSense script from docs 2026-04-07 14:18:15 +08:00
程序员阿江(Relakkes)
f4dce4985d feat: parse pasted JSON to auto-fill provider form fields 2026-04-07 14:03:50 +08:00
程序员阿江(Relakkes)
b49a8b6c9b fix: show correct model name when custom provider is active
When a custom provider (e.g. MiniMax) is activated, settings.model still
contains the old Anthropic model ID. handleCurrentModel was returning this
raw ID as the model name instead of the provider's configured model.

Fix handleCurrentModel to use ANTHROPIC_MODEL from env (set by
syncToSettings when provider was activated) when no explicit model is
set. Also fix getRuntimeSettings to skip passing --model to CLI when a
provider is active and model is still the default — the CLI should read
ANTHROPIC_MODEL from env instead of receiving a wrong model ID override.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:51:05 +08:00
程序员阿江(Relakkes)
9b74e064c7 refactor: move task tracking from standalone page into session bottom bar
Remove the separate Tasks sidebar page (wrong concept — was showing
scheduled tasks). Instead, display CLI task progress as a sticky bar
at the bottom of the active session, matching the official desktop app
behavior. Tasks are refreshed in real-time by detecting TaskCreate/
TaskUpdate tool_result messages over WebSocket.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:00:45 +08:00
程序员阿江(Relakkes)
56b4fe3585 Merge branch 'feat/provider-model-config' into main
Provider preset redesign:
- Preset-based providers (DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom)
- Storage moved to ~/.claude/cc-haha/providers.json
- Full 6-key env sync to ~/.claude/settings.json (merge, not overwrite)
- Official provider card with one-click activation (clears env)
- Editable settings.json preview in provider form
- Remove redundant Model tab from Settings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:28:37 +08:00
程序员阿江(Relakkes)
ed8114ce68 fix: official card at top, modal state reset on close, remove official from presets
- Official provider shown as fixed card in provider list (click to activate)
- Add Provider modal conditionally rendered — state resets on close (fixes API key leak)
- Remove official from preset chips (not applicable to Add flow)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:28:28 +08:00
程序员阿江(Relakkes)
1b190524e5 fix: official preset add button — write settings.json first, handle errors
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:12:22 +08:00
程序员阿江(Relakkes)
d3d3e0ce2a fix: show settings.json editor for all presets including official
- Official preset shows Name, Notes, and full settings.json editor
- Non-official presets show Base URL, API Key, Model Mapping, Test, plus settings.json
- Settings JSON re-loads when switching presets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:09:31 +08:00
程序员阿江(Relakkes)
aac41964ba fix: update models API for new provider structure, widen dialog
- Replace getActiveProvider() calls with listProviders() + activeId lookup
- Convert ModelMapping to model list for API compatibility
- Widen provider form dialog from 600px to 720px

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:06:50 +08:00
程序员阿江(Relakkes)
d109759c9c feat: editable settings.json in provider form with JSON validation
- Load full ~/.claude/settings.json content, merge provider env vars
- Editable textarea replaces read-only preview
- Real-time JSON syntax validation, blocks submit on error
- On save, writes edited JSON to settings.json then saves provider
- Shows all existing settings (plugins, hooks, etc.) preserved

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:00:10 +08:00
程序员阿江(Relakkes)
2e92ba3116 fix: official preset in chips, model mapping always visible, settings.json preview
- Move Official to first preset chip instead of standalone card
- Show model mapping directly without collapsible
- Add settings.json preview showing the env vars that will be written
- Official preset shows "no config needed" message

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:54:11 +08:00
程序员阿江(Relakkes)
232f768750 feat: rewrite ProviderSettings UI — preset chips, official card, simplified form
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:28:39 +08:00
程序员阿江(Relakkes)
609ddd0ff5 refactor: rewrite frontend provider types, API client, and store for preset system
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:28:36 +08:00
程序员阿江(Relakkes)
e584df1d28 refactor: update provider API — presets endpoint, simplified activate, official route 2026-04-07 11:24:22 +08:00
程序员阿江(Relakkes)
747b45b14f refactor: rewrite providerService — cc-haha storage, full env sync, official clear 2026-04-07 11:23:59 +08:00
程序员阿江(Relakkes)
9806bef5ec refactor: rewrite provider types — simplified model mapping, preset-based structure 2026-04-07 11:23:24 +08:00
程序员阿江(Relakkes)
08cd15ed1b feat: add provider preset definitions (Official, DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:21:35 +08:00
程序员阿江(Relakkes)
468a2853e0 docs: add provider preset redesign implementation plan
7 tasks: presets config, backend types/service/API rewrite, frontend types/API/store/UI rewrite.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:17:10 +08:00
程序员阿江(Relakkes)
ec78c066f9 docs: add provider preset redesign spec
Preset-based provider configuration inspired by cc-switch.
Presets: Official, DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:11:34 +08:00
程序员阿江(Relakkes)
e9fa36ab86 refactor: remove Model tab, move effort level to General, fix test button in edit mode
- Remove redundant Model tab — model config is handled by Providers
- Move Effort Level control to General tab
- Fix Test Connection disabled in edit mode — use testProvider(id) when no new API key entered

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:54:44 +08:00
程序员阿江(Relakkes)
dca08d6f00 chore: untrack .omx, .playwright-mcp, desktop/dist — already in .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:38:14 +08:00
程序员阿江(Relakkes)
58837589fb Merge branch 'docs/ui-clone-requirements' into main
Features merged:
- Provider management UI (CRUD, activation, connectivity test)
- CLI Tasks page with dependency graph visualization
- Scheduled task enhancements (model, permissionMode, folderPath)
- AskUserQuestion tab navigation and toggle selection
- Sidebar redesign with project filter and time-grouped sessions
- Markdown/code viewer rewrite (Prism + React)
- Streaming indicator with CLI status sync

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:38:01 +08:00
程序员阿江(Relakkes)
06d766308f feat: optimize AskUserQuestion UI with tab navigation and toggle selection
- Multi-question display uses horizontal tabs instead of vertical stack
- Options are toggleable (click to select, click again to deselect)
- Submit requires all questions answered or custom text provided
- Align card width with assistant message content (ml-10)
- Selected indicator uses filled checkmark instead of hollow radio

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:37:23 +08:00
程序员阿江(Relakkes)
454548207c chore: add .playwright-mcp, .omx, desktop/dist, e2e screenshots to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:07:00 +08:00
程序员阿江(Relakkes)
d059a8b487 feat: add Provider management UI, CLI Tasks page, and enhance NewTaskModal
- Settings: new Providers tab with full CRUD, activation, and connectivity
  test; Model tab shows active provider name; General tab simplified
- Tasks: new CLI Tasks page displaying task lists from ~/.claude/tasks/
  with status, owner, and dependency (blocks/blockedBy) visualization
- NewTaskModal: add Advanced options (model, permission mode, working dir)
- Backend: fix TaskService to parse CLI V2 task format; extend /api/tasks
  with /lists endpoint for grouped queries
- Fix ModelInfo.context type from number to string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:05:50 +08:00
程序员阿江(Relakkes)
da2be1f81b Merge branch 'worktree-feature-scheduled-tasks' into docs/ui-clone-requirements
Resolve PLAN.md conflict by keeping both plans: Provider management
system and Scheduled Tasks enhancement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 01:48:03 +08:00
程序员阿江(Relakkes)
b1db66ac8c feat: add scheduled task edit UI, CronUpdateTool, wizard components and tests 2026-04-07 01:44:44 +08:00
程序员阿江(Relakkes)
bd658d98f6 Merge branch 'worktree-feature-model-config' into docs/ui-clone-requirements 2026-04-07 01:33:09 +08:00